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

Release 2.1.0 #1371

Merged
merged 223 commits into from
Sep 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
223 commits
Select commit Hold shift + click to select a range
8c9aa80
New git branches setup (#1296)
goastler Jul 19, 2024
c6a9443
Cache cypress install (#1305)
goastler Jul 23, 2024
42ef8d3
Merge branch 'main' into dev
goastler Jul 23, 2024
4b5a70d
Add staging branch to workflow (#1311)
forgetso Jul 29, 2024
20c0e12
New linting (#1309)
goastler Jul 29, 2024
86400eb
fix npm script error handling (#1306)
goastler Jul 29, 2024
35e7505
fix auto merge (#1302)
goastler Jul 29, 2024
cd6b236
Remove contract calls (#1308)
HughParry Jul 29, 2024
5bff693
Removing unused deps, bumping package lock
HughParry Jul 30, 2024
fa08353
Working pow captcha with timeouts
HughParry Jul 30, 2024
42e1102
Add missing deps and bundling command for staging
forgetso Jul 30, 2024
30e686d
Remove version from docker compose files
forgetso Jul 30, 2024
70d1ec5
Use NODE_ENV var for pulling in env var file into docker compose file
forgetso Jul 30, 2024
a28b142
Add staging deploy process
forgetso Jul 30, 2024
7831942
Add staging bundle command
forgetso Jul 30, 2024
a0212ff
package lock
forgetso Jul 30, 2024
64bf575
Remove old deps.
forgetso Jul 30, 2024
802d47e
Update package-lock.json
forgetso Jul 30, 2024
f374527
Update event name
forgetso Jul 30, 2024
8793b54
Add missing dep
forgetso Jul 30, 2024
79b214c
Use latest image to create container from
forgetso Jul 30, 2024
c09b367
Use staging tag for container
forgetso Jul 30, 2024
0aac58f
Await crypto WASM blob
forgetso Jul 31, 2024
29902b7
Allow NODE_ENV to be passed into Vite config
forgetso Jul 31, 2024
f93a81b
Add load-balancer refs to tsconfigs
forgetso Jul 31, 2024
6bf009b
Allow PROSOPO_DEFAULT_ENVIRONMENT to inherit from NODE_ENV
forgetso Jul 31, 2024
7aa256d
Add some logging and change some imports
forgetso Jul 31, 2024
17983c7
exporting hardcoded provider from types
HughParry Jul 31, 2024
129be99
Cleanup linting process (#1312)
goastler Jul 31, 2024
7f9b730
Fix provider not erroring on database connection error. Add option to…
forgetso Jul 31, 2024
9ef7504
Add staging command back in
forgetso Jul 31, 2024
5a70867
deploy staging workflow to bundle branch
HughParry Jul 31, 2024
2a77f02
addit commit details for bumps
HughParry Jul 31, 2024
dad13ec
Add watchtower to provider docker compose
forgetso Jul 31, 2024
b20be8e
Don't mount missing file
forgetso Jul 31, 2024
61fa810
watch provider container only
forgetso Jul 31, 2024
eaab4ca
Change container name
forgetso Jul 31, 2024
61390ca
Use createConnection instead of connection
forgetso Aug 1, 2024
5b02bee
Fix build
forgetso Aug 1, 2024
d9717ea
Staging deploy workflow (#1314)
goastler Aug 5, 2024
81a4421
Pkg json
HughParry Aug 5, 2024
8466c4b
bump version to v2.0.0
goastler Aug 5, 2024
3951216
no build specified
HughParry Aug 5, 2024
3bbaf77
Merge branch 'staging' into release/2.0.0
forgetso Aug 5, 2024
5348243
remove deploy_X scripts
goastler Aug 5, 2024
c408692
Merge branch 'release/2.0.0' of github.com:prosopo/captcha into relea…
goastler Aug 5, 2024
b1bbfe8
remove deploy_X scripts
goastler Aug 5, 2024
b95a62a
remove deploy_protocol script call
goastler Aug 5, 2024
a97880b
remove deploy_protocol workflow step
goastler Aug 5, 2024
ac0a6aa
remove github assets for contract
goastler Aug 5, 2024
ea6db02
remove deploy_protool
goastler Aug 5, 2024
4a08205
Use 2.0.0 everywhere
forgetso Aug 5, 2024
3116a13
Merge branch 'release/2.0.0' of github.com:prosopo/captcha into relea…
forgetso Aug 5, 2024
190b248
Provider tests passing
HughParry Aug 5, 2024
d8f3bc6
Adding if present to cjs
HughParry Aug 5, 2024
4eab1e4
Dropping auto merge
HughParry Aug 5, 2024
65e2b41
Dropping dapp example demo
HughParry Aug 5, 2024
cff6194
fix check version bump all history available
goastler Aug 5, 2024
50503e0
Update check_version_bump.yml
goastler Aug 5, 2024
e949d6f
Update check_version_bump.yml
goastler Aug 5, 2024
8518742
Remove out of date readme
forgetso Aug 5, 2024
4ebced2
Update check_version_bump.yml
goastler Aug 5, 2024
e538432
Merge branch 'release/2.0.0' of github.com:prosopo/captcha into relea…
goastler Aug 5, 2024
f18b989
Re-add old babel plugins
forgetso Aug 5, 2024
98b70b2
start provider
HughParry Aug 6, 2024
b96fe50
Always add the token to the form
forgetso Aug 6, 2024
ff21ed4
Supply token to onHuman function
forgetso Aug 6, 2024
29e2c69
Fix build
forgetso Aug 6, 2024
915b414
Adding button next for cypress tests
HughParry Aug 6, 2024
0918250
Fixing hanging test
HughParry Aug 6, 2024
86a84db
Fixing get dataset being broken
HughParry Aug 6, 2024
af7bcb1
Remove substrate from docker compose
forgetso Aug 6, 2024
1fa1787
Cypress tests passing
HughParry Aug 6, 2024
f802200
stop the provider workflow from falling over if the npm packages are …
forgetso Aug 6, 2024
1e3ae78
Only load the provider mock container if we built it
forgetso Aug 6, 2024
b68f60c
Try to upload screenshots
forgetso Aug 6, 2024
ca04b68
Try to store screenshots on failure
forgetso Aug 6, 2024
a61368f
Try using withinSubject:null
forgetso Aug 6, 2024
2ec1fe4
Wait for button to be visible
forgetso Aug 6, 2024
34f547c
Wait for the the API call
forgetso Aug 6, 2024
844783c
Remove wait for solution request
forgetso Aug 6, 2024
0d1d924
try to force the click
forgetso Aug 6, 2024
dc74abb
Just force, don't expect the element
forgetso Aug 6, 2024
bf2f2fe
try waiting after clicking
forgetso Aug 6, 2024
61befa1
Store videos of cypress runs
forgetso Aug 6, 2024
bed1ba6
Remove the then
forgetso Aug 6, 2024
8e9e149
Remove duplicate click
forgetso Aug 6, 2024
858d126
Fix function return type
forgetso Aug 6, 2024
82a2fec
try within
forgetso Aug 6, 2024
ddd95c3
Adding setup step for setup env in test
HughParry Aug 7, 2024
a6d7298
Add data-cy attributes if environment is not production
forgetso Aug 7, 2024
a904c21
wait for docker containers to setup env
HughParry Aug 7, 2024
44efdbc
Merge branch 'release/2.0.0' of github.com:prosopo/captcha into relea…
forgetso Aug 7, 2024
51cfce2
Adding setup step for setup env in test
HughParry Aug 7, 2024
7282e1c
Start docker first
forgetso Aug 7, 2024
bc4d19f
Check if there are references
forgetso Aug 7, 2024
6ed8217
remove within
forgetso Aug 7, 2024
b4152cc
Try to kill processes with concurrently
forgetso Aug 7, 2024
d0d987f
Size fixes for widget and logo
forgetso Aug 7, 2024
1af2dd4
Make signature stuff less confusing
forgetso Aug 8, 2024
62ac3b4
Fix license header positions
forgetso Aug 8, 2024
edf4536
Fix tests
forgetso Aug 8, 2024
3a83cdf
Get it all working
forgetso Aug 8, 2024
581662d
Merge branch 'staging' into size-fixes
forgetso Aug 8, 2024
d8a5ecf
Fix size
forgetso Aug 8, 2024
6e938a6
Fix lint issues (#1318)
goastler Aug 9, 2024
fe99949
use package workspaces rather than cd'ing (#1321)
goastler Aug 9, 2024
7f5caf2
Add push to js branch again to get live staging bundle
forgetso Aug 11, 2024
1b115ce
Remove any existing procaptcha responses on human
forgetso Aug 11, 2024
8eed75c
deploy staging on push to staging
forgetso Aug 12, 2024
89ce6bf
Use duplicate JS Server for now
forgetso Aug 12, 2024
669f6e7
Silence GH warning about NoSQL injection in demo
forgetso Aug 12, 2024
9beaa38
Silence GH warning about NoSQL injection in demo
forgetso Aug 12, 2024
8b7563e
Set GH_TOKEN env
forgetso Aug 12, 2024
fc0e4a7
Remove production step for JS Server
forgetso Aug 12, 2024
50013d1
Add back command to push to js-bundle branch. Remove quotes in asset …
forgetso Aug 12, 2024
514164a
Use correct docker tag
forgetso Aug 12, 2024
a6f22a7
Try moving to its own step
forgetso Aug 12, 2024
0035f24
don't fail if nothing to commit
forgetso Aug 12, 2024
806dbff
Update provider docker run CMD
forgetso Aug 12, 2024
b92dbd1
Always pull new version of tag for provider image
forgetso Aug 12, 2024
400c5a9
Update provider CMD
forgetso Aug 12, 2024
3f033a0
Alter the verify endpoint when in non-production environments in clie…
forgetso Aug 12, 2024
4f58e79
Allow PoW captchas to be stored and counted
forgetso Aug 13, 2024
4a1258c
Removing exportData from Manager
HughParry Aug 13, 2024
81dde17
Adding synamic config for load balancer
HughParry Aug 13, 2024
4b949d8
Fix build
forgetso Aug 13, 2024
7a75dc4
fix server build
forgetso Aug 13, 2024
4ce946a
fix server again
forgetso Aug 13, 2024
7918d9e
Merge branch 'release/2.0.0' of github.com:prosopo/captcha into relea…
forgetso Aug 13, 2024
a127542
fix provider build
forgetso Aug 13, 2024
eb8a958
Merge branch 'staging' into release/2.0.0
forgetso Aug 13, 2024
25d4bd0
Removing dangerou
HughParry Aug 13, 2024
6ff6f25
Change scale-ts type to u64 to avoid losing data
forgetso Aug 13, 2024
0c287c5
revert change to number for timestamp
forgetso Aug 13, 2024
4e89de6
make sure procaptcha-response is deleted
forgetso Aug 13, 2024
2ce41a8
Fix scheduler database name and add env option for storage schedule
forgetso Aug 13, 2024
c0557d8
Make the models available once the connection has been made
forgetso Aug 13, 2024
1ab5169
Merge branch 'main' into staging
forgetso Aug 13, 2024
7665044
Merge branch 'staging' into size-fixes
forgetso Aug 14, 2024
3e0053a
Move headers
forgetso Aug 14, 2024
be85cd9
Update js_server release step
forgetso Aug 14, 2024
48eeeb1
Try using secret directly
forgetso Aug 14, 2024
b4daac5
Add some debug
forgetso Aug 14, 2024
8f26856
Modify debug
forgetso Aug 14, 2024
f639fad
Yet more debug
forgetso Aug 14, 2024
383c73f
I give up
forgetso Aug 14, 2024
5da691d
Working captcha results in mongo (#1322)
HughParry Aug 14, 2024
40d8d73
Use a var for mongo image
forgetso Aug 14, 2024
1c86647
more debug
forgetso Aug 14, 2024
cd33a71
Removing lint fix from version bump
HughParry Aug 14, 2024
54b953f
Merge branch 'main' into staging
forgetso Aug 19, 2024
5f35181
User data mvp (#1327)
forgetso Aug 21, 2024
15e1289
only run prosoponator on non-draft pr's (#1333)
goastler Aug 21, 2024
2a0a69e
fix dir capitalisation (#1329)
goastler Aug 21, 2024
8f1d57a
Introduce dotenv package for finding environment files (#1334)
forgetso Aug 21, 2024
4df38b8
Fix dataset IDs for staging providers
forgetso Aug 21, 2024
4aeab1e
Allow pow challenges to be submitted more than once for verification
forgetso Aug 21, 2024
02e3045
Fail if the challenge exists in the db
forgetso Aug 21, 2024
30bf49f
Revert unlimited challenge checking
forgetso Aug 21, 2024
eec7235
Make demo re-render captcha component when form changes
forgetso Aug 21, 2024
6d40870
Allow navigating between the captcha types
forgetso Aug 21, 2024
eee3867
Fix license location
forgetso Aug 21, 2024
ad05937
remove debug
forgetso Aug 21, 2024
095f595
Store something on each request. Update PoW types. Additional checks …
forgetso Aug 26, 2024
4feb72c
Bug fix for missing status in scheduled task record
forgetso Aug 26, 2024
da57633
Fix captcha storage mechanism. Add tests (#1337)
forgetso Aug 28, 2024
8104c93
use correct branch name in bump version
forgetso Aug 28, 2024
920fdfe
Merge branch 'main' into staging
forgetso Aug 28, 2024
f62ee80
Merge branch 'main' into staging
forgetso Aug 28, 2024
7a9ebb5
Merge branch 'main' into staging
forgetso Aug 28, 2024
a634f05
Merge branch 'main' into staging
forgetso Aug 28, 2024
973a9ca
Merge branch 'main' into staging
forgetso Aug 28, 2024
279a3cc
Merge branch 'main' into staging
forgetso Aug 29, 2024
3bf8166
Merge branch 'main' into staging
forgetso Aug 31, 2024
7f7a89d
Fix captcha scheduling insert (#1341)
forgetso Sep 2, 2024
7c5ebb0
Add types to tests to filter by test type during testing (#1342)
goastler Sep 2, 2024
a4e43b5
Fix last scheduled task getter (#1346)
forgetso Sep 3, 2024
57cbb09
Merge branch 'main' into staging
forgetso Sep 3, 2024
2ca87bb
Lint repo (#1349)
HughParry Sep 5, 2024
6203add
Docker compose overhaul (#1350)
goastler Sep 10, 2024
835e37f
Caddyfile defaults (#1352)
goastler Sep 11, 2024
79c2437
rimraf dep (#1331)
goastler Sep 11, 2024
e58539c
security policy (#1343)
goastler Sep 11, 2024
31988de
Portal settings (#1351)
forgetso Sep 11, 2024
18e351e
TLS headers (#1353)
goastler Sep 11, 2024
ec0d1af
remove old demo/example pkgs (#1345)
goastler Sep 11, 2024
7a24598
Provider retry (#1348)
HughParry Sep 11, 2024
130c70e
remove find-up (#1354)
forgetso Sep 12, 2024
d911587
Stop npm from failing on extraneous packages
forgetso Sep 12, 2024
7cc65a2
Add package-lock-only flag
forgetso Sep 12, 2024
0a7e42f
drop depends
goastler Sep 12, 2024
b24c1f4
Merge branch 'staging' of github.com:prosopo/captcha into staging
goastler Sep 12, 2024
4403820
Deps (#1356)
goastler Sep 16, 2024
3cc4736
Deploy bundle on push (#1362)
HughParry Sep 16, 2024
b48522f
No hats (#1357)
goastler Sep 16, 2024
43dc049
npmrc (#1361)
goastler Sep 16, 2024
ffa2d2f
Adding prosopo to css selectors (#1363)
HughParry Sep 16, 2024
6a0e9c5
Deps (#1365)
goastler Sep 16, 2024
30a539b
npmrc fix (#1366)
goastler Sep 17, 2024
4d63776
bump vite to 5.4.6
forgetso Sep 17, 2024
7fc42d9
📦🔒
forgetso Sep 17, 2024
1e61dd5
fix bump version workflow (#1368)
goastler Sep 17, 2024
72b34c0
Bump version to 2.1.0
prosoponator Sep 17, 2024
f08ab8e
Bump to 2.0.1
forgetso Sep 17, 2024
1d06208
Merge branch 'release/2.1.0' of github.com:prosopo/captcha into relea…
forgetso Sep 17, 2024
3ab8bed
Lint-fix
forgetso Sep 17, 2024
8fc6e93
Bump env versions
forgetso Sep 17, 2024
b7e3d67
saving to js folder (#1373)
HughParry Sep 18, 2024
d3b6b95
Adding spanish and portuguese support (#1364)
HughParry Sep 18, 2024
f7663c7
Merge branch 'staging' into release/2.1.0
forgetso Sep 18, 2024
93f6e2d
Package bumps
forgetso Sep 18, 2024
754cba9
recursive copy
forgetso Sep 18, 2024
8bb1d32
Merge branch 'staging' into release/2.1.0
forgetso Sep 18, 2024
0762bf7
caddyfile defaults for variables
goastler Sep 18, 2024
aea585b
Merge branch 'staging' of github.com:prosopo/captcha into staging
goastler Sep 18, 2024
2f39d6c
Copy top level files only
forgetso Sep 18, 2024
41c9efc
deploy fix (#1374)
HughParry Sep 18, 2024
6d0e187
Use inherited vite config from dev/config package (#1376)
forgetso Sep 19, 2024
78d37cf
i18n fixes (#1377)
HughParry Sep 19, 2024
cc7edf7
Portugese Brazilian (#1379)
forgetso Sep 19, 2024
da7a40e
Merge branch 'staging' into release/2.1.0
forgetso Sep 19, 2024
28707bf
Commit so that i can pin
forgetso Sep 19, 2024
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
78 changes: 54 additions & 24 deletions .github/workflows/bump_version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,27 @@ on:
type: string
description: Version number (e.g. 1.2.3)
required: true
src:
type: string
description: Source branch name (e.g. staging)
required: true
default: staging
interim:
type: string
description: Interim branch name (e.g. release/1.2.3). Leave empty to use 'release/<version_number>'.
required: false
dest:
type: string
description: Destination branch name (e.g. main)
required: true
default: main

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

env:
GITHUB_TOKEN: ${{ secrets.PROSOPONATOR_PAT }}

jobs:
bump_version:
Expand Down Expand Up @@ -60,34 +77,47 @@ jobs:
- uses: actions/checkout@v3

- name: Bump version
env:
GITHUB_TOKEN: ${{ secrets.PROSOPONATOR_PAT }}
run: |
set -euxo pipefail # stop on errors, print commands, fail on pipe fails

# set the branch name
BRANCH_NAME="release/${{ github.event.inputs.version }}"
set -euxo pipefail # stop on errors, print commands, fail on pipe fails

# set the author in git
git config user.name "prosoponator[bot]"
git config user.email "dev@prosopo.io"

# checkout the src branch
git checkout ${{ github.event.inputs.src }}

INTERIM="${{ github.event.inputs.interim}}"
# set the interim branch name to release/<version_number> if not provided
INTERIM="${INTERIM:-release/${{ github.event.inputs.version }}}"

# make a new branch for the version changes
git switch -c $BRANCH_NAME
# make a new branch for the version changes
git switch -c $INTERIM

# find all package.json files, recursively
pkgJsons=$(find . -name package.json -prune -not -path '*/node_modules/*' -not -path '*/.next/*')
# replace the version in all package.json files
xargs -I % sh -c "cat % | jq '.version = \"${{ github.event.inputs.version }}\"' > %.new && mv %.new %" <<< "$pkgJsons"
pkgJsons=$(npm run --silent ws:pkg)
pkgNames=$(npm run --silent ws:ls)
for pkgJson in $pkgJsons; do
# for each package in the workspace, set the version number
cat $pkgJson | jq ".version = \"${{ github.event.inputs.version }}\"" > $pkgJson
for pkgName in $pkgNames; do
# for each package in the workspace, check whether it is in the dependencies of the current package
# if so, bump the version number in the dependencies
cat $pkgJson | jq "if .dependencies[\"$pkgName\"] then .dependencies[\"$pkgName\"] = \"^${{ github.event.inputs.version }}\" else . end" > $pkgJson
done
done

# set the author in git
git config user.name "prosoponator[bot]"
git config user.email "dev@prosopo.io"
# update pkg lock
npm i

# commit the version changes
git add .
git commit -m "Bump version to ${{ github.event.inputs.version }}"
# commit the version changes
git add .
git commit -m "Bump version to ${{ github.event.inputs.version }}"

# push version changes
git push --set-upstream origin $BRANCH_NAME

git fetch origin main
# push version changes
git push --set-upstream origin $INTERIM

# fetch the dest branch
git fetch origin ${{ github.event.inputs.dest }}

# create a PR for the release
gh pr create --base main --title "Release ${{ github.event.inputs.version }}" --fill
# create a PR for the release
gh pr create --base ${{ github.event.inputs.dest }} --title "Release ${{ github.event.inputs.version }}" --fill
31 changes: 14 additions & 17 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ jobs:
git checkout js-bundle

# Copy built bundle to js-bundle branch
cp packages/procaptcha-bundle/dist/bundle/* .
cp $(find packages/procaptcha-bundle/dist/bundle/* -maxdepth 0 -not -type d) .

# set the author in git
git config user.name "prosoponator[bot]"
Expand All @@ -164,24 +164,21 @@ jobs:
# Return to the original branch
git checkout ${{ github.ref }}

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v2
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: eu-west-1

- name: Deploy staging js bundle
if: ${{ steps.env.outputs.staging }}
env:
GH_TOKEN: ${{ github.token }}
- name: Deploy bundle to AWS S3
if: ${{ steps.env.outputs.production || steps.env.outputs.staging }}
run: |

# stop on errors, print commands, fail on pipe fails
set -euo pipefail

# the tag for the release
TAG=${{ steps.env.outputs.env }}-release

# find the staging release, list the assets, then delete each asset. This stops any assets being carried over from one staging release to the next
gh release view $TAG --json assets | jq '.assets[].name' | tr -d '"' | xargs -P 1 --verbose -I {} gh release delete-asset $TAG {} -y

# upload the bundle to the staging release
gh release upload $TAG packages/procaptcha-bundle/dist/bundle/*
if [ "${{ steps.env.outputs.production }}" = "true" ]; then
aws s3 cp packages/procaptcha-bundle/dist/bundle/ s3://js.prosopo.io/js/ --recursive
elif [ "${{ steps.env.outputs.staging }}" = "true" ]; then
aws s3 cp packages/procaptcha-bundle/dist/bundle/ s3://staging-js.prosopo.io/js/ --recursive
fi

- name: Build docker js_server
run: |
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ jobs:
check:
name: check
runs-on: ubuntu-latest
container:
image: prosopo/ci:latest
options: >
--volume ${{ github.workspace }}:/repo
if: github.event.pull_request.draft == false
steps:
- name: Print contexts
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/prosoponator_bot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on: issue_comment
jobs:
comment:
# This job only runs for pull request comments
if: ${{ github.event.issue.pull_request }} && github.event.pull_request.draft == false
if: ${{ github.event.issue.pull_request && github.event.pull_request.draft == false }}
runs-on: ubuntu-latest
steps:
- name: Print contexts
Expand Down
56 changes: 56 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,62 @@ jobs:
restore-keys: |
project-cache-${{ github.event.pull_request.head.ref || github.ref }}-${{ runner.os }}-${{ runner.arch }}-

# check that each package.json contains a `build` and `build:cjs` script.
- name: Check for build and build:cjs scripts
run: |
for file in $(find ./packages -name package.json -not -path "**/node_modules/*" -not -path "./packages/detector/*"); do
if ! grep -q '"build":' $file; then
echo "Missing 'build' script in $file"
exit 1
fi
if ! grep -q '"build:cjs":' $file; then
echo "Missing 'build:cjs' script in $file"
exit 1
fi
done

# check that the number of references in each tsconfig.json is equal to the number of references in the tsconfig.cjs.json for each package
- name: Check for matching references in tsconfig.json and tsconfig.cjs.json
run: |
rm -f mismatched_references.txt
for file in $(find ./packages -name tsconfig.json -not -path "**/node_modules/*" -not -path "./packages/detector/*"); do
if [ $(jq '.references | length' $file) -ne $(jq '.references | length' $(dirname $file)/tsconfig.cjs.json) ]; then
echo "Mismatched number of references in $file and $(dirname $file)/tsconfig.cjs.json" >> mismatched_references.txt
fi
done
if [ -f mismatched_references.txt ]; then
cat mismatched_references.txt
exit 1
fi

# check that each @prosopo package referenced in package.json is in the tsconfig.json for each package
- name: Check for matching references in package.json and tsconfig.json
run: |
rm -f missing_references.txt
for file in $(find ./packages -name package.json -not -path "**/node_modules/*" -not -path "./packages/detector/*"); do
for package in $(jq -r '.dependencies | keys[]' $file); do
# if the package is not a @prosopo package, skip it
if ! echo $package | grep -q "^@prosopo"; then
continue
fi

# if the package is @prosopo/config, skip it
if [[ "$package" == "@prosopo/config" ]]; then
continue
fi

# split the package by '/' and get the last element
searchterm=$(echo $package | awk -F/ '{print $NF}')
if ! grep -oI "\"..\/$searchterm\"" $(dirname $file)/tsconfig.json; then
# store the results
echo "Missing reference to $searchterm in $(dirname $file)/tsconfig.json" >> missing_references.txt
fi
done
done
if [ -f missing_references.txt ]; then
cat missing_references.txt
fi

- uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
Expand Down
6 changes: 6 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
save-prefix= # don't add ^ to deps by default when adding new deps
maxsockets=10 # 10 concurrent downloads
fetch-retries=100 # try 100 times to download a pkg
fetch-retry-mintimeout=1 # 1ms between retries minimum
fetch-retry-maxtimeout=10000 # 10s between retries maximum
fetch-retry-factor=2 # increase timeout by 2x each retry
46 changes: 25 additions & 21 deletions demos/client-bundle-example/package.json
Original file line number Diff line number Diff line change
@@ -1,23 +1,27 @@
{
"name": "@prosopo/client-bundle-example",
"main": "index.js",
"engines": {
"node": ">=20",
"npm": ">=9"
},
"scripts": {
"test": "echo \"No test specified\"",
"build": "echo \"No build specified\"",
"start": "vite serve ./src --port 9232 --config vite.config.ts",
"clean": "echo 'nothing to clean'"
},
"dependencies": {
"dotenv": "^16.0.1",
"vite": "^5.1.7"
},
"version": "2.0.3",
"devDependencies": {
"tslib": "2.6.2",
"typescript": "5.1.6"
}
"name": "@prosopo/client-bundle-example",
"main": "index.js",
"engines": {
"node": ">=20",
"npm": ">=9"
},
"scripts": {
"test": "echo \"No test specified\"",
"build": "echo \"No build specified\"",
"start": "vite serve ./src --port 9232 --config vite.config.ts",
"clean": "echo 'nothing to clean'"
},
"version": "2.1.0",
"devDependencies": {
"@types/node": "22.5.5",
"@vitest/coverage-v8": "2.1.1",
"concurrently": "9.0.1",
"npm-run-all": "4.1.5",
"rimraf": "6.0.1",
"tslib": "2.7.0",
"tsx": "4.19.1",
"typescript": "5.6.2",
"vite": "5.4.6",
"vitest": "2.1.1"
}
}
109 changes: 59 additions & 50 deletions demos/client-example-server/package.json
Original file line number Diff line number Diff line change
@@ -1,52 +1,61 @@
{
"name": "@prosopo/client-example-server",
"version": "2.0.3",
"description": "Backend for client-example",
"main": "dist/app.js",
"type": "module",
"engines": {
"node": ">=20",
"npm": ">=9"
},
"scripts": {
"test": "echo \"No test specified\"",
"dev": "NODE_ENV=${NODE_ENV:-development}; vite serve --mode=$NODE_ENV --config ./vite.config.ts --host",
"start": "node ./dist/app.js",
"start:bundle": "node ./dist/bundle/prosopo_client_example_server.app.bundle.js",
"build": "tsc --build --verbose",
"bundle": "NODE_ENV=${NODE_ENV:-production}; vite build --mode=$NODE_ENV --config ./vite.config.ts",
"clean": "tsc --build --clean"
},
"repository": {
"type": "git",
"url": "git+https://github.com/prosopo/client-example-server.git"
},
"author": "PROSOPO LIMITED <info@prosopo.io>",
"license": "Apache-2.0",
"bugs": {
"url": "https://github.com/prosopo/client-example-server/issues"
},
"homepage": "https://github.com/prosopo/client-example-server#readme",
"dependencies": {
"@noble/hashes": "^1.3.1",
"@polkadot/util": "12.6.2",
"@polkadot/util-crypto": "12.6.2",
"@prosopo/api": "2.0.3",
"@prosopo/dotenv": "2.0.3",
"@prosopo/procaptcha": "2.0.3",
"@prosopo/server": "2.0.3",
"@prosopo/types": "2.0.3",
"@typegoose/auto-increment": "^4.5.0",
"cors": "^2.8.5",
"jsonwebtoken": "^9.0.0",
"mongoose": "^8.5.1",
"zod": "^3.22.3"
},
"devDependencies": {
"@prosopo/config": "2.0.3",
"@types/jsonwebtoken": "^9.0.2",
"tslib": "2.6.2",
"typescript": "5.1.6",
"vite": "^5.1.7"
}
"name": "@prosopo/client-example-server",
"version": "2.1.0",
"description": "Backend for client-example",
"main": "dist/app.js",
"type": "module",
"engines": {
"node": ">=20",
"npm": ">=9"
},
"scripts": {
"test": "echo \"No test specified\"",
"dev": "NODE_ENV=${NODE_ENV:-development}; vite serve --mode=$NODE_ENV --config ./vite.config.ts --host",
"start": "node ./dist/app.js",
"start:bundle": "node ./dist/bundle/prosopo_client_example_server.app.bundle.js",
"build": "tsc --build --verbose",
"bundle": "NODE_ENV=${NODE_ENV:-production}; vite build --mode=$NODE_ENV --config ./vite.config.ts",
"clean": "tsc --build --clean"
},
"repository": {
"type": "git",
"url": "git+https://github.com/prosopo/client-example-server.git"
},
"author": "PROSOPO LIMITED <info@prosopo.io>",
"license": "Apache-2.0",
"bugs": {
"url": "https://github.com/prosopo/client-example-server/issues"
},
"homepage": "https://github.com/prosopo/client-example-server#readme",
"dependencies": {
"@noble/hashes": "1.5.0",
"@polkadot/util": "12.6.2",
"@polkadot/util-crypto": "12.6.2",
"@prosopo/common": "2.1.0",
"@prosopo/contract": "2.1.0",
"@prosopo/dotenv": "2.1.0",
"@prosopo/server": "2.1.0",
"@prosopo/types": "2.1.0",
"@prosopo/util": "2.1.0",
"@typegoose/auto-increment": "4.6.0",
"cors": "2.8.5",
"express": "4.21.0",
"jsonwebtoken": "9.0.2",
"mongodb-memory-server": "10.0.0",
"mongoose": "8.6.2",
"zod": "3.23.8"
},
"devDependencies": {
"@prosopo/config": "2.1.0",
"@types/jsonwebtoken": "9.0.6",
"@vitest/coverage-v8": "2.1.1",
"concurrently": "9.0.1",
"npm-run-all": "4.1.5",
"rimraf": "6.0.1",
"tslib": "2.7.0",
"tsx": "4.19.1",
"typescript": "5.6.2",
"vite": "5.4.6",
"vitest": "2.1.1"
}
}
Loading
Loading