@tscircuit/cli 0.1.215 → 0.1.216
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/main.js +59 -33
- package/package.json +1 -1
package/dist/main.js
CHANGED
|
@@ -58202,7 +58202,7 @@ var require_resvgjs_linux_x64_gnu = __commonJS((exports2, module2) => {
|
|
|
58202
58202
|
// node_modules/@resvg/resvg-js/js-binding.js
|
|
58203
58203
|
var require_js_binding = __commonJS((exports2, module2) => {
|
|
58204
58204
|
var __dirname = "/home/runner/work/cli/cli/node_modules/@resvg/resvg-js";
|
|
58205
|
-
var { existsSync:
|
|
58205
|
+
var { existsSync: existsSync9, readFileSync: readFileSync7 } = __require("fs");
|
|
58206
58206
|
var { join: join12 } = __require("path");
|
|
58207
58207
|
var { platform, arch } = process;
|
|
58208
58208
|
var nativeBinding = null;
|
|
@@ -58225,7 +58225,7 @@ var require_js_binding = __commonJS((exports2, module2) => {
|
|
|
58225
58225
|
case "android":
|
|
58226
58226
|
switch (arch) {
|
|
58227
58227
|
case "arm64":
|
|
58228
|
-
localFileExisted =
|
|
58228
|
+
localFileExisted = existsSync9(join12(__dirname, "resvgjs.android-arm64.node"));
|
|
58229
58229
|
try {
|
|
58230
58230
|
localFileExisted ? nativeBinding = (()=>{throw new Error("Cannot require module "+"./resvgjs.android-arm64.node");})() : nativeBinding = (()=>{throw new Error("Cannot require module "+"@resvg/resvg-js-android-arm64");})();
|
|
58231
58231
|
} catch (e) {
|
|
@@ -58233,7 +58233,7 @@ var require_js_binding = __commonJS((exports2, module2) => {
|
|
|
58233
58233
|
}
|
|
58234
58234
|
break;
|
|
58235
58235
|
case "arm":
|
|
58236
|
-
localFileExisted =
|
|
58236
|
+
localFileExisted = existsSync9(join12(__dirname, "resvgjs.android-arm-eabi.node"));
|
|
58237
58237
|
try {
|
|
58238
58238
|
localFileExisted ? nativeBinding = (()=>{throw new Error("Cannot require module "+"./resvgjs.android-arm-eabi.node");})() : nativeBinding = (()=>{throw new Error("Cannot require module "+"@resvg/resvg-js-android-arm-eabi");})();
|
|
58239
58239
|
} catch (e) {
|
|
@@ -58247,7 +58247,7 @@ var require_js_binding = __commonJS((exports2, module2) => {
|
|
|
58247
58247
|
case "win32":
|
|
58248
58248
|
switch (arch) {
|
|
58249
58249
|
case "x64":
|
|
58250
|
-
localFileExisted =
|
|
58250
|
+
localFileExisted = existsSync9(join12(__dirname, "resvgjs.win32-x64-msvc.node"));
|
|
58251
58251
|
try {
|
|
58252
58252
|
localFileExisted ? nativeBinding = (()=>{throw new Error("Cannot require module "+"./resvgjs.win32-x64-msvc.node");})() : nativeBinding = (()=>{throw new Error("Cannot require module "+"@resvg/resvg-js-win32-x64-msvc");})();
|
|
58253
58253
|
} catch (e) {
|
|
@@ -58255,7 +58255,7 @@ var require_js_binding = __commonJS((exports2, module2) => {
|
|
|
58255
58255
|
}
|
|
58256
58256
|
break;
|
|
58257
58257
|
case "ia32":
|
|
58258
|
-
localFileExisted =
|
|
58258
|
+
localFileExisted = existsSync9(join12(__dirname, "resvgjs.win32-ia32-msvc.node"));
|
|
58259
58259
|
try {
|
|
58260
58260
|
localFileExisted ? nativeBinding = (()=>{throw new Error("Cannot require module "+"./resvgjs.win32-ia32-msvc.node");})() : nativeBinding = (()=>{throw new Error("Cannot require module "+"@resvg/resvg-js-win32-ia32-msvc");})();
|
|
58261
58261
|
} catch (e) {
|
|
@@ -58263,7 +58263,7 @@ var require_js_binding = __commonJS((exports2, module2) => {
|
|
|
58263
58263
|
}
|
|
58264
58264
|
break;
|
|
58265
58265
|
case "arm64":
|
|
58266
|
-
localFileExisted =
|
|
58266
|
+
localFileExisted = existsSync9(join12(__dirname, "resvgjs.win32-arm64-msvc.node"));
|
|
58267
58267
|
try {
|
|
58268
58268
|
localFileExisted ? nativeBinding = (()=>{throw new Error("Cannot require module "+"./resvgjs.win32-arm64-msvc.node");})() : nativeBinding = (()=>{throw new Error("Cannot require module "+"@resvg/resvg-js-win32-arm64-msvc");})();
|
|
58269
58269
|
} catch (e) {
|
|
@@ -58275,14 +58275,14 @@ var require_js_binding = __commonJS((exports2, module2) => {
|
|
|
58275
58275
|
}
|
|
58276
58276
|
break;
|
|
58277
58277
|
case "darwin":
|
|
58278
|
-
localFileExisted =
|
|
58278
|
+
localFileExisted = existsSync9(join12(__dirname, "resvgjs.darwin-universal.node"));
|
|
58279
58279
|
try {
|
|
58280
58280
|
localFileExisted ? nativeBinding = (()=>{throw new Error("Cannot require module "+"./resvgjs.darwin-universal.node");})() : nativeBinding = (()=>{throw new Error("Cannot require module "+"@resvg/resvg-js-darwin-universal");})();
|
|
58281
58281
|
break;
|
|
58282
58282
|
} catch {}
|
|
58283
58283
|
switch (arch) {
|
|
58284
58284
|
case "x64":
|
|
58285
|
-
localFileExisted =
|
|
58285
|
+
localFileExisted = existsSync9(join12(__dirname, "resvgjs.darwin-x64.node"));
|
|
58286
58286
|
try {
|
|
58287
58287
|
localFileExisted ? nativeBinding = (()=>{throw new Error("Cannot require module "+"./resvgjs.darwin-x64.node");})() : nativeBinding = (()=>{throw new Error("Cannot require module "+"@resvg/resvg-js-darwin-x64");})();
|
|
58288
58288
|
} catch (e) {
|
|
@@ -58290,7 +58290,7 @@ var require_js_binding = __commonJS((exports2, module2) => {
|
|
|
58290
58290
|
}
|
|
58291
58291
|
break;
|
|
58292
58292
|
case "arm64":
|
|
58293
|
-
localFileExisted =
|
|
58293
|
+
localFileExisted = existsSync9(join12(__dirname, "resvgjs.darwin-arm64.node"));
|
|
58294
58294
|
try {
|
|
58295
58295
|
localFileExisted ? nativeBinding = (()=>{throw new Error("Cannot require module "+"./resvgjs.darwin-arm64.node");})() : nativeBinding = (()=>{throw new Error("Cannot require module "+"@resvg/resvg-js-darwin-arm64");})();
|
|
58296
58296
|
} catch (e) {
|
|
@@ -58304,7 +58304,7 @@ var require_js_binding = __commonJS((exports2, module2) => {
|
|
|
58304
58304
|
case "freebsd":
|
|
58305
58305
|
if (arch !== "x64")
|
|
58306
58306
|
throw new Error(`Unsupported architecture on FreeBSD: ${arch}`);
|
|
58307
|
-
localFileExisted =
|
|
58307
|
+
localFileExisted = existsSync9(join12(__dirname, "resvgjs.freebsd-x64.node"));
|
|
58308
58308
|
try {
|
|
58309
58309
|
localFileExisted ? nativeBinding = (()=>{throw new Error("Cannot require module "+"./resvgjs.freebsd-x64.node");})() : nativeBinding = (()=>{throw new Error("Cannot require module "+"@resvg/resvg-js-freebsd-x64");})();
|
|
58310
58310
|
} catch (e) {
|
|
@@ -58315,14 +58315,14 @@ var require_js_binding = __commonJS((exports2, module2) => {
|
|
|
58315
58315
|
switch (arch) {
|
|
58316
58316
|
case "x64":
|
|
58317
58317
|
if (isMusl()) {
|
|
58318
|
-
localFileExisted =
|
|
58318
|
+
localFileExisted = existsSync9(join12(__dirname, "resvgjs.linux-x64-musl.node"));
|
|
58319
58319
|
try {
|
|
58320
58320
|
localFileExisted ? nativeBinding = (()=>{throw new Error("Cannot require module "+"./resvgjs.linux-x64-musl.node");})() : nativeBinding = require_resvgjs_linux_x64_musl();
|
|
58321
58321
|
} catch (e) {
|
|
58322
58322
|
loadError = e;
|
|
58323
58323
|
}
|
|
58324
58324
|
} else {
|
|
58325
|
-
localFileExisted =
|
|
58325
|
+
localFileExisted = existsSync9(join12(__dirname, "resvgjs.linux-x64-gnu.node"));
|
|
58326
58326
|
try {
|
|
58327
58327
|
localFileExisted ? nativeBinding = (()=>{throw new Error("Cannot require module "+"./resvgjs.linux-x64-gnu.node");})() : nativeBinding = require_resvgjs_linux_x64_gnu();
|
|
58328
58328
|
} catch (e) {
|
|
@@ -58332,14 +58332,14 @@ var require_js_binding = __commonJS((exports2, module2) => {
|
|
|
58332
58332
|
break;
|
|
58333
58333
|
case "arm64":
|
|
58334
58334
|
if (isMusl()) {
|
|
58335
|
-
localFileExisted =
|
|
58335
|
+
localFileExisted = existsSync9(join12(__dirname, "resvgjs.linux-arm64-musl.node"));
|
|
58336
58336
|
try {
|
|
58337
58337
|
localFileExisted ? nativeBinding = (()=>{throw new Error("Cannot require module "+"./resvgjs.linux-arm64-musl.node");})() : nativeBinding = (()=>{throw new Error("Cannot require module "+"@resvg/resvg-js-linux-arm64-musl");})();
|
|
58338
58338
|
} catch (e) {
|
|
58339
58339
|
loadError = e;
|
|
58340
58340
|
}
|
|
58341
58341
|
} else {
|
|
58342
|
-
localFileExisted =
|
|
58342
|
+
localFileExisted = existsSync9(join12(__dirname, "resvgjs.linux-arm64-gnu.node"));
|
|
58343
58343
|
try {
|
|
58344
58344
|
localFileExisted ? nativeBinding = (()=>{throw new Error("Cannot require module "+"./resvgjs.linux-arm64-gnu.node");})() : nativeBinding = (()=>{throw new Error("Cannot require module "+"@resvg/resvg-js-linux-arm64-gnu");})();
|
|
58345
58345
|
} catch (e) {
|
|
@@ -58348,7 +58348,7 @@ var require_js_binding = __commonJS((exports2, module2) => {
|
|
|
58348
58348
|
}
|
|
58349
58349
|
break;
|
|
58350
58350
|
case "arm":
|
|
58351
|
-
localFileExisted =
|
|
58351
|
+
localFileExisted = existsSync9(join12(__dirname, "resvgjs.linux-arm-gnueabihf.node"));
|
|
58352
58352
|
try {
|
|
58353
58353
|
localFileExisted ? nativeBinding = (()=>{throw new Error("Cannot require module "+"./resvgjs.linux-arm-gnueabihf.node");})() : nativeBinding = (()=>{throw new Error("Cannot require module "+"@resvg/resvg-js-linux-arm-gnueabihf");})();
|
|
58354
58354
|
} catch (e) {
|
|
@@ -58357,14 +58357,14 @@ var require_js_binding = __commonJS((exports2, module2) => {
|
|
|
58357
58357
|
break;
|
|
58358
58358
|
case "riscv64":
|
|
58359
58359
|
if (isMusl()) {
|
|
58360
|
-
localFileExisted =
|
|
58360
|
+
localFileExisted = existsSync9(join12(__dirname, "resvgjs.linux-riscv64-musl.node"));
|
|
58361
58361
|
try {
|
|
58362
58362
|
localFileExisted ? nativeBinding = (()=>{throw new Error("Cannot require module "+"./resvgjs.linux-riscv64-musl.node");})() : nativeBinding = (()=>{throw new Error("Cannot require module "+"@resvg/resvg-js-linux-riscv64-musl");})();
|
|
58363
58363
|
} catch (e) {
|
|
58364
58364
|
loadError = e;
|
|
58365
58365
|
}
|
|
58366
58366
|
} else {
|
|
58367
|
-
localFileExisted =
|
|
58367
|
+
localFileExisted = existsSync9(join12(__dirname, "resvgjs.linux-riscv64-gnu.node"));
|
|
58368
58368
|
try {
|
|
58369
58369
|
localFileExisted ? nativeBinding = (()=>{throw new Error("Cannot require module "+"./resvgjs.linux-riscv64-gnu.node");})() : nativeBinding = (()=>{throw new Error("Cannot require module "+"@resvg/resvg-js-linux-riscv64-gnu");})();
|
|
58370
58370
|
} catch (e) {
|
|
@@ -58373,7 +58373,7 @@ var require_js_binding = __commonJS((exports2, module2) => {
|
|
|
58373
58373
|
}
|
|
58374
58374
|
break;
|
|
58375
58375
|
case "s390x":
|
|
58376
|
-
localFileExisted =
|
|
58376
|
+
localFileExisted = existsSync9(join12(__dirname, "resvgjs.linux-s390x-gnu.node"));
|
|
58377
58377
|
try {
|
|
58378
58378
|
localFileExisted ? nativeBinding = (()=>{throw new Error("Cannot require module "+"./resvgjs.linux-s390x-gnu.node");})() : nativeBinding = (()=>{throw new Error("Cannot require module "+"@resvg/resvg-js-linux-s390x-gnu");})();
|
|
58379
58379
|
} catch (e) {
|
|
@@ -63215,7 +63215,7 @@ var getGlobalDepsInstallCommand = (packageManager, deps) => {
|
|
|
63215
63215
|
import { execSync as execSync2 } from "node:child_process";
|
|
63216
63216
|
var import_semver2 = __toESM2(require_semver2(), 1);
|
|
63217
63217
|
// package.json
|
|
63218
|
-
var version = "0.1.
|
|
63218
|
+
var version = "0.1.215";
|
|
63219
63219
|
var package_default = {
|
|
63220
63220
|
name: "@tscircuit/cli",
|
|
63221
63221
|
version,
|
|
@@ -68187,23 +68187,23 @@ var registerConfigPrint = (program3) => {
|
|
|
68187
68187
|
import * as fs20 from "node:fs";
|
|
68188
68188
|
import * as path20 from "node:path";
|
|
68189
68189
|
var registerClone = (program3) => {
|
|
68190
|
-
program3.command("clone").description("Clone a package from the registry").argument("<package>", "Package to clone (e.g. author/packageName or https://tscircuit.com/author/packageName)").option("-a, --include-author", "Include author name in the directory path").action(async (
|
|
68191
|
-
const urlMatch =
|
|
68192
|
-
const originalMatch = !urlMatch &&
|
|
68190
|
+
program3.command("clone").description("Clone a package from the registry").argument("<package>", "Package to clone (e.g. author/packageName or https://tscircuit.com/author/packageName)").option("-a, --include-author", "Include author name in the directory path").action(async (packagePath, options) => {
|
|
68191
|
+
const urlMatch = packagePath.match(/^https:\/\/tscircuit\.com\/([^\/]+)\/([^\/]+)\/?$/i);
|
|
68192
|
+
const originalMatch = !urlMatch && packagePath.match(/^(?:@tsci\/)?([^/.]+)[/.]([^/.]+)$/);
|
|
68193
68193
|
const originalCwd = process.cwd();
|
|
68194
68194
|
if (!urlMatch && !originalMatch) {
|
|
68195
|
-
console.error(`Invalid package path "${
|
|
68196
|
-
- author/
|
|
68197
|
-
- author.
|
|
68198
|
-
- @tsci/author.
|
|
68199
|
-
- https://tscircuit.com/author/
|
|
68195
|
+
console.error(`Invalid package path "${packagePath}". Accepted formats:
|
|
68196
|
+
- author/packageName
|
|
68197
|
+
- author.packageName
|
|
68198
|
+
- @tsci/author.packageName
|
|
68199
|
+
- https://tscircuit.com/author/packageName`);
|
|
68200
68200
|
process.exit(1);
|
|
68201
68201
|
}
|
|
68202
68202
|
const match = urlMatch || originalMatch;
|
|
68203
68203
|
if (!match)
|
|
68204
68204
|
throw new Error("No valid match found");
|
|
68205
|
-
const [, author,
|
|
68206
|
-
console.log(`Cloning ${author}/${
|
|
68205
|
+
const [, author, packageName] = match;
|
|
68206
|
+
console.log(`Cloning ${author}/${packageName}...`);
|
|
68207
68207
|
const ky2 = getRegistryApiKy();
|
|
68208
68208
|
let packageFileList = {
|
|
68209
68209
|
package_files: []
|
|
@@ -68211,20 +68211,46 @@ var registerClone = (program3) => {
|
|
|
68211
68211
|
try {
|
|
68212
68212
|
packageFileList = await ky2.post("package_files/list", {
|
|
68213
68213
|
json: {
|
|
68214
|
-
package_name: `${author}/${
|
|
68214
|
+
package_name: `${author}/${packageName}`,
|
|
68215
68215
|
use_latest_version: true
|
|
68216
68216
|
}
|
|
68217
68217
|
}).json();
|
|
68218
68218
|
} catch (error) {
|
|
68219
68219
|
if (typeof error === "object" && error !== null && "response" in error && typeof error.response === "object" && error.response?.status === 404) {
|
|
68220
|
-
console.error(`
|
|
68220
|
+
console.error(`Package "${author}/${packageName}" not found. Please check the name and try again.`);
|
|
68221
68221
|
process.exit(1);
|
|
68222
68222
|
}
|
|
68223
68223
|
console.error("Failed to fetch package files:", error instanceof Error ? error.message : error);
|
|
68224
68224
|
process.exit(1);
|
|
68225
68225
|
}
|
|
68226
68226
|
const userSettingToIncludeAuthor = options.includeAuthor || cliConfig.get("alwaysCloneWithAuthorName");
|
|
68227
|
-
const dirPath = userSettingToIncludeAuthor ? path20.resolve(`${author}.${
|
|
68227
|
+
const dirPath = userSettingToIncludeAuthor ? path20.resolve(`${author}.${packageName}`) : path20.resolve(packageName);
|
|
68228
|
+
if (fs20.existsSync(dirPath)) {
|
|
68229
|
+
const prompts2 = await Promise.resolve().then(() => __toESM2(require_prompts3(), 1));
|
|
68230
|
+
const response = await prompts2.default({
|
|
68231
|
+
type: "select",
|
|
68232
|
+
name: "action",
|
|
68233
|
+
message: `Directory "${path20.basename(dirPath)}" already exists. What would you like to do?`,
|
|
68234
|
+
choices: [
|
|
68235
|
+
{ title: "Merge files into existing directory", value: "merge" },
|
|
68236
|
+
{
|
|
68237
|
+
title: "Delete existing directory and clone fresh",
|
|
68238
|
+
value: "delete"
|
|
68239
|
+
},
|
|
68240
|
+
{ title: "Cancel", value: "cancel" }
|
|
68241
|
+
]
|
|
68242
|
+
});
|
|
68243
|
+
if (!response.action || response.action === "cancel") {
|
|
68244
|
+
console.log("Clone cancelled.");
|
|
68245
|
+
process.exit(0);
|
|
68246
|
+
}
|
|
68247
|
+
if (response.action === "delete") {
|
|
68248
|
+
fs20.rmSync(dirPath, { recursive: true, force: true });
|
|
68249
|
+
console.log(`Deleted existing directory: ${dirPath}`);
|
|
68250
|
+
} else if (response.action === "merge") {
|
|
68251
|
+
console.log(`Merging files into existing directory: ${dirPath}`);
|
|
68252
|
+
}
|
|
68253
|
+
}
|
|
68228
68254
|
fs20.mkdirSync(dirPath, { recursive: true });
|
|
68229
68255
|
for (const fileInfo of packageFileList.package_files) {
|
|
68230
68256
|
const filePath = fileInfo.file_path.replace(/^\/|dist\//g, "");
|
|
@@ -68235,7 +68261,7 @@ var registerClone = (program3) => {
|
|
|
68235
68261
|
try {
|
|
68236
68262
|
const fileContent = await ky2.post("package_files/get", {
|
|
68237
68263
|
json: {
|
|
68238
|
-
package_name: `${author}/${
|
|
68264
|
+
package_name: `${author}/${packageName}`,
|
|
68239
68265
|
file_path: fileInfo.file_path
|
|
68240
68266
|
}
|
|
68241
68267
|
}).json();
|