@tscircuit/cli 0.1.1183 → 0.1.1185
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/main.js +82 -5
- package/dist/lib/index.js +1 -1
- package/package.json +1 -1
package/dist/cli/main.js
CHANGED
|
@@ -98409,7 +98409,7 @@ var import_perfect_cli = __toESM2(require_dist2(), 1);
|
|
|
98409
98409
|
// lib/getVersion.ts
|
|
98410
98410
|
import { createRequire as createRequire2 } from "node:module";
|
|
98411
98411
|
// package.json
|
|
98412
|
-
var version = "0.1.
|
|
98412
|
+
var version = "0.1.1183";
|
|
98413
98413
|
var package_default = {
|
|
98414
98414
|
name: "@tscircuit/cli",
|
|
98415
98415
|
version,
|
|
@@ -98770,6 +98770,26 @@ function getPackageManager() {
|
|
|
98770
98770
|
process.stdout.write(output);
|
|
98771
98771
|
}
|
|
98772
98772
|
},
|
|
98773
|
+
update: ({ name, cwd }) => {
|
|
98774
|
+
let updateCommand;
|
|
98775
|
+
if (pm === "yarn") {
|
|
98776
|
+
updateCommand = `yarn upgrade ${name}`;
|
|
98777
|
+
} else if (pm === "pnpm") {
|
|
98778
|
+
updateCommand = `pnpm update ${name}`;
|
|
98779
|
+
} else if (pm === "bun") {
|
|
98780
|
+
updateCommand = `bun update ${name}`;
|
|
98781
|
+
} else {
|
|
98782
|
+
updateCommand = `npm update ${name}`;
|
|
98783
|
+
}
|
|
98784
|
+
console.log(kleur_default.gray(`> ${updateCommand}`));
|
|
98785
|
+
const output = execSync(updateCommand, {
|
|
98786
|
+
stdio: ["inherit", "pipe", "pipe"],
|
|
98787
|
+
cwd
|
|
98788
|
+
});
|
|
98789
|
+
if (output) {
|
|
98790
|
+
process.stdout.write(output);
|
|
98791
|
+
}
|
|
98792
|
+
},
|
|
98773
98793
|
init: ({ cwd }) => {
|
|
98774
98794
|
const initCommand = getInitCommand();
|
|
98775
98795
|
execSync(initCommand, { stdio: "inherit", cwd });
|
|
@@ -109052,6 +109072,7 @@ import path38 from "node:path";
|
|
|
109052
109072
|
// lib/shared/thread-worker-pool.ts
|
|
109053
109073
|
import { Worker } from "node:worker_threads";
|
|
109054
109074
|
var DEFAULT_WORKER_JOB_TIMEOUT_MS = 3 * 60 * 1000;
|
|
109075
|
+
var DEFAULT_HEARTBEAT_INTERVAL_MS = 30 * 1000;
|
|
109055
109076
|
|
|
109056
109077
|
class ThreadWorkerPool {
|
|
109057
109078
|
workers = [];
|
|
@@ -109097,10 +109118,7 @@ class ThreadWorkerPool {
|
|
|
109097
109118
|
if (!this.options.onLog || this.heartbeatIntervalId) {
|
|
109098
109119
|
return;
|
|
109099
109120
|
}
|
|
109100
|
-
|
|
109101
|
-
return;
|
|
109102
|
-
}
|
|
109103
|
-
const heartbeatIntervalMs = this.options.heartbeatIntervalMs ?? 5000;
|
|
109121
|
+
const heartbeatIntervalMs = this.options.heartbeatIntervalMs ?? DEFAULT_HEARTBEAT_INTERVAL_MS;
|
|
109104
109122
|
if (heartbeatIntervalMs <= 0) {
|
|
109105
109123
|
return;
|
|
109106
109124
|
}
|
|
@@ -270046,6 +270064,64 @@ function registerUpgradeCommand(program3) {
|
|
|
270046
270064
|
});
|
|
270047
270065
|
}
|
|
270048
270066
|
|
|
270067
|
+
// lib/shared/update-package.ts
|
|
270068
|
+
import * as path68 from "node:path";
|
|
270069
|
+
import * as fs65 from "node:fs";
|
|
270070
|
+
async function updatePackage(packageSpec, projectDir = process.cwd()) {
|
|
270071
|
+
const packageManager = getPackageManager();
|
|
270072
|
+
if (!packageSpec) {
|
|
270073
|
+
const pkgJsonPath = path68.join(projectDir, "package.json");
|
|
270074
|
+
if (!fs65.existsSync(pkgJsonPath)) {
|
|
270075
|
+
console.log(kleur_default.yellow("No package.json found. Cannot update all packages."));
|
|
270076
|
+
return;
|
|
270077
|
+
}
|
|
270078
|
+
const pkgJson = JSON.parse(fs65.readFileSync(pkgJsonPath, "utf-8"));
|
|
270079
|
+
const allDeps = {
|
|
270080
|
+
...pkgJson.dependencies || {},
|
|
270081
|
+
...pkgJson.devDependencies || {}
|
|
270082
|
+
};
|
|
270083
|
+
const tsciPackages = Object.keys(allDeps).filter((dep) => dep.startsWith("@tsci/") || dep.startsWith("@tscircuit/"));
|
|
270084
|
+
if (tsciPackages.length === 0) {
|
|
270085
|
+
console.log(kleur_default.yellow("No tscircuit packages found in package.json to update."));
|
|
270086
|
+
return;
|
|
270087
|
+
}
|
|
270088
|
+
const targetList = tsciPackages.join(" ");
|
|
270089
|
+
console.log(kleur_default.cyan(`Updating ${tsciPackages.length} packages: ${kleur_default.bold(targetList)}...`));
|
|
270090
|
+
try {
|
|
270091
|
+
packageManager.update({ name: targetList, cwd: projectDir });
|
|
270092
|
+
console.log(kleur_default.green(`✓ Updated all tscircuit packages successfully`));
|
|
270093
|
+
} catch (error) {
|
|
270094
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
270095
|
+
console.error(kleur_default.red(`✗ Failed to update packages:`), errorMessage);
|
|
270096
|
+
throw new Error(`Failed to update packages: ${errorMessage}`);
|
|
270097
|
+
}
|
|
270098
|
+
return;
|
|
270099
|
+
}
|
|
270100
|
+
const normalizedName = normalizeTscircuitPackageName(packageSpec);
|
|
270101
|
+
const displayName = normalizedName || packageSpec;
|
|
270102
|
+
const updateTarget = normalizedName || packageSpec;
|
|
270103
|
+
console.log(kleur_default.cyan(`Updating ${kleur_default.bold(displayName)}...`));
|
|
270104
|
+
try {
|
|
270105
|
+
packageManager.update({ name: updateTarget, cwd: projectDir });
|
|
270106
|
+
console.log(kleur_default.green(`✓ Updated ${kleur_default.bold(displayName)} successfully`));
|
|
270107
|
+
} catch (error) {
|
|
270108
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
270109
|
+
console.error(kleur_default.red(`✗ Failed to update ${displayName}:`), errorMessage);
|
|
270110
|
+
throw new Error(`Failed to update ${displayName}: ${errorMessage}`);
|
|
270111
|
+
}
|
|
270112
|
+
}
|
|
270113
|
+
|
|
270114
|
+
// cli/update/register.ts
|
|
270115
|
+
var registerUpdate = (program3) => {
|
|
270116
|
+
program3.command("update").description("Update tscircuit component packages to their latest version").argument("[packageSpec]", "Package to update, leave blank to update all @tsci dependencies.").action(async (packageSpec) => {
|
|
270117
|
+
try {
|
|
270118
|
+
await updatePackage(packageSpec);
|
|
270119
|
+
} catch (error) {
|
|
270120
|
+
process.exit(1);
|
|
270121
|
+
}
|
|
270122
|
+
});
|
|
270123
|
+
};
|
|
270124
|
+
|
|
270049
270125
|
// cli/main.ts
|
|
270050
270126
|
var program2 = new Command;
|
|
270051
270127
|
program2.name("tsci").description("CLI for developing tscircuit packages");
|
|
@@ -270072,6 +270148,7 @@ registerRemove(program2);
|
|
|
270072
270148
|
registerSnapshot(program2);
|
|
270073
270149
|
registerSetup(program2);
|
|
270074
270150
|
registerInstall(program2);
|
|
270151
|
+
registerUpdate(program2);
|
|
270075
270152
|
registerUpgradeCommand(program2);
|
|
270076
270153
|
registerDoctor(program2);
|
|
270077
270154
|
registerCheck(program2);
|
package/dist/lib/index.js
CHANGED
|
@@ -60678,7 +60678,7 @@ var getNodeHandler = (winterSpec, { port, middleware = [] }) => {
|
|
|
60678
60678
|
}));
|
|
60679
60679
|
};
|
|
60680
60680
|
// package.json
|
|
60681
|
-
var version = "0.1.
|
|
60681
|
+
var version = "0.1.1183";
|
|
60682
60682
|
var package_default = {
|
|
60683
60683
|
name: "@tscircuit/cli",
|
|
60684
60684
|
version,
|