-
Notifications
You must be signed in to change notification settings - Fork 0
Support Cloudflare Workers #47
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
Open
mickmister
wants to merge
30
commits into
main
Choose a base branch
from
refactor-springboard-server
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 28 commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
0f86a3b
inteoduce crossws to support cf workers
mickmister 713ad82
cf worker works but craps out due to CPU time
mickmister 1b580cc
remove buildServer function from build.ts
mickmister 0eb2539
fix cf worker entrypoint to do more initialization before fetch function
mickmister d171a49
add PUBLIC_USE_WEBSOCKETS_FOR_RPC build var and introduce import.meta…
mickmister 6c8426d
remove claude local settings file
mickmister cb06666
cf workers is mostly working. websockets are giving some more trouble…
mickmister 954b259
make sure server module callback is called after engine is initialized
mickmister 6906cf3
use partyserver in cf-workers entrypoint
mickmister 9ab8259
Merge branch 'main' into refactor-springboard-server
mickmister 474e554
fix workflow
mickmister 17bf810
change how we invoke sb cli in workflow
mickmister f2a8d4e
fix tauri build
mickmister 44702ac
fix cf workflow
mickmister 065590e
fix tauri build
mickmister 15cb513
fix browser platform entrypoint path
mickmister 7f60de9
fix pkg binary path for tauri
mickmister c978a20
remove mock pr preview comment
mickmister 118e0c3
remove partykit library
mickmister 7040a23
try cf deploy in ci
mickmister 4b62074
try again
mickmister e2391e5
make ci job say dry run in name
mickmister e4fc6fa
fix middleware and add middleware example to tic-tac-toe app
mickmister 45b6738
ignore empty interface
mickmister 50ced6f
fix createActions types
mickmister 3d36ac2
fix deps
mickmister 04224fc
fix createAction passing of middleware results
mickmister a527a84
add crypto library alias
mickmister 3f7ceb3
Address review feedback: clean up code and fix structure
claude[bot] 52f19fa
fix cf workers deployment by using `party: 'my-server'`
mickmister File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,104 @@ | ||
| name: Build Cloudflare Workers | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| inputs: | ||
| deploy: | ||
| description: 'Deploy to production (true) or dry run (false)' | ||
| required: true | ||
| type: boolean | ||
| default: false | ||
| site_url: | ||
| description: 'Deployment URL' | ||
| required: true | ||
| type: string | ||
| default: 'https://jamtools.app' | ||
| pull_request: | ||
| branches: [main] | ||
| push: | ||
| branches: [main] | ||
|
|
||
| env: | ||
| NODE_VERSION: '20' | ||
|
|
||
| jobs: | ||
| determine-mode: | ||
| runs-on: ubuntu-latest | ||
| outputs: | ||
| mode: ${{ steps.deploy-mode.outputs.mode }} | ||
| job-name: ${{ steps.deploy-mode.outputs.job-name }} | ||
| steps: | ||
| - name: Determine deployment mode | ||
| id: deploy-mode | ||
| run: | | ||
| if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then | ||
| if [[ "${{ github.event.inputs.deploy }}" == "true" ]]; then | ||
| echo "mode=deploy" >> $GITHUB_OUTPUT | ||
| echo "job-name=Build and Deploy" >> $GITHUB_OUTPUT | ||
| else | ||
| echo "mode=dry-run" >> $GITHUB_OUTPUT | ||
| echo "job-name=Build (dry run)" >> $GITHUB_OUTPUT | ||
| fi | ||
| elif [[ "${{ github.event_name }}" == "pull_request" ]]; then | ||
| echo "mode=deploy" >> $GITHUB_OUTPUT | ||
| echo "job-name=Build and Deploy" >> $GITHUB_OUTPUT | ||
| elif [[ "${{ github.event_name }}" == "push" && "${{ github.ref }}" == "refs/heads/main" ]]; then | ||
| echo "mode=deploy" >> $GITHUB_OUTPUT | ||
| echo "job-name=Build and Deploy" >> $GITHUB_OUTPUT | ||
| fi | ||
|
|
||
| build-and-deploy: | ||
| needs: determine-mode | ||
| runs-on: ubuntu-latest | ||
| name: ${{ needs.determine-mode.outputs.job-name }} | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v3 | ||
| - name: Install pnpm | ||
| uses: pnpm/action-setup@v4 | ||
| with: | ||
| version: 9.13.2 | ||
| - name: Install Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: 20 | ||
| cache: 'pnpm' | ||
| - name: Install modules | ||
| run: pnpm i | ||
|
|
||
| - name: Build application | ||
| run: | | ||
| export PUBLIC_SITE_URL="${{ secrets.CLOUDFLARE_DEPLOYMENT_URL }}" | ||
| npx tsx packages/springboard/cli/src/cli.ts build ./apps/jamtools/modules/index.ts --platforms cf-workers | ||
| env: | ||
| PUBLIC_SITE_URL: ${{ secrets.CLOUDFLARE_DEPLOYMENT_URL }} | ||
|
|
||
| - name: Setup Wrangler | ||
| if: needs.determine-mode.outputs.mode != '' | ||
| run: npm install -g wrangler | ||
|
|
||
| - name: Deploy (Dry Run) | ||
| if: needs.determine-mode.outputs.mode == 'dry-run' | ||
| run: | | ||
| cd dist/cf-workers | ||
| npx wrangler deploy --dry-run | ||
|
|
||
| - name: Deploy (Production) | ||
| if: needs.determine-mode.outputs.mode == 'deploy' | ||
| run: | | ||
| cd dist/cf-workers | ||
| npx wrangler deploy | ||
| env: | ||
| CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} | ||
| CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | ||
| CLOUDFLARE_ZONE_ID: ${{ secrets.CLOUDFLARE_ZONE_ID }} | ||
|
|
||
| - name: Upload build artifacts | ||
| if: always() | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: cf-workers-build-${{ github.sha }} | ||
| path: | | ||
| dist/cf-workers/ | ||
| !dist/cf-workers/node_modules | ||
| retention-days: 7 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,3 +13,5 @@ esbuild_meta.json | |
| stats.html | ||
| games | ||
| platform-examples | ||
|
|
||
| .claude/settings.local.json | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| .wrangler |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| { | ||
| "extends": "../../tsconfig.json", | ||
| "compilerOptions": { | ||
| "paths": { | ||
| // "~/*": ["../../packages/jamtools/*"], | ||
| }, | ||
| "baseUrl": "." | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
packages/jamtools/features/modules/ultimate_guitar/components/ultimate_guitar_qr_code.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove commented code. Pretty sure this wasn't useful in the first place