@tscircuit/cli 0.0.134 → 0.0.136
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/dist/cli.js +13 -7
- package/lib/get-program.ts +1 -0
- package/lib/soupify.ts +5 -3
- package/lib/util/create-context-and-run-program.ts +5 -0
- package/package.json +1 -1
package/lib/get-program.ts
CHANGED
|
@@ -13,6 +13,7 @@ export const getProgram = (ctx: AppContext) => {
|
|
|
13
13
|
.description("Run development server in current directory")
|
|
14
14
|
.option("--cwd <cwd>", "Current working directory")
|
|
15
15
|
.option("--port <port>", "Port to run dev server on")
|
|
16
|
+
.option("--no-cleanup", "Don't cleanup temporary files (for debugging)")
|
|
16
17
|
.action((args) => CMDFN.dev(ctx, args))
|
|
17
18
|
|
|
18
19
|
cmd
|
package/lib/soupify.ts
CHANGED
|
@@ -18,7 +18,7 @@ export const soupify = async (
|
|
|
18
18
|
filePath: string
|
|
19
19
|
exportName?: string
|
|
20
20
|
},
|
|
21
|
-
ctx:
|
|
21
|
+
ctx: Pick<AppContext, "runtime" | "params">
|
|
22
22
|
) => {
|
|
23
23
|
debug(`reading ${filePath}`)
|
|
24
24
|
const targetFileContent = await readFile(filePath, "utf-8")
|
|
@@ -89,8 +89,10 @@ console.log(JSON.stringify(elements))
|
|
|
89
89
|
const rawSoup = processResult.stdout.replace(/^[^\[]*/, "")
|
|
90
90
|
const errText = processResult.stderr
|
|
91
91
|
|
|
92
|
-
|
|
93
|
-
|
|
92
|
+
if (ctx.params.cleanup !== false) {
|
|
93
|
+
debug(`deleting ${tmpFilePath}`)
|
|
94
|
+
await unlink(tmpFilePath)
|
|
95
|
+
}
|
|
94
96
|
|
|
95
97
|
try {
|
|
96
98
|
debug(`parsing result of soupify...`)
|
|
@@ -81,6 +81,11 @@ export const createContextAndRunProgram = async (process_args: any) => {
|
|
|
81
81
|
}
|
|
82
82
|
// end ignores ---
|
|
83
83
|
|
|
84
|
+
if (err.response?.status === 401) {
|
|
85
|
+
console.log(kleur.red("Authentication failed. Please run 'tsci login' to authenticate yourself."))
|
|
86
|
+
process.exit(1)
|
|
87
|
+
}
|
|
88
|
+
|
|
84
89
|
console.log(
|
|
85
90
|
kleur.red(
|
|
86
91
|
`[ERR] ${err.response?.status} ${err.config.method?.toUpperCase()} ${
|