@tscircuit/cli 0.0.93 → 0.0.95
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/bun.lockb +0 -0
- package/dist/cli.js +34 -10
- package/lib/cmd-fns/version.ts +33 -13
- package/lib/get-program.ts +1 -0
- package/lib/util/create-context-and-run-program.ts +6 -0
- package/package.json +2 -2
package/lib/cmd-fns/version.ts
CHANGED
|
@@ -7,17 +7,37 @@ export const versionCmd = async (ctx: AppContext, args: any) => {
|
|
|
7
7
|
console.log(`tscircuit@${(global as any).TSCIRCUIT_VERSION}`)
|
|
8
8
|
console.log("")
|
|
9
9
|
}
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
)
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
10
|
+
|
|
11
|
+
const table: { name: string; current: string; latest?: string }[] = []
|
|
12
|
+
|
|
13
|
+
table.push({ name: "@tscircuit/cli", current: cliPackageJson.version })
|
|
14
|
+
table.push({
|
|
15
|
+
name: "@tscircuit/react-fiber",
|
|
16
|
+
current: cliPackageJson.dependencies["@tscircuit/react-fiber"],
|
|
17
|
+
})
|
|
18
|
+
table.push({
|
|
19
|
+
name: "@tscircuit/schematic-viewer",
|
|
20
|
+
current: frontendPackageJson.dependencies["@tscircuit/schematic-viewer"],
|
|
21
|
+
})
|
|
22
|
+
table.push({
|
|
23
|
+
name: "@tscircuit/pcb-viewer",
|
|
24
|
+
current: frontendPackageJson.dependencies["@tscircuit/pcb-viewer"],
|
|
25
|
+
})
|
|
26
|
+
table.push({
|
|
27
|
+
name: "@tscircuit/builder",
|
|
28
|
+
current: cliPackageJson.dependencies["@tscircuit/builder"],
|
|
29
|
+
})
|
|
30
|
+
|
|
31
|
+
if (args.showLatest) {
|
|
32
|
+
// Get the latest version for each package
|
|
33
|
+
for (const row of table) {
|
|
34
|
+
const { name } = row
|
|
35
|
+
const { data: packageInfo } = await ctx.axios.get(
|
|
36
|
+
"https://registry.npmjs.org/" + name
|
|
37
|
+
)
|
|
38
|
+
row.latest = packageInfo["dist-tags"].latest
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
console.table(table)
|
|
23
43
|
}
|
package/lib/get-program.ts
CHANGED
|
@@ -122,6 +122,12 @@ export const createContextAndRunProgram = async (process_args: any) => {
|
|
|
122
122
|
process.exit(0)
|
|
123
123
|
}
|
|
124
124
|
|
|
125
|
+
// HACK: Fixes issue with tsci version --show-latest
|
|
126
|
+
if (args_without_globals.includes("--show_latest")) {
|
|
127
|
+
args_without_globals[args_without_globals.indexOf("--show_latest")] =
|
|
128
|
+
"--show-latest"
|
|
129
|
+
}
|
|
130
|
+
|
|
125
131
|
await perfectCli(getProgram(ctx), args_without_globals, {
|
|
126
132
|
async customParamHandler({ commandPath, optionName }, { prompts }) {
|
|
127
133
|
let optionNameHandler =
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tscircuit/cli",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.95",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "Command line tool for developing, publishing and installing tscircuit circuits",
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"minimist": "^1.2.8",
|
|
62
62
|
"node-persist": "^4.0.1",
|
|
63
63
|
"open": "^10.1.0",
|
|
64
|
-
"perfect-cli": "1.0.20",
|
|
64
|
+
"perfect-cli": "^1.0.20",
|
|
65
65
|
"prompts": "^2.4.2",
|
|
66
66
|
"react": "^18.2.0",
|
|
67
67
|
"semver": "^7.6.0",
|