Skip to content

Commit 05301ab

Browse files
committed
Initial work on replacing the storybook with a monaco based playground
1 parent 5d70645 commit 05301ab

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+2071
-4103
lines changed

.github/workflows/ci.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ jobs:
301301
templates/cxx-browser-esm-vite/package.json
302302
templates/cxx-parse-esm/package.json
303303
304-
build-storybook:
304+
build-playground:
305305
runs-on: ubuntu-latest
306306
needs: build-emscripten
307307
steps:
@@ -318,20 +318,20 @@ jobs:
318318
- name: Build
319319
run: |
320320
npm ci
321-
npm run build:storybook
322-
mkdir -p packages/cxx-storybook/storybook-static/docs
323-
cp -a packages/cxx-frontend/docs/. packages/cxx-storybook/storybook-static/docs
321+
npm run build:playground
322+
mkdir -p packages/cxx-playground/dist/docs
323+
cp -a packages/cxx-frontend/docs/. packages/cxx-playground/dist/docs
324324
325325
- name: Upload GitHub Pages artifact
326326
uses: actions/upload-pages-artifact@v3
327327
with:
328-
path: packages/cxx-storybook/storybook-static
328+
path: packages/cxx-playground/dist
329329

330-
deploy-storybook:
331-
name: Deploy Storybook
330+
deploy-playground:
331+
name: Deploy Playground
332332
if: github.repository == 'robertoraggi/cplusplus' && github.ref == 'refs/heads/main'
333333

334-
needs: build-storybook
334+
needs: build-playground
335335

336336
permissions:
337337
pages: write

package-lock.json

Lines changed: 949 additions & 3291 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@
3232
],
3333
"scripts": {
3434
"build:cxx-frontend": "npm run build -w cxx-frontend",
35-
"build:storybook": "npm run build-storybook -w @robertoraggi/cxx-storybook",
35+
"build:playground": "npm run build -w @robertoraggi/cxx-playground",
3636
"build:emscripten": "npm run build -w cxx-frontend",
3737
"build:wasi": "zx scripts/build-wasi.mjs",
3838
"build:mlir": "zx scripts/build-mlir.mjs",
39-
"storybook": "npm run storybook -w @robertoraggi/cxx-storybook",
39+
"playground": "npm run dev -w @robertoraggi/cxx-playground",
4040
"setup-venv": "zx scripts/setup-venv.mjs",
4141
"update-tests": "zx scripts/update-tests.mjs",
4242
"cxx-gen-ast": "node packages/cxx-gen-ast",

packages/cxx-playground/.gitignore

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
pnpm-debug.log*
8+
lerna-debug.log*
9+
10+
node_modules
11+
dist
12+
dist-ssr
13+
*.local
14+
15+
# Editor directories and files
16+
.vscode/*
17+
!.vscode/extensions.json
18+
.idea
19+
.DS_Store
20+
*.suo
21+
*.ntvs*
22+
*.njsproj
23+
*.sln
24+
*.sw?
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
src/lib/utils.ts

packages/cxx-playground/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# cxx-playground
2+
3+
**cxx-playground** is a sandbox project designed to experiment with and test the `cxx` frontend.
4+
Prototype, explore features, and validate `cxx`.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"$schema": "https://ui.shadcn.com/schema.json",
3+
"style": "new-york",
4+
"rsc": false,
5+
"tsx": true,
6+
"tailwind": {
7+
"config": "",
8+
"css": "src/index.css",
9+
"baseColor": "neutral",
10+
"cssVariables": true,
11+
"prefix": ""
12+
},
13+
"aliases": {
14+
"components": "@/components",
15+
"utils": "@/lib/utils",
16+
"ui": "@/components/ui",
17+
"lib": "@/lib",
18+
"hooks": "@/hooks"
19+
},
20+
"iconLibrary": "lucide"
21+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import js from "@eslint/js";
2+
import globals from "globals";
3+
import reactHooks from "eslint-plugin-react-hooks";
4+
import reactRefresh from "eslint-plugin-react-refresh";
5+
import tseslint from "typescript-eslint";
6+
import { globalIgnores } from "eslint/config";
7+
8+
export default tseslint.config([
9+
globalIgnores(["dist"]),
10+
{
11+
files: ["**/*.{ts,tsx}"],
12+
extends: [
13+
js.configs.recommended,
14+
tseslint.configs.recommended,
15+
reactHooks.configs["recommended-latest"],
16+
reactRefresh.configs.vite,
17+
],
18+
languageOptions: {
19+
ecmaVersion: 2020,
20+
globals: globals.browser,
21+
},
22+
},
23+
]);

packages/cxx-storybook/index.html renamed to packages/cxx-playground/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<head>
44
<meta charset="UTF-8" />
55
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
6-
<title>C++ Storybook</title>
6+
<title>C++ Playground</title>
77
</head>
88
<body>
99
<div id="root"></div>
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
{
2+
"name": "@robertoraggi/cxx-playground",
3+
"private": true,
4+
"version": "0.0.0",
5+
"type": "module",
6+
"scripts": {
7+
"dev": "vite",
8+
"build": "tsc -b && vite build",
9+
"lint": "eslint .",
10+
"preview": "vite preview"
11+
},
12+
"dependencies": {
13+
"class-variance-authority": "^0.7.1",
14+
"clsx": "^2.1.1",
15+
"lucide-react": "^0.525.0",
16+
"react": "latest",
17+
"react-dom": "latest",
18+
"tailwind-merge": "^3.3.1"
19+
},
20+
"devDependencies": {
21+
"@eslint/js": "latest",
22+
"@tailwindcss/vite": "^4.1.11",
23+
"@tanstack/react-query": "^5.81.5",
24+
"@types/react": "latest",
25+
"@types/react-dom": "latest",
26+
"@types/react-window": "^1.8.8",
27+
"@vitejs/plugin-react": "latest",
28+
"birpc": "^2.4.0",
29+
"cxx-frontend": "^1.1.27",
30+
"eslint": "latest",
31+
"eslint-plugin-react-hooks": "latest",
32+
"eslint-plugin-react-refresh": "latest",
33+
"globals": "latest",
34+
"monaco-editor": "^0.52.2",
35+
"prettier": "^3.6.2",
36+
"react-virtualized-auto-sizer": "^1.0.26",
37+
"react-window": "^1.8.11",
38+
"tailwindcss": "^4.1.11",
39+
"tw-animate-css": "^1.3.5",
40+
"typescript": "latest",
41+
"typescript-eslint": "latest",
42+
"use-debounce": "^10.0.5",
43+
"vite": "latest"
44+
}
45+
}

0 commit comments

Comments
 (0)