@tscircuit/cli 0.0.92 → 0.0.94

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.
@@ -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
- console.log(`@tscircuit/cli@${cliPackageJson.version}`)
11
- console.log(
12
- `@tscircuit/react-fiber@${cliPackageJson.dependencies["@tscircuit/react-fiber"]}`
13
- )
14
- console.log(
15
- `@tscircuit/schematic-viewer@${frontendPackageJson.dependencies["@tscircuit/schematic-viewer"]}`
16
- )
17
- console.log(
18
- `@tscircuit/pcb-viewer@${frontendPackageJson.dependencies["@tscircuit/pcb-viewer"]}`
19
- )
20
- console.log(
21
- `@tscircuit/builder@${cliPackageJson.dependencies["@tscircuit/builder"]}`
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
  }
@@ -240,6 +240,7 @@ export const getProgram = (ctx: AppContext) => {
240
240
  cmd
241
241
  .command("version")
242
242
  .description("Print current version")
243
+ .option("--show-latest", "Show latest versions of dependencies")
243
244
  .action((args) => CMDFN.version(ctx, args))
244
245
 
245
246
  cmd
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tscircuit/cli",
3
- "version": "0.0.92",
3
+ "version": "0.0.94",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "description": "Command line tool for developing, publishing and installing tscircuit circuits",