Skip to content

Commit

Permalink
Add basic open source docs
Browse files Browse the repository at this point in the history
  • Loading branch information
nkshah2 committed Apr 15, 2022
1 parent 113749c commit abd4dc4
Show file tree
Hide file tree
Showing 5 changed files with 134 additions and 1 deletion.
1 change: 0 additions & 1 deletion .mocharc.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
exit: true
spec:
- test/unit/**/*.test.js
- test/end-to-end/**/*.test.js
reporter: spec
require: "@babel/register"
slow: 20000
Expand Down
81 changes: 81 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
# Contributing

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:

## New to Open Source?

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)
2. Go through the [SuperTokens Code of Conduct](https://github.com/supertokens/supertokens-web-js/blob/master/CODE_OF_CONDUCT.md)

## Where to ask Questions?

1. Check our [Github Issues](https://github.com/supertokens/supertokens-web-js/issues) to see if someone has already answered your question.
2. Join our community on [Discord](https://supertokens.com/discord) and feel free to ask us your questions

### Prerequisites

- OS: Linux or macOS
- Nodejs & npm
- IDE: [VSCode](https://code.visualstudio.com/download)(recommended) or equivalent IDE

### Project Setup

1. Please setup `supertokens-core` by following [this guide](https://github.com/supertokens/supertokens-core/blob/master/CONTRIBUTING.md#development-setup). If you are not contributing to `supertokens-core`, please skip steps 1 & 4 under "Project Setup" section.
2. `git clone https://github.com/supertokens/supertokens-web-js.git`, `supertokens-web-js` and `supertokens-root` should exist side by side within the same parent directory.
3. `cd supertokens-web-js`
4. Install the project dependencies
```
npm run init
```
5. Add git pre-commit hooks
```
npm run set-up-hooks
```
## Modifying Code
1. Open the `supertokens-web-js` project in your IDE.
2. You can start modifying the code.
3. After modification, you need to build the project:
```
npm run build-pretty
```
4. Make sure the linter passes:
```
npm run lint
```
## Testing
1. Navigate to the supertokens-root repository
2. Start the testing environment
```
./startTestingEnv --wait
```
3. Open a new terminal in `supertokens-web-js` and run all tests
```
npm run test
```
## Pull Request
1. Before submitting a pull request make sure all tests have passed
2. Reference the relevant issue or pull request and give a clear description of changes/features added when submitting a pull request
3. Make sure the PR title follows [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/) specification
## SuperTokens Community
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:
- [Github Issues](https://github.com/supertokens/supertokens-web-js/issues)
- [Discord](https://supertokens.io/discord)
- [Twitter](https://twitter.com/supertokensio)
- or [email us](mailto:[email protected])
Additional resources you might find useful:
- [SuperTokens Docs](https://supertokens.io/docs/community/getting-started/installation)
- [Blog Posts](https://supertokens.io/blog/)
30 changes: 30 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,32 @@
# supertokens-web-js (In progress)

SuperTokens SDK for vanilla JS for all recipes

![SuperTokens banner](https://raw.githubusercontent.com/supertokens/supertokens-logo/master/images/Artboard%20%E2%80%93%2027%402x.png)

# SuperTokens Web JS SDK

<a href="https://supertokens.io/discord">
<img src="https://img.shields.io/discord/603466164219281420.svg?logo=discord"
alt="chat on Discord"></a>

## About
This is a plain Javascript SDK that provides the login functionality with SuperTokens.

Learn more at https://supertokens.io

## Documentation

To see documentation, please click [here](https://supertokens.io/docs/community/introduction).

## Contributing

Please refer to the [CONTRIBUTING.md](https://github.com/supertokens/supertokens-web-js/blob/master/CONTRIBUTING.md) file in this repo.

## Contact us

For any queries, or support requests, please email us at [email protected], or join our [Discord](supertokens.io/discord) server.

## Authors

Created with :heart: by the folks at SuperTokens.io.
22 changes: 22 additions & 0 deletions init.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# This script is used to initialise the dev env for this package.
# Depending on the node version being used, it will do slightly different actions

version=`node --version`

while IFS='.' read -ra ADDR; do
counter=0
for i in "${ADDR[@]}"; do
if [ $counter == 0 ]
then
version=$i
fi
counter=$(($counter+1))
done
done <<< "$version"
version="${version:1}" # here version will be something like v16. So we remove the v

if [ "$version" -gt "15" ]; then
npm i -d --force
else
node --version && npm i -d
fi
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"description": "SuperTokens SDK for vanilla JS for all recipes",
"main": "./index.js",
"scripts": {
"init": "bash ./init.sh",
"build-check": "cd lib && npx tsc -p tsconfig.json --noEmit && cd ../test/with-typescript && npm run build",
"check-circular-dependencies": "npx madge --circular --extensions js ./lib/build/",
"build": "cd lib && rm -rf build && npx tsc -p tsconfig.json && npm run pack",
Expand Down

0 comments on commit abd4dc4

Please sign in to comment.