@tscircuit/cli 0.0.65 → 0.0.66

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/lib/soupify.ts CHANGED
@@ -6,6 +6,9 @@ import { unlink } from "node:fs/promises"
6
6
  import kleur from "kleur"
7
7
  import { writeFileSync } from "fs"
8
8
  import { readFile } from "fs/promises"
9
+ import Debug from "debug"
10
+
11
+ const debug = Debug("tscircuit:soupify")
9
12
 
10
13
  export const soupify = async (
11
14
  {
@@ -17,6 +20,7 @@ export const soupify = async (
17
20
  },
18
21
  ctx: { runtime: "node" | "bun" }
19
22
  ) => {
23
+ debug(`reading ${filePath}`)
20
24
  const targetFileContent = await readFile(filePath, "utf-8")
21
25
 
22
26
  if (!exportName) {
@@ -43,6 +47,7 @@ export const soupify = async (
43
47
  Path.basename(filePath).replace(/\.[^\.]+$/, "") + ".__tmp_entrypoint.tsx"
44
48
  )
45
49
 
50
+ debug(`writing to ${tmpFilePath}`)
46
51
  writeFileSync(
47
52
  tmpFilePath,
48
53
  `
@@ -69,20 +74,24 @@ console.log(JSON.stringify(elements))
69
74
  `.trim()
70
75
  )
71
76
 
77
+ debug(`using runtime ${ctx.runtime}`)
72
78
  const processCmdPart1 =
73
79
  ctx.runtime === "node" ? $`npx tsx ${tmpFilePath}` : $`bun ${tmpFilePath}`
74
80
 
81
+ debug(`starting process....`)
75
82
  const processResult = await processCmdPart1
76
- .stdout("piped")
77
- .stderr("piped")
83
+ .stdout("inheritPiped")
84
+ .stderr("inheritPiped")
78
85
  .noThrow()
79
86
 
80
87
  const rawSoup = processResult.stdout
81
88
  const errText = processResult.stderr
82
89
 
90
+ debug(`deleting ${tmpFilePath}`)
83
91
  await unlink(tmpFilePath)
84
92
 
85
93
  try {
94
+ debug(`parsing result of soupify...`)
86
95
  const soup = JSON.parse(rawSoup)
87
96
 
88
97
  if (soup.COMPILE_ERROR) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tscircuit/cli",
3
- "version": "0.0.65",
3
+ "version": "0.0.66",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "description": "Command line tool for developing, publishing and installing tscircuit circuits",
@@ -45,6 +45,7 @@
45
45
  "configstore": "^6.0.0",
46
46
  "dargs": "^8.1.0",
47
47
  "dax-sh": "^0.39.2",
48
+ "debug": "^4.3.4",
48
49
  "delay": "^6.0.0",
49
50
  "edgespec": "^0.0.69",
50
51
  "esbuild": "^0.20.2",
@@ -69,6 +70,7 @@
69
70
  "@types/bun": "^1.0.8",
70
71
  "@types/chokidar": "^2.1.3",
71
72
  "@types/configstore": "^6.0.2",
73
+ "@types/debug": "^4.1.12",
72
74
  "@types/lodash": "^4.14.202",
73
75
  "@types/mime-types": "^2.1.4",
74
76
  "@types/minimist": "^1.2.5",