|
1 | 1 | # Contributing
|
2 | 2 |
|
3 |
| -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 :blush: |
| 3 | +We're so excited you're interested in helping with SuperTokens! We are happy to help you get started, even if you don't |
| 4 | +have any previous open-source experience :blush: |
4 | 5 |
|
5 | 6 | ## New to Open Source?
|
6 |
| -1. Take a look at [How to Contribute to an Open Source Project on GitHub](https://egghead.io/courses/how-to-contribute-to-an-open-source-project-on-github) |
7 |
| -2. Go through the [SuperTokens Code of Conduct](https://github.com/supertokens/supertokens-core/blob/master/CODE_OF_CONDUCT.md) |
| 7 | + |
| 8 | +1. Take a look |
| 9 | + at [How to Contribute to an Open Source Project on GitHub](https://egghead.io/courses/how-to-contribute-to-an-open-source-project-on-github) |
| 10 | +2. Go through |
| 11 | + the [SuperTokens Code of Conduct](https://github.com/supertokens/supertokens-core/blob/master/CODE_OF_CONDUCT.md) |
8 | 12 |
|
9 | 13 | ## Where to ask Questions?
|
10 |
| -1. Check our [Github Issues](https://github.com/supertokens/supertokens-core/issues) to see if someone has already answered your question. |
11 |
| -2. Join our community on [Discord](https://supertokens.io/discord) and feel free to ask us your questions |
12 | 14 |
|
13 |
| -As you gain experience with SuperTokens, please help answer other people's questions! :pray: |
| 15 | +1. Check our [Github Issues](https://github.com/supertokens/supertokens-core/issues) to see if someone has already |
| 16 | + answered your question. |
| 17 | +2. Join our community on [Discord](https://supertokens.io/discord) and feel free to ask us your questions |
| 18 | + |
| 19 | +As you gain experience with SuperTokens, please help answer other people's questions! :pray: |
14 | 20 |
|
15 | 21 | ## What to Work On?
|
| 22 | + |
16 | 23 | You can get started by taking a look at our [Github issues](https://github.com/supertokens/supertokens-core/issues)
|
17 |
| -If you find one that looks interesting and no one else is already working on it, comment in the issue that you are going to work on it. |
| 24 | +If you find one that looks interesting and no one else is already working on it, comment in the issue that you are going |
| 25 | +to work on it. |
18 | 26 |
|
19 |
| -Please ask as many questions as you need, either directly in the issue or on [Discord](https://supertokens.io/discord). We're happy to help!:raised_hands: |
| 27 | +Please ask as many questions as you need, either directly in the issue or on [Discord](https://supertokens.io/discord). |
| 28 | +We're happy to help!:raised_hands: |
20 | 29 |
|
21 |
| -### Contributions that are ALWAYS welcome |
| 30 | +### Contributions that are ALWAYS welcome |
22 | 31 |
|
23 | 32 | 1. More tests
|
24 |
| -2. Contributing to discussions that can be found [here](https://github.com/supertokens/supertokens-core/issues?q=is%3Aissue+is%3Aopen+label%3Adiscussions) |
| 33 | +2. Contributing to discussions that can be |
| 34 | + found [here](https://github.com/supertokens/supertokens-core/issues?q=is%3Aissue+is%3Aopen+label%3Adiscussions) |
25 | 35 | 3. Improved error messages
|
26 | 36 | 4. Educational content like blogs, videos, courses
|
27 | 37 |
|
28 |
| - |
29 | 38 | ## Development Setup
|
30 | 39 |
|
31 | 40 | ### With Gitpod
|
| 41 | + |
32 | 42 | 1. Navigate to the [supertokens-root](https://github.com/supertokens/supertokens-root) repository
|
33 | 43 | 2. Click on the `Open in Gitpod` button
|
34 | 44 |
|
35 | 45 | ### Local Setup Prerequisites
|
| 46 | + |
36 | 47 | - OS: Linux or macOS. Or if using Windows, you need to use [wsl2](https://docs.microsoft.com/en-us/windows/wsl/about).
|
37 |
| -- JDK: openjdk 15.0.1. Installation instructions for Mac and Linux can be found in [our wiki](https://github.com/supertokens/supertokens-core/wiki/Installing-OpenJDK-for-Mac-and-Linux) |
| 48 | +- JDK: openjdk 15.0.1. Installation instructions for Mac and Linux can be found |
| 49 | + in [our wiki](https://github.com/supertokens/supertokens-core/wiki/Installing-OpenJDK-for-Mac-and-Linux) |
38 | 50 | - IDE: [IntelliJ](https://www.jetbrains.com/idea/download/)(recommended) or equivalent IDE
|
39 | 51 |
|
40 | 52 | ### Familiarize yourself with SuperTokens
|
| 53 | + |
41 | 54 | 1. [Architecture of SuperTokens](https://github.com/supertokens/supertokens-core/wiki/SuperTokens-Architecture)
|
42 | 55 | 2. [SuperTokens code and file structure overview](https://github.com/supertokens/supertokens-core/wiki/Code-and-file-structure-overview)
|
43 | 56 | 3. [Versioning methodology](https://github.com/supertokens/supertokens-core/wiki/Versioning,-git-and-releases)
|
44 | 57 |
|
45 |
| - |
46 | 58 | ### Project Setup
|
47 |
| -1. Fork the [supertokens-core](https://github.com/supertokens/supertokens-core) repository (**Skip this step if you are NOT modifying supertokens-core**) |
| 59 | + |
| 60 | +1. Fork the [supertokens-core](https://github.com/supertokens/supertokens-core) repository (**Skip this step if you are |
| 61 | + NOT modifying supertokens-core**) |
48 | 62 | 2. `git clone https://github.com/supertokens/supertokens-root.git`
|
49 | 63 | 3. `cd supertokens-root`
|
50 | 64 | 4. Open the `modules.txt` file in an editor (**Skip this step if you are NOT modifying supertokens-core**):
|
51 |
| - - The `modules.txt` file contains the core, plugin-interface, the type of plugin and their branches(versions) |
52 |
| - - By default the `master` branch is used but you can change the branch depending on which version you want to modify |
| 65 | + - The `modules.txt` file contains the core, plugin-interface, the type of plugin and their branches(versions) |
| 66 | + - By default the `master` branch is used but you can change the branch depending on which version you want to modify |
53 | 67 | - The `sqlite-plugin` is used as the default plugin as it is an in-memory database and requires no setup
|
54 |
| - - [core](https://github.com/supertokens/supertokens-core) |
55 |
| - - [plugin-interface](https://github.com/supertokens/supertokens-plugin-interface) |
56 |
| - - Check the repository branches by clicking on the links listed above, click the branch tab and check for all the available versions |
| 68 | + - [core](https://github.com/supertokens/supertokens-core) |
| 69 | + - [plugin-interface](https://github.com/supertokens/supertokens-plugin-interface) |
| 70 | + - Check the repository branches by clicking on the links listed above, click the branch tab and check for all |
| 71 | + the available versions |
57 | 72 | - Add your github `username` separated by a ',' after `core,master` in `modules.txt`
|
58 |
| - - If, for example, your github `username` is `helloworld` then modules.txt should look like... |
| 73 | + - If, for example, your github `username` is `helloworld` then modules.txt should look like... |
59 | 74 | ```
|
60 | 75 | // put module name like module name,branch name,github username(if contributing with a forked repository) and then call ./loadModules script
|
61 | 76 | core,master,helloworld
|
62 | 77 | plugin-interface,master
|
63 | 78 | sqlite-plugin,master
|
64 | 79 | ```
|
65 |
| - |
66 |
| -5. Run loadModules to clone the required repositories |
67 |
| -`./loadModules` |
68 | 80 |
|
| 81 | +5. Run loadModules to clone the required repositories |
| 82 | + `./loadModules` |
69 | 83 |
|
70 | 84 | ## Modifying code
|
| 85 | +
|
71 | 86 | 1. Open `supetokens-root` in your IDE
|
72 |
| -2. After gradle has imported all the dependencies you can start modifying the code |
| 87 | +2. After gradle has imported all the dependencies you can start modifying the code |
73 | 88 |
|
74 |
| -## Testing |
| 89 | +## Testing |
75 | 90 |
|
76 | 91 | ### On your local machine
|
77 |
| -1. Navigate to the `supertokens-root` repository |
| 92 | +
|
| 93 | +1. Navigate to the `supertokens-root` repository |
78 | 94 | 2. Run all tests
|
79 |
| -`./startTestEnv` |
80 |
| -3. If all tests pass the terminal should display |
| 95 | + `./startTestEnv` |
| 96 | +3. If all tests pass the terminal should display |
| 97 | +
|
81 | 98 | - core tests:
|
82 |
| - |
| 99 | +  |
83 | 100 | - plugin tests:
|
84 |
| - |
| 101 | +  |
85 | 102 |
|
86 | 103 | ### Using github actions
|
| 104 | +
|
87 | 105 | 1. Go to the supertokens-core repo on github (or your forked version of it).
|
88 | 106 | 2. Navigate to the Actions tab.
|
89 | 107 | 3. Find the action named "Run tests" and navigate to it.
|
90 | 108 | 4. Click on the "Run workflow" button.
|
91 | 109 | 5. Set the config variables in the drop down:
|
92 |
| - - **supertokens-plugin-interface repo owner name**: If you have forked the supertokens-plugin-interface repo, then set the value of this to your github username. |
93 |
| - - **supertokens-plugin-interface repos branch name**: If the core version you are working on is compatible with a plugin-interface version that is not in the master branch, then set the correct branch name in this value. |
| 110 | + - **supertokens-plugin-interface repo owner name**: If you have forked the supertokens-plugin-interface repo, then |
| 111 | + set the value of this to your github username. |
| 112 | + - **supertokens-plugin-interface repos branch name**: If the core version you are working on is compatible with a |
| 113 | + plugin-interface version that is not in the master branch, then set the correct branch name in this value. |
94 | 114 | 6. Click on "Run workflow".
|
95 | 115 |
|
96 | 116 | ## Running the core manually
|
| 117 | +
|
97 | 118 | 1. Run `startTestEnv --wait` in a terminal, and keep it running
|
98 | 119 | 2. Then open `supertokens-root` in another terminal and run `cp ./temp/config.yaml .`
|
99 |
| -3. Then run `java -classpath "./core/*:./plugin-interface/*" io.supertokens.Main ./ DEV`. This will start the core to listen on `http://localhost:3567` |
| 120 | +3. Then run `java -classpath "./core/*:./plugin-interface/*:./ee/*" io.supertokens.Main ./ DEV`. This will start the |
| 121 | + core to listen on `http://localhost:3567` |
100 | 122 |
|
101 | 123 | ## Pull Request
|
102 |
| -1. Before submitting a pull request make sure all tests have passed |
103 |
| -2. Reference the relevant issue or pull request and give a clear description of changes/features added when submitting a pull request |
| 124 | +
|
| 125 | +1. Before submitting a pull request make sure all tests have passed |
| 126 | +2. Reference the relevant issue or pull request and give a clear description of changes/features added when submitting a |
| 127 | + pull request |
104 | 128 | 3. Make sure the PR title follows [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/) specification
|
105 | 129 |
|
106 |
| -## SuperTokens Community |
107 |
| -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: |
108 |
| - - [Github Issues](https://github.com/supertokens/supertokens-core/issues) |
109 |
| - - [Discord](https://supertokens.io/discord) |
110 |
| - - [Twitter](https://twitter.com/supertokensio) |
111 |
| - - or [email us](mailto:[email protected]) |
112 |
| - |
| 130 | +## Install the supertokens CLI manually |
| 131 | +
|
| 132 | +1. Setup test env and keep it running |
| 133 | +2. In `supertokens-root`, run `cp temp/config.yaml .` |
| 134 | +3. On a different terminal, go to `supertokens-root` folder and |
| 135 | + run `java -classpath "./cli/*" io.supertokens.cli.Main true install` |
| 136 | +
|
| 137 | +## SuperTokens Community |
| 138 | +
|
| 139 | +SuperTokens is made possible by a passionate team and a strong community of developers. If you have any questions or |
| 140 | +would like to get more involved in the SuperTokens community you can check out: |
| 141 | +
|
| 142 | +- [Github Issues](https://github.com/supertokens/supertokens-core/issues) |
| 143 | +- [Discord](https://supertokens.io/discord) |
| 144 | +- [Twitter](https://twitter.com/supertokensio) |
| 145 | +- or [email us](mailto:[email protected]) |
| 146 | +
|
113 | 147 | Additional resources you might find useful:
|
114 |
| - - [SuperTokens Docs](https://supertokens.io/docs/community/getting-started/installation) |
115 |
| - - [Blog Posts](https://supertokens.io/blog/) |
116 |
| - - [Development guideline for the backend and frontend recipes](https://github.com/supertokens/supertokens-core/wiki/Development-guideline-for-the-backend-and-frontend-recipes) |
| 148 | +
|
| 149 | +- [SuperTokens Docs](https://supertokens.io/docs/community/getting-started/installation) |
| 150 | +- [Blog Posts](https://supertokens.io/blog/) |
| 151 | +- [Development guideline for the backend and frontend recipes](https://github.com/supertokens/supertokens-core/wiki/Development-guideline-for-the-backend-and-frontend-recipes) |
117 | 152 |
|
118 | 153 |
|
119 | 154 |
|
|
0 commit comments