@tscircuit/cli 0.0.183 → 0.0.185
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/typecheck.yml +1 -1
- package/bun.lockb +0 -0
- package/cli/lib/cmd-fns/version.ts +2 -2
- package/cli/lib/soupify/soupify-with-core.ts +21 -4
- package/cli/lib/soupify/soupify.ts +1 -1
- package/dist/cli.js +30 -15
- package/example-project/examples/basic-capacitor.tsx +3 -1
- package/example-project/examples/macrokeypad.tsx +10 -0
- package/example-project/src/SwitchShaft.tsx +55 -0
- package/frontend/views/HeaderMenu.tsx +0 -7
- package/package.json +3 -5
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/
|
|
15
|
-
current: cliPackageJson.dependencies["@tscircuit/
|
|
14
|
+
name: "@tscircuit/core",
|
|
15
|
+
current: cliPackageJson.dependencies["@tscircuit/core"],
|
|
16
16
|
})
|
|
17
17
|
table.push({
|
|
18
18
|
name: "@tscircuit/schematic-viewer",
|
|
@@ -32,17 +32,34 @@ export const soupifyWithCore = async (
|
|
|
32
32
|
tmpEntrypointPath,
|
|
33
33
|
`
|
|
34
34
|
import React from "react"
|
|
35
|
-
import {
|
|
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
|
|
41
|
+
const project = new Circuit()
|
|
42
42
|
|
|
43
|
-
|
|
43
|
+
try {
|
|
44
|
+
project.add(<Component />)
|
|
45
|
+
} catch (e: any) {
|
|
46
|
+
console.log(e.toString())
|
|
47
|
+
writeFileSync("[during .add()] ${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)
|