Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/20.1' into feat/oauth2/base
Browse files Browse the repository at this point in the history
  • Loading branch information
porcellus committed Sep 24, 2024
2 parents 4100705 + e57cda4 commit ed182a7
Show file tree
Hide file tree
Showing 178 changed files with 5,112 additions and 1,161 deletions.
Original file line number Diff line number Diff line change
@@ -1,24 +1,34 @@
name: "Test edge function compatibility"
name: "Test edge function compatibility for Hono on Cloudflare Workers"
on: push
jobs:
test:
runs-on: ubuntu-latest
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.netlify_auth_token }}
NETLIFY_SITE_ID: ${{ secrets.netlify_site_id }}
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
APP_URL: "https://hono.rishabh-77b.workers.dev"
CLOUDFLARE_PROJECT_NAME: "hono"
TEST_DEPLOYED_VERSION: true
defaults:
run:
working-directory: examples/next/with-emailpassword
working-directory: examples/cloudflare-workers/with-email-password-hono-be-only
steps:
- uses: actions/checkout@v2
- run: echo $GITHUB_SHA
- run: npm install git+https://github.com:supertokens/supertokens-node.git#$GITHUB_SHA
- run: npm install
- run: npm install mocha@6.1.4 jsdom-global@3.0.2 puppeteer@^11.0.0 isomorphic-fetch@^3.0.0
- run: netlify deploy --alias 0 --build --json --auth=$NETLIFY_AUTH_TOKEN > deployInfo.json
- run: cat deployInfo.json
- run: |

- name: Replace APP_URL with deployed URL value
run: |
sed -i "s|process.env.REACT_APP_API_URL|\"${{ env.APP_URL }}\"|" config.ts
sed -i "s|process.env.REACT_APP_WEBSITE_URL|\"${{ env.APP_URL }}\"|" config.ts
- name: Deploy the changes
run: npx wrangler deploy --name ${{ env.CLOUDFLARE_PROJECT_NAME }} index.ts

