@tscircuit/cli 0.0.2 → 0.0.3
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/README.md +17 -18
- package/lib/cmd-fns/config-reveal-location.ts +1 -1
- package/lib/cmd-fns/{dev.ts → dev/index.ts} +3 -3
- package/lib/cmd-fns/index.ts +1 -1
- package/lib/get-program.ts +2 -2
- package/lib/util/create-context-and-run-program.ts +1 -1
- package/package.json +3 -2
- package/tests/assets/example-project/examples/basic-capacitor.tsx +3 -1
- package/tests/assets/example-project/src/MyCircuit.tsx +3 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
# `
|
|
1
|
+
# `tsck` - The TSCircuit Command Line Tool
|
|
2
2
|
|
|
3
|
-
Command line tool for
|
|
3
|
+
Command line tool for developing tscircuit projects and interacting with the
|
|
4
4
|
tscircuit registry.
|
|
5
5
|
|
|
6
6
|
## Installation
|
|
@@ -11,40 +11,39 @@ npm install -g @tscircuit/cli
|
|
|
11
11
|
|
|
12
12
|
## Usage
|
|
13
13
|
|
|
14
|
-
The `
|
|
14
|
+
The `tsck` CLI is interactive by default. You can specify the `-y` or any fully-
|
|
15
15
|
qualified with all required arguments to skip the interactive mode.
|
|
16
16
|
|
|
17
17
|
```bash
|
|
18
18
|
# Interactively choose a command and options:
|
|
19
|
-
|
|
19
|
+
tsck
|
|
20
20
|
|
|
21
21
|
# Login
|
|
22
|
-
|
|
22
|
+
tsck login
|
|
23
23
|
|
|
24
24
|
# Create a Project
|
|
25
|
-
|
|
25
|
+
tsck init
|
|
26
26
|
|
|
27
27
|
# Develop a Project
|
|
28
|
-
|
|
29
|
-
tsci dev # build, view and edit circuit files in browser
|
|
28
|
+
tsck dev # build, view and edit circuit files in browser
|
|
30
29
|
|
|
31
30
|
# Manage Dependencies
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
31
|
+
tsck install
|
|
32
|
+
tsck add some-package
|
|
33
|
+
tsck remove some-package
|
|
35
34
|
|
|
36
35
|
# Lint a Project
|
|
37
|
-
|
|
38
|
-
|
|
36
|
+
tsck lint
|
|
37
|
+
tsck lint 2024 # use 2024 tscircuit recommendations
|
|
39
38
|
|
|
40
39
|
# Format a Project
|
|
41
|
-
|
|
42
|
-
|
|
40
|
+
tsck format
|
|
41
|
+
tsck format 2024
|
|
43
42
|
|
|
44
43
|
# Publish a Project
|
|
45
|
-
|
|
44
|
+
tsck publish
|
|
46
45
|
|
|
47
46
|
# View Your Project on Registry
|
|
48
|
-
|
|
49
|
-
|
|
47
|
+
tsck open
|
|
48
|
+
tsck view
|
|
50
49
|
```
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { AppContext } from "
|
|
1
|
+
import { AppContext } from "../../util/app-context"
|
|
2
2
|
import { z } from "zod"
|
|
3
3
|
import kleur from "kleur"
|
|
4
4
|
import { join as joinPath } from "path"
|
|
5
5
|
import prompts from "prompts"
|
|
6
6
|
import open from "open"
|
|
7
|
-
import apiServer from "
|
|
8
|
-
import frontendVfs from "
|
|
7
|
+
import apiServer from "../../../dev-server-api/dist/bundle"
|
|
8
|
+
import frontendVfs from "../../../dev-server-frontend/dist/bundle"
|
|
9
9
|
import defaultAxios from "axios"
|
|
10
10
|
import { readdirSync, readFileSync } from "fs"
|
|
11
11
|
import { soupify } from "lib/soupify"
|
package/lib/cmd-fns/index.ts
CHANGED
|
@@ -24,4 +24,4 @@ export { packageExamplesGet } from "./package-examples-get"
|
|
|
24
24
|
export { packageExamplesCreate } from "./package-examples-create"
|
|
25
25
|
export { publish } from "./publish"
|
|
26
26
|
export { soupifyCmd as soupify } from "./soupify"
|
|
27
|
-
export { devCmd as dev } from "./dev"
|
|
27
|
+
export { devCmd as dev } from "./dev/dev"
|
package/lib/get-program.ts
CHANGED
|
@@ -21,7 +21,7 @@ import * as CMDFN from "lib/cmd-fns"
|
|
|
21
21
|
// | /package_examples/create | Create a new package example |
|
|
22
22
|
|
|
23
23
|
export const getProgram = (ctx: AppContext) => {
|
|
24
|
-
const cmd = new Command("
|
|
24
|
+
const cmd = new Command("tsck")
|
|
25
25
|
|
|
26
26
|
cmd.version(packageJson.version)
|
|
27
27
|
|
|
@@ -163,7 +163,7 @@ export const getProgram = (ctx: AppContext) => {
|
|
|
163
163
|
|
|
164
164
|
cmd
|
|
165
165
|
.command("version")
|
|
166
|
-
.action(() => console.log(`
|
|
166
|
+
.action(() => console.log(`tsck v${packageJson.version}`))
|
|
167
167
|
|
|
168
168
|
cmd.command("login").action((args) => CMDFN.authLogin(ctx, args))
|
|
169
169
|
cmd.command("logout").action((args) => CMDFN.authLogout(ctx, args))
|
|
@@ -18,7 +18,7 @@ export type CliArgs = {
|
|
|
18
18
|
export const createContextAndRunProgram = async (process_args: any) => {
|
|
19
19
|
const args = minimist(process_args)
|
|
20
20
|
|
|
21
|
-
const global_config = new Configstore("
|
|
21
|
+
const global_config = new Configstore("tsck")
|
|
22
22
|
const current_profile =
|
|
23
23
|
args.profile ?? global_config.get("current_profile") ?? "default"
|
|
24
24
|
const profile_config: typeof global_config = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tscircuit/cli",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.3",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "Command line tool for developing, publishing and installing tscircuit circuits",
|
|
@@ -15,7 +15,8 @@
|
|
|
15
15
|
},
|
|
16
16
|
"bin": {
|
|
17
17
|
"tscircuit": "./dist/cli.js",
|
|
18
|
-
"tsci": "./dist/cli.js"
|
|
18
|
+
"tsci": "./dist/cli.js",
|
|
19
|
+
"tsck": "./dist/cli.js"
|
|
19
20
|
},
|
|
20
21
|
"keywords": [],
|
|
21
22
|
"author": "",
|