Skip to content

Commit bc85764

Browse files
committed
Merge branch '0.49' into feat/plugin/base
# Conflicts: # lib/build/emailpassword.js # lib/build/emailverification.js # lib/build/genericComponentOverrideContext.js # lib/build/index.js # lib/build/multifactorauth.js # lib/build/multitenancy.js # lib/build/oauth2provider.js # lib/build/passwordless.js # lib/build/passwordlessprebuiltui.js # lib/build/session.js # lib/build/thirdparty.js # lib/build/totp.js # lib/build/version.d.ts # lib/ts/version.ts # package-lock.json # package.json
2 parents 733e3d6 + 9d15cab commit bc85764

File tree

276 files changed

+25947
-15503
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

276 files changed

+25947
-15503
lines changed

.circleci/config_continue.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,13 @@ orbs:
77
jobs:
88
build:
99
docker:
10-
- image: rishabhpoddar/supertokens_website_sdk_testing_node_16
10+
- image: node:18
1111
steps:
1212
- run: git config --global url."https://github.com/".insteadOf ssh://[email protected]/ # This makes npm use http instead of ssh (required for node 16)
1313
- checkout
14-
- run: apt-get install lsof
14+
- run: apt update && apt install -y bc jq lsof libnss3 libatk1.0-0 libatk-bridge2.0-0 libcups2 libdrm2 libxkbcommon0 libgconf-2-4 libgdk-pixbuf2.0-0 libgtk-3-0 libgbm1 libxss1 libasound2 libxshmfence1 xvfb
15+
- run: chmod +x .circleci/installJava.sh
16+
- run: (cd .circleci/ && ./installJava.sh)
1517
- run: npm run init
1618
- run: npm run build-check
1719
- run: npm run size
@@ -20,14 +22,16 @@ jobs:
2022
- persist_to_workspace:
2123
root: / # relative path to our working directory
2224
paths:
23-
- usr/lib/node_modules
25+
- usr/lib
26+
- usr/java
27+
- usr/bin
2428
- root/project/node_modules
2529
- root/project/test/server/node_modules
2630
- root/project/examples/for-tests/node_modules
2731
- root/project/examples/for-tests-react-16/node_modules
2832
test:
2933
docker:
30-
- image: rishabhpoddar/supertokens_website_sdk_testing_node_16
34+
- image: node:18
3135
- image: rishabhpoddar/oauth-server-cicd
3236
environment:
3337
MOCHA_FILE: test_report/report_node-<< parameters.fdi-version >>.xml

