diff --git a/.github/workflows/pre-commit-hook-run.yml b/.github/workflows/pre-commit-hook-run.yml new file mode 100644 index 0000000..90ddb9c --- /dev/null +++ b/.github/workflows/pre-commit-hook-run.yml @@ -0,0 +1,25 @@ +name: "Pre commit hook check" + +on: + pull_request: + types: + - opened + - reopened + - edited + - synchronize + +jobs: + pre-commit-check: + name: Pre commit hook check + runs-on: ubuntu-latest + container: rishabhpoddar/supertokens_website_sdk_testing_node_16 + steps: + - uses: actions/checkout@v2 + - run: git init && git add --all && git -c user.name='test' -c user.email='test@example.com' commit -m 'init for pr action' + - run: npm i --force || true + # the below command is there cause otherwise running npm run check-circular-dependencies gives an error like: + # Your cache folder contains root-owned files, due to a bug in + # npm ERR! previous versions of npm which has since been addressed. + - run: chown -R 1001:121 "/github/home/.npm" + - run: npm i --force + - run: ./hooks/pre-commit.sh \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index d2a45c9..2616365 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [unreleased] +- Update contributing Prerequisites +- Remove unused ESLint and Prettier config files from TestingApp ## [4.0.8] - 2023-09-26 - use `URL` polyfill for `shouldDoInterceptionBasedOnUrl`: https://github.com/supertokens/supertokens-react-native/pull/111 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 40bf5a6..02489f4 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -14,7 +14,7 @@ We're so excited you're interested in helping with SuperTokens! We are happy to ## Development Setup ### Prerequisites -- Nodejs & npm +- **Node.js v16.x** & npm - IDE: [VSCode](https://code.visualstudio.com/download)(recommended) or equivalent IDE ### Project Setup @@ -55,11 +55,12 @@ We're so excited you're interested in helping with SuperTokens! We are happy to cp -r ./test/tough-cookie ./node_modules/ npm i git+https://github.com:/supertokens-react-native.git ``` -5. Navigate to `supertokens-react-native/TestingApp` and run all tests +5. Add a static entry for `127.0.0.1 localhost.org` in your `/etc/hosts` file +6. Navigate to `supertokens-react-native/TestingApp` and run all tests ``` INSTALL_PATH=../../supertokens-root npm test ``` -6. If all tests pass the output should be: +7. If all tests pass the output should be: React Native tests passing diff --git a/TestingApp/.eslintrc.js b/TestingApp/.eslintrc.js deleted file mode 100644 index 40c6dcd..0000000 --- a/TestingApp/.eslintrc.js +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = { - root: true, - extends: '@react-native-community', -}; diff --git a/TestingApp/.prettierrc.js b/TestingApp/.prettierrc.js deleted file mode 100644 index 84196d9..0000000 --- a/TestingApp/.prettierrc.js +++ /dev/null @@ -1,7 +0,0 @@ -module.exports = { - bracketSpacing: false, - jsxBracketSameLine: true, - singleQuote: true, - trailingComma: 'all', - arrowParens: 'avoid', -}; diff --git a/TestingApp/App.js b/TestingApp/App.js index d49805f..b3c10ef 100644 --- a/TestingApp/App.js +++ b/TestingApp/App.js @@ -6,244 +6,253 @@ * @flow strict-local */ - import React from 'react'; - import { - View, - Text, - Button - } from 'react-native'; - - import SuperTokens from "supertokens-react-native" - import axios from "axios"; +import React from "react"; +import { View, Text, Button } from "react-native"; + +import SuperTokens from "supertokens-react-native"; +import axios from "axios"; SuperTokens.addAxiosInterceptors(axios); -const BASE_URL = "http://192.168.1.100:8080/" - - class App extends React.Component { - - constructor(props) { - super(props); - this.state = { - loggedIn: undefined, - sessionVerified: undefined - }; - } - - render() { - if (this.state.loggedIn === undefined) { - return ( - - ); - } else if (this.state.loggedIn) { - if (this.state.sessionVerified === undefined) { - return ( - - ); - } else if (this.state.sessionVerified) { - return ( - - - Logged in, session verification passed! - - -