@tscircuit/cli 0.0.241 → 0.0.243

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 CHANGED
Binary file
package/cli/cli.ts CHANGED
@@ -1,14 +1,13 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  import kleur from "kleur"
4
- import { AppContext } from "./lib/util/app-context"
5
4
  import { createContextAndRunProgram } from "./lib/util/create-context-and-run-program"
6
5
 
7
6
  async function main() {
8
7
  await createContextAndRunProgram(process.argv)
9
8
  }
10
9
 
11
- main().catch((e: any) => {
12
- console.log(kleur.gray(e.stack))
10
+ main().catch((e: Error) => {
11
+ console.log(kleur.gray(e.stack ?? ""))
13
12
  console.log(kleur.red(`Error running CLI: ${e.toString()}`))
14
13
  })
@@ -1,9 +1,12 @@
1
1
  import { AxiosInstance } from "axios"
2
- import Configstore from "configstore"
3
2
  import { ContextConfigProps } from "cli/lib/create-config-manager"
4
3
 
5
4
  export type AppContext = {
6
- args: any
5
+ args: {
6
+ cmd: string[]
7
+ yes: boolean
8
+ help: boolean | undefined
9
+ }
7
10
  cwd: string
8
11
  cmd: string[]
9
12
  params: Record<string, any>
@@ -18,7 +18,7 @@ export type CliArgs = {
18
18
  help?: boolean
19
19
  }
20
20
 
21
- export const createContextAndRunProgram = async (process_args: any) => {
21
+ export const createContextAndRunProgram = async (process_args: string[]) => {
22
22
  const args = minimist(process_args)
23
23
 
24
24
  const { global_config, profile_config, current_profile } =
@@ -56,8 +56,8 @@ const ensureNodeModulesIgnored = async () => {
56
56
  if (!gitignore.includes("node_modules/")) {
57
57
  await fs.appendFile(gitignorePath, "\nnode_modules/\n")
58
58
  }
59
- } catch (err: any) {
60
- if (err.code === "ENOENT") {
59
+ } catch (err) {
60
+ if ((err as NodeJS.ErrnoException).code === "ENOENT") {
61
61
  await fs.writeFile(gitignorePath, "node_modules/\n")
62
62
  } else {
63
63
  console.error("Error while updating .gitignore:", err)