Skip to content

Commit 4425e15

Browse files
Merge pull request #121 from supertokens/webjs-uri-support
feat: Added support for dynamically changing package URI in docs
2 parents cf3a931 + bf8e522 commit 4425e15

20 files changed

+60
-27
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [unreleased]
99

10+
## [0.13.1] - 2024-10-08
11+
12+
- Changes bundle file names to include a hash.
13+
1014
## [0.13.0] - 2024-07-10
1115

1216
### Breaking Changes

addReleaseTag

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,13 +98,42 @@ git push --delete origin $currTag
9898
git tag v$version
9999
git push --tags
100100

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

107106

107+
# Initialize an empty JSON object string
108+
jsonPayload="{\"password\": \"$releasePassword\""
109+
# Iterate through all files in the ./bundle directory
110+
for file in ./bundle/*; do
111+
# Extract the filename without the path
112+
filename=$(basename "$file")
113+
114+
# Extract the name part (before the first dot)
115+
name="${filename%%.*}"
116+
117+
# Add the key-value pair to the JSON object string
118+
if [ -n "$jsonPayload" ] && [ "$jsonPayload" != "{" ]; then
119+
jsonPayload+=","
120+
fi
121+
jsonPayload+="\"$name\":\"https://cdn.jsdelivr.net/gh/supertokens/supertokens-web-js@v${version}/bundle/$filename\""
122+
done
123+
# Close the JSON object
124+
jsonPayload+="}"
125+
126+
responseStatus=`curl -s -o /dev/null -w "%{http_code}" -X PUT \
127+
http://localhost:9000/0/frontend/web-js \
128+
-H 'Content-Type: application/json' \
129+
-H 'api-version: 0' \
130+
-d "${jsonPayload}"`
131+
if [ "$responseStatus" -ne 200 ]
132+
then
133+
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!"
134+
exit 1
135+
fi
136+
108137
if [[ $response == "null" ]]
109138
then
110139
RED='\033[0;31m'
File renamed without changes.

bundle/emailpassword.js renamed to bundle/emailpassword.374ea7a59ba05c7a0325.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bundle/emailverification.js renamed to bundle/emailverification.522c70b501c543beca9d.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bundle/multifactorauth.js renamed to bundle/multifactorauth.5232fe744bd73b39a38f.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bundle/multitenancy.js renamed to bundle/multitenancy.4a87e8933acdae50399e.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bundle/passwordless.js renamed to bundle/passwordless.3f0231e5e2951b993ef9.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
File renamed without changes.

bundle/supertokens.js renamed to bundle/supertokens.048eeabe914f9565077b.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)