Skip to content

Commit ba73965

Browse files
authored
Merge pull request #20 from githubnext/copilot/add-interactive-playground
Merge main, fix 19 pre-existing test failures, add interactive playgrounds for all features, bundle TypeScript locally
2 parents 18ae3c9 + 9a5c5c0 commit ba73965

34 files changed

Lines changed: 3460 additions & 1465 deletions

.github/workflows/pages.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ jobs:
3333
- name: Build library for browser
3434
run: bun build ./src/index.ts --outdir ./playground/dist --target browser --minify
3535

36+
- name: Bundle TypeScript compiler for offline playground
37+
run: cp node_modules/typescript/lib/typescript.js ./playground/dist/typescript.js
38+
3639
- name: Setup Pages
3740
uses: actions/configure-pages@v5
3841
with:

biome.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
},
88
"files": {
99
"ignoreUnknown": false,
10-
"ignore": ["dist/**", "node_modules/**", "*.d.ts", "playground/**/*.js"]
10+
"ignore": ["dist/**", "node_modules/**", "*.d.ts", "playground/**/*.js", "playground/serve.ts"]
1111
},
1212
"formatter": {
1313
"enabled": true,

docs/playground.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ compiler from CDN and transpiles user code to JavaScript before execution.
2424
Users can write type annotations, interfaces, and generics — the compiler
2525
strips them automatically.
2626

27-
- TypeScript compiler: loaded from `https://cdn.jsdelivr.net/npm/typescript@5/lib/typescript.js`
27+
- TypeScript compiler: bundled locally (`playground/dist/typescript.js`) with
28+
CDN fallback (`https://cdn.jsdelivr.net/npm/typescript@5/lib/typescript.js`).
2829
- No WASM required — the compiler runs natively in JavaScript.
2930

3031
### 3. Live tsb Library Access
@@ -112,6 +113,7 @@ playground/
112113

113114
```bash
114115
bun build ./src/index.ts --outdir ./playground/dist --target browser --minify
116+
cp node_modules/typescript/lib/typescript.js ./playground/dist/typescript.js
115117
```
116118

117119
The CI pipeline (`pages.yml`) runs this automatically during deployment.

0 commit comments

Comments
 (0)