.circleci/installJava.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/bash
2+
3+
wget https://download.java.net/java/GA/jdk15.0.1/51f4f36ad4ef43e39d0dfdbaf6549e32/9/GPL/openjdk-15.0.1_linux-x64_bin.tar.gz
4+
mkdir /usr/java
5+
mv openjdk-15.0.1_linux-x64_bin.tar.gz /usr/java
6+
cd /usr/java
7+
tar -xzvf openjdk-15.0.1_linux-x64_bin.tar.gz
8+
rm openjdk-15.0.1_linux-x64_bin.tar.gz
9+
ln -s /usr/java/jdk-15.0.1/bin/java /usr/bin/java
10+
ln -s /usr/java/jdk-15.0.1/bin/javac /usr/bin/javac
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
name: Auth-React Tests - L1
2+
3+
on:
4+
pull_request:
5+
types:
6+
- opened
7+
- reopened
8+
- synchronize
9+
push:
10+
branches:
11+
- master
12+
- "v[0-9]+.[0-9]+"
13+
tags:
14+
- "(dev-)?v[0-9]+.[0-9]+.[0-9]+"
15+
16+
jobs:
17+
define-versions:
18+
runs-on: ubuntu-latest
19+
outputs:
20+
fdiVersions: ${{ steps.versions.outputs.fdiVersions }}
21+
steps:
22+
- uses: actions/checkout@v4
23+
- uses: supertokens/get-supported-versions-action@main
24+
id: versions
25+
with:
26+
has-fdi: true
27+
28+
setup-auth-react:
29+
runs-on: ubuntu-latest
30+
needs: define-versions
31+
strategy:
32+
fail-fast: true
33+
matrix:
34+
fdi-version: ${{ fromJSON(needs.define-versions.outputs.fdiVersions) }}
35+
36+
outputs:
37+
AUTH_REACT__LOG_DIR: ${{ steps.envs.outputs.AUTH_REACT__LOG_DIR }}
38+
AUTH_REACT__SCREENSHOT_DIR: ${{ steps.envs.outputs.AUTH_REACT__SCREENSHOT_DIR }}
39+
AUTH_REACT__NODE_PORT: ${{ steps.envs.outputs.AUTH_REACT__NODE_PORT }}
40+
AUTH_REACT__APP_SERVER: ${{ steps.envs.outputs.AUTH_REACT__NODE_PORT }}
41+
AUTH_REACT__TEST_MODE: ${{ steps.envs.outputs.AUTH_REACT__TEST_MODE }}
42+
AUTH_REACT__PORT: ${{ steps.envs.outputs.AUTH_REACT__PORT }}
43+
specs: ${{ steps.envs.outputs.specs }}
44+
fdiVersions: ${{ needs.define-versions.outputs.fdiVersions }}
45+
46+
steps:
47+
- uses: supertokens/get-versions-action@main
48+
id: versions
49+
with:
50+
driver-name: node
51+
fdi-version: ${{ matrix.fdi-version }}
52+
env:
53+
SUPERTOKENS_API_KEY: ${{ secrets.SUPERTOKENS_API_KEY }}
54+
55+
- uses: supertokens/auth-react-testing-action/setup@main
56+
id: envs
57+
with:
58+
auth-react-version: ${{ github.sha }}
59+
node-sdk-version: ${{ steps.versions.outputs.nodeTag }}
60+
fdi-version: ${{ matrix.fdi-version }}
61+
use-common-app-and-test-server: "true"
62+
63+
launch-test-workflow:
64+
uses: ./.github/workflows/auth-react-test-2.yml
65+
needs: setup-auth-react
66+
name: FDI ${{ matrix.fdi-version }}
67+
strategy:
68+
max-parallel: 1 # This is important to avoid ddos GHA API
69+
fail-fast: false # Don't fail fast to avoid locking TF State
70+
matrix:
71+
fdi-version: ${{ fromJSON(needs.setup-auth-react.outputs.fdiVersions) }}
72+
with:
73+
fdi-version: ${{ matrix.fdi-version }}
74+
specs: ${{ needs.setup-auth-react.outputs.specs }}
75+
AUTH_REACT__LOG_DIR: ${{ needs.setup-auth-react.outputs.AUTH_REACT__LOG_DIR }}
76+
AUTH_REACT__SCREENSHOT_DIR: ${{ needs.setup-auth-react.outputs.AUTH_REACT__SCREENSHOT_DIR }}
77+
AUTH_REACT__APP_SERVER: ${{ needs.setup-auth-react.outputs.AUTH_REACT__APP_SERVER }}
78+
AUTH_REACT__NODE_PORT: ${{ needs.setup-auth-react.outputs.AUTH_REACT__NODE_PORT }}
79+
AUTH_REACT__TEST_MODE: ${{ needs.setup-auth-react.outputs.AUTH_REACT__TEST_MODE }}
80+
AUTH_REACT__PORT: ${{ needs.setup-auth-react.outputs.AUTH_REACT__PORT }}
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
name: Auth-React Tests - L2
2+
on:
3+
workflow_call:
4+
inputs:
5+
fdi-version:
6+
description: "FDI Version"
7+
required: true
8+
type: string
9+
10+
specs:
11+
description: "Spec Files"
12+
required: true
13+
type: string
14+
15+
AUTH_REACT__LOG_DIR:
16+
description: AUTH_REACT__LOG_DIR
17+
required: true
18+
type: string
19+
20+
AUTH_REACT__SCREENSHOT_DIR:
21+
description: AUTH_REACT__SCREENSHOT_DIR
22+
required: true
23+
type: string
24+
25+
AUTH_REACT__APP_SERVER:
26+
description: AUTH_REACT__APP_SERVER
27+
required: true
28+
type: string
29+
30+
AUTH_REACT__NODE_PORT:
31+
description: AUTH_REACT__NODE_PORT
32+
required: true
33+
type: string
34+
35+
AUTH_REACT__TEST_MODE:
36+
description: AUTH_REACT__TEST_MODE
37+
required: true
38+
type: string
39+
40+
AUTH_REACT__PORT:
41+
description: AUTH_REACT__PORT
42+
required: true
43+
type: string
44+
45+
jobs:
46+
test:
47+
runs-on: ubuntu-latest
48+
49+
strategy:
50+
max-parallel: 10
51+
fail-fast: false
52+
matrix:
53+
spec: ${{ fromJSON(inputs.specs) }}
54+
55+
env:
56+
SUPERTOKENS_CORE_PORT: 3567
57+
SUPERTOKENS_CORE_HOST: localhost
58+
TEST_MODE: testing
59+
# Auth react setup envs
60+
AUTH_REACT__LOG_DIR: ${{ inputs.AUTH_REACT__LOG_DIR }}
61+
AUTH_REACT__SCREENSHOT_DIR: ${{ inputs.AUTH_REACT__SCREENSHOT_DIR }}
62+
AUTH_REACT__NODE_PORT: ${{ inputs.AUTH_REACT__NODE_PORT }}
63+
AUTH_REACT__APP_SERVER: ${{ inputs.AUTH_REACT__NODE_PORT }}
64+
AUTH_REACT__TEST_MODE: ${{ inputs.AUTH_REACT__TEST_MODE }}
65+
AUTH_REACT__PORT: ${{ inputs.AUTH_REACT__PORT }}
66+
67+
steps:
68+
- uses: actions/checkout@v4
69+
with:
70+
path: supertokens-auth-react
71+
72+
- name: Start core
73+
run: docker compose up --wait
74+
working-directory: supertokens-auth-react
75+
76+
- uses: supertokens/auth-react-testing-action@main
77+
name: test ${{ matrix.spec }} for ${{ inputs.fdi-version }}
78+
with:
79+
fdi-version: ${{ inputs.fdi-version }}
80+
check-name-suffix: "[FDI=${{ inputs.fdi-version }}][Spec=${{ matrix.spec }}]"
81+
path: supertokens-auth-react
82+
spec: ${{ matrix.spec }}

