@tscircuit/cli 0.0.393 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/bun-formatcheck.yml +26 -0
- package/.github/workflows/bun-pver-release.yml +25 -0
- package/.github/workflows/{typecheck.yml → bun-typecheck.yml} +0 -3
- package/LICENSE +21 -0
- package/README.md +30 -36
- package/biome.json +9 -9
- package/bun.lockb +0 -0
- package/cli/CliContext.ts +8 -0
- package/cli/auth/login/register.ts +73 -0
- package/cli/auth/logout/register.ts +11 -0
- package/cli/auth/register.ts +5 -0
- package/cli/config/print/register.ts +12 -0
- package/cli/config/register.ts +5 -0
- package/cli/dev/register.ts +111 -0
- package/cli/main.ts +31 -0
- package/dist/main.js +473 -0
- package/docs/file-server-api-usage.md +57 -0
- package/docs/run-frame-usage.md +14 -0
- package/example-dir/manual-edits.json +1 -0
- package/example-dir/snippet.d.ts +13 -0
- package/example-dir/snippet.tsx +20 -0
- package/example-dir/types.d.ts +11 -0
- package/lib/cli-config/TypedConfigStore.ts +50 -0
- package/lib/cli-config/index.ts +16 -0
- package/lib/dependency-analysis/DependencyAnalyzer.ts +129 -0
- package/lib/dependency-analysis/getLocalFileDependencies.ts +101 -0
- package/lib/dependency-analysis/installNodeModuleTypes.ts +74 -0
- package/lib/index.ts +2 -0
- package/lib/project-config/index.ts +5 -0
- package/lib/registry-api/endpoint-types.ts +20 -0
- package/lib/registry-api/get-ky.ts +30 -0
- package/lib/server/EventsWatcher.ts +75 -0
- package/lib/server/createServer.ts +62 -0
- package/lib/site/getIndex.ts +18 -0
- package/package.json +27 -144
- package/tsconfig.json +25 -22
- package/.github/workflows/formatbot.yml +0 -63
- package/.github/workflows/release.yml +0 -40
- package/.github/workflows/test.yml +0 -32
- package/.github/workflows/windows-tests.yml +0 -32
- package/.prettierrc +0 -1
- package/DEVELOPMENT.md +0 -7
- package/api/README.md +0 -3
- package/api/db/generic-json-level.ts +0 -123
- package/api/db/get-db.ts +0 -26
- package/api/db/schema.ts +0 -65
- package/api/db/zod-level-db.ts +0 -148
- package/api/index.ts +0 -4
- package/api/lib/middlewares/with-db.ts +0 -18
- package/api/lib/middlewares/with-debug-request-logging.ts +0 -13
- package/api/lib/middlewares/with-error-response.ts +0 -37
- package/api/lib/with-winter-spec.ts +0 -9
- package/api/lib/zod/export_parameters.ts +0 -25
- package/api/routes/api/db/download.ts +0 -25
- package/api/routes/api/dev_package_examples/create.ts +0 -43
- package/api/routes/api/dev_package_examples/get.ts +0 -46
- package/api/routes/api/dev_package_examples/list.ts +0 -36
- package/api/routes/api/dev_package_examples/update.ts +0 -59
- package/api/routes/api/dev_server/reset.ts +0 -13
- package/api/routes/api/export_files/create.ts +0 -27
- package/api/routes/api/export_files/download.ts +0 -25
- package/api/routes/api/export_requests/create.ts +0 -30
- package/api/routes/api/export_requests/get.ts +0 -43
- package/api/routes/api/export_requests/list.ts +0 -26
- package/api/routes/api/export_requests/update.ts +0 -34
- package/api/routes/api/health.ts +0 -11
- package/api/routes/api/package_info/create.ts +0 -26
- package/api/routes/api/package_info/get.ts +0 -16
- package/api/routes/health.ts +0 -11
- package/api/routes/index.ts +0 -16
- package/api/server.ts +0 -20
- package/api/static-routes.ts +0 -24
- package/api/tests/fixtures/get-test-server.ts +0 -31
- package/api/tests/fixtures/start-server.ts +0 -41
- package/api/tests/routes/dev_package_examples/create.test.ts +0 -19
- package/api/tests/routes/dev_package_examples/get.test.ts +0 -25
- package/api/tests/routes/dev_package_examples/list.test.ts +0 -32
- package/api/tests/routes/dev_package_examples/update.test.ts +0 -38
- package/api/tests/routes/export_files/create.test.ts +0 -18
- package/api/tests/routes/export_files/download.test.ts +0 -29
- package/api/tests/routes/export_requests/create.test.ts +0 -24
- package/api/tests/routes/export_requests/get.test.ts +0 -41
- package/api/tests/routes/export_requests/list.test.ts +0 -35
- package/api/tests/routes/export_requests/update.test.ts +0 -50
- package/api/tests/routes/health.test.ts +0 -10
- package/bunfig.toml +0 -2
- package/cli/cli.ts +0 -13
- package/cli/lib/cmd-fns/add.ts +0 -34
- package/cli/lib/cmd-fns/auth-login.ts +0 -59
- package/cli/lib/cmd-fns/auth-logout.ts +0 -7
- package/cli/lib/cmd-fns/auth-sessions-create.ts +0 -3
- package/cli/lib/cmd-fns/auth-sessions-get.ts +0 -3
- package/cli/lib/cmd-fns/auth-sessions-list.ts +0 -5
- package/cli/lib/cmd-fns/config-clear.ts +0 -5
- package/cli/lib/cmd-fns/config-print-config.ts +0 -6
- package/cli/lib/cmd-fns/config-reveal-location.ts +0 -5
- package/cli/lib/cmd-fns/config-set-log-requests.ts +0 -7
- package/cli/lib/cmd-fns/config-set-registry.ts +0 -9
- package/cli/lib/cmd-fns/config-set-runtime.ts +0 -7
- package/cli/lib/cmd-fns/config-set-session.ts +0 -7
- package/cli/lib/cmd-fns/dev/check-if-initialized.ts +0 -22
- package/cli/lib/cmd-fns/dev/derive-selector-from-pcb-component-id.ts +0 -23
- package/cli/lib/cmd-fns/dev/dev-server-request-handler.ts +0 -61
- package/cli/lib/cmd-fns/dev/find-available-port.ts +0 -32
- package/cli/lib/cmd-fns/dev/fulfill-export-requests.ts +0 -162
- package/cli/lib/cmd-fns/dev/get-dev-server-axios.ts +0 -29
- package/cli/lib/cmd-fns/dev/index.ts +0 -168
- package/cli/lib/cmd-fns/dev/infer-export-name-from-source.ts +0 -17
- package/cli/lib/cmd-fns/dev/mark-all-examples-loading.ts +0 -18
- package/cli/lib/cmd-fns/dev/soupify-and-upload-example-file.ts +0 -62
- package/cli/lib/cmd-fns/dev/start-dev-server.ts +0 -34
- package/cli/lib/cmd-fns/dev/start-edit-event-watcher.ts +0 -347
- package/cli/lib/cmd-fns/dev/start-export-request-watcher.ts +0 -33
- package/cli/lib/cmd-fns/dev/start-fs-watcher.ts +0 -54
- package/cli/lib/cmd-fns/dev/upload-examples-from-directory.ts +0 -42
- package/cli/lib/cmd-fns/dev-server-fulfill-export-requests.ts +0 -43
- package/cli/lib/cmd-fns/dev-server-upload.ts +0 -56
- package/cli/lib/cmd-fns/export-gerbers.ts +0 -28
- package/cli/lib/cmd-fns/export-kicad-pcb.ts +0 -36
- package/cli/lib/cmd-fns/export-pnp-csv.ts +0 -32
- package/cli/lib/cmd-fns/gen-jlcpcb-component.ts +0 -64
- package/cli/lib/cmd-fns/go.ts +0 -14
- package/cli/lib/cmd-fns/index.ts +0 -46
- package/cli/lib/cmd-fns/init/create-or-modify-npmrc.ts +0 -21
- package/cli/lib/cmd-fns/init/get-generated-npmrc.ts +0 -8
- package/cli/lib/cmd-fns/init/get-generated-readme.ts +0 -41
- package/cli/lib/cmd-fns/init/get-generated-tsconfig.ts +0 -34
- package/cli/lib/cmd-fns/init/index.ts +0 -193
- package/cli/lib/cmd-fns/install.ts +0 -34
- package/cli/lib/cmd-fns/lint.ts +0 -43
- package/cli/lib/cmd-fns/open.ts +0 -19
- package/cli/lib/cmd-fns/package-examples-create.ts +0 -36
- package/cli/lib/cmd-fns/package-examples-get.ts +0 -20
- package/cli/lib/cmd-fns/package-examples-list.ts +0 -18
- package/cli/lib/cmd-fns/package-files-create.ts +0 -31
- package/cli/lib/cmd-fns/package-files-download.ts +0 -29
- package/cli/lib/cmd-fns/package-files-get.ts +0 -3
- package/cli/lib/cmd-fns/package-files-list.ts +0 -28
- package/cli/lib/cmd-fns/package-files-upload-directory.ts +0 -6
- package/cli/lib/cmd-fns/package-releases-create.ts +0 -35
- package/cli/lib/cmd-fns/package-releases-get.ts +0 -3
- package/cli/lib/cmd-fns/package-releases-list.ts +0 -32
- package/cli/lib/cmd-fns/package-releases-update.ts +0 -45
- package/cli/lib/cmd-fns/packages-create.ts +0 -16
- package/cli/lib/cmd-fns/packages-get.ts +0 -16
- package/cli/lib/cmd-fns/packages-list.ts +0 -16
- package/cli/lib/cmd-fns/publish/index.ts +0 -336
- package/cli/lib/cmd-fns/remove.ts +0 -31
- package/cli/lib/cmd-fns/render.ts +0 -45
- package/cli/lib/cmd-fns/soupify.ts +0 -31
- package/cli/lib/cmd-fns/uninstall.ts +0 -31
- package/cli/lib/cmd-fns/version.ts +0 -38
- package/cli/lib/create-config-manager.ts +0 -97
- package/cli/lib/export-fns/export-bom-csv.ts +0 -32
- package/cli/lib/export-fns/export-gerbers.ts +0 -108
- package/cli/lib/export-fns/export-kicad-pcb.ts +0 -32
- package/cli/lib/export-fns/export-pnp-csv.ts +0 -31
- package/cli/lib/get-program.ts +0 -387
- package/cli/lib/param-handlers/index.ts +0 -21
- package/cli/lib/param-handlers/interact-for-local-directory.ts +0 -58
- package/cli/lib/param-handlers/interact-for-local-file.ts +0 -59
- package/cli/lib/param-handlers/interact-for-package-example-id.ts +0 -25
- package/cli/lib/param-handlers/interact-for-package-name-with-version.ts +0 -63
- package/cli/lib/param-handlers/interact-for-package-name.ts +0 -45
- package/cli/lib/param-handlers/interact-for-package-release-id.ts +0 -15
- package/cli/lib/param-handlers/interact-for-registry-url.ts +0 -27
- package/cli/lib/param-handlers/interact-for-runtime.ts +0 -33
- package/cli/lib/param-handlers/param-handler-type.ts +0 -7
- package/cli/lib/posthog.ts +0 -23
- package/cli/lib/soupify/get-export-name-from-file.ts +0 -29
- package/cli/lib/soupify/get-tmp-entrpoint-filepath.ts +0 -15
- package/cli/lib/soupify/index.ts +0 -1
- package/cli/lib/soupify/run-entrypoint-file.ts +0 -59
- package/cli/lib/soupify/soupify-with-core.ts +0 -74
- package/cli/lib/soupify/soupify.ts +0 -6
- package/cli/lib/util/app-context.ts +0 -17
- package/cli/lib/util/create-context-and-run-program.ts +0 -168
- package/cli/lib/util/get-all-package-files.ts +0 -66
- package/cli/lib/util/lint-project.ts +0 -137
- package/cli/tests/export-gerber-keyboard.test.ts +0 -16
- package/cli/tests/export-gerber.test.ts +0 -49
- package/cli/tests/export-kicad-pcb.test.ts +0 -23
- package/cli/tests/export-pnp-csv.test.ts +0 -24
- package/cli/tests/fixtures/preload.ts +0 -54
- package/cli/tests/init.test.ts +0 -9
- package/cli/tests/open.test.ts +0 -9
- package/cli/tests/soupify-builder.test.ts +0 -9
- package/cli/tests/soupify-core.test.ts +0 -9
- package/dist/cli.js +0 -3676
- package/docs/EDIT_EVENT_PIPELINE.md +0 -34
- package/example-project/README.md +0 -18
- package/example-project/examples/basic-capacitor.tsx +0 -5
- package/example-project/examples/basic-chip.tsx +0 -26
- package/example-project/examples/basic-resistor.tsx +0 -3
- package/example-project/examples/macrokeypad.tsx +0 -59
- package/example-project/index.ts +0 -1
- package/example-project/package.json +0 -5
- package/example-project/src/ArduinoProMicroBreakout.tsx +0 -37
- package/example-project/src/Key.tsx +0 -46
- package/example-project/src/Keyswitch.tsx +0 -26
- package/example-project/src/KeyswitchSocket.tsx +0 -56
- package/example-project/src/MyCircuit.tsx +0 -38
- package/example-project/src/manual-edits.ts +0 -93
- package/frontend/README.md +0 -3
- package/frontend/bun.lockb +0 -0
- package/frontend/components/command-k.tsx +0 -86
- package/frontend/components/dialogs/generic-export-dialog.tsx +0 -189
- package/frontend/components/dialogs/gerber-export-dialog.tsx +0 -168
- package/frontend/components/global-context-providers.tsx +0 -11
- package/frontend/components/select-example-search.tsx +0 -118
- package/frontend/components/ui/alert-dialog.tsx +0 -139
- package/frontend/components/ui/alert.tsx +0 -59
- package/frontend/components/ui/breadcrumb.tsx +0 -115
- package/frontend/components/ui/button.tsx +0 -57
- package/frontend/components/ui/card.tsx +0 -76
- package/frontend/components/ui/command.tsx +0 -153
- package/frontend/components/ui/context-menu.tsx +0 -202
- package/frontend/components/ui/dialog.tsx +0 -120
- package/frontend/components/ui/menubar.tsx +0 -238
- package/frontend/components/ui/navigation-menu.tsx +0 -128
- package/frontend/components/ui/popover.tsx +0 -31
- package/frontend/components/ui/select.tsx +0 -162
- package/frontend/components/ui/tabs.tsx +0 -53
- package/frontend/components/ui/toggle-group.tsx +0 -59
- package/frontend/components/ui/toggle.tsx +0 -43
- package/frontend/components/ui/tooltip.tsx +0 -28
- package/frontend/components.json +0 -17
- package/frontend/hooks/toast-if-api-not-connected.ts +0 -23
- package/frontend/hooks/use-active-dev-package-example-lite.ts +0 -39
- package/frontend/hooks/use-dev-package-examples.tsx +0 -18
- package/frontend/hooks/use-global-store.ts +0 -42
- package/frontend/index.css +0 -76
- package/frontend/index.html +0 -13
- package/frontend/lib/utils.ts +0 -6
- package/frontend/main.tsx +0 -13
- package/frontend/tailwind.config.js +0 -74
- package/frontend/views/App.tsx +0 -22
- package/frontend/views/Header.tsx +0 -55
- package/frontend/views/HeaderMenu.tsx +0 -326
- package/frontend/views/MainContentView.tsx +0 -172
- package/frontend/vite-env.d.ts +0 -1
- package/frontend/vite.config.ts +0 -50
- package/renovate.json +0 -15
- package/scripts/build-cli.ts +0 -12
- package/tsup.config.ts +0 -7
package/package.json
CHANGED
|
@@ -1,156 +1,39 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tscircuit/cli",
|
|
3
|
-
"
|
|
4
|
-
"private": false,
|
|
3
|
+
"main": "dist/main.js",
|
|
5
4
|
"type": "module",
|
|
6
|
-
"
|
|
7
|
-
"
|
|
8
|
-
|
|
9
|
-
"type": "git",
|
|
10
|
-
"url": "https://github.com/tscircuit/cli"
|
|
5
|
+
"version": "0.1.1",
|
|
6
|
+
"bin": {
|
|
7
|
+
"tsci": "./dist/main.js"
|
|
11
8
|
},
|
|
12
9
|
"scripts": {
|
|
13
|
-
"cli": "bun cli/cli.ts",
|
|
14
10
|
"start": "bun run dev",
|
|
15
|
-
"dev": "bun
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
"
|
|
20
|
-
"build": "bun build:dev-server && npm run build:cli",
|
|
21
|
-
"build:cli": "bun scripts/build-cli.ts",
|
|
22
|
-
"build:dev-server": "bun run build:api && bun run build:frontend",
|
|
23
|
-
"build:api": "cd api && winterspec bundle-routes -i ./routes -o ./static-routes.ts",
|
|
24
|
-
"build:frontend": "vite build --config frontend/vite.config.ts && make-vfs --content-format string --dir frontend/dist --outfile ./frontend/dist/bundle.ts",
|
|
25
|
-
"format": "biome format . --write"
|
|
26
|
-
},
|
|
27
|
-
"bin": {
|
|
28
|
-
"tsci": "./dist/cli.js"
|
|
11
|
+
"dev": "bun --hot ./cli/main.ts dev ./example-dir/snippet.tsx",
|
|
12
|
+
"build": "tsup-node cli/main.ts --format esm --sourcemap inline",
|
|
13
|
+
"format": "biome format --write .",
|
|
14
|
+
"format:check": "biome format .",
|
|
15
|
+
"cli": "bun ./cli/main.ts"
|
|
29
16
|
},
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
|
|
37
|
-
"author": "",
|
|
38
|
-
"license": "ISC",
|
|
39
|
-
"dependencies": {
|
|
40
|
-
"@edge-runtime/primitives": "^4.1.0",
|
|
41
|
-
"@hono/node-server": "^1.8.2",
|
|
42
|
-
"@tscircuit/core": "^0.0.250",
|
|
43
|
-
"@tscircuit/props": "^0.0.108",
|
|
44
|
-
"@tscircuit/soup": "^0.0.73",
|
|
45
|
-
"archiver": "^7.0.1",
|
|
46
|
-
"axios": "^1.6.7",
|
|
47
|
-
"chokidar": "^3.6.0",
|
|
48
|
-
"circuit-json": "^0.0.77",
|
|
49
|
-
"circuit-json-to-bom-csv": "^0.0.4",
|
|
50
|
-
"circuit-json-to-connectivity-map": "^0.0.16",
|
|
51
|
-
"circuit-json-to-gerber": "^0.0.4",
|
|
52
|
-
"circuit-json-to-pnp-csv": "^0.0.5",
|
|
53
|
-
"circuit-to-png": "^0.0.3",
|
|
54
|
-
"circuit-to-svg": "^0.0.39",
|
|
55
|
-
"commander": "^12.0.0",
|
|
56
|
-
"configstore": "^6.0.0",
|
|
57
|
-
"dargs": "^8.1.0",
|
|
58
|
-
"dax-sh": "^0.39.2",
|
|
59
|
-
"debug": "^4.3.4",
|
|
60
|
-
"delay": "^6.0.0",
|
|
61
|
-
"easyeda": "^0.0.36",
|
|
62
|
-
"esbuild": "^0.20.2",
|
|
63
|
-
"fast-glob": "^3.3.2",
|
|
64
|
-
"glob": "^10.4.5",
|
|
65
|
-
"hono": "^4.1.0",
|
|
66
|
-
"ignore": "^5.3.1",
|
|
67
|
-
"json5": "^2.2.3",
|
|
68
|
-
"kicad-converter": "^0.0.14",
|
|
69
|
-
"kleur": "^4.1.5",
|
|
70
|
-
"lodash": "^4.17.21",
|
|
71
|
-
"memory-level": "^1.0.0",
|
|
72
|
-
"mime-types": "^2.1.35",
|
|
73
|
-
"minimist": "^1.2.8",
|
|
74
|
-
"node-persist": "^4.0.1",
|
|
75
|
-
"open": "^10.1.0",
|
|
76
|
-
"perfect-cli": "^1.0.20",
|
|
77
|
-
"performance-now": "^2.1.0",
|
|
78
|
-
"posthog-node": "^4.0.1",
|
|
79
|
-
"prompts": "^2.4.2",
|
|
80
|
-
"redaxios": "^0.5.1",
|
|
81
|
-
"semver": "^7.6.0",
|
|
82
|
-
"tempy": "^3.1.0",
|
|
83
|
-
"ts-morph": "^22.0.0",
|
|
84
|
-
"tsup": "^8.0.2",
|
|
85
|
-
"winterspec": "0.0.89",
|
|
86
|
-
"zod": "^3.22.4"
|
|
17
|
+
"devDependencies": {
|
|
18
|
+
"@biomejs/biome": "^1.9.4",
|
|
19
|
+
"@tscircuit/core": "^0.0.249",
|
|
20
|
+
"@types/bun": "latest",
|
|
21
|
+
"@types/configstore": "^6.0.2",
|
|
22
|
+
"@types/react": "^19.0.1",
|
|
23
|
+
"tsup": "^8.3.5"
|
|
87
24
|
},
|
|
88
25
|
"peerDependencies": {
|
|
89
|
-
"
|
|
90
|
-
"@tscircuit/manual-edit-events": "*",
|
|
91
|
-
"@tscircuit/soup-util": "*"
|
|
26
|
+
"typescript": "^5.0.0"
|
|
92
27
|
},
|
|
93
|
-
"
|
|
94
|
-
"@
|
|
95
|
-
"@
|
|
96
|
-
"
|
|
97
|
-
"
|
|
98
|
-
"
|
|
99
|
-
"
|
|
100
|
-
"
|
|
101
|
-
"
|
|
102
|
-
"
|
|
103
|
-
"@radix-ui/react-select": "^2.0.0",
|
|
104
|
-
"@radix-ui/react-slot": "^1.0.2",
|
|
105
|
-
"@radix-ui/react-tabs": "^1.0.4",
|
|
106
|
-
"@radix-ui/react-toggle": "^1.0.3",
|
|
107
|
-
"@radix-ui/react-toggle-group": "^1.0.4",
|
|
108
|
-
"@radix-ui/react-tooltip": "^1.0.7",
|
|
109
|
-
"@tscircuit/3d-viewer": "^0.0.79",
|
|
110
|
-
"@tscircuit/layout": "^0.0.29",
|
|
111
|
-
"@tscircuit/manual-edit-events": "^0.0.6",
|
|
112
|
-
"@tscircuit/pcb-viewer": "^1.10.8",
|
|
113
|
-
"@tscircuit/schematic-viewer": "^1.2.14",
|
|
114
|
-
"@tscircuit/soup-util": "^0.0.41",
|
|
115
|
-
"@tscircuit/table-viewer": "0.0.8",
|
|
116
|
-
"@types/archiver": "^6.0.2",
|
|
117
|
-
"@types/bun": "^1.0.8",
|
|
118
|
-
"@types/chokidar": "^2.1.3",
|
|
119
|
-
"@types/configstore": "^6.0.2",
|
|
120
|
-
"@types/debug": "^4.1.12",
|
|
121
|
-
"@types/lodash": "^4.14.202",
|
|
122
|
-
"@types/mime-types": "^2.1.4",
|
|
123
|
-
"@types/minimist": "^1.2.5",
|
|
124
|
-
"@types/node": "^20.10.6",
|
|
125
|
-
"@types/prompts": "^2.4.9",
|
|
126
|
-
"@types/react": "^18.2.64",
|
|
127
|
-
"@types/react-dom": "^18.3.0",
|
|
128
|
-
"@types/semver": "^7.5.8",
|
|
129
|
-
"@vitejs/plugin-react": "^4.3.1",
|
|
130
|
-
"autoprefixer": "^10.4.20",
|
|
131
|
-
"ava": "^6.1.1",
|
|
132
|
-
"bun-match-svg": "^0.0.3",
|
|
133
|
-
"class-variance-authority": "^0.7.0",
|
|
134
|
-
"clsx": "^2.1.0",
|
|
135
|
-
"cmdk": "^1.0.0",
|
|
136
|
-
"concurrently": "^8.2.2",
|
|
137
|
-
"extract-zip": "^2.0.1",
|
|
138
|
-
"make-vfs": "^1.0.10",
|
|
139
|
-
"pcb-stackup": "^4.2.8",
|
|
140
|
-
"postcss": "^8.4.41",
|
|
141
|
-
"react": "^18.2.0",
|
|
142
|
-
"react-data-grid": "7.0.0-beta.37",
|
|
143
|
-
"react-dom": "^18.2.0",
|
|
144
|
-
"react-error-boundary": "^4.0.13",
|
|
145
|
-
"react-hot-toast": "^2.4.1",
|
|
146
|
-
"react-query": "^3.39.3",
|
|
147
|
-
"rimraf": "^5.0.7",
|
|
148
|
-
"tailwind-merge": "^2.2.1",
|
|
149
|
-
"tailwindcss": "^3.4.9",
|
|
150
|
-
"tailwindcss-animate": "^1.0.7",
|
|
151
|
-
"tsx": "^4.7.1",
|
|
152
|
-
"typescript": "^5.5.4",
|
|
153
|
-
"vite": "^5.4.0",
|
|
154
|
-
"zustand": "^4.5.2"
|
|
28
|
+
"dependencies": {
|
|
29
|
+
"@tscircuit/file-server": "^0.0.11",
|
|
30
|
+
"@tscircuit/runframe": "^0.0.47",
|
|
31
|
+
"chokidar": "^4.0.1",
|
|
32
|
+
"commander": "^12.1.0",
|
|
33
|
+
"configstore": "^7.0.0",
|
|
34
|
+
"cosmiconfig": "^9.0.0",
|
|
35
|
+
"delay": "^6.0.0",
|
|
36
|
+
"ky": "^1.7.4",
|
|
37
|
+
"perfect-cli": "^1.0.20"
|
|
155
38
|
}
|
|
156
39
|
}
|
package/tsconfig.json
CHANGED
|
@@ -1,29 +1,32 @@
|
|
|
1
1
|
{
|
|
2
2
|
"compilerOptions": {
|
|
3
|
-
|
|
4
|
-
"
|
|
5
|
-
|
|
6
|
-
"module": "ESNext"
|
|
7
|
-
"
|
|
8
|
-
"
|
|
9
|
-
"
|
|
10
|
-
|
|
11
|
-
"resolveJsonModule": true /* Enable importing .json files. */,
|
|
12
|
-
"noEmit": true /* Disable emitting files from a compilation. */,
|
|
13
|
-
"esModuleInterop": true /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */,
|
|
14
|
-
"forceConsistentCasingInFileNames": true /* Ensure that casing is correct in imports. */,
|
|
15
|
-
|
|
3
|
+
// Enable latest features
|
|
4
|
+
"lib": ["ESNext", "DOM"],
|
|
5
|
+
"target": "ESNext",
|
|
6
|
+
"module": "ESNext",
|
|
7
|
+
"moduleDetection": "force",
|
|
8
|
+
"jsx": "react-jsx",
|
|
9
|
+
"allowJs": true,
|
|
10
|
+
"baseUrl": ".",
|
|
16
11
|
"paths": {
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
"api/*": ["api/*"],
|
|
20
|
-
"scripts/*": ["scripts/*"],
|
|
12
|
+
"lib/*": ["lib/*"],
|
|
13
|
+
"cli/*": ["cli/*"]
|
|
21
14
|
},
|
|
22
15
|
|
|
23
|
-
|
|
24
|
-
"
|
|
16
|
+
// Bundler mode
|
|
17
|
+
"moduleResolution": "bundler",
|
|
18
|
+
"allowImportingTsExtensions": true,
|
|
25
19
|
"verbatimModuleSyntax": false,
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
20
|
+
"noEmit": true,
|
|
21
|
+
|
|
22
|
+
// Best practices
|
|
23
|
+
"strict": true,
|
|
24
|
+
"skipLibCheck": true,
|
|
25
|
+
"noFallthroughCasesInSwitch": true,
|
|
26
|
+
|
|
27
|
+
// Some stricter flags (disabled by default)
|
|
28
|
+
"noUnusedLocals": false,
|
|
29
|
+
"noUnusedParameters": false,
|
|
30
|
+
"noPropertyAccessFromIndexSignature": false
|
|
31
|
+
}
|
|
29
32
|
}
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
name: Format PR
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
pull_request:
|
|
5
|
-
types: [opened, synchronize, reopened, ready_for_review]
|
|
6
|
-
|
|
7
|
-
jobs:
|
|
8
|
-
format:
|
|
9
|
-
name: Format code
|
|
10
|
-
runs-on: ubuntu-latest
|
|
11
|
-
if: github.event.pull_request.draft == false
|
|
12
|
-
|
|
13
|
-
steps:
|
|
14
|
-
- name: Determine if fork
|
|
15
|
-
id: check_fork
|
|
16
|
-
run: |
|
|
17
|
-
if [ "${{ github.event.pull_request.head.repo.full_name }}" = "${{ github.repository }}" ]; then
|
|
18
|
-
echo "is_fork=false" >> $GITHUB_OUTPUT
|
|
19
|
-
else
|
|
20
|
-
echo "is_fork=true" >> $GITHUB_OUTPUT
|
|
21
|
-
fi
|
|
22
|
-
|
|
23
|
-
- name: Checkout code
|
|
24
|
-
uses: actions/checkout@v3
|
|
25
|
-
with:
|
|
26
|
-
token: ${{ steps.check_fork.outputs.is_fork == 'true' && secrets.GITHUB_TOKEN || secrets.TSCIRCUIT_BOT_GITHUB_TOKEN }}
|
|
27
|
-
|
|
28
|
-
- name: Setup bun
|
|
29
|
-
uses: oven-sh/setup-bun@v1
|
|
30
|
-
with:
|
|
31
|
-
bun-version: latest
|
|
32
|
-
|
|
33
|
-
- name: Get @biomejs/biome version
|
|
34
|
-
id: get-biome-version
|
|
35
|
-
run: echo "BIOME_VERSION=$(node -p "require('./package.json').devDependencies['@biomejs/biome']")" >> $GITHUB_OUTPUT
|
|
36
|
-
|
|
37
|
-
- name: Install @biomejs/biome
|
|
38
|
-
run: bun install
|
|
39
|
-
|
|
40
|
-
- name: Run Formatter and autofix
|
|
41
|
-
if: steps.check_fork.outputs.is_fork == 'false'
|
|
42
|
-
run: bunx biome format . --write
|
|
43
|
-
|
|
44
|
-
- name: Format Check (cannot autofix against forks)
|
|
45
|
-
if: steps.check_fork.outputs.is_fork == 'true'
|
|
46
|
-
run: bunx biome format .
|
|
47
|
-
|
|
48
|
-
- name: Restore lock files
|
|
49
|
-
if: steps.check_fork.outputs.is_fork == 'false'
|
|
50
|
-
run: |
|
|
51
|
-
git checkout -- *lock.json || true
|
|
52
|
-
git checkout -- *.lock || true
|
|
53
|
-
git checkout -- *.lockb || true
|
|
54
|
-
|
|
55
|
-
- name: Commit changes
|
|
56
|
-
if: steps.check_fork.outputs.is_fork == 'false'
|
|
57
|
-
uses: stefanzweifel/git-auto-commit-action@v4
|
|
58
|
-
with:
|
|
59
|
-
commit_message: "formatbot: Automatically format code"
|
|
60
|
-
branch: ${{ github.head_ref }}
|
|
61
|
-
commit_user_name: tscircuitbot
|
|
62
|
-
commit_user_email: tscircuitbot@users.noreply.github.com
|
|
63
|
-
commit_author: tscircuitbot <tscircuitbot@users.noreply.github.com>
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
name: Release Workflow
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
push:
|
|
5
|
-
branches:
|
|
6
|
-
- main
|
|
7
|
-
|
|
8
|
-
jobs:
|
|
9
|
-
build_and_release:
|
|
10
|
-
runs-on: ubuntu-latest
|
|
11
|
-
|
|
12
|
-
steps:
|
|
13
|
-
- name: Checkout code
|
|
14
|
-
uses: actions/checkout@v2
|
|
15
|
-
|
|
16
|
-
- uses: actions/setup-node@v4
|
|
17
|
-
with:
|
|
18
|
-
node-version: 20
|
|
19
|
-
registry-url: https://registry.npmjs.org/
|
|
20
|
-
|
|
21
|
-
- name: Setup bun
|
|
22
|
-
uses: oven-sh/setup-bun@v1
|
|
23
|
-
with:
|
|
24
|
-
bun-version: latest
|
|
25
|
-
|
|
26
|
-
- name: Install project dependencies
|
|
27
|
-
run: |
|
|
28
|
-
bun install
|
|
29
|
-
|
|
30
|
-
# Undo changes to the lockfile that might block release
|
|
31
|
-
# when this project is more mature use "bun install --frozen-lockfile"
|
|
32
|
-
git checkout -- bun.lockb
|
|
33
|
-
|
|
34
|
-
- name: Build project
|
|
35
|
-
run: bun run build
|
|
36
|
-
|
|
37
|
-
- name: Run pver release
|
|
38
|
-
run: npx pver release --npm
|
|
39
|
-
env:
|
|
40
|
-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
name: CLI Tests
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
push:
|
|
5
|
-
branches:
|
|
6
|
-
- main
|
|
7
|
-
pull_request:
|
|
8
|
-
branches:
|
|
9
|
-
- main
|
|
10
|
-
|
|
11
|
-
jobs:
|
|
12
|
-
tests:
|
|
13
|
-
runs-on: ubuntu-latest
|
|
14
|
-
timeout-minutes: 5
|
|
15
|
-
|
|
16
|
-
steps:
|
|
17
|
-
- name: Checkout code
|
|
18
|
-
uses: actions/checkout@v2
|
|
19
|
-
|
|
20
|
-
- name: Setup bun
|
|
21
|
-
uses: oven-sh/setup-bun@v1
|
|
22
|
-
with:
|
|
23
|
-
bun-version: latest
|
|
24
|
-
|
|
25
|
-
- name: Install dependencies
|
|
26
|
-
run: bun install
|
|
27
|
-
|
|
28
|
-
- name: Build
|
|
29
|
-
run: bun run build
|
|
30
|
-
|
|
31
|
-
- name: Run tests
|
|
32
|
-
run: bun test --timeout 15000
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
name: Windows Tests
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
push:
|
|
5
|
-
branches:
|
|
6
|
-
- main
|
|
7
|
-
pull_request:
|
|
8
|
-
branches:
|
|
9
|
-
- main
|
|
10
|
-
|
|
11
|
-
jobs:
|
|
12
|
-
tests:
|
|
13
|
-
runs-on: windows-latest
|
|
14
|
-
timeout-minutes: 10
|
|
15
|
-
|
|
16
|
-
steps:
|
|
17
|
-
- name: Checkout code
|
|
18
|
-
uses: actions/checkout@v2
|
|
19
|
-
|
|
20
|
-
- name: Setup bun
|
|
21
|
-
uses: oven-sh/setup-bun@v1
|
|
22
|
-
with:
|
|
23
|
-
bun-version: latest
|
|
24
|
-
|
|
25
|
-
- name: Install dependencies
|
|
26
|
-
run: bun install
|
|
27
|
-
|
|
28
|
-
- name: Build
|
|
29
|
-
run: bun run build
|
|
30
|
-
|
|
31
|
-
- name: Run tests
|
|
32
|
-
run: bun test --timeout 15000
|
package/.prettierrc
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{ "semi": false }
|
package/DEVELOPMENT.md
DELETED
package/api/README.md
DELETED
|
@@ -1,123 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
AbstractLevel,
|
|
3
|
-
AbstractIterator,
|
|
4
|
-
AbstractKeyIterator,
|
|
5
|
-
AbstractValueIterator,
|
|
6
|
-
} from "abstract-level"
|
|
7
|
-
import { promises as fs } from "fs"
|
|
8
|
-
import path from "path/posix"
|
|
9
|
-
|
|
10
|
-
interface JSONLevelOptions {}
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* This is not totally tested yet, but is basically a NodeJS level that doesn't
|
|
14
|
-
* use C-bindings. It could be used as a replacement for memory-level to store
|
|
15
|
-
* to disk.
|
|
16
|
-
*/
|
|
17
|
-
class GenericJsonLevel extends AbstractLevel<string, any> {
|
|
18
|
-
private location: string
|
|
19
|
-
|
|
20
|
-
constructor(location: string, options?: JSONLevelOptions) {
|
|
21
|
-
super({ ...options, encodings: { utf8: true } })
|
|
22
|
-
this.location = location
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
async _open(): Promise<void> {
|
|
26
|
-
await fs.mkdir(this.location, { recursive: true })
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
async _put(key: string, value: any): Promise<void> {
|
|
30
|
-
const filePath = path.join(this.location, `${key}.json`)
|
|
31
|
-
console.log("writing file", filePath)
|
|
32
|
-
await fs.writeFile(filePath, JSON.stringify(value))
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
async _get(key: string): Promise<any> {
|
|
36
|
-
const filePath = path.join(this.location, `${key}.json`)
|
|
37
|
-
try {
|
|
38
|
-
const data = await fs.readFile(filePath, "utf8")
|
|
39
|
-
return JSON.parse(data)
|
|
40
|
-
} catch (error) {
|
|
41
|
-
if ((error as NodeJS.ErrnoException).code === "ENOENT") {
|
|
42
|
-
throw new Error("NotFoundError")
|
|
43
|
-
}
|
|
44
|
-
throw error
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
async _del(key: string): Promise<void> {
|
|
49
|
-
const filePath = path.join(this.location, `${key}.json`)
|
|
50
|
-
try {
|
|
51
|
-
await fs.unlink(filePath)
|
|
52
|
-
} catch (error) {
|
|
53
|
-
if ((error as NodeJS.ErrnoException).code !== "ENOENT") {
|
|
54
|
-
throw error
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
async _batch(
|
|
60
|
-
operations: Array<{ type: "put" | "del"; key: string; value?: any }>,
|
|
61
|
-
): Promise<void> {
|
|
62
|
-
for (const op of operations) {
|
|
63
|
-
if (op.type === "put") {
|
|
64
|
-
await this._put(op.key, op.value)
|
|
65
|
-
} else if (op.type === "del") {
|
|
66
|
-
await this._del(op.key)
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
async _clear(): Promise<void> {
|
|
72
|
-
const files = await fs.readdir(this.location)
|
|
73
|
-
for (const file of files) {
|
|
74
|
-
if (file.endsWith(".json")) {
|
|
75
|
-
await fs.unlink(path.join(this.location, file))
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
_iterator(): AbstractIterator<this, string, any> {
|
|
81
|
-
let files: string[] = []
|
|
82
|
-
let index = 0
|
|
83
|
-
|
|
84
|
-
const nextFile = async (): Promise<{ key: string; value: any } | null> => {
|
|
85
|
-
if (index >= files.length) {
|
|
86
|
-
return null
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
const file = files[index++]
|
|
90
|
-
const key = path.basename(file, ".json")
|
|
91
|
-
const filePath = path.join(this.location, file)
|
|
92
|
-
const data = await fs.readFile(filePath, "utf8")
|
|
93
|
-
const value = JSON.parse(data)
|
|
94
|
-
|
|
95
|
-
return { key, value }
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
return {
|
|
99
|
-
async next() {
|
|
100
|
-
if (files.length === 0) {
|
|
101
|
-
files = (await fs.readdir(this.db.location)).filter((file) =>
|
|
102
|
-
file.endsWith(".json"),
|
|
103
|
-
)
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
const entry = await nextFile()
|
|
107
|
-
if (entry === null) {
|
|
108
|
-
return undefined
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
return [entry.key, entry.value] as [string, any]
|
|
112
|
-
},
|
|
113
|
-
async seek(target: string) {
|
|
114
|
-
index = files.findIndex((file) => file.startsWith(target))
|
|
115
|
-
if (index === -1) {
|
|
116
|
-
index = files.length
|
|
117
|
-
}
|
|
118
|
-
},
|
|
119
|
-
} as any
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
export { GenericJsonLevel }
|
package/api/db/get-db.ts
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { mkdirSync } from "fs"
|
|
2
|
-
import * as Path from "path/posix"
|
|
3
|
-
import { ZodLevelDatabase } from "./zod-level-db"
|
|
4
|
-
|
|
5
|
-
let globalDb: ZodLevelDatabase | undefined
|
|
6
|
-
|
|
7
|
-
export const getDbFilePath = () =>
|
|
8
|
-
process.env.TSCI_DEV_SERVER_DB ?? "./.tscircuit/devdb"
|
|
9
|
-
|
|
10
|
-
export const getDb = async (): Promise<ZodLevelDatabase> => {
|
|
11
|
-
if (globalDb) {
|
|
12
|
-
return globalDb
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
const devServerDbPath = getDbFilePath()
|
|
16
|
-
|
|
17
|
-
mkdirSync(devServerDbPath, { recursive: true })
|
|
18
|
-
|
|
19
|
-
const db = new ZodLevelDatabase(devServerDbPath)
|
|
20
|
-
|
|
21
|
-
db.open()
|
|
22
|
-
|
|
23
|
-
globalDb = db
|
|
24
|
-
|
|
25
|
-
return db
|
|
26
|
-
}
|
package/api/db/schema.ts
DELETED
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import { z } from "zod"
|
|
2
|
-
|
|
3
|
-
// Helper function for nullable fields
|
|
4
|
-
const nullableText = () => z.string().nullable().default(null)
|
|
5
|
-
const id = () => z.any().pipe(z.number().int())
|
|
6
|
-
|
|
7
|
-
// PackageInfo schema
|
|
8
|
-
export const PackageInfoSchema = z.object({
|
|
9
|
-
package_info_id: id(),
|
|
10
|
-
name: z.string(),
|
|
11
|
-
})
|
|
12
|
-
|
|
13
|
-
// DevPackageExample schema
|
|
14
|
-
export const DevPackageExampleSchema = z.object({
|
|
15
|
-
dev_package_example_id: id(),
|
|
16
|
-
file_path: z.string(),
|
|
17
|
-
export_name: nullableText(),
|
|
18
|
-
tscircuit_soup: z.any().nullable(), // Using any for JSON type
|
|
19
|
-
completed_edit_events: z.array(z.any()).default([]), // Using any for JSON type
|
|
20
|
-
error: nullableText(),
|
|
21
|
-
is_loading: z.boolean(),
|
|
22
|
-
soup_last_updated_at: nullableText(),
|
|
23
|
-
edit_events_last_updated_at: nullableText(),
|
|
24
|
-
edit_events_last_applied_at: nullableText(),
|
|
25
|
-
last_updated_at: nullableText(),
|
|
26
|
-
})
|
|
27
|
-
|
|
28
|
-
// ExportRequest schema
|
|
29
|
-
export const ExportRequestSchema = z.object({
|
|
30
|
-
export_request_id: id(),
|
|
31
|
-
example_file_path: nullableText(),
|
|
32
|
-
export_parameters: z.any().nullable(), // Using any for JSON type
|
|
33
|
-
export_name: nullableText(),
|
|
34
|
-
is_complete: z.boolean(),
|
|
35
|
-
has_error: z.boolean(),
|
|
36
|
-
error: nullableText(),
|
|
37
|
-
created_at: nullableText(),
|
|
38
|
-
})
|
|
39
|
-
|
|
40
|
-
// ExportFile schema
|
|
41
|
-
export const ExportFileSchema = z.object({
|
|
42
|
-
export_file_id: id(),
|
|
43
|
-
file_name: nullableText(),
|
|
44
|
-
file_content_base64: z.string().nullable(),
|
|
45
|
-
export_request_id: z.number().int().nullable(),
|
|
46
|
-
created_at: nullableText(),
|
|
47
|
-
})
|
|
48
|
-
|
|
49
|
-
// Combined DBSchema
|
|
50
|
-
export const DBSchema = z.object({
|
|
51
|
-
package_info: PackageInfoSchema,
|
|
52
|
-
dev_package_example: DevPackageExampleSchema,
|
|
53
|
-
export_request: ExportRequestSchema,
|
|
54
|
-
export_file: ExportFileSchema,
|
|
55
|
-
})
|
|
56
|
-
|
|
57
|
-
// TypeScript type inference
|
|
58
|
-
export type DBSchemaType = z.infer<typeof DBSchema>
|
|
59
|
-
export type DBInputSchemaType = z.input<typeof DBSchema>
|
|
60
|
-
|
|
61
|
-
// You can also export individual types if needed
|
|
62
|
-
export type PackageInfo = z.infer<typeof PackageInfoSchema>
|
|
63
|
-
export type DevPackageExample = z.infer<typeof DevPackageExampleSchema>
|
|
64
|
-
export type ExportRequest = z.infer<typeof ExportRequestSchema>
|
|
65
|
-
export type ExportFile = z.infer<typeof ExportFileSchema>
|