@tscircuit/cli 0.0.184 → 0.0.186

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.
@@ -25,5 +25,5 @@ jobs:
25
25
  - name: Build (required for dist imports)
26
26
  run: bun run build
27
27
 
28
- - name: Run format check
28
+ - name: Run type check
29
29
  run: bunx tsc --noEmit
package/bun.lockb CHANGED
Binary file
@@ -11,8 +11,8 @@ export const versionCmd = async (ctx: AppContext, args: any) => {
11
11
 
12
12
  table.push({ name: "@tscircuit/cli", current: cliPackageJson.version })
13
13
  table.push({
14
- name: "@tscircuit/react-fiber",
15
- current: cliPackageJson.dependencies["@tscircuit/react-fiber"],
14
+ name: "@tscircuit/core",
15
+ current: cliPackageJson.dependencies["@tscircuit/core"],
16
16
  })
17
17
  table.push({
18
18
  name: "@tscircuit/schematic-viewer",
@@ -1,11 +1,11 @@
1
1
  import Path from "node:path"
2
2
 
3
3
  export const getTmpEntrypointFilePath = (filePath: string) => {
4
- const tmpEntrypointPath = Path.join(
4
+ const tmpEntrypointPath = Path.resolve(
5
5
  Path.dirname(filePath),
6
6
  Path.basename(filePath).replace(/\.[^\.]+$/, "") + ".__tmp_entrypoint.tsx",
7
7
  )
8
- const tmpOutputPath = Path.join(
8
+ const tmpOutputPath = Path.resolve(
9
9
  Path.dirname(filePath),
10
10
  Path.basename(filePath).replace(/\.[^\.]+$/, "") + ".__tmp_output.json",
11
11
  )
@@ -32,17 +32,34 @@ export const soupifyWithCore = async (
32
32
  tmpEntrypointPath,
33
33
  `
34
34
  import React from "react"
35
- import { Project } from "@tscircuit/core"
35
+ import { Circuit } from "@tscircuit/core"
36
36
  import * as EXPORTS from "./${Path.basename(filePath)}"
37
37
  import { writeFileSync } from "node:fs"
38
38
 
39
39
  const Component = EXPORTS["${exportName}"]
40
40
 
41
- const project = new Project()
41
+ const project = new Circuit()
42
42
 
43
- project.add(<Component />)
43
+ try {
44
+ project.add(<Component />)
45
+ } catch (e: any) {
46
+ console.log("[during .add()] ", e.toString())
47
+ writeFileSync("${tmpOutputPath}", JSON.stringify({
48
+ COMPILE_ERROR: e.toString() + "\\n\\n" + e.stack,
49
+ }))
50
+ throw e
51
+ }
52
+
53
+ try {
54
+ project.render()
55
+ } catch (e: any) {
56
+ console.log(e.toString())
57
+ writeFileSync("${tmpOutputPath}", JSON.stringify({
58
+ COMPILE_ERROR: e.toString() + "\\n\\n" + e.stack,
59
+ }))
60
+ throw e
61
+ }
44
62
 
45
- project.render()
46
63
 
47
64
  writeFileSync("${tmpOutputPath}", JSON.stringify(project.getCircuitJson()))
48
65
  `.trim(),
@@ -26,7 +26,7 @@ export const soupifyWithBuilder = async (
26
26
  },
27
27
  ctx: Pick<AppContext, "runtime" | "params">,
28
28
  ) => {
29
- let { filePath, exportName, useCore } = params
29
+ let { filePath, exportName, useCore = true } = params
30
30
  if (useCore) return soupifyWithCore(params, ctx)
31
31
 
32
32
  exportName ??= await getExportNameFromFile(filePath)