Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

resolving circular dependencies #40

Open
wants to merge 2 commits into
base: 3.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ jobs:
- run: npm i -d
- run: (cd .circleci/ && ./doTests.sh)
- run: npm run size
- run: npm run check-circular-dependencies
- slack/status
update-docs:
docker:
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file.
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).

## [3.0.6] - 2021-11-17

### Changes
- Re orgainses code to remove circular dependencies and adds scripts to check that they don't get added in the future.

## [3.0.4] - 2021-11-11
### Changed
- When calling a user's API, uses rid "anti-csrf" instead of session to solve https://github.com/supertokens/supertokens-node/issues/202
Expand Down
20 changes: 19 additions & 1 deletion hooks/pre-commit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,18 @@ else
echo "$(tput setaf 1)* No$(tput sgr 0)"
fi

npm run check-circular-dependencies
circDep=$?

echo "$(tput setaf 3)* No circular dependencies?$(tput sgr 0)"

if [ $circDep -eq 0 ]
then
echo "$(tput setaf 2)* Yes$(tput sgr 0)"
else
echo "$(tput setaf 1)* No$(tput sgr 0)"
fi

npm run pretty-check >/dev/null 2>/dev/null
formatted=$?

Expand All @@ -58,7 +70,7 @@ then
git stash drop >/dev/null 2>/dev/null
fi

if [ $compiles -eq 0 ] && [ $formatted -eq 0 ]
if [ $compiles -eq 0 ] && [ $formatted -eq 0 ] && [ $circDep -eq 0 ]
then
echo "$(tput setaf 2)... done. Proceeding with commit.$(tput sgr 0)"
echo ""
Expand All @@ -68,6 +80,12 @@ then
echo "$(tput setaf 1)CANCELLING commit due to NON-FORMATTED CODE.$(tput sgr 0)"
echo ""
exit 1
elif [ $circDep -eq 0 ]
then
echo "$(tput setaf 1)... done.$(tput sgr 0)"
echo "$(tput setaf 1)CANCELLING commit due to CIRCULAR-DEPENDENCIES IN CODE.$(tput sgr 0)"
echo ""
exit 1
else
echo "$(tput setaf 1)... done.$(tput sgr 0)"
echo "$(tput setaf 1)CANCELLING commit due to COMPILE ERROR.$(tput sgr 0)"
Expand Down
2 changes: 1 addition & 1 deletion lib/build/version.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/build/version.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/ts/version.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@
* License for the specific language governing permissions and limitations
* under the License.
*/
export const package_version = "3.0.5";
export const package_version = "3.0.6";

export const supported_fdi = ["1.8", "1.9", "1.10"];
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
{
"name": "supertokens-react-native",
"version": "3.0.5",
"version": "3.0.6",
"description": "React Native SDK for SuperTokens",
"main": "index.js",
"scripts": {
"check-circular-dependencies": "npx madge --circular --extensions js ./lib/build/",
"build-check": "cd lib && npx tsc -p tsconfig.json --skipLibCheck --noEmit",
"build": "cd lib && npx tsc -p tsconfig.json --skipLibCheck && cd ../ && cd test/playground && npx tsc -p tsconfig.json",
"pretty": "npx prettier --write --config .prettierrc \"lib/ts/**/*.ts\" \"lib/build/**/*.js\" \"TestingApp/test/**/*.js\" \"examples/**/*.js\"",
Expand Down Expand Up @@ -58,4 +59,4 @@
"limit": "25kb"
}
]
}
}