We're so excited you're interested in helping with SuperTokens! We are happy to help you get started, even if you don't have any previous open-source experience 😊
- Take a look at How to Contribute to an Open Source Project on GitHub
- Go thorugh the SuperTokens Code of Conduct
- Check our Github Issues to see if someone has already answered your question.
- Join our community on Discord and feel free to ask us your questions
You will need to setup the supertokens-core
in order to to run the supertokens-node
tests, you can setup supertokens-core
by following this guide
Note: If you are not contributing to the supertokens-core
you can skip steps 1 & 4 under Project Setup of the supertokens-core
contributing guide.
- OS: Linux or macOS
- Nodejs & npm
- IDE: VSCode(recommended) or equivalent IDE
- Fork the supertokens-node repository
- Clone the forked repository in the parent directory of the previously setup
supertokens-root
.
supertokens-node
andsupertokens-root
should exist side by side within the same parent directory cd supertokens-node
- Install the project dependencies
npm i -d
- Install the dependencies inside
test/with-typescript
cd test/with-typescript && npm i && cd ../..
- Add git pre-commit hooks
npm run set-up-hooks
- Open the
supertokens-node
project in your IDE and you can start modifying the code - After modifying the code, build your project to implement your changes
npm run build-pretty
- Navigate to the
supertokens-root
repository - Start the testing environment
./startTestingEnv --wait
- Navigate to the
supertokens-node
repository
cd ../supertokens-node/
- Run all tests (make sure to have node version >= 16.20.0 and < 17.0.0)
INSTALL_PATH=../supertokens-root npm test
- If all tests pass the output should be:
- Install the extension - https://marketplace.visualstudio.com/items?itemName=hbenl.vscode-mocha-test-adapter
- Add the following to your vscode settings:
{ // ..., "mochaExplorer.env": { "TEST_MODE": "testing", "INSTALL_PATH": "../supertokens-root" } }
- In
lib/tsconfig.json
, change"sourceMap"
totrue
- Run
npm run build
You should now be able to see tests on the VSCode's testing panel and run/debug from there.
- Before submitting a pull request make sure all tests have passed
- Reference the relevant issue or pull request and give a clear description of changes/features added when submitting a pull request
- Make sure the PR title follows conventional commits specification
SuperTokens is made possible by a passionate team and a strong community of developers. If you have any questions or would like to get more involved in the SuperTokens community you can check out:
Additional resources you might find useful:
- Make sure all CRUD operations are available on the objects of that recipe
- Make sure the implementation of that interface takes types imports from the
index.ts
file of that recipe. This is so that if a user wants to copy / paste that code into their project, they can do so via the normal import statement.
- Make sure the implementation of that interface takes types imports from the
index.ts
file of that recipe. This is so that if a user wants to copy / paste that code into their project, they can do so via the normal import statement.
This will generate the API docs in a folder called docs
npm run build-docs