@tscircuit/cli 0.1.1533 → 0.1.1535
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 +1 -1
- package/dist/cli/build/build.worker.js +193 -32
- package/dist/cli/main.js +667 -604
- package/dist/cli/snapshot/snapshot.worker.js +551 -10985
- package/dist/lib/index.js +26 -14
- package/package.json +2 -1
package/dist/lib/index.js
CHANGED
|
@@ -65365,7 +65365,7 @@ var getNodeHandler = (winterSpec, { port, middleware = [] }) => {
|
|
|
65365
65365
|
}));
|
|
65366
65366
|
};
|
|
65367
65367
|
// package.json
|
|
65368
|
-
var version = "0.1.
|
|
65368
|
+
var version = "0.1.1534";
|
|
65369
65369
|
var package_default = {
|
|
65370
65370
|
name: "@tscircuit/cli",
|
|
65371
65371
|
version,
|
|
@@ -65403,6 +65403,7 @@ var package_default = {
|
|
|
65403
65403
|
"bun-match-svg": "^0.0.12",
|
|
65404
65404
|
chokidar: "4.0.1",
|
|
65405
65405
|
"circuit-json": "^0.0.437",
|
|
65406
|
+
"circuit-json-to-3d-png": "^0.0.6",
|
|
65406
65407
|
"circuit-json-to-bom-csv": "^0.0.7",
|
|
65407
65408
|
"circuit-json-to-gerber": "^0.0.51",
|
|
65408
65409
|
"circuit-json-to-kicad": "0.0.153",
|
|
@@ -79100,11 +79101,18 @@ function normalizeTscircuitPackageName(packageSpec) {
|
|
|
79100
79101
|
return null;
|
|
79101
79102
|
}
|
|
79102
79103
|
async function addPackage(packageSpec, projectDir = process.cwd()) {
|
|
79103
|
-
|
|
79104
|
-
|
|
79105
|
-
|
|
79106
|
-
|
|
79107
|
-
|
|
79104
|
+
return addPackages([packageSpec], projectDir);
|
|
79105
|
+
}
|
|
79106
|
+
async function addPackages(packageSpecs, projectDir = process.cwd()) {
|
|
79107
|
+
const normalized = packageSpecs.map((spec) => ({
|
|
79108
|
+
original: spec,
|
|
79109
|
+
normalized: normalizeTscircuitPackageName(spec)
|
|
79110
|
+
}));
|
|
79111
|
+
const displayNames = normalized.map((p) => p.normalized || p.original).join(" ");
|
|
79112
|
+
console.log(kleur_default.cyan(`Adding ${kleur_default.bold(displayNames)}...`));
|
|
79113
|
+
const hasTsciPackage = normalized.some((p) => p.normalized?.startsWith("@tsci/"));
|
|
79114
|
+
let useTarball = false;
|
|
79115
|
+
if (hasTsciPackage) {
|
|
79108
79116
|
const npmrcPath = path21.join(projectDir, ".npmrc");
|
|
79109
79117
|
const npmrcContent = fs22.existsSync(npmrcPath) ? fs22.readFileSync(npmrcPath, "utf-8") : "";
|
|
79110
79118
|
let hasTsciRegistry = /@tsci[/:]/.test(npmrcContent);
|
|
@@ -79125,22 +79133,26 @@ async function addPackage(packageSpec, projectDir = process.cwd()) {
|
|
|
79125
79133
|
hasTsciRegistry = true;
|
|
79126
79134
|
} else {
|
|
79127
79135
|
console.log("Continuing without updating .npmrc; will fetch package directly from registry tarball.");
|
|
79136
|
+
useTarball = true;
|
|
79128
79137
|
}
|
|
79129
79138
|
}
|
|
79130
|
-
if (!hasTsciRegistry) {
|
|
79131
|
-
installTarget = await resolveTarballUrlFromRegistry(normalizedName);
|
|
79132
|
-
}
|
|
79133
79139
|
}
|
|
79140
|
+
const installTargets = await Promise.all(normalized.map(async ({ original, normalized: norm }) => {
|
|
79141
|
+
if (norm?.startsWith("@tsci/") && useTarball) {
|
|
79142
|
+
return resolveTarballUrlFromRegistry(norm);
|
|
79143
|
+
}
|
|
79144
|
+
return norm || original;
|
|
79145
|
+
}));
|
|
79134
79146
|
const packageManager = getPackageManager();
|
|
79135
79147
|
try {
|
|
79136
|
-
packageManager.install({ name:
|
|
79137
|
-
console.log(kleur_default.green(`✓ Added ${kleur_default.bold(
|
|
79138
|
-
await detectAndSetupKicadLibrary(
|
|
79148
|
+
packageManager.install({ name: installTargets.join(" "), cwd: projectDir });
|
|
79149
|
+
console.log(kleur_default.green(`✓ Added ${kleur_default.bold(displayNames)} successfully`));
|
|
79150
|
+
await Promise.all(packageSpecs.map((spec) => detectAndSetupKicadLibrary(spec, projectDir)));
|
|
79139
79151
|
} catch (error) {
|
|
79140
79152
|
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
79141
|
-
console.error(kleur_default.red(`✗ Failed to add ${
|
|
79153
|
+
console.error(kleur_default.red(`✗ Failed to add ${displayNames}:`), errorMessage);
|
|
79142
79154
|
handleRegistryAuthError({ error, projectDir });
|
|
79143
|
-
throw new Error(`Failed to add ${
|
|
79155
|
+
throw new Error(`Failed to add ${displayNames}: ${errorMessage}`);
|
|
79144
79156
|
}
|
|
79145
79157
|
}
|
|
79146
79158
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tscircuit/cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1535",
|
|
4
4
|
"main": "dist/cli/main.js",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": "./dist/cli/main.js",
|
|
@@ -35,6 +35,7 @@
|
|
|
35
35
|
"bun-match-svg": "^0.0.12",
|
|
36
36
|
"chokidar": "4.0.1",
|
|
37
37
|
"circuit-json": "^0.0.437",
|
|
38
|
+
"circuit-json-to-3d-png": "^0.0.6",
|
|
38
39
|
"circuit-json-to-bom-csv": "^0.0.7",
|
|
39
40
|
"circuit-json-to-gerber": "^0.0.51",
|
|
40
41
|
"circuit-json-to-kicad": "0.0.153",
|