.github/workflows/pre-commit-hook-run.yml

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,8 @@ jobs:
1212
pr-title:
1313
name: Pre commit hook check
1414
runs-on: ubuntu-latest
15-
container: rishabhpoddar/supertokens_website_sdk_testing_node_16
1615
steps:
17-
- uses: actions/checkout@v2
18-
- run: git init && git add --all && git -c user.name='test' -c user.email='[email protected]' commit -m 'init for pr action'
19-
- run: npm i --force || true
20-
# the below command is there cause otherwise running npm run check-circular-dependencies gives an error like:
21-
# Your cache folder contains root-owned files, due to a bug in
22-
# npm ERR! previous versions of npm which has since been addressed.
23-
- run: chown -R 1001:121 "/github/home/.npm"
24-
- run: npm i --force
25-
- run: cd test/with-typescript && npm i --force
16+
- uses: actions/checkout@v4
17+
- run: npm ci
18+
- run: cd test/with-typescript && npm ci
2619
- run: ./hooks/pre-commit.sh

.github/workflows/test-examples.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ jobs:
66
outputs:
77
matrix: ${{ steps.set-matrix.outputs.matrix }}
88
steps:
9-
- uses: actions/checkout@v2
9+
- uses: actions/checkout@v4
1010
- run: bash test/findExamplesWithTests.sh
1111
- id: set-matrix
1212
run: echo "::set-output name=matrix::{\"include\":$(bash test/findExamplesWithTests.sh)}"
@@ -24,7 +24,7 @@ jobs:
2424
run:
2525
working-directory: ${{ matrix.examplePath }}
2626
steps:
27-
- uses: actions/checkout@v2
27+
- uses: actions/checkout@v4
2828
- run: bash ../../test/updateExampleAppDeps.sh .
2929
- run: npm install [email protected] [email protected] puppeteer@^11.0.0 isomorphic-fetch@^3.0.0
3030
- run: npm run build || true
@@ -36,7 +36,7 @@ jobs:
3636
)
3737
- name: The job has failed
3838
if: ${{ failure() }}
39-
uses: actions/upload-artifact@v3
39+
uses: actions/upload-artifact@v4
4040
with:
4141
name: screenshots
4242
path: ./**/*screenshot.jpeg

.github/workflows/tests-pass-check-pr.yml

Lines changed: 0 additions & 24 deletions
This file was deleted.

.github/workflows/tests-visual.yml

Lines changed: 0 additions & 33 deletions
This file was deleted.

.github/workflows/unit-tests.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Auth-React Unit Tests
2+
3+
on:
4+
pull_request:
5+
types:
6+
- opened
7+
- reopened
8+
- synchronize
9+
push:
10+
branches:
11+
- master
12+
- "v[0-9]+.[0-9]+"
13+
tags:
14+
- "(dev-)?v[0-9]+.[0-9]+.[0-9]+"
15+
16+
jobs:
17+
unit-tests:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: actions/checkout@v4
21+
- uses: actions/setup-node@v4
22+
with:
23+
node-version: 18
24+
- run: npm install
25+
- run: npm run test-unit

.mocharc.yml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
1-
spec:
2-
- test/unit/**/*.test.js
3-
- test/end-to-end/**/*.test.js
4-
reporter: spec
1+
# spec:
2+
# - test/end-to-end/**/*.test.js
53
slow: 20000
6-
timeout: 30000
4+
timeout: 40000
5+
exit: true
6+
require:
7+
- "@babel/register"
8+
- test/test.mocha.env
9+
reporter: mocha-multi-reporters
10+
reporter-option:
11+
- configFile=mocha-multi-reporters.json

0 commit comments

Comments
 (0)