Skip to content
This repository has been archived by the owner on Jan 2, 2025. It is now read-only.

Commit

Permalink
improve version command
Browse files Browse the repository at this point in the history
  • Loading branch information
seveibar committed Mar 19, 2024
1 parent 6bd14fa commit 96c1905
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
21 changes: 19 additions & 2 deletions lib/cmd-fns/version.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,23 @@
import { AppContext } from "lib/util/app-context"
import packageJson from "./../../package.json"
import cliPackageJson from "./../../package.json"
import frontendPackageJson from "dev-server-frontend/package.json"

export const versionCmd = async (ctx: AppContext, args: any) => {
console.log(`tsci v${packageJson.version}`)
const tscircuitPackageJson = await import(
"tscircuit/package.json" as any
).catch((e) => ({ version: "" }))
const reactFiberPackageJson = await import(
"@tscircuit/react-fiber/package.json"
).catch((e) => ({ version: "" }))
if (tscircuitPackageJson.version) {
console.log(`tscircuit@${cliPackageJson.version}`)
}
console.log(`@tscircuit/cli@${cliPackageJson.version}`)
console.log(`@tscircuit/react-fiber@${reactFiberPackageJson.version}`)
console.log(
`@tscircuit/schematic-viewer@${frontendPackageJson.dependencies["@tscircuit/schematic-viewer"]}`
)
console.log(
`@tscircuit/pcb-viewer@${frontendPackageJson.dependencies["@tscircuit/pcb-viewer"]}`
)
}
2 changes: 1 addition & 1 deletion lib/get-program.ts
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ export const getProgram = (ctx: AppContext) => {
.option("--lock", "Lock the release after publishing to prevent changes")
.action((args) => CMDFN.publish(ctx, args))

cmd.command("version").action(() => CMDFN.version(ctx, args))
cmd.command("version").action((args) => CMDFN.version(ctx, args))

cmd.command("login").action((args) => CMDFN.authLogin(ctx, args))
cmd.command("logout").action((args) => CMDFN.authLogout(ctx, args))
Expand Down

0 comments on commit 96c1905

Please sign in to comment.