File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ on :
2+ push :
3+ tags :
4+ - ' *'
5+
6+ name : Release a New Version of the CLI
7+
8+ jobs :
9+ releaseandpublish :
10+ name : Release on Github
11+ runs-on : ubuntu-latest
12+ steps :
13+ - name : ⬇️ Checkout repo
14+ uses : actions/checkout@v4
15+ with :
16+ fetch-depth : 0
17+ fetch-tags : false
18+
19+ - name : ⎔ Setup bun
20+ uses : oven-sh/setup-bun@v2
21+
22+ - name : 📥 Download deps
23+ run : bun install --frozen-lockfile
24+
25+ - name : 🔨 Compiling the different versions
26+ run : make build-all-cli
27+
28+ - name : 🏷 Create GitHub Release
29+ run : |
30+ TAG_NAME=${GITHUB_REF_NAME}
31+ TAG_MESSAGE=$(git tag -l --format='%(contents)' "$TAG_NAME")
32+ gh release create "${TAG_NAME}" --title "Release ${TAG_NAME}" --notes "${TAG_MESSAGE}"
33+ env :
34+ GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
35+
36+ - name : 🚀 Upload Assets
37+ run : |
38+ ASSET_PLATFORMS=("bun-linux-x64" "bun-linux-arm64" "bun-windows-x64.exe" "bun-darwin-x64" "bun-darwin-arm64")
39+ for platform in "${ASSET_PLATFORMS[@]}"; do
40+ if [ -f "atw-cli/atw-cli-$platform" ]; then
41+ gh release upload "${GITHUB_REF_NAME}" "atw-cli/atw-cli-$platform" --clobber
42+ echo "✅ Uploaded file for platform $platform"
43+ else
44+ echo "❌ File for platform $platform not found, skipping."
45+ fi
46+ done
47+ env :
48+ GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
Original file line number Diff line number Diff line change 1+ name : Deploy to Pages
2+
3+ on :
4+ push :
5+ branches : ['main']
6+ workflow_dispatch :
7+
8+ permissions :
9+ contents : read
10+ pages : write
11+ id-token : write
12+
13+ concurrency :
14+ group : ' pages'
15+ cancel-in-progress : false
16+
17+ jobs :
18+ deploy :
19+ environment :
20+ name : github-pages
21+ url : ${{ steps.deployment.outputs.page_url }}
22+ runs-on : ubuntu-latest
23+ steps :
24+ - name : ⬇️ Checkout repo
25+ uses : actions/checkout@v4
26+ with :
27+ fetch-depth : 0
28+ fetch-tags : false
29+
30+ - name : 📦 Setup Pages
31+ uses : actions/configure-pages@v5
32+
33+ - name : 🦾 Upload artifact
34+ uses : actions/upload-pages-artifact@v3
35+ with :
36+ path : ' pages/'
37+
38+ - name : 🚢 Deploy to GitHub Pages
39+ id : deployment
40+ uses : actions/deploy-pages@v4
Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ PACKAGE_MANAGER := bun
99CURRENT_DIR := $(shell pwd)
1010DEPENDENCIES := bun git
1111WEBSITE_DIR := $(CURRENT_DIR ) /website
12+ CLI_DIR := $(CURRENT_DIR ) /atw-cli
1213
1314.PHONY : list
1415list :
@@ -56,3 +57,19 @@ test: ## Run Playwright tests (requires dev server to be running)
5657.PHONY : serve
5758serve : website/.env # # Serve the application
5859 @cd $(WEBSITE_DIR ) && $(PACKAGE_MANAGER ) run dev
60+
61+ .PHONY : build-cli
62+ build-cli : # # Build CLI
63+ @cd $(CLI_DIR ) && bun build --bundle src/index.ts --outfile atw-cli.js --target=bun
64+ @cd $(CLI_DIR ) && bun shim.ts
65+ @cd $(CLI_DIR ) && bun build --compile --minify atw-cli.js --outfile atw-cli
66+ @cd $(CLI_DIR ) && rm atw-cli.js
67+
68+ .PHONY : build-all-cli
69+ build-all-cli :
70+ @cd $(CLI_DIR ) && bun build --bundle src/index.ts --outfile atw-cli.js --target=bun
71+ @cd $(CLI_DIR ) && bun shim.ts
72+ @cd $(CLI_DIR ) && for target in bun-linux-x64 bun-linux-arm64 bun-windows-x64 bun-darwin-x64 bun-darwin-arm64; do \
73+ bun build --compile --minify atw-cli.js --outfile atw-cli-$$ target --target=$$ target; \
74+ done
75+ @rm atw-cli.js
Original file line number Diff line number Diff line change 1+ # dependencies (bun install)
2+ node_modules
3+
4+ # output
5+ out
6+ dist
7+ * .tgz
8+
9+ # code coverage
10+ coverage
11+ * .lcov
12+
13+ # logs
14+ logs
15+ _.log
16+ report. [0-9 ]_. [0-9 ]_. [0-9 ]_. [0-9 ]_.json
17+
18+ # dotenv environment variable files
19+ .env
20+ .env.development.local
21+ .env.test.local
22+ .env.production.local
23+ .env.local
24+
25+ # caches
26+ .eslintcache
27+ .cache
28+ * .tsbuildinfo
29+
30+ # IntelliJ based IDEs
31+ .idea
32+
33+ # Finder (MacOS) folder config
34+ .DS_Store
Original file line number Diff line number Diff line change 1+ {
2+ "name" : " atw-cli" ,
3+ "module" : " index.ts" ,
4+ "type" : " module" ,
5+ "version" : " 1.0.0" ,
6+ "private" : true ,
7+ "devDependencies" : {
8+ "@types/bun" : " latest" ,
9+ "@types/react" : " ^19.0.10"
10+ },
11+ "peerDependencies" : {
12+ "typescript" : " ^5"
13+ },
14+ "dependencies" : {
15+ "@inkjs/ui" : " ^2.0.0" ,
16+ "commander" : " ^13.1.0" ,
17+ "ink" : " ^5.1.1" ,
18+ "ink-link" : " ^4.1.0" ,
19+ "picocolors" : " ^1.1.1" ,
20+ "react" : " 18" ,
21+ "react-devtools-core" : " ^6.1.1"
22+ }
23+ }
Original file line number Diff line number Diff line change 1+ // Workaround to compile properly the yoga.wasm...
2+ const bin = Bun . file ( 'atw-cli.js' ) ;
3+ let content = await new Response ( bin ) . text ( ) ;
4+ const pattern = / v a r Y o g a = a w a i t i n i t Y o g a \( a w a i t E \( _ \( i m p o r t \. m e t a \. u r l \) \. r e s o l v e \( " \. \/ y o g a \. w a s m " \) \) \) ; / g;
5+ const replacement = `import initYogaAsm from 'yoga-wasm-web/asm'; const Yoga = initYogaAsm();` ;
6+ content = content . replace ( pattern , replacement ) ;
7+ await Bun . write ( 'atw-cli.js' , content ) ;
Original file line number Diff line number Diff line change 1+
2+ export type Event = {
3+ id : string
4+ slug : string
5+ name : string
6+ startDate : string
7+ location : string
8+ }
9+
10+ export const registerAction = async ( email : string , eventId : Event [ 'id' ] ) => {
11+ const response = await fetch ( `https://allthingsweb.dev/api/events/${ eventId } /register` , {
12+ method : 'POST' ,
13+ body : JSON . stringify ( { email } )
14+ } )
15+ if ( ! response . ok ) {
16+ throw new Error ( 'Failed to register' )
17+ }
18+ const { success } = await response . json ( )
19+ return success
20+ }
Original file line number Diff line number Diff line change 1+ import { createRegisterCommand } from "./register" ;
2+
3+ export const commands = [
4+ createRegisterCommand ( )
5+ ]
6+
You can’t perform that action at this time.
0 commit comments