@tscircuit/cli 0.1.158 → 0.1.160
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 +23 -23
- package/dist/main.js +21 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -36,31 +36,31 @@ Usage: tsci [options] [command]
|
|
|
36
36
|
CLI for developing tscircuit packages
|
|
37
37
|
|
|
38
38
|
Options:
|
|
39
|
-
-h, --help
|
|
39
|
+
-h, --help display help for command
|
|
40
40
|
|
|
41
41
|
Commands:
|
|
42
|
-
init [directory]
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
dev [options] [file]
|
|
46
|
-
clone [options] <package>
|
|
47
|
-
push [options] [file]
|
|
48
|
-
auth
|
|
49
|
-
login
|
|
50
|
-
logout
|
|
51
|
-
config
|
|
52
|
-
export [options] <file>
|
|
53
|
-
build [options] [file]
|
|
54
|
-
add <component>
|
|
55
|
-
remove <component>
|
|
56
|
-
|
|
57
|
-
snapshot [options] [file]
|
|
58
|
-
|
|
59
|
-
setup
|
|
60
|
-
upgrade
|
|
61
|
-
search <query>
|
|
62
|
-
version
|
|
63
|
-
help [command]
|
|
42
|
+
init [options] [directory] Initialize a new TSCircuit project in the
|
|
43
|
+
specified directory (or current directory if none
|
|
44
|
+
is provided)
|
|
45
|
+
dev [options] [file] Start development server for a package
|
|
46
|
+
clone [options] <package> Clone a package from the registry
|
|
47
|
+
push [options] [file] Save snippet code to Registry API
|
|
48
|
+
auth Login/logout
|
|
49
|
+
login Login to tscircuit registry
|
|
50
|
+
logout Logout from tscircuit registry
|
|
51
|
+
config Manage tscircuit CLI configuration
|
|
52
|
+
export [options] <file> Export tscircuit code to various formats
|
|
53
|
+
build [options] [file] Run tscircuit eval and output circuit json
|
|
54
|
+
add <component> Add a tscircuit component package to your project
|
|
55
|
+
remove <component> Remove a tscircuit component package from your
|
|
56
|
+
project
|
|
57
|
+
snapshot [options] [file] Generate schematic and PCB snapshots (add --3d for
|
|
58
|
+
3d preview)
|
|
59
|
+
setup Setup utilities like GitHub Actions
|
|
60
|
+
upgrade Upgrade CLI to the latest version
|
|
61
|
+
search <query> Search for packages in the tscircuit registry
|
|
62
|
+
version Print CLI version
|
|
63
|
+
help [command] display help for command
|
|
64
64
|
```
|
|
65
65
|
<!-- END_HELP_OUTPUT -->
|
|
66
66
|
|
package/dist/main.js
CHANGED
|
@@ -240539,7 +240539,7 @@ var getGlobalDepsInstallCommand = (packageManager, deps) => {
|
|
|
240539
240539
|
import { execSync as execSync2 } from "node:child_process";
|
|
240540
240540
|
var import_semver2 = __toESM2(require_semver2(), 1);
|
|
240541
240541
|
// package.json
|
|
240542
|
-
var version = "0.1.
|
|
240542
|
+
var version = "0.1.159";
|
|
240543
240543
|
var package_default = {
|
|
240544
240544
|
name: "@tscircuit/cli",
|
|
240545
240545
|
version,
|
|
@@ -240710,9 +240710,9 @@ var updateTsci = async () => {
|
|
|
240710
240710
|
|
|
240711
240711
|
// cli/init/register.ts
|
|
240712
240712
|
var registerInit = (program3) => {
|
|
240713
|
-
program3.command("init").description("Initialize a new TSCircuit project in the specified directory (or current directory if none is provided)").argument("[directory]", "Directory name (optional, defaults to current directory)").action(async (directory) => {
|
|
240713
|
+
program3.command("init").description("Initialize a new TSCircuit project in the specified directory (or current directory if none is provided)").argument("[directory]", "Directory name (optional, defaults to current directory)").option("-y, --yes", "Use defaults and skip prompts").action(async (directory, options) => {
|
|
240714
240714
|
await checkForTsciUpdates();
|
|
240715
|
-
if (!directory) {
|
|
240715
|
+
if (!directory && !options?.yes) {
|
|
240716
240716
|
const { continueInCurrentDirectory } = await prompts({
|
|
240717
240717
|
type: "confirm",
|
|
240718
240718
|
name: "continueInCurrentDirectory",
|
|
@@ -240734,7 +240734,7 @@ var registerInit = (program3) => {
|
|
|
240734
240734
|
}
|
|
240735
240735
|
const projectDir = directory ? path10.resolve(process.cwd(), directory) : process.cwd();
|
|
240736
240736
|
const defaultPackageName = path10.basename(projectDir);
|
|
240737
|
-
const { packageName } = await prompts({
|
|
240737
|
+
const { packageName } = options?.yes ? { packageName: defaultPackageName } : await prompts({
|
|
240738
240738
|
type: "text",
|
|
240739
240739
|
name: "packageName",
|
|
240740
240740
|
message: "Package name",
|
|
@@ -280645,6 +280645,22 @@ import { CircuitRunner } from "tscircuit";
|
|
|
280645
280645
|
import path21 from "node:path/posix";
|
|
280646
280646
|
import { relative as relative6 } from "node:path";
|
|
280647
280647
|
import fs21 from "node:fs";
|
|
280648
|
+
|
|
280649
|
+
// lib/utils/abbreviate-stringify-object.ts
|
|
280650
|
+
var abbreviateStringifyObject = (obj) => {
|
|
280651
|
+
if (obj === null || obj === undefined)
|
|
280652
|
+
return obj;
|
|
280653
|
+
if (typeof obj !== "object")
|
|
280654
|
+
return obj;
|
|
280655
|
+
return JSON.stringify(Object.fromEntries(Object.entries(obj).map(([k, v]) => {
|
|
280656
|
+
return [
|
|
280657
|
+
k,
|
|
280658
|
+
typeof v === "string" ? v.slice(0, 100) : typeof v === "object" && v !== null ? abbreviateStringifyObject(v) : v
|
|
280659
|
+
];
|
|
280660
|
+
})));
|
|
280661
|
+
};
|
|
280662
|
+
|
|
280663
|
+
// lib/shared/generate-circuit-json.ts
|
|
280648
280664
|
var debug11 = import_debug13.default("tsci:generate-circuit-json");
|
|
280649
280665
|
var ALLOWED_FILE_EXTENSIONS = [
|
|
280650
280666
|
".tsx",
|
|
@@ -280693,6 +280709,7 @@ async function generateCircuitJson({
|
|
|
280693
280709
|
contentFormat: "string"
|
|
280694
280710
|
})
|
|
280695
280711
|
};
|
|
280712
|
+
debug11(`fsMap: ${abbreviateStringifyObject(fsMap)}`);
|
|
280696
280713
|
await runner.executeWithFsMap({
|
|
280697
280714
|
fsMap,
|
|
280698
280715
|
mainComponentPath: relativeComponentPath
|