- name: Run tests
run: |
( \
(echo "=========== Test attempt 1 ===========" && npx mocha --no-config --timeout 80000 test/**/*.test.js) || \
(echo "=========== Test attempt 2 ===========" && npx mocha --no-config --timeout 80000 test/**/*.test.js) || \
Expand Down
72 changes: 72 additions & 0 deletions .github/workflows/test-cf-worker-next.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: "Test edge function compatibility for Next.js on Cloudflare Workers"
on: push
jobs:
test:
runs-on: ubuntu-latest
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
APP_URL: "supertokens-node-b95.pages.dev"
CLOUDFLARE_PROJECT_NAME: "supertokens-node-pr-check-for-edge-function-compat"
TEST_DEPLOYED_VERSION: true
defaults:
run:
working-directory: examples/next/with-emailpassword
steps:
- uses: actions/checkout@v2
- run: echo $GITHUB_SHA
- run: npm install git+https://github.com:supertokens/supertokens-node.git#$GITHUB_SHA
- run: npm install
- run: npm install mocha@6.1.4 jsdom-global@3.0.2 puppeteer@^11.0.0 isomorphic-fetch@^3.0.0

# Step to update the runtime to edge to all files in app/api/
- name: Add runtime export to API files
run: |
find app/api -type f \( -name "*.js" -o -name "*.ts" \) -exec sed -i '1s/^/export const runtime = "edge";\n/' {} +
echo 'export const runtime = "edge";' >> app/auth/[[...path]]/page.tsx
# Install next on pages to build the app
- name: Install next-on-pages
run: npm install --save-dev @cloudflare/next-on-pages

# Setup the compatibility flag to make non edge functions run
- name: Create a wrangler.toml
run: echo "compatibility_flags = [ "nodejs_compat" ]" >> wrangler.toml

- name: Replace APP_URL with deployed URL value
run: |
sed -i "s|process.env.APP_URL|\"${{ env.APP_URL }}\"|" config/appInfo.ts
- name: Build using next-on-pages
run: npx next-on-pages

- name: Publish to Cloudflare Pages
id: deploy
uses: cloudflare/pages-action@v1
with:
apiToken: ${{ env.CLOUDFLARE_API_TOKEN }}
accountId: ${{ env.CLOUDFLARE_ACCOUNT_ID }}
projectName: ${{ env.CLOUDFLARE_PROJECT_NAME }}
directory: "./examples/next/with-emailpassword/.vercel/output/static"
wranglerVersion: "3"
branch: "master"

- name: Extract deployment info and save to JSON
id: extract_deploy_info
run: |
DEPLOY_ID=${{ steps.deploy.outputs.id }}
DEPLOY_URL=${{ steps.deploy.outputs.url }}
echo "{\"deploy_url\": \"$DEPLOY_URL\", \"deploy_id\": \"$DEPLOY_ID\"}" > deployInfo.json
- name: Run tests
run: |
( \
(echo "=========== Test attempt 1 ===========" && npx mocha --no-config --timeout 80000 test/**/*.test.js) || \
(echo "=========== Test attempt 2 ===========" && npx mocha --no-config --timeout 80000 test/**/*.test.js) || \
(echo "=========== Test attempt 3 ===========" && npx mocha --no-config --timeout 80000 test/**/*.test.js) \
)
- name: The job has failed
if: ${{ failure() }}
uses: actions/upload-artifact@v3
with:
name: screenshots
path: |
./**/*screenshot.jpeg
25 changes: 25 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,31 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Added OAuth2Provider recipe

## [20.1.2] - 2024-09-14

- Fixes formFields to accept non string types as well.

## [20.1.1] - 2024-09-10

- Fixes an issue with Okta / Active Directory providers where we check for additional config if `oidcDiscoveryEndpoint` is not defined. It would not be necessary in the cases where other endpoints are already provided.

## [20.1.0] - 2024-09-09

- Add edge compatibility for custom frameworks and Next.JS

## [20.0.5] - 2024-09-02

- Optional form fields are now truly optional, can be omitted from the payload.

## [20.0.4] - 2024-08-30

- Improves thirdParty debug logging to help with debugging issues with JSON parsing.

## [20.0.3] - 2024-08-22

- Fixes issue with dashboard APIs `createOrUpdateThirdPartyConfig` and `deleteThirdPartyConfig` which did not take `includeInNonPublicTenantsByDefault` into account for non-public tenants.
- Updates test server to support dashboard tests.

## [20.0.2] - 2024-08-08

- Fixes an issue where `shouldDoAutomaticAccountLinking` was called without a primary user when linking in some cases.
Expand Down
2 changes: 1 addition & 1 deletion docs/classes/framework.BaseRequest.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/classes/framework.BaseResponse.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/classes/framework_custom.CollectingResponse.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/classes/framework_custom.PreParsedRequest.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/classes/index.RecipeUserId.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/classes/index.User.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/classes/index.default.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/classes/ingredients_emaildelivery.default.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/classes/ingredients_smsdelivery.default.html

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions docs/classes/recipe_accountlinking.default.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/classes/recipe_dashboard.default.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/classes/recipe_emailpassword.default.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/classes/recipe_emailverification.default.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/classes/recipe_jwt.default.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/classes/recipe_multifactorauth.default.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/classes/recipe_multitenancy.default.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/classes/recipe_openid.default.html

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions docs/classes/recipe_passwordless.default.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/classes/recipe_session.default.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/classes/recipe_thirdparty.default.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/classes/recipe_totp.default.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/classes/recipe_usermetadata.default.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/classes/recipe_userroles.default.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/interfaces/framework_awsLambda.SessionEvent.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/interfaces/framework_awsLambda.SessionEventV2.html

Large diffs are not rendered by default.

Loading

0 comments on commit ed182a7

Please sign in to comment.