diff --git a/bun.lockb b/bun.lockb index c7ace95f..be76f10b 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/dev-server-api/routes/api/dev_package_examples/get.ts b/dev-server-api/routes/api/dev_package_examples/get.ts index 5fbeb8e8..fdba121a 100644 --- a/dev-server-api/routes/api/dev_package_examples/get.ts +++ b/dev-server-api/routes/api/dev_package_examples/get.ts @@ -12,6 +12,7 @@ export default withEdgeSpec({ dev_package_example_id: z.coerce.number(), file_path: z.string(), tscircuit_soup: z.any(), + completed_edit_events: z.array(z.any()).nullable().default(null), is_loading: z.boolean(), error: z.string().nullable().optional().default(null), last_updated_at: z.string().datetime(), @@ -35,6 +36,9 @@ export default withEdgeSpec({ ...r, is_loading: r.is_loading === 1, tscircuit_soup: JSON.parse(r.tscircuit_soup), + completed_edit_events: r.completed_edit_events + ? JSON.parse(r.completed_edit_events) + : null, })), }) }) diff --git a/dev-server-api/routes/api/dev_package_examples/list.ts b/dev-server-api/routes/api/dev_package_examples/list.ts index a2758e19..03b013d7 100644 --- a/dev-server-api/routes/api/dev_package_examples/list.ts +++ b/dev-server-api/routes/api/dev_package_examples/list.ts @@ -24,6 +24,7 @@ export default withEdgeSpec({ "file_path", "export_name", "last_updated_at", + "soup_last_updated_at", sql`(is_loading = 1)`.$castTo().as("is_loading"), ]) .execute() diff --git a/dev-server-api/routes/api/dev_package_examples/update.ts b/dev-server-api/routes/api/dev_package_examples/update.ts index 515b3fb9..ee433ab5 100644 --- a/dev-server-api/routes/api/dev_package_examples/update.ts +++ b/dev-server-api/routes/api/dev_package_examples/update.ts @@ -7,6 +7,7 @@ export default withEdgeSpec({ jsonBody: z.object({ dev_package_example_id: z.coerce.number(), tscircuit_soup: z.any().optional(), + completed_edit_events: z.array(z.any()).optional(), error: z.string().nullable().optional().default(null), }), jsonResponse: z.object({ @@ -23,10 +24,23 @@ export default withEdgeSpec({ dev_package_example: await ctx.db .updateTable("dev_package_example") .set({ - tscircuit_soup: req.jsonBody.tscircuit_soup, - error: req.jsonBody.error, last_updated_at: new Date().toISOString(), }) + .$if(req.jsonBody.tscircuit_soup !== undefined, (q) => + q + .set("tscircuit_soup", req.jsonBody.tscircuit_soup) + .set("error", null) + .set("soup_last_updated_at", new Date().toISOString()) + ) + .$if(req.jsonBody.error !== undefined, (q) => + q.set("error", req.jsonBody.error) + ) + .$if(req.jsonBody.completed_edit_events !== undefined, (q) => + q.set( + "completed_edit_events", + JSON.stringify(req.jsonBody.completed_edit_events) + ) + ) .returningAll() .where("dev_package_example_id", "=", req.jsonBody.dev_package_example_id) .executeTakeFirstOrThrow(), diff --git a/dev-server-api/src/db/create-schema.ts b/dev-server-api/src/db/create-schema.ts index 61bb1dd0..e32a2162 100644 --- a/dev-server-api/src/db/create-schema.ts +++ b/dev-server-api/src/db/create-schema.ts @@ -1,6 +1,7 @@ import type { DbClient } from "./get-db" export const createSchema = async (db: DbClient) => { + console.log("Creating schema...") await db.schema .createTable("dev_package_example") .addColumn("dev_package_example_id", "integer", (col) => @@ -9,8 +10,10 @@ export const createSchema = async (db: DbClient) => { .addColumn("file_path", "text", (col) => col.unique()) .addColumn("export_name", "text") .addColumn("tscircuit_soup", "json") + .addColumn("completed_edit_events", "json") .addColumn("error", "text") .addColumn("is_loading", "boolean", (cb) => cb.defaultTo(0).notNull()) + .addColumn("soup_last_updated_at", "text") .addColumn("last_updated_at", "text") .execute() diff --git a/dev-server-api/src/db/get-db.ts b/dev-server-api/src/db/get-db.ts index 1eb1ae4f..33f36b6e 100644 --- a/dev-server-api/src/db/get-db.ts +++ b/dev-server-api/src/db/get-db.ts @@ -6,11 +6,13 @@ import * as Path from "path" export interface DevPackageExample { dev_package_example_id: Generated tscircuit_soup: any + completed_edit_events: any file_path: string export_name: string error: string | null is_loading: 1 | 0 last_updated_at: string + soup_last_updated_at: string } export interface ExportRequest { diff --git a/dev-server-frontend/bun.lockb b/dev-server-frontend/bun.lockb index d1da7885..f1af2cd8 100755 Binary files a/dev-server-frontend/bun.lockb and b/dev-server-frontend/bun.lockb differ diff --git a/dev-server-frontend/package-lock.json b/dev-server-frontend/package-lock.json index 2f060667..eca2bc7a 100644 --- a/dev-server-frontend/package-lock.json +++ b/dev-server-frontend/package-lock.json @@ -22,16 +22,16 @@ "@radix-ui/react-toggle": "^1.0.3", "@radix-ui/react-toggle-group": "^1.0.4", "@radix-ui/react-tooltip": "^1.0.7", - "@tscircuit/builder": "latest", - "@tscircuit/pcb-viewer": "^1.2.24", - "@tscircuit/schematic-viewer": "^1.1.22", - "@tscircuit/table-viewer": "0.0.7", + "@tscircuit/builder": "^1.5.85", + "@tscircuit/pcb-viewer": "^1.3.6", + "@tscircuit/schematic-viewer": "^1.2.3", + "@tscircuit/table-viewer": "0.0.8", "axios": "^1.6.7", "class-variance-authority": "^0.7.0", "clsx": "^2.1.0", "cmdk": "^1.0.0", "react": "^18.2.0", - "react-data-grid": "^7.0.0-beta.37", + "react-data-grid": "7.0.0-beta.37", "react-dom": "^18.2.0", "react-error-boundary": "^4.0.13", "react-hot-toast": "^2.4.1", @@ -90,7 +90,6 @@ }, "node_modules/@babel/code-frame": { "version": "7.23.5", - "dev": true, "license": "MIT", "dependencies": { "@babel/highlight": "^7.23.4", @@ -102,7 +101,6 @@ }, "node_modules/@babel/code-frame/node_modules/chalk": { "version": "2.4.2", - "dev": true, "license": "MIT", "dependencies": { "ansi-styles": "^3.2.1", @@ -115,7 +113,6 @@ }, "node_modules/@babel/code-frame/node_modules/chalk/node_modules/ansi-styles": { "version": "3.2.1", - "dev": true, "license": "MIT", "dependencies": { "color-convert": "^1.9.0" @@ -126,7 +123,6 @@ }, "node_modules/@babel/code-frame/node_modules/chalk/node_modules/ansi-styles/node_modules/color-convert": { "version": "1.9.3", - "dev": true, "license": "MIT", "dependencies": { "color-name": "1.1.3" @@ -134,12 +130,10 @@ }, "node_modules/@babel/code-frame/node_modules/chalk/node_modules/ansi-styles/node_modules/color-convert/node_modules/color-name": { "version": "1.1.3", - "dev": true, "license": "MIT" }, "node_modules/@babel/code-frame/node_modules/chalk/node_modules/escape-string-regexp": { "version": "1.0.5", - "dev": true, "license": "MIT", "engines": { "node": ">=0.8.0" @@ -147,7 +141,6 @@ }, "node_modules/@babel/code-frame/node_modules/chalk/node_modules/supports-color": { "version": "5.5.0", - "dev": true, "license": "MIT", "dependencies": { "has-flag": "^3.0.0" @@ -158,7 +151,6 @@ }, "node_modules/@babel/code-frame/node_modules/chalk/node_modules/supports-color/node_modules/has-flag": { "version": "3.0.0", - "dev": true, "license": "MIT", "engines": { "node": ">=4" @@ -292,7 +284,6 @@ }, "node_modules/@babel/helper-module-imports": { "version": "7.22.15", - "dev": true, "license": "MIT", "dependencies": { "@babel/types": "^7.22.15" @@ -351,7 +342,6 @@ }, "node_modules/@babel/helper-string-parser": { "version": "7.23.4", - "dev": true, "license": "MIT", "engines": { "node": ">=6.9.0" @@ -359,7 +349,6 @@ }, "node_modules/@babel/helper-validator-identifier": { "version": "7.22.20", - "dev": true, "license": "MIT", "engines": { "node": ">=6.9.0" @@ -388,7 +377,6 @@ }, "node_modules/@babel/highlight": { "version": "7.23.4", - "dev": true, "license": "MIT", "dependencies": { "@babel/helper-validator-identifier": "^7.22.20", @@ -401,7 +389,6 @@ }, "node_modules/@babel/highlight/node_modules/chalk": { "version": "2.4.2", - "dev": true, "license": "MIT", "dependencies": { "ansi-styles": "^3.2.1", @@ -414,7 +401,6 @@ }, "node_modules/@babel/highlight/node_modules/chalk/node_modules/ansi-styles": { "version": "3.2.1", - "dev": true, "license": "MIT", "dependencies": { "color-convert": "^1.9.0" @@ -425,7 +411,6 @@ }, "node_modules/@babel/highlight/node_modules/chalk/node_modules/ansi-styles/node_modules/color-convert": { "version": "1.9.3", - "dev": true, "license": "MIT", "dependencies": { "color-name": "1.1.3" @@ -433,12 +418,10 @@ }, "node_modules/@babel/highlight/node_modules/chalk/node_modules/ansi-styles/node_modules/color-convert/node_modules/color-name": { "version": "1.1.3", - "dev": true, "license": "MIT" }, "node_modules/@babel/highlight/node_modules/chalk/node_modules/escape-string-regexp": { "version": "1.0.5", - "dev": true, "license": "MIT", "engines": { "node": ">=0.8.0" @@ -446,7 +429,6 @@ }, "node_modules/@babel/highlight/node_modules/chalk/node_modules/supports-color": { "version": "5.5.0", - "dev": true, "license": "MIT", "dependencies": { "has-flag": "^3.0.0" @@ -457,7 +439,6 @@ }, "node_modules/@babel/highlight/node_modules/chalk/node_modules/supports-color/node_modules/has-flag": { "version": "3.0.0", - "dev": true, "license": "MIT", "engines": { "node": ">=4" @@ -555,7 +536,6 @@ }, "node_modules/@babel/types": { "version": "7.24.0", - "dev": true, "license": "MIT", "dependencies": { "@babel/helper-string-parser": "^7.23.4", @@ -566,6 +546,95 @@ "node": ">=6.9.0" } }, + "node_modules/@emotion/babel-plugin": { + "version": "11.11.0", + "resolved": "https://registry.npmjs.org/@emotion/babel-plugin/-/babel-plugin-11.11.0.tgz", + "integrity": "sha512-m4HEDZleaaCH+XgDDsPF15Ht6wTLsgDTeR3WYj9Q/k76JtWhrJjcP4+/XlG8LGT/Rol9qUfOIztXeA84ATpqPQ==", + "dependencies": { + "@babel/helper-module-imports": "^7.16.7", + "@babel/runtime": "^7.18.3", + "@emotion/hash": "^0.9.1", + "@emotion/memoize": "^0.8.1", + "@emotion/serialize": "^1.1.2", + "babel-plugin-macros": "^3.1.0", + "convert-source-map": "^1.5.0", + "escape-string-regexp": "^4.0.0", + "find-root": "^1.1.0", + "source-map": "^0.5.7", + "stylis": "4.2.0" + } + }, + "node_modules/@emotion/babel-plugin/node_modules/convert-source-map": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.9.0.tgz", + "integrity": "sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A==" + }, + "node_modules/@emotion/cache": { + "version": "11.11.0", + "resolved": "https://registry.npmjs.org/@emotion/cache/-/cache-11.11.0.tgz", + "integrity": "sha512-P34z9ssTCBi3e9EI1ZsWpNHcfY1r09ZO0rZbRO2ob3ZQMnFI35jB536qoXbkdesr5EUhYi22anuEJuyxifaqAQ==", + "dependencies": { + "@emotion/memoize": "^0.8.1", + "@emotion/sheet": "^1.2.2", + "@emotion/utils": "^1.2.1", + "@emotion/weak-memoize": "^0.3.1", + "stylis": "4.2.0" + } + }, + "node_modules/@emotion/css": { + "version": "11.11.2", + "resolved": "https://registry.npmjs.org/@emotion/css/-/css-11.11.2.tgz", + "integrity": "sha512-VJxe1ucoMYMS7DkiMdC2T7PWNbrEI0a39YRiyDvK2qq4lXwjRbVP/z4lpG+odCsRzadlR+1ywwrTzhdm5HNdew==", + "dependencies": { + "@emotion/babel-plugin": "^11.11.0", + "@emotion/cache": "^11.11.0", + "@emotion/serialize": "^1.1.2", + "@emotion/sheet": "^1.2.2", + "@emotion/utils": "^1.2.1" + } + }, + "node_modules/@emotion/hash": { + "version": "0.9.1", + "resolved": "https://registry.npmjs.org/@emotion/hash/-/hash-0.9.1.tgz", + "integrity": "sha512-gJB6HLm5rYwSLI6PQa+X1t5CFGrv1J1TWG+sOyMCeKz2ojaj6Fnl/rZEspogG+cvqbt4AE/2eIyD2QfLKTBNlQ==" + }, + "node_modules/@emotion/memoize": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/@emotion/memoize/-/memoize-0.8.1.tgz", + "integrity": "sha512-W2P2c/VRW1/1tLox0mVUalvnWXxavmv/Oum2aPsRcoDJuob75FC3Y8FbpfLwUegRcxINtGUMPq0tFCvYNTBXNA==" + }, + "node_modules/@emotion/serialize": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/@emotion/serialize/-/serialize-1.1.4.tgz", + "integrity": "sha512-RIN04MBT8g+FnDwgvIUi8czvr1LU1alUMI05LekWB5DGyTm8cCBMCRpq3GqaiyEDRptEXOyXnvZ58GZYu4kBxQ==", + "dependencies": { + "@emotion/hash": "^0.9.1", + "@emotion/memoize": "^0.8.1", + "@emotion/unitless": "^0.8.1", + "@emotion/utils": "^1.2.1", + "csstype": "^3.0.2" + } + }, + "node_modules/@emotion/sheet": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/@emotion/sheet/-/sheet-1.2.2.tgz", + "integrity": "sha512-0QBtGvaqtWi+nx6doRwDdBIzhNdZrXUppvTM4dtZZWEGTXL/XE/yJxLMGlDT1Gt+UHH5IX1n+jkXyytE/av7OA==" + }, + "node_modules/@emotion/unitless": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/@emotion/unitless/-/unitless-0.8.1.tgz", + "integrity": "sha512-KOEGMu6dmJZtpadb476IsZBclKvILjopjUii3V+7MnXIQCYh8W3NgNcgwo21n9LXZX6EDIKvqfjYxXebDwxKmQ==" + }, + "node_modules/@emotion/utils": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@emotion/utils/-/utils-1.2.1.tgz", + "integrity": "sha512-Y2tGf3I+XVnajdItskUCn6LX+VUDmP6lTL4fcqsXAv43dnlbZiuW4MWQW38rW/BVWSE7Q/7+XQocmpnRYILUmg==" + }, + "node_modules/@emotion/weak-memoize": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/@emotion/weak-memoize/-/weak-memoize-0.3.1.tgz", + "integrity": "sha512-EsBwpc7hBUJWAsNPBmJy4hxWx12v6bshQsldrVmjxJoc3isbxhOrF2IcCpaXxfvq03NwkI7sbsOLXbYuqF/8Ww==" + }, "node_modules/@esbuild/linux-x64": { "version": "0.19.12", "cpu": [ @@ -1831,16 +1900,20 @@ } }, "node_modules/@tscircuit/builder": { - "version": "1.5.53", - "resolved": "https://registry.npmjs.org/@tscircuit/builder/-/builder-1.5.53.tgz", - "integrity": "sha512-DJWEJAacSN+5p4Sc1RSbYAUEMqbKarS8HusrLpyDHnP+K3NzDG4/kxMGrD9rzTZSq2hfed97Zne/BZlVqfigVQ==", + "version": "1.5.85", + "resolved": "https://registry.npmjs.org/@tscircuit/builder/-/builder-1.5.85.tgz", + "integrity": "sha512-QKLkkVGLCuhmN5YgWnpETRGyn3POp+92Eam3CDo0b4qrCYheV7DQoJ87HG4iAPr4WBvUy7NxtAPTeZRVOtccdA==", "dependencies": { "@lume/kiwi": "^0.1.0", "@tscircuit/footprints": "^0.0.14", + "@tscircuit/layout": "^0.0.7", "@tscircuit/routing": "^1.3.1", - "@tscircuit/sparkfun-packages": "^1.2.0", + "@tscircuit/schematic-autolayout": "^0.0.5", + "@tscircuit/sparkfun-packages": "^1.2.1", "convert-units": "^2.3.4", "fast-json-stable-stringify": "^2.1.0", + "format-si-prefix": "^0.3.2", + "papaparse": "^5.4.1", "rectilinear-router": "^1.0.1", "svg-path-bounds": "^1.0.2", "transformation-matrix": "^2.12.0" @@ -1857,6 +1930,18 @@ "typescript": "^5.0.0" } }, + "node_modules/@tscircuit/layout": { + "version": "0.0.7", + "resolved": "https://registry.npmjs.org/@tscircuit/layout/-/layout-0.0.7.tgz", + "integrity": "sha512-Jdd6j0+p4yK8zAqFX7dgmb5PT8A9KJduDBhEgAm+OgwDrw3Mp0hQ80pbR2Mvm02UF2Gu9H7TWpMytACCoNqPdA==", + "dependencies": { + "transformation-matrix": "^2.16.1" + }, + "peerDependencies": { + "@tscircuit/builder": "*", + "zod": "*" + } + }, "node_modules/@tscircuit/mm": { "version": "0.0.4", "resolved": "https://registry.npmjs.org/@tscircuit/mm/-/mm-0.0.4.tgz", @@ -1869,12 +1954,15 @@ } }, "node_modules/@tscircuit/pcb-viewer": { - "version": "1.2.24", - "resolved": "https://registry.npmjs.org/@tscircuit/pcb-viewer/-/pcb-viewer-1.2.24.tgz", - "integrity": "sha512-T1ohSL9vVI2nPxeXiYnSDJHMVV55Zspa9MqcLCfb4MDFhm8kf/Ba/kMSkmvwkzv8jLFJkdS+HkEcEu9yfncl2Q==", - "dependencies": { - "react-supergrid": "^1.0.7", - "transformation-matrix": "^2.13.0" + "version": "1.3.6", + "resolved": "https://registry.npmjs.org/@tscircuit/pcb-viewer/-/pcb-viewer-1.3.6.tgz", + "integrity": "sha512-57emRZm9jK6MlZ4+EUtdgTqtnl7zYPjczzSRlfWL3srzcKGLTSQxvrvF7b/g9kVpmQKmkaDkp7sZ5G4lm/yywQ==", + "dependencies": { + "@emotion/css": "^11.11.2", + "color": "^4.2.3", + "react-supergrid": "^1.0.10", + "transformation-matrix": "^2.13.0", + "zustand": "^4.5.2" }, "peerDependencies": { "@tscircuit/builder": "*", @@ -1882,6 +1970,18 @@ "react": "*" } }, + "node_modules/@tscircuit/pcb-viewer/node_modules/color": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/color/-/color-4.2.3.tgz", + "integrity": "sha512-1rXeuUUiGGrykh+CeBdu5Ie7OJwinCgQY0bc7GCRxy5xVHy+moaqkpL/jqQq0MtQOeYcrqEz4abc5f0KtU7W4A==", + "dependencies": { + "color-convert": "^2.0.1", + "color-string": "^1.9.0" + }, + "engines": { + "node": ">=12.5.0" + } + }, "node_modules/@tscircuit/react-fiber": { "version": "1.0.6", "license": "MIT", @@ -1904,13 +2004,25 @@ "react-error-boundary": "^4.0.11" } }, + "node_modules/@tscircuit/schematic-autolayout": { + "version": "0.0.5", + "resolved": "https://registry.npmjs.org/@tscircuit/schematic-autolayout/-/schematic-autolayout-0.0.5.tgz", + "integrity": "sha512-I4CtLQfqTPTxDSumnquaJtkJkc16VjLC4bwU3jQdBXwwh9ODzBf88clUznUtDDzwV+BPM5P0W0VCfFhvPL3/Cw==", + "dependencies": { + "react": "^18.2.0", + "react-dom": "^18.2.0", + "react-supergrid": "^1.0.10", + "transformation-matrix": "^2.16.1", + "use-mouse-matrix-transform": "^1.1.12" + } + }, "node_modules/@tscircuit/schematic-viewer": { - "version": "1.1.22", - "resolved": "https://registry.npmjs.org/@tscircuit/schematic-viewer/-/schematic-viewer-1.1.22.tgz", - "integrity": "sha512-aU2CGv9fGnjiMsP0Cg2LAC2nzmXTSfWqu5TEl3MNj5sPbPLpft0kBT4hdKfyrwxPCoL5p0GJnlPesW9byjSySA==", + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/@tscircuit/schematic-viewer/-/schematic-viewer-1.2.3.tgz", + "integrity": "sha512-fkG+tmSkIrfmk8vHZrWWy4XcIVb86On8Cu4hKXbGbAlAZrt7YxrvqkUPXE0p3jErzEsIbWpm8d8QbyD+vwbr7Q==", "dependencies": { "react-error-boundary": "^4.0.4", - "react-supergrid": "^1.0.8", + "react-supergrid": "^1.0.10", "use-mouse-matrix-transform": "^1.1.12" }, "peerDependencies": { @@ -1921,17 +2033,17 @@ } }, "node_modules/@tscircuit/sparkfun-packages": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@tscircuit/sparkfun-packages/-/sparkfun-packages-1.2.0.tgz", - "integrity": "sha512-m+jCOaSBpwRzUN5trc9z5f8yh2zzLITANgNhuNQOtxNZRIrv98iYfL3dSSmf73xknh0Nz68EephNvKVZmproCQ==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@tscircuit/sparkfun-packages/-/sparkfun-packages-1.2.1.tgz", + "integrity": "sha512-2HzmmHydo5vgoKmNBAHd6RD93LaIMXRSt6t//1zx19/ZwrOA43qVOvb7cCTA82GHib1bSxoL7bqgii9sYudCHw==", "dependencies": { "change-case": "^5.4.3" } }, "node_modules/@tscircuit/table-viewer": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/@tscircuit/table-viewer/-/table-viewer-0.0.7.tgz", - "integrity": "sha512-DhQetibJG5nOwmrA+gFHdNJPZvjPtM7wV8nB++oxkYsfHLhYblMUrUo2dlSvFoCVJLaOdUgIF7sPxNXqs+PG6Q==", + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/@tscircuit/table-viewer/-/table-viewer-0.0.8.tgz", + "integrity": "sha512-55PRjpIvIN6wGnGi2tbAsyiUHEUPWOQcV/YDDxMApIPHEBxQngNgjIuzA5DiPq5rjX9xSrikt3mfOK78qQMJbA==", "dependencies": { "react-json-tree": "^0.18.0" }, @@ -1996,6 +2108,11 @@ "version": "4.17.0", "license": "MIT" }, + "node_modules/@types/parse-json": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/@types/parse-json/-/parse-json-4.0.2.tgz", + "integrity": "sha512-dISoDXWWQwUquiKsyZ4Ng+HX2KsPL7LyHKHQwgGFEA3IaKac4Obd+h2a/a6waisAoepJlBcx9paWqjA8/HVjCw==" + }, "node_modules/@types/prop-types": { "version": "15.7.11", "license": "MIT" @@ -2402,6 +2519,20 @@ "proxy-from-env": "^1.1.0" } }, + "node_modules/babel-plugin-macros": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/babel-plugin-macros/-/babel-plugin-macros-3.1.0.tgz", + "integrity": "sha512-Cg7TFGpIr01vOQNODXOOaGz2NpCU5gl8x1qJFbb6hbZxR7XrcE2vtbAsTAbJ7/xwJtUuJEw8K8Zr/AE0LHlesg==", + "dependencies": { + "@babel/runtime": "^7.12.5", + "cosmiconfig": "^7.0.0", + "resolve": "^1.19.0" + }, + "engines": { + "node": ">=10", + "npm": ">=6" + } + }, "node_modules/balanced-match": { "version": "1.0.2", "license": "MIT" @@ -2489,7 +2620,6 @@ }, "node_modules/callsites": { "version": "3.1.0", - "dev": true, "license": "MIT", "engines": { "node": ">=6" @@ -2689,6 +2819,29 @@ "lodash.keys": "2.3.x" } }, + "node_modules/cosmiconfig": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-7.1.0.tgz", + "integrity": "sha512-AdmX6xUzdNASswsFtmwSt7Vj8po9IuqXm0UXz7QKPuEUmPB4XyjGfaAr2PSuELMwkRMVH1EpIkX5bTZGRB3eCA==", + "dependencies": { + "@types/parse-json": "^4.0.0", + "import-fresh": "^3.2.1", + "parse-json": "^5.0.0", + "path-type": "^4.0.0", + "yaml": "^1.10.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/cosmiconfig/node_modules/yaml": { + "version": "1.10.2", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.2.tgz", + "integrity": "sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==", + "engines": { + "node": ">= 6" + } + }, "node_modules/cross-spawn": { "version": "7.0.3", "license": "MIT", @@ -2794,6 +2947,19 @@ "version": "9.2.2", "license": "MIT" }, + "node_modules/error-ex": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", + "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", + "dependencies": { + "is-arrayish": "^0.2.1" + } + }, + "node_modules/error-ex/node_modules/is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==" + }, "node_modules/esbuild": { "version": "0.19.12", "dev": true, @@ -2841,7 +3007,6 @@ }, "node_modules/escape-string-regexp": { "version": "4.0.0", - "dev": true, "license": "MIT", "engines": { "node": ">=10" @@ -3069,6 +3234,11 @@ "node": ">=8" } }, + "node_modules/find-root": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/find-root/-/find-root-1.1.0.tgz", + "integrity": "sha512-NKfW6bec6GfKc0SGx1e07QZY9PE99u0Bft/0rzSD5k3sO/vwkVUpDUKVm5Gpp5Ue3YfShPFTX2070tDs5kB9Ng==" + }, "node_modules/find-up": { "version": "5.0.0", "dev": true, @@ -3146,6 +3316,14 @@ "node": ">= 6" } }, + "node_modules/format-si-prefix": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/format-si-prefix/-/format-si-prefix-0.3.2.tgz", + "integrity": "sha512-gtCZh4RpmlmEZtyzyvs+FXXWOmdfpQQ0M7mjc81zpAYm5QpsoUDPKhAK+Lj7fJCtZSJpE5xbpCYgspCBxahObQ==", + "dependencies": { + "parseunit": "^0" + } + }, "node_modules/fraction.js": { "version": "4.3.7", "dev": true, @@ -3319,7 +3497,6 @@ }, "node_modules/import-fresh": { "version": "3.3.0", - "dev": true, "license": "MIT", "dependencies": { "parent-module": "^1.0.0", @@ -3495,6 +3672,11 @@ "dev": true, "license": "MIT" }, + "node_modules/json-parse-even-better-errors": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", + "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==" + }, "node_modules/json-schema-traverse": { "version": "0.4.1", "dev": true, @@ -3937,9 +4119,13 @@ "version": "2.1.0", "license": "(MIT AND Zlib)" }, + "node_modules/papaparse": { + "version": "5.4.1", + "resolved": "https://registry.npmjs.org/papaparse/-/papaparse-5.4.1.tgz", + "integrity": "sha512-HipMsgJkZu8br23pW15uvo6sib6wne/4woLZPlFf3rpDyMe9ywEXUsuD7+6K9PRkJlVT51j/sCOYDKGGS3ZJrw==" + }, "node_modules/parent-module": { "version": "1.0.1", - "dev": true, "license": "MIT", "dependencies": { "callsites": "^3.0.0" @@ -3948,10 +4134,32 @@ "node": ">=6" } }, + "node_modules/parse-json": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", + "integrity": "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==", + "dependencies": { + "@babel/code-frame": "^7.0.0", + "error-ex": "^1.3.1", + "json-parse-even-better-errors": "^2.3.0", + "lines-and-columns": "^1.1.6" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/parse-svg-path": { "version": "0.1.2", "license": "MIT" }, + "node_modules/parseunit": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/parseunit/-/parseunit-0.3.1.tgz", + "integrity": "sha512-kKtTgCJDsktOHsnvRR/B5DhWi3a/RZ5M9XjVQZGbOatcam+/tk4sMOCQ1WM9Rswfr78zWGBgHNbWTyJvfR0ejg==" + }, "node_modules/path-exists": { "version": "4.0.0", "dev": true, @@ -4001,7 +4209,6 @@ }, "node_modules/path-type": { "version": "4.0.0", - "dev": true, "license": "MIT", "engines": { "node": ">=8" @@ -4411,8 +4618,9 @@ } }, "node_modules/react-supergrid": { - "version": "1.0.8", - "license": "ISC", + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/react-supergrid/-/react-supergrid-1.0.10.tgz", + "integrity": "sha512-dJd9wkH6BJkdfkv62EcRAIBn59e2wj58bJFVXiW/ZHQzxz20qIql63fTU2qFMOujXnBIDaMG0uTod67/mjEGeA==", "peerDependencies": { "react": "*", "react-dom": "*", @@ -4469,7 +4677,6 @@ }, "node_modules/resolve-from": { "version": "4.0.0", - "dev": true, "license": "MIT", "engines": { "node": ">=4" @@ -4643,6 +4850,14 @@ "node": ">=8" } }, + "node_modules/source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ==", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/source-map-js": { "version": "1.0.2", "license": "BSD-3-Clause", @@ -4710,6 +4925,11 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/stylis": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/stylis/-/stylis-4.2.0.tgz", + "integrity": "sha512-Orov6g6BB1sDfYgzWfTHDOxamtX1bE/zo104Dh9e6fqJ3PooipYyfJ0pUmrZO2wAvO8YbEyeFrkV91XTsGMSrw==" + }, "node_modules/sucrase": { "version": "3.35.0", "license": "MIT", @@ -4842,7 +5062,6 @@ }, "node_modules/to-fast-properties": { "version": "2.0.0", - "dev": true, "license": "MIT", "engines": { "node": ">=4" diff --git a/dev-server-frontend/package.json b/dev-server-frontend/package.json index e027e6f4..01af260a 100644 --- a/dev-server-frontend/package.json +++ b/dev-server-frontend/package.json @@ -30,9 +30,9 @@ "@radix-ui/react-toggle": "^1.0.3", "@radix-ui/react-toggle-group": "^1.0.4", "@radix-ui/react-tooltip": "^1.0.7", - "@tscircuit/builder": "^1.5.66", - "@tscircuit/pcb-viewer": "^1.3.4", - "@tscircuit/schematic-viewer": "^1.1.22", + "@tscircuit/builder": "^1.5.85", + "@tscircuit/pcb-viewer": "^1.3.7", + "@tscircuit/schematic-viewer": "^1.2.3", "@tscircuit/table-viewer": "0.0.8", "axios": "^1.6.7", "class-variance-authority": "^0.7.0", diff --git a/dev-server-frontend/src/ExampleContentView.tsx b/dev-server-frontend/src/ExampleContentView.tsx index b44f4efb..629c5976 100644 --- a/dev-server-frontend/src/ExampleContentView.tsx +++ b/dev-server-frontend/src/ExampleContentView.tsx @@ -7,6 +7,8 @@ import { cn } from "./lib/utils" import { ErrorBoundary } from "react-error-boundary" import { SoupTableViewer } from "@tscircuit/table-viewer" import "react-data-grid/lib/styles.css" +import { useRef, useState } from "react" +import type { EditEvent } from "@tscircuit/pcb-viewer" export const ExampleContentView = () => { const devExamplePackageId = useGlobalStore( @@ -34,10 +36,13 @@ export const ExampleContentView = () => { } ) + const sentEditEvents = useRef>({}) + const notFound = (error as any)?.response?.status === 404 const viewMode = useGlobalStore((s) => s.view_mode) const splitMode = useGlobalStore((s) => s.split_mode) + const [editEvents, setEditEvents] = useState([]) const editorHeight = window.innerHeight - 52 const halfHeight = Math.floor(editorHeight / 2) @@ -47,7 +52,7 @@ export const ExampleContentView = () => { return (
{ {pkg && (viewMode === "schematic" || viewMode === "split") && ( Failed to render Schematic
}> { {pkg && (viewMode === "pcb" || viewMode === "split") && ( Failed to render PCB}> { + // Look for any edit events that have not been sent to the server + // and send them, then mark them as sent + let hasUnsentEditEvents = false + for (const editEvent of changedEditEvents) { + if ( + !editEvent.in_progress && + !sentEditEvents.current[editEvent.edit_event_id] + ) { + hasUnsentEditEvents = true + sentEditEvents.current[editEvent.edit_event_id] = true + } + } + if (hasUnsentEditEvents) { + axios.post(`/api/dev_package_examples/update`, { + dev_package_example_id: devExamplePackageId, + completed_edit_events: changedEditEvents.filter( + (ee) => ee.in_progress === false + ), + }) + } + setEditEvents(changedEditEvents) + }} soup={pkg.tscircuit_soup} /> @@ -79,7 +109,7 @@ export const ExampleContentView = () => { {pkg && viewMode === "soup" && ( Failed to render Soup}> { + const source_component = su(soup).source_component.getUsing({ + pcb_component_id, + }) + if (!source_component) { + throw new Error( + `Could not find source component for pcb_component_id="${pcb_component_id}"` + ) + } + + // TODO travel up the tree to make the selector more specific + + return `.${source_component.name}` +} diff --git a/lib/cmd-fns/dev/index.ts b/lib/cmd-fns/dev/index.ts index 471bcc8e..0420d9c3 100644 --- a/lib/cmd-fns/dev/index.ts +++ b/lib/cmd-fns/dev/index.ts @@ -14,6 +14,7 @@ import { checkIfInitialized } from "./check-if-initialized" import { initCmd } from "../init" import { startExportRequestWatcher } from "./start-export-request-watcher" import $ from "dax-sh" +import { startEditEventWatcher } from "./start-edit-event-watcher" export const devCmd = async (ctx: AppContext, args: any) => { const params = z @@ -75,9 +76,10 @@ export const devCmd = async (ctx: AppContext, args: any) => { console.log(`Loading examples...`) await uploadExamplesFromDirectory({ devServerAxios, cwd }, ctx) - // Start watcher + // Start watchers const fs_watcher = await startFsWatcher({ cwd, devServerAxios }, ctx) const er_watcher = await startExportRequestWatcher({ devServerAxios }, ctx) + const ee_watcher = await startEditEventWatcher({ devServerAxios }, ctx) while (true) { const { action } = await prompts({ @@ -108,6 +110,7 @@ export const devCmd = async (ctx: AppContext, args: any) => { if (server.close) server.close() fs_watcher.stop() er_watcher.stop() + ee_watcher.stop() break } } diff --git a/lib/cmd-fns/dev/start-edit-event-watcher.ts b/lib/cmd-fns/dev/start-edit-event-watcher.ts new file mode 100644 index 00000000..28a43b5d --- /dev/null +++ b/lib/cmd-fns/dev/start-edit-event-watcher.ts @@ -0,0 +1,219 @@ +import { DevPackageExample } from "@server/db/get-db" +import { AxiosInstance } from "axios" +import kleur from "kleur" +import { AppContext } from "lib/util/app-context" +import fg from "fast-glob" +import fs from "fs" +import { Project, ts } from "ts-morph" +import * as Path from "path" +import { ManualPcbPosition } from "@tscircuit/builder" +import { deriveSelectorFromPcbComponentId } from "./derive-selector-from-pcb-component-id" + +// TODO import from builder when builder exports it +type EditEvent = { + edit_event_id: string + pcb_edit_event_type: "edit_component_location" + pcb_component_id: string + original_center: { x: number; y: number } + new_center: { x: number; y: number } +} + +export const startEditEventWatcher = async ( + { + devServerAxios, + }: { + devServerAxios: AxiosInstance + }, + ctx: AppContext +) => { + let running = true + + ;(async () => { + let last_edit_event_update_time: Record = {} + + while (running) { + try { + const dev_package_examples: DevPackageExample[] = await devServerAxios + .post("/api/dev_package_examples/list", {}) + .then((r) => r.data.dev_package_examples) + + for (const dev_package_example of dev_package_examples) { + const dev_package_example_id: number = + dev_package_example.dev_package_example_id as any + + const last_recorded_update_time = + last_edit_event_update_time[dev_package_example_id] + + // TODO use last_edit_event_updated_at + if ( + last_recorded_update_time !== dev_package_example.last_updated_at + ) { + console.log( + kleur.gray( + `Edit event detected for dev_package_example ${dev_package_example.dev_package_example_id}` + ) + ) + console.log( + kleur.gray(` file_path: ${dev_package_example.file_path}`) + ) + + last_edit_event_update_time[dev_package_example_id] = + dev_package_example.last_updated_at // TODO last_edit_event_updated_at + + console.log(kleur.gray(` getting new edit events...`)) + + const dev_package_example_full = await devServerAxios + .post("/api/dev_package_examples/get", { + dev_package_example_id, + }) + .then((r) => r.data.dev_package_example) + + // 1. Find the *.manual-edits.ts, if there are multiple error + const manual_edit_files = fg.sync( + ["**/*.manual-edits.ts", "**/manual-edits.ts"], + { + cwd: ctx.cwd, + } + ) + + if (manual_edit_files.length === 0) { + console.log( + kleur.red( + `No manual edit files found in "${ctx.cwd}", please create a file "manual-edits.ts" or "*.manual-edits.ts" to persist manual edits` + ) + ) + continue + } + + if (manual_edit_files.length > 1) { + console.log( + kleur.red( + `Multiple manual edit files found, tsci currently doesn't know how to handle this, you should go upvote an issue` + ) + ) + continue + } + + const manual_edit_file = manual_edit_files[0] + const manual_edit_file_content = fs.readFileSync( + Path.join(ctx.cwd, manual_edit_file), + "utf-8" + ) + + console.log( + kleur.gray(` found manual edit file: ${manual_edit_file}`) + ) + + // 2. Convert the edit events into ManualPcbPosition[] and append, + // removing any old placements/positions for the same selector. + // We can completely rewrite the file here for now (we'll need + // to preserve comments etc. later) + + const edit_events: EditEvent[] = + dev_package_example_full.completed_edit_events ?? [] + + if (edit_events.length === 0) continue + + const project = new Project() + + const ts_manual_edits_file = project.createSourceFile( + "manual-edits.ts", + manual_edit_file_content + ) + + // Access the default export declaration + const default_export_dec = ts_manual_edits_file + .getDefaultExportSymbol()! + .getDeclarations()[0] + + // Get the object literal expression from the export default statement + const object_literal = + default_export_dec.getFirstChildByKindOrThrow( + ts.SyntaxKind.ObjectLiteralExpression + ) + + // Get the `pcb_placements` property + const pcb_placements_ts = + object_literal.getPropertyOrThrow("pcb_placements") + + let pcb_placements: (ManualPcbPosition & { + _edit_event_id?: string + })[] + try { + pcb_placements = JSON.parse( + pcb_placements_ts.getText().replace(/pcb_placements:\s/, "") + ) + } catch (e: any) { + console.log( + kleur.red( + `Error parsing pcb_placements from manual edits file: ${pcb_placements_ts.getText()} ${e.toString()}` + ) + ) + continue + } + + const handled_edit_events = new Set( + pcb_placements + .map((p) => (p as any)._edit_event_id) + .filter(Boolean) + ) + + // Add PCB placements from edit events + for (const edit_event of edit_events) { + if (handled_edit_events.has(edit_event.edit_event_id)) continue + + // TODO Figure out a good selector for this pcb_component + const selector = deriveSelectorFromPcbComponentId({ + soup: dev_package_example_full.tscircuit_soup, + pcb_component_id: edit_event.pcb_component_id, + }) + + const existing_placement_for_selector = pcb_placements.find( + (pp) => pp.selector === selector + ) + + if (!existing_placement_for_selector) { + console.log( + kleur.gray( + ` adding PCB placement from edit event for "${selector}"` + ) + ) + + pcb_placements.push({ + _edit_event_id: edit_event.edit_event_id, + selector, + center: edit_event.new_center, + relative_to: "group_center", + }) + } else { + existing_placement_for_selector.center = edit_event.new_center + } + + // Edit the pcb placements object + pcb_placements_ts.replaceWithText( + `pcb_placements: ${JSON.stringify(pcb_placements, null, " ")}` + ) + + // Save the file + + fs.writeFileSync( + Path.join(ctx.cwd, manual_edit_file), + ts_manual_edits_file.getFullText() + ) + } + } + } + } catch (err: any) { + console.log(kleur.red(`Error in edit event watcher: ${err.toString()}`)) + } + + await new Promise((resolve) => setTimeout(resolve, 100)) + } + })() + + return { + stop: () => { + running = false + }, + } +} diff --git a/lib/cmd-fns/dev/start-export-request-watcher.ts b/lib/cmd-fns/dev/start-export-request-watcher.ts index b39f869d..e53754c6 100644 --- a/lib/cmd-fns/dev/start-export-request-watcher.ts +++ b/lib/cmd-fns/dev/start-export-request-watcher.ts @@ -15,7 +15,13 @@ export const startExportRequestWatcher = async ( ;(async () => { while (running) { - await fulfillExportRequests({ dev_server_axios: devServerAxios }, ctx) + try { + await fulfillExportRequests({ dev_server_axios: devServerAxios }, ctx) + } catch (err: any) { + console.log( + kleur.red(`Error in export request watcher: ${err.toString()}`) + ) + } await new Promise((resolve) => setTimeout(resolve, 100)) } })() diff --git a/lib/cmd-fns/init/index.ts b/lib/cmd-fns/init/index.ts index dbe91e99..0ba6e408 100644 --- a/lib/cmd-fns/init/index.ts +++ b/lib/cmd-fns/init/index.ts @@ -111,15 +111,44 @@ export const initCmd = async (ctx: AppContext, args: any) => { mkdirSync("examples", { recursive: true }) mkdirSync("lib", { recursive: true }) + writeFileSync( + Path.join("lib", "MyCircuit.manual-edits.ts"), + ` +/** + * DO NOT EDIT THIS FILE DIRECTLY! + * + * This file is automatically edited when running \`tsci dev\` and dragging things + * around. \`tsci dev\` searches for a file named "*.manual-edits.ts" and edits + * it when you e.g. move a footprint. If there are multiple files, it'll try + * to pick one based on context or ask. + * + * If you're not running \`tsci dev\`, you can safely edit this file. + */ +export default { + // Generated when this file is created, this unique identifier is used to help + // determine which file to edit when there are many *.manual-edits.ts files + manual_edit_id: "abcdef", + + // Manual pcb placements, added when you drag a footprint + pcb_placements: [], +} +`.trim() + ) + writeFileSync( Path.join("lib", "MyCircuit.tsx"), ` + import { layout } from "tscircuit" + import manual_edits from "./MyCircuit.manual-edits" + export const MyCircuit = () => ( - + + + ) `.trim() ) diff --git a/package-lock.json b/package-lock.json index d9311db3..e7b9ea07 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,18 +1,19 @@ { "name": "@tscircuit/cli", - "version": "0.0.74", + "version": "0.0.83", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@tscircuit/cli", - "version": "0.0.74", + "version": "0.0.83", "license": "ISC", "dependencies": { "@edge-runtime/primitives": "^4.1.0", "@hono/node-server": "^1.8.2", - "@tscircuit/builder": "1.5.69", - "@tscircuit/react-fiber": "^1.0.35", + "@tscircuit/builder": "^1.5.85", + "@tscircuit/react-fiber": "^1.0.39", + "@tscircuit/soup-util": "^0.0.1", "archiver": "^7.0.1", "axios": "^1.6.7", "better-sqlite3": "^9.4.3", @@ -25,6 +26,7 @@ "delay": "^6.0.0", "edgespec": "^0.0.69", "esbuild": "^0.20.2", + "fast-glob": "^3.3.2", "glob": "^10.3.10", "hono": "^4.1.0", "ignore": "^5.3.1", @@ -39,6 +41,7 @@ "prompts": "^2.4.2", "react": "^18.2.0", "semver": "^7.6.0", + "ts-morph": "^22.0.0", "tsup": "^8.0.2", "zod": "latest" }, @@ -889,9 +892,9 @@ } }, "node_modules/@ts-morph/common": { - "version": "0.22.0", - "resolved": "https://registry.npmjs.org/@ts-morph/common/-/common-0.22.0.tgz", - "integrity": "sha512-HqNBuV/oIlMKdkLshXd1zKBqNQCsuPEsgQOkfFQ/eUKjRlwndXW1AjN9LVkBEIukm00gGXSRmfkl0Wv5VXLnlw==", + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@ts-morph/common/-/common-0.23.0.tgz", + "integrity": "sha512-m7Lllj9n/S6sOkCkRftpM7L24uvmfXQFedlW/4hENcuJH1HHm9u5EgxZb9uVjQSCGrbBWBkOGgcTxNg36r6ywA==", "dependencies": { "fast-glob": "^3.3.2", "minimatch": "^9.0.3", @@ -914,14 +917,16 @@ } }, "node_modules/@tscircuit/builder": { - "version": "1.5.69", - "resolved": "https://registry.npmjs.org/@tscircuit/builder/-/builder-1.5.69.tgz", - "integrity": "sha512-T4XTkzNlL9TPE8LVhwmR0TZzAmQMylX3VpNGf9nhri8HjCtbdQi3eIVR7qRrNngwtxFH/APXd01DUgqIo6xQjQ==", + "version": "1.5.85", + "resolved": "https://registry.npmjs.org/@tscircuit/builder/-/builder-1.5.85.tgz", + "integrity": "sha512-QKLkkVGLCuhmN5YgWnpETRGyn3POp+92Eam3CDo0b4qrCYheV7DQoJ87HG4iAPr4WBvUy7NxtAPTeZRVOtccdA==", "dependencies": { "@lume/kiwi": "^0.1.0", "@tscircuit/footprints": "^0.0.14", + "@tscircuit/layout": "^0.0.7", "@tscircuit/routing": "^1.3.1", - "@tscircuit/sparkfun-packages": "^1.2.0", + "@tscircuit/schematic-autolayout": "^0.0.5", + "@tscircuit/sparkfun-packages": "^1.2.1", "convert-units": "^2.3.4", "fast-json-stable-stringify": "^2.1.0", "format-si-prefix": "^0.3.2", @@ -942,6 +947,18 @@ "typescript": "^5.0.0" } }, + "node_modules/@tscircuit/layout": { + "version": "0.0.7", + "resolved": "https://registry.npmjs.org/@tscircuit/layout/-/layout-0.0.7.tgz", + "integrity": "sha512-Jdd6j0+p4yK8zAqFX7dgmb5PT8A9KJduDBhEgAm+OgwDrw3Mp0hQ80pbR2Mvm02UF2Gu9H7TWpMytACCoNqPdA==", + "dependencies": { + "transformation-matrix": "^2.16.1" + }, + "peerDependencies": { + "@tscircuit/builder": "*", + "zod": "*" + } + }, "node_modules/@tscircuit/mm": { "version": "0.0.4", "resolved": "https://registry.npmjs.org/@tscircuit/mm/-/mm-0.0.4.tgz", @@ -954,9 +971,9 @@ } }, "node_modules/@tscircuit/react-fiber": { - "version": "1.0.35", - "resolved": "https://registry.npmjs.org/@tscircuit/react-fiber/-/react-fiber-1.0.35.tgz", - "integrity": "sha512-VGtzN70TvOX7qwajJ2/hYlGcA3bdlulVZndF4APf1+tMVS+MMATKH6luN8ym/97Qh8a0KWBgpGBVEnXYBv0prA==", + "version": "1.0.39", + "resolved": "https://registry.npmjs.org/@tscircuit/react-fiber/-/react-fiber-1.0.39.tgz", + "integrity": "sha512-xdEghvKDm9xr5j+zvEH8VVLj6haYCsQ5V8vNOyuXLoc63o7B/Maibsp5Yf6DdoC+SsxYYdZIt8cc0lAj7REfFg==", "dependencies": { "react-reconciler": "^0.29.0" }, @@ -974,10 +991,31 @@ "react-error-boundary": "^4.0.11" } }, + "node_modules/@tscircuit/schematic-autolayout": { + "version": "0.0.5", + "resolved": "https://registry.npmjs.org/@tscircuit/schematic-autolayout/-/schematic-autolayout-0.0.5.tgz", + "integrity": "sha512-I4CtLQfqTPTxDSumnquaJtkJkc16VjLC4bwU3jQdBXwwh9ODzBf88clUznUtDDzwV+BPM5P0W0VCfFhvPL3/Cw==", + "dependencies": { + "react": "^18.2.0", + "react-dom": "^18.2.0", + "react-supergrid": "^1.0.10", + "transformation-matrix": "^2.16.1", + "use-mouse-matrix-transform": "^1.1.12" + } + }, + "node_modules/@tscircuit/soup-util": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/@tscircuit/soup-util/-/soup-util-0.0.1.tgz", + "integrity": "sha512-hNJayJ/Z+Clms1uAv8j6TCkK2aVNrm/C0PnAUcbSMY3gZfA+os7ovTxS/hCJfC22K4wHoBwsbZ+mE8R3KxaFfQ==", + "peerDependencies": { + "@tscircuit/builder": "*", + "zod": "*" + } + }, "node_modules/@tscircuit/sparkfun-packages": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@tscircuit/sparkfun-packages/-/sparkfun-packages-1.2.0.tgz", - "integrity": "sha512-m+jCOaSBpwRzUN5trc9z5f8yh2zzLITANgNhuNQOtxNZRIrv98iYfL3dSSmf73xknh0Nz68EephNvKVZmproCQ==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@tscircuit/sparkfun-packages/-/sparkfun-packages-1.2.1.tgz", + "integrity": "sha512-2HzmmHydo5vgoKmNBAHd6RD93LaIMXRSt6t//1zx19/ZwrOA43qVOvb7cCTA82GHib1bSxoL7bqgii9sYudCHw==", "dependencies": { "change-case": "^5.4.3" } @@ -2028,9 +2066,9 @@ } }, "node_modules/code-block-writer": { - "version": "12.0.0", - "resolved": "https://registry.npmjs.org/code-block-writer/-/code-block-writer-12.0.0.tgz", - "integrity": "sha512-q4dMFMlXtKR3XNBHyMHt/3pwYNA69EDk00lloMOaaUMKPUXBw6lpXtbu3MMVG6/uOihGnRDOlkyqsONEUj60+w==" + "version": "13.0.1", + "resolved": "https://registry.npmjs.org/code-block-writer/-/code-block-writer-13.0.1.tgz", + "integrity": "sha512-c5or4P6erEA69TxaxTNcHUNcIn+oyxSRTOWV+pSYF+z4epXqNvwvJ70XPGjPNgue83oAFAPBRQYwpAJ/Hpe/Sg==" }, "node_modules/code-excerpt": { "version": "4.0.0", @@ -3069,6 +3107,22 @@ "node": ">=12" } }, + "node_modules/edgespec/node_modules/@ts-morph/common": { + "version": "0.22.0", + "resolved": "https://registry.npmjs.org/@ts-morph/common/-/common-0.22.0.tgz", + "integrity": "sha512-HqNBuV/oIlMKdkLshXd1zKBqNQCsuPEsgQOkfFQ/eUKjRlwndXW1AjN9LVkBEIukm00gGXSRmfkl0Wv5VXLnlw==", + "dependencies": { + "fast-glob": "^3.3.2", + "minimatch": "^9.0.3", + "mkdirp": "^3.0.1", + "path-browserify": "^1.0.1" + } + }, + "node_modules/edgespec/node_modules/code-block-writer": { + "version": "12.0.0", + "resolved": "https://registry.npmjs.org/code-block-writer/-/code-block-writer-12.0.0.tgz", + "integrity": "sha512-q4dMFMlXtKR3XNBHyMHt/3pwYNA69EDk00lloMOaaUMKPUXBw6lpXtbu3MMVG6/uOihGnRDOlkyqsONEUj60+w==" + }, "node_modules/edgespec/node_modules/esbuild": { "version": "0.19.12", "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.19.12.tgz", @@ -3106,6 +3160,29 @@ "@esbuild/win32-x64": "0.19.12" } }, + "node_modules/edgespec/node_modules/mkdirp": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-3.0.1.tgz", + "integrity": "sha512-+NsyUUAZDmo6YVHzL/stxSu3t9YS1iljliy3BSDrXJ/dkn1KYdmtZODGGjLcc9XLgVVpH4KshHB8XmZgMhaBXg==", + "bin": { + "mkdirp": "dist/cjs/src/bin.js" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/edgespec/node_modules/ts-morph": { + "version": "21.0.1", + "resolved": "https://registry.npmjs.org/ts-morph/-/ts-morph-21.0.1.tgz", + "integrity": "sha512-dbDtVdEAncKctzrVZ+Nr7kHpHkv+0JDJb2MjjpBaj8bFeCkePU9rHfMklmhuLFnpeq/EJZk2IhStY6NzqgjOkg==", + "dependencies": { + "@ts-morph/common": "~0.22.0", + "code-block-writer": "^12.0.0" + } + }, "node_modules/emittery": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/emittery/-/emittery-1.0.2.tgz", @@ -5130,9 +5207,9 @@ } }, "node_modules/react": { - "version": "18.2.0", - "resolved": "https://registry.npmjs.org/react/-/react-18.2.0.tgz", - "integrity": "sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ==", + "version": "18.3.1", + "resolved": "https://registry.npmjs.org/react/-/react-18.3.1.tgz", + "integrity": "sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ==", "dependencies": { "loose-envify": "^1.1.0" }, @@ -5140,6 +5217,18 @@ "node": ">=0.10.0" } }, + "node_modules/react-dom": { + "version": "18.3.1", + "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-18.3.1.tgz", + "integrity": "sha512-5m4nQKp+rZRb09LNH59GM4BxTh9251/ylbKIbpe7TpGxfJ+9kv6BLkLBXIjjspbgbnIBNqlI23tRnTWT0snUIw==", + "dependencies": { + "loose-envify": "^1.1.0", + "scheduler": "^0.23.2" + }, + "peerDependencies": { + "react": "^18.3.1" + } + }, "node_modules/react-error-boundary": { "version": "4.0.13", "resolved": "https://registry.npmjs.org/react-error-boundary/-/react-error-boundary-4.0.13.tgz", @@ -5166,6 +5255,16 @@ "react": "^18.2.0" } }, + "node_modules/react-supergrid": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/react-supergrid/-/react-supergrid-1.0.10.tgz", + "integrity": "sha512-dJd9wkH6BJkdfkv62EcRAIBn59e2wj58bJFVXiW/ZHQzxz20qIql63fTU2qFMOujXnBIDaMG0uTod67/mjEGeA==", + "peerDependencies": { + "react": "*", + "react-dom": "*", + "transformation-matrix": "*" + } + }, "node_modules/readable-stream": { "version": "3.6.2", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", @@ -5456,9 +5555,9 @@ ] }, "node_modules/scheduler": { - "version": "0.23.0", - "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.23.0.tgz", - "integrity": "sha512-CtuThmgHNg7zIZWAXi3AsyIzA3n4xx7aNyjwC2VJldO2LMVDhFK+63xGqq6CsJH4rTAt6/M+N4GhZiDYPx9eUw==", + "version": "0.23.2", + "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.23.2.tgz", + "integrity": "sha512-UOShsPwz7NrMUqhR6t0hWjFduvOzbtv7toDH1/hIrfRNIDBnnBWd0CwJTGvTpngVlmwGCdP9/Zl/tVrDqcuYzQ==", "dependencies": { "loose-envify": "^1.1.0" } @@ -6087,12 +6186,12 @@ "integrity": "sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==" }, "node_modules/ts-morph": { - "version": "21.0.1", - "resolved": "https://registry.npmjs.org/ts-morph/-/ts-morph-21.0.1.tgz", - "integrity": "sha512-dbDtVdEAncKctzrVZ+Nr7kHpHkv+0JDJb2MjjpBaj8bFeCkePU9rHfMklmhuLFnpeq/EJZk2IhStY6NzqgjOkg==", + "version": "22.0.0", + "resolved": "https://registry.npmjs.org/ts-morph/-/ts-morph-22.0.0.tgz", + "integrity": "sha512-M9MqFGZREyeb5fTl6gNHKZLqBQA0TjA1lea+CR48R8EBTDuWrNqW6ccC5QvjNR4s6wDumD3LTCjOFSp9iwlzaw==", "dependencies": { - "@ts-morph/common": "~0.22.0", - "code-block-writer": "^12.0.0" + "@ts-morph/common": "~0.23.0", + "code-block-writer": "^13.0.1" } }, "node_modules/tslib": { @@ -7048,6 +7147,17 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/use-mouse-matrix-transform": { + "version": "1.1.13", + "resolved": "https://registry.npmjs.org/use-mouse-matrix-transform/-/use-mouse-matrix-transform-1.1.13.tgz", + "integrity": "sha512-NsP0j0Ifv9TywhqrNGfIhjpGzuyEzPK553ahn+LBVvZHZ6Gv+2T3tn41pJV6Syos1W7crWKolbP+XLfqa5BpCQ==", + "dependencies": { + "transformation-matrix": "^2.14.0" + }, + "peerDependencies": { + "react": "^18.2.0" + } + }, "node_modules/util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", diff --git a/package.json b/package.json index b38971bf..b52c1c3e 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,8 @@ "bootstrap": "bun i && cd dev-server-api && bun i && cd ../dev-server-frontend && bun i", "bootstrap:ci": "bun i --frozen-lockfile && cd dev-server-api && bun i --frozen-lockfile && cd ../dev-server-frontend && bun i --frozen-lockfile", "start": "bun cli.ts", - "start:dev-server:dev": "TSCI_DEV_SERVER_DB=$(pwd)/.tscircuit/dev-server.sqlite concurrently 'cd dev-server-api && bun start' 'cd dev-server-frontend && bun start'", + "dev": "TSCI_DEV_SERVER_DB=$(pwd)/.tscircuit/dev-server.sqlite concurrently 'cd dev-server-api && bun run build && bun start' 'cd dev-server-frontend && bun start' 'bun run dev-with-test-project'", + "clear": "rm -rf .tscircuit", "start:dev-server": "bun build:dev-server && bun cli.ts dev -y --cwd ./tests/assets/example-project", "build:dev-server": "cd dev-server-api && bun run build && cd ../dev-server-frontend && bun run build", "build:dev-server:api": "cd dev-server-api && bun run build", @@ -17,7 +18,7 @@ "build": "bun build:dev-server && npm run build:cli", "dev-with-test-project": "bun cli.ts dev --cwd ./tests/assets/example-project", "test:init": "bun cli.ts init --dir ./tmp/test --name test", - "update-deps": "bun add @tscircuit/builder@latest @tscircuit/react-fiber@latest && cd dev-server-frontend && bun run update-deps" + "update-deps": "npm add @tscircuit/builder@latest @tscircuit/react-fiber@latest && cd dev-server-frontend && npm run update-deps && cd ../tests/assets/example-project && npm add @tscircuit/builder@latest @tscircuit/react-fiber@latest" }, "bin": { "tscircuit": "./dist/cli.js", @@ -35,8 +36,9 @@ "dependencies": { "@edge-runtime/primitives": "^4.1.0", "@hono/node-server": "^1.8.2", - "@tscircuit/builder": "1.5.72", - "@tscircuit/react-fiber": "^1.0.35", + "@tscircuit/builder": "^1.5.85", + "@tscircuit/react-fiber": "^1.0.39", + "@tscircuit/soup-util": "^0.0.1", "archiver": "^7.0.1", "axios": "^1.6.7", "better-sqlite3": "^9.4.3", @@ -49,6 +51,7 @@ "delay": "^6.0.0", "edgespec": "^0.0.69", "esbuild": "^0.20.2", + "fast-glob": "^3.3.2", "glob": "^10.3.10", "hono": "^4.1.0", "ignore": "^5.3.1", @@ -63,6 +66,7 @@ "prompts": "^2.4.2", "react": "^18.2.0", "semver": "^7.6.0", + "ts-morph": "^22.0.0", "tsup": "^8.0.2", "zod": "latest" }, diff --git a/tests/assets/example-project/examples/basic-bug.tsx b/tests/assets/example-project/examples/basic-bug.tsx index 4c1bdce4..64afd280 100644 --- a/tests/assets/example-project/examples/basic-bug.tsx +++ b/tests/assets/example-project/examples/basic-bug.tsx @@ -1,16 +1,22 @@ +import { layout } from "@tscircuit/layout" +import manual_edits from "../src/manual-edits" + export const BasicBug = () => ( - + + + ) diff --git a/tests/assets/example-project/package-lock.json b/tests/assets/example-project/package-lock.json index 20a09970..2175f21e 100644 --- a/tests/assets/example-project/package-lock.json +++ b/tests/assets/example-project/package-lock.json @@ -8,8 +8,8 @@ "name": "example-project", "version": "1.2.26", "dependencies": { - "@tscircuit/builder": "^1.5.61", - "@tscircuit/react-fiber": "^1.0.34" + "@tscircuit/builder": "^1.5.85", + "@tscircuit/react-fiber": "^1.0.39" } }, "node_modules/@babel/runtime": { @@ -29,14 +29,16 @@ "integrity": "sha512-iB+oaYyaVK1hQ0cODubnoSDg4gGYL9cp/4ad7G1b9Z0/IqehPztp5qE3KP2mV9Ns0UYmzwvtkEhTCmKUuhorbg==" }, "node_modules/@tscircuit/builder": { - "version": "1.5.61", - "resolved": "https://registry.npmjs.org/@tscircuit/builder/-/builder-1.5.61.tgz", - "integrity": "sha512-pkaIte2C6Kksp3B79eQIG5f0/9KO2x0fdkHe/a0757lMYVUbcSvqjanL7RmJJ983C2wnEMo2au5ycgXvZseMUQ==", + "version": "1.5.85", + "resolved": "https://registry.npmjs.org/@tscircuit/builder/-/builder-1.5.85.tgz", + "integrity": "sha512-QKLkkVGLCuhmN5YgWnpETRGyn3POp+92Eam3CDo0b4qrCYheV7DQoJ87HG4iAPr4WBvUy7NxtAPTeZRVOtccdA==", "dependencies": { "@lume/kiwi": "^0.1.0", "@tscircuit/footprints": "^0.0.14", + "@tscircuit/layout": "^0.0.7", "@tscircuit/routing": "^1.3.1", - "@tscircuit/sparkfun-packages": "^1.2.0", + "@tscircuit/schematic-autolayout": "^0.0.5", + "@tscircuit/sparkfun-packages": "^1.2.1", "convert-units": "^2.3.4", "fast-json-stable-stringify": "^2.1.0", "format-si-prefix": "^0.3.2", @@ -57,6 +59,18 @@ "typescript": "^5.0.0" } }, + "node_modules/@tscircuit/layout": { + "version": "0.0.7", + "resolved": "https://registry.npmjs.org/@tscircuit/layout/-/layout-0.0.7.tgz", + "integrity": "sha512-Jdd6j0+p4yK8zAqFX7dgmb5PT8A9KJduDBhEgAm+OgwDrw3Mp0hQ80pbR2Mvm02UF2Gu9H7TWpMytACCoNqPdA==", + "dependencies": { + "transformation-matrix": "^2.16.1" + }, + "peerDependencies": { + "@tscircuit/builder": "*", + "zod": "*" + } + }, "node_modules/@tscircuit/mm": { "version": "0.0.4", "resolved": "https://registry.npmjs.org/@tscircuit/mm/-/mm-0.0.4.tgz", @@ -69,9 +83,9 @@ } }, "node_modules/@tscircuit/react-fiber": { - "version": "1.0.34", - "resolved": "https://registry.npmjs.org/@tscircuit/react-fiber/-/react-fiber-1.0.34.tgz", - "integrity": "sha512-kI5oOe/dbJGbeWlInx239hXNWPIRMRTgD8pO9IXvAvZ4YOldR6CJanx9DuT5vgTcZTjoswaXJzRJZZB1Ib2jmw==", + "version": "1.0.39", + "resolved": "https://registry.npmjs.org/@tscircuit/react-fiber/-/react-fiber-1.0.39.tgz", + "integrity": "sha512-xdEghvKDm9xr5j+zvEH8VVLj6haYCsQ5V8vNOyuXLoc63o7B/Maibsp5Yf6DdoC+SsxYYdZIt8cc0lAj7REfFg==", "dependencies": { "react-reconciler": "^0.29.0" }, @@ -89,10 +103,22 @@ "react-error-boundary": "^4.0.11" } }, + "node_modules/@tscircuit/schematic-autolayout": { + "version": "0.0.5", + "resolved": "https://registry.npmjs.org/@tscircuit/schematic-autolayout/-/schematic-autolayout-0.0.5.tgz", + "integrity": "sha512-I4CtLQfqTPTxDSumnquaJtkJkc16VjLC4bwU3jQdBXwwh9ODzBf88clUznUtDDzwV+BPM5P0W0VCfFhvPL3/Cw==", + "dependencies": { + "react": "^18.2.0", + "react-dom": "^18.2.0", + "react-supergrid": "^1.0.10", + "transformation-matrix": "^2.16.1", + "use-mouse-matrix-transform": "^1.1.12" + } + }, "node_modules/@tscircuit/sparkfun-packages": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@tscircuit/sparkfun-packages/-/sparkfun-packages-1.2.0.tgz", - "integrity": "sha512-m+jCOaSBpwRzUN5trc9z5f8yh2zzLITANgNhuNQOtxNZRIrv98iYfL3dSSmf73xknh0Nz68EephNvKVZmproCQ==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@tscircuit/sparkfun-packages/-/sparkfun-packages-1.2.1.tgz", + "integrity": "sha512-2HzmmHydo5vgoKmNBAHd6RD93LaIMXRSt6t//1zx19/ZwrOA43qVOvb7cCTA82GHib1bSxoL7bqgii9sYudCHw==", "dependencies": { "change-case": "^5.4.3" } @@ -359,10 +385,9 @@ } }, "node_modules/react": { - "version": "18.2.0", - "resolved": "https://registry.npmjs.org/react/-/react-18.2.0.tgz", - "integrity": "sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ==", - "peer": true, + "version": "18.3.1", + "resolved": "https://registry.npmjs.org/react/-/react-18.3.1.tgz", + "integrity": "sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ==", "dependencies": { "loose-envify": "^1.1.0" }, @@ -370,6 +395,18 @@ "node": ">=0.10.0" } }, + "node_modules/react-dom": { + "version": "18.3.1", + "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-18.3.1.tgz", + "integrity": "sha512-5m4nQKp+rZRb09LNH59GM4BxTh9251/ylbKIbpe7TpGxfJ+9kv6BLkLBXIjjspbgbnIBNqlI23tRnTWT0snUIw==", + "dependencies": { + "loose-envify": "^1.1.0", + "scheduler": "^0.23.2" + }, + "peerDependencies": { + "react": "^18.3.1" + } + }, "node_modules/react-error-boundary": { "version": "4.0.13", "resolved": "https://registry.npmjs.org/react-error-boundary/-/react-error-boundary-4.0.13.tgz", @@ -396,6 +433,16 @@ "react": "^18.2.0" } }, + "node_modules/react-supergrid": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/react-supergrid/-/react-supergrid-1.0.10.tgz", + "integrity": "sha512-dJd9wkH6BJkdfkv62EcRAIBn59e2wj58bJFVXiW/ZHQzxz20qIql63fTU2qFMOujXnBIDaMG0uTod67/mjEGeA==", + "peerDependencies": { + "react": "*", + "react-dom": "*", + "transformation-matrix": "*" + } + }, "node_modules/rectilinear-router": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/rectilinear-router/-/rectilinear-router-1.0.1.tgz", @@ -419,9 +466,9 @@ } }, "node_modules/scheduler": { - "version": "0.23.0", - "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.23.0.tgz", - "integrity": "sha512-CtuThmgHNg7zIZWAXi3AsyIzA3n4xx7aNyjwC2VJldO2LMVDhFK+63xGqq6CsJH4rTAt6/M+N4GhZiDYPx9eUw==", + "version": "0.23.2", + "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.23.2.tgz", + "integrity": "sha512-UOShsPwz7NrMUqhR6t0hWjFduvOzbtv7toDH1/hIrfRNIDBnnBWd0CwJTGvTpngVlmwGCdP9/Zl/tVrDqcuYzQ==", "dependencies": { "loose-envify": "^1.1.0" } @@ -462,6 +509,26 @@ "engines": { "node": ">=14.17" } + }, + "node_modules/use-mouse-matrix-transform": { + "version": "1.1.13", + "resolved": "https://registry.npmjs.org/use-mouse-matrix-transform/-/use-mouse-matrix-transform-1.1.13.tgz", + "integrity": "sha512-NsP0j0Ifv9TywhqrNGfIhjpGzuyEzPK553ahn+LBVvZHZ6Gv+2T3tn41pJV6Syos1W7crWKolbP+XLfqa5BpCQ==", + "dependencies": { + "transformation-matrix": "^2.14.0" + }, + "peerDependencies": { + "react": "^18.2.0" + } + }, + "node_modules/zod": { + "version": "3.23.6", + "resolved": "https://registry.npmjs.org/zod/-/zod-3.23.6.tgz", + "integrity": "sha512-RTHJlZhsRbuA8Hmp/iNL7jnfc4nZishjsanDAfEY1QpDQZCahUp3xDzl+zfweE9BklxMUcgBgS1b7Lvie/ZVwA==", + "peer": true, + "funding": { + "url": "https://github.com/sponsors/colinhacks" + } } } } diff --git a/tests/assets/example-project/package.json b/tests/assets/example-project/package.json index 43342b1f..761811f0 100644 --- a/tests/assets/example-project/package.json +++ b/tests/assets/example-project/package.json @@ -4,7 +4,7 @@ "type": "module", "main": "dist/index.js", "dependencies": { - "@tscircuit/builder": "^1.5.61", - "@tscircuit/react-fiber": "^1.0.34" + "@tscircuit/builder": "^1.5.85", + "@tscircuit/react-fiber": "^1.0.39" } } diff --git a/tests/assets/example-project/src/MyCircuit.tsx b/tests/assets/example-project/src/MyCircuit.tsx index 088144a9..03359134 100644 --- a/tests/assets/example-project/src/MyCircuit.tsx +++ b/tests/assets/example-project/src/MyCircuit.tsx @@ -1,7 +1,15 @@ import "@tscircuit/react-fiber" +import { layout } from "@tscircuit/layout" +import manual_edits from "./manual-edits" export const MyCircuit = () => ( - +