@tscircuit/cli 0.0.46 → 0.0.48
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 +8 -8
- package/lib/get-program.ts +35 -54
- package/package.json +1 -1
package/lib/get-program.ts
CHANGED
|
@@ -3,29 +3,47 @@ import packageJson from "../package.json"
|
|
|
3
3
|
import { AppContext } from "./util/app-context"
|
|
4
4
|
import * as CMDFN from "lib/cmd-fns"
|
|
5
5
|
|
|
6
|
-
// | Endpoint | Description |
|
|
7
|
-
// | ------------------------------------- | ---------------------------- |
|
|
8
|
-
// | /packages/search | Search for packages |
|
|
9
|
-
// | /packages/list | List packages with a filter |
|
|
10
|
-
// | /packages/get | Get a package by id or name |
|
|
11
|
-
// | /packages/create | Create a new package |
|
|
12
|
-
// | /package_releases/list | List package releases |
|
|
13
|
-
// | /package_releases/get | Get a package release by id |
|
|
14
|
-
// | /package_releases/create | Create a new package release |
|
|
15
|
-
// | /package_files/list | List package files |
|
|
16
|
-
// | /package_files/get | Get a package file by id |
|
|
17
|
-
// | /package_files/download | Download a package file |
|
|
18
|
-
// | /package_files/create | Create a new package file |
|
|
19
|
-
// | /package_examples/list | List package examples |
|
|
20
|
-
// | /package_examples/get | Get a package example by id |
|
|
21
|
-
// | /package_examples/create | Create a new package example |
|
|
22
|
-
|
|
23
6
|
export const getProgram = (ctx: AppContext) => {
|
|
24
7
|
const cmd = new Command("tsci").description(
|
|
25
8
|
"Develop, test and manage tscircuit packages"
|
|
26
9
|
)
|
|
27
10
|
|
|
28
11
|
cmd
|
|
12
|
+
.command("dev")
|
|
13
|
+
.description("Run development server in current directory")
|
|
14
|
+
.option("--cwd <cwd>", "Current working directory")
|
|
15
|
+
.option("--port <port>", "Port to run dev server on")
|
|
16
|
+
.action((args) => CMDFN.dev(ctx, args))
|
|
17
|
+
|
|
18
|
+
cmd
|
|
19
|
+
.command("init")
|
|
20
|
+
.description("Initialize a new tscircuit project")
|
|
21
|
+
.option("--name <name>", "Name of the project")
|
|
22
|
+
.option(
|
|
23
|
+
"--runtime <runtime>",
|
|
24
|
+
"Runtime to use (attempts to bun, otherwise node/tsx)"
|
|
25
|
+
)
|
|
26
|
+
.option(
|
|
27
|
+
"--dir <dir>",
|
|
28
|
+
"Directory to initialize (defaults to ./<name> or . if name not provided)"
|
|
29
|
+
)
|
|
30
|
+
.action((args) => CMDFN.init(ctx, args))
|
|
31
|
+
|
|
32
|
+
cmd
|
|
33
|
+
.command("add")
|
|
34
|
+
.description("Add a package from the tscircuit registry")
|
|
35
|
+
.argument(
|
|
36
|
+
"<packages...>",
|
|
37
|
+
"Packages to install from registry.tscircuit.com, optionally with version"
|
|
38
|
+
)
|
|
39
|
+
.option("-D, --dev", "Add to devDependencies")
|
|
40
|
+
.action((packages, flags) => CMDFN.add(ctx, { packages, flags }))
|
|
41
|
+
|
|
42
|
+
cmd
|
|
43
|
+
.command("remove")
|
|
44
|
+
.description("Remove/uninstall a package")
|
|
45
|
+
.argument("<packages...>", "Packages to remove")
|
|
46
|
+
.action((packages, flags) => CMDFN.remove(ctx, { packages, flags }))
|
|
29
47
|
|
|
30
48
|
const authCmd = cmd.command("auth").description("Login/logout")
|
|
31
49
|
authCmd
|
|
@@ -243,43 +261,6 @@ export const getProgram = (ctx: AppContext) => {
|
|
|
243
261
|
)
|
|
244
262
|
.action((args) => CMDFN.soupify(ctx, args))
|
|
245
263
|
|
|
246
|
-
cmd
|
|
247
|
-
.command("dev")
|
|
248
|
-
.description("Run development server in current directory")
|
|
249
|
-
.option("--cwd <cwd>", "Current working directory")
|
|
250
|
-
.option("--port <port>", "Port to run dev server on")
|
|
251
|
-
.action((args) => CMDFN.dev(ctx, args))
|
|
252
|
-
|
|
253
|
-
cmd
|
|
254
|
-
.command("init")
|
|
255
|
-
.description("Initialize a new tscircuit project")
|
|
256
|
-
.option("--name <name>", "Name of the project")
|
|
257
|
-
.option(
|
|
258
|
-
"--runtime <runtime>",
|
|
259
|
-
"Runtime to use (attempts to bun, otherwise node/tsx)"
|
|
260
|
-
)
|
|
261
|
-
.option(
|
|
262
|
-
"--dir <dir>",
|
|
263
|
-
"Directory to initialize (defaults to ./<name> or . if name not provided)"
|
|
264
|
-
)
|
|
265
|
-
.action((args) => CMDFN.init(ctx, args))
|
|
266
|
-
|
|
267
|
-
cmd
|
|
268
|
-
.command("add")
|
|
269
|
-
.description("Add a package from the tscircuit registry")
|
|
270
|
-
.argument(
|
|
271
|
-
"<packages...>",
|
|
272
|
-
"Packages to install from registry.tscircuit.com, optionally with version"
|
|
273
|
-
)
|
|
274
|
-
.option("-D, --dev", "Add to devDependencies")
|
|
275
|
-
.action((packages, flags) => CMDFN.add(ctx, { packages, flags }))
|
|
276
|
-
|
|
277
|
-
cmd
|
|
278
|
-
.command("remove")
|
|
279
|
-
.description("Remove/uninstall a package")
|
|
280
|
-
.argument("<packages...>", "Packages to remove")
|
|
281
|
-
.action((packages, flags) => CMDFN.remove(ctx, { packages, flags }))
|
|
282
|
-
|
|
283
264
|
cmd
|
|
284
265
|
.command("install")
|
|
285
266
|
.description("Install a package from the tscircuit registry")
|