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

feat: Added support for dynamically changing package URI in docs #121

Merged
merged 5 commits into from
Oct 8, 2024
Merged
Show file tree
Hide file tree
Changes from 4 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
31 changes: 30 additions & 1 deletion addReleaseTag
rishabhpoddar marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -98,13 +98,42 @@ git push --delete origin $currTag
git tag v$version
git push --tags


response=`curl -s -X GET \
"https://api.supertokens.io/0/frontend/latest/check?password=$password&version=$version&name=web-js" \
-H 'api-version: 0'`
response=`echo $response | jq .isLatest`


# Initialize an empty JSON object string
jsonPayload="{\"password\": \"$releasePassword\""
# Iterate through all files in the ./bundle directory
for file in ./bundle/*; do
# Extract the filename without the path
filename=$(basename "$file")

# Extract the name part (before the first dot)
name="${filename%%.*}"

# Add the key-value pair to the JSON object string
if [ -n "$jsonPayload" ] && [ "$jsonPayload" != "{" ]; then
jsonPayload+=","
fi
jsonPayload+="\"$name\":\"https://cdn.jsdelivr.net/gh/supertokens/supertokens-web-js@v${version}/bundle/$filename\""
done
# Close the JSON object
jsonPayload+="}"

responseStatus=`curl -s -o /dev/null -w "%{http_code}" -X PUT \
http://localhost:9000/0/frontend/web-js \
-H 'Content-Type: application/json' \
-H 'api-version: 0' \
-d "${jsonPayload}"`
if [ "$responseStatus" -ne 200 ]
then
echo "failed PUT API to update js deliver uri on server with status code: $responseStatus. You need to manually call this API with the right url!"
exit 1
fi

if [[ $response == "null" ]]
then
RED='\033[0;31m'
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"scripts": {
"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",
"build": "rm -rf bundle && cd lib && rm -rf build && npx tsc -p tsconfig.json && npm run pack",
"pretty-check": "npx pretty-quick --check .",
"pretty": "npx pretty-quick .",
"build-pretty": "npm run build && npm run pretty && npm run pretty",
Expand Down
24 changes: 12 additions & 12 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,52 +16,52 @@ var config = {
entry: {
supertokens: {
import: APP_DIR + "/lib/build/bundleEntry.js",
filename: "supertokens.js",
filename: "supertokens.[contenthash].js",
dependOn: "supertokensWebsite",
},
supertokensSession: {
import: APP_DIR + "/lib/build/recipe/session/index.js",
filename: "session.js",
filename: "session.[contenthash].js",
dependOn: "supertokensWebsite",
},
supertokensEmailVerification: {
import: APP_DIR + "/lib/build/recipe/emailverification/index.js",
filename: "emailverification.js",
filename: "emailverification.[contenthash].js",
dependOn: "supertokensWebsite",
},
supertokensEmailPassword: {
import: APP_DIR + "/lib/build/recipe/emailpassword/index.js",
filename: "emailpassword.js",
filename: "emailpassword.[contenthash].js",
dependOn: "supertokensWebsite",
},
supertokensThirdParty: {
import: APP_DIR + "/lib/build/recipe/thirdparty/index.js",
filename: "thirdparty.js",
filename: "thirdparty.[contenthash].js",
dependOn: "supertokensWebsite",
},
supertokensPasswordless: {
import: APP_DIR + "/lib/build/recipe/passwordless/index.js",
filename: "passwordless.js",
filename: "passwordless.[contenthash].js",
dependOn: "supertokensWebsite",
},
supertokensUserRoles: {
import: APP_DIR + "/lib/build/recipe/userroles/index.js",
filename: "userroles.js",
filename: "userroles.[contenthash].js",
dependOn: "supertokensWebsite",
},
supertokensMultitenancy: {
import: APP_DIR + "/lib/build/recipe/multitenancy/index.js",
filename: "multitenancy.js",
filename: "multitenancy.[contenthash].js",
dependOn: "supertokensWebsite",
},
supertokensMultiFactorAuth: {
import: APP_DIR + "/lib/build/recipe/multifactorauth/index.js",
filename: "multifactorauth.js",
filename: "multifactorauth.[contenthash].js",
dependOn: "supertokensWebsite",
},
supertokensTOTP: {
import: APP_DIR + "/lib/build/recipe/totp/index.js",
filename: "totp.js",
filename: "totp.[contenthash].js",
dependOn: "supertokensWebsite",
},
/**
Expand All @@ -71,7 +71,7 @@ var config = {
*/
supertokensDateProvider: {
import: APP_DIR + "/utils/dateProvider/index.js",
filename: "dateprovider.js",
filename: "dateprovider.[contenthash].js",
dependOn: "supertokensWebsite",
},
/**
Expand All @@ -84,7 +84,7 @@ var config = {
*/
supertokensWebsite: {
import: "supertokens-website",
filename: "website.js",
filename: "website.[contenthash].js",
},
},
output: {
Expand Down
Loading