@tscircuit/eval 0.0.335 → 0.0.337

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tscircuit/eval",
3
3
  "main": "dist/lib/index.js",
4
- "version": "0.0.335",
4
+ "version": "0.0.337",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "build": "bun run build:lib && bun run build:webworker && bun run build:blob-url && bun run build:runner && bun run build:worker-wrapper",
@@ -56,7 +56,7 @@
56
56
  "@tscircuit/checks": "^0.0.75",
57
57
  "@tscircuit/circuit-json-flex": "^0.0.3",
58
58
  "@tscircuit/circuit-json-util": "^0.0.67",
59
- "@tscircuit/core": "^0.0.741",
59
+ "@tscircuit/core": "^0.0.745",
60
60
  "@tscircuit/footprinter": "^0.0.236",
61
61
  "@tscircuit/import-snippet": "^0.0.4",
62
62
  "@tscircuit/infgrid-ijump-astar": "^0.0.33",
@@ -81,11 +81,11 @@
81
81
  "bun-match-svg": "0.0.12",
82
82
  "calculate-elbow": "^0.0.12",
83
83
  "chokidar-cli": "^3.0.0",
84
- "circuit-json": "^0.0.261",
84
+ "circuit-json": "^0.0.265",
85
85
  "circuit-json-to-bpc": "^0.0.13",
86
86
  "circuit-json-to-connectivity-map": "^0.0.22",
87
87
  "circuit-json-to-simple-3d": "^0.0.9",
88
- "circuit-to-svg": "^0.0.197",
88
+ "circuit-to-svg": "^0.0.200",
89
89
  "comlink": "^4.4.2",
90
90
  "concurrently": "^9.1.2",
91
91
  "connectivity-map": "^1.0.0",
@@ -0,0 +1,31 @@
1
+ import { createCircuitWebWorker } from "lib"
2
+ import { expect, test } from "bun:test"
3
+
4
+ test("support backwards compat for the `.ts` extension files", async () => {
5
+ const circuitWebWorker = await createCircuitWebWorker({
6
+ webWorkerUrl: new URL("../../webworker/entrypoint.ts", import.meta.url),
7
+ })
8
+
9
+ await circuitWebWorker.executeWithFsMap({
10
+ fsMap: {
11
+ "index.ts": `
12
+ circuit.add(
13
+ <board width="10mm" height="10mm">
14
+ <resistor name="R1" resistance="1k" />
15
+ </board>
16
+ )
17
+ `,
18
+ },
19
+ entrypoint: "index.ts",
20
+ })
21
+
22
+ await circuitWebWorker.renderUntilSettled()
23
+
24
+ const circuitJson = await circuitWebWorker.getCircuitJson()
25
+
26
+ const component = circuitJson.find((el: any) => el.name === "R1")
27
+ expect(component).toBeDefined()
28
+ expect(component?.type).toBe("source_component")
29
+
30
+ await circuitWebWorker.kill()
31
+ })
@@ -1,7 +1,7 @@
1
1
  import { transform, type Transform as SucraseTransform } from "sucrase"
2
2
 
3
3
  const TS_EXTENSIONS = new Set([".ts", ".tsx", ".mts", ".cts"])
4
- const JSX_EXTENSIONS = new Set([".tsx", ".jsx"])
4
+ const JSX_EXTENSIONS = new Set([".tsx", ".jsx", ".ts"])
5
5
 
6
6
  const stripQueryAndHash = (filePath: string) => {
7
7
  const queryIndex = filePath.indexOf("?")