@tscircuit/cli 0.1.548 → 0.1.549

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.
Files changed (2) hide show
  1. package/dist/main.js +33 -6
  2. package/package.json +1 -1
package/dist/main.js CHANGED
@@ -67115,7 +67115,7 @@ var require_dist7 = __commonJS((exports2, module2) => {
67115
67115
  });
67116
67116
  module2.exports = __toCommonJS2(src_exports);
67117
67117
  var import_minimist = __toESM3(require_minimist());
67118
- var import_prompts7 = __toESM3(require_prompts3());
67118
+ var import_prompts8 = __toESM3(require_prompts3());
67119
67119
  var getAllLeafCommandPaths = (program3) => {
67120
67120
  const allCommandPaths = [];
67121
67121
  const traverse = (command, currentPath) => {
@@ -67175,7 +67175,7 @@ var require_dist7 = __commonJS((exports2, module2) => {
67175
67175
  return commandPath;
67176
67176
  }
67177
67177
  const normalizeText = (text) => text.replace(/[-_ ]/g, "_").toLowerCase();
67178
- const { nextCommandName } = yield (0, import_prompts7.default)({
67178
+ const { nextCommandName } = yield (0, import_prompts8.default)({
67179
67179
  type: "autocomplete",
67180
67180
  name: "nextCommandName",
67181
67181
  message: "Choose command",
@@ -72387,7 +72387,7 @@ var getGlobalDepsInstallCommand = (packageManager, deps) => {
72387
72387
  import { execSync as execSync2 } from "node:child_process";
72388
72388
  var import_semver2 = __toESM2(require_semver2(), 1);
72389
72389
  // package.json
72390
- var version = "0.1.547";
72390
+ var version = "0.1.548";
72391
72391
  var package_default = {
72392
72392
  name: "@tscircuit/cli",
72393
72393
  version,
@@ -77970,6 +77970,7 @@ import * as path24 from "node:path";
77970
77970
 
77971
77971
  // cli/clone/clone-bug-report.ts
77972
77972
  var import_jszip = __toESM2(require_lib4(), 1);
77973
+ var import_prompts7 = __toESM2(require_prompts3(), 1);
77973
77974
  import * as fs23 from "node:fs";
77974
77975
  import * as path23 from "node:path";
77975
77976
 
@@ -78044,7 +78045,7 @@ var cloneBugReport = async ({
78044
78045
  console.error("Bug report ID must not be empty.");
78045
78046
  process.exit(1);
78046
78047
  }
78047
- const dirPath = path23.resolve(`bug-report-${trimmedBugReportId}`);
78048
+ let dirPath = path23.resolve(`bug-report-${trimmedBugReportId}`);
78048
78049
  await handleExistingDirectory(dirPath);
78049
78050
  const ky2 = getRegistryApiKy();
78050
78051
  let zipBuffer;
@@ -78079,6 +78080,32 @@ var cloneBugReport = async ({
78079
78080
  const fileContent = await entry.async("nodebuffer");
78080
78081
  fs23.writeFileSync(fullPath, fileContent);
78081
78082
  }
78083
+ const packageJsonPath = path23.join(dirPath, "package.json");
78084
+ if (fs23.existsSync(packageJsonPath)) {
78085
+ try {
78086
+ const packageJson = JSON.parse(fs23.readFileSync(packageJsonPath, "utf-8"));
78087
+ const packageName = packageJson?.name;
78088
+ if (typeof packageName === "string" && packageName.trim()) {
78089
+ const sanitizedName = packageName.replace(/[^a-zA-Z0-9]/g, "_");
78090
+ const suggestedDirPath = path23.resolve(`${sanitizedName}_${trimmedBugReportId.slice(7)}`);
78091
+ if (suggestedDirPath !== dirPath) {
78092
+ const response = await import_prompts7.default({
78093
+ type: "confirm",
78094
+ name: "rename",
78095
+ initial: true,
78096
+ message: `Rename the directory to "${path23.basename(suggestedDirPath)}"?`
78097
+ });
78098
+ if (response.rename) {
78099
+ await handleExistingDirectory(suggestedDirPath);
78100
+ fs23.renameSync(dirPath, suggestedDirPath);
78101
+ dirPath = suggestedDirPath;
78102
+ }
78103
+ }
78104
+ }
78105
+ } catch (error) {
78106
+ console.warn("Unable to read package name for renaming:", error);
78107
+ }
78108
+ }
78082
78109
  fs23.writeFileSync(path23.join(dirPath, ".npmrc"), "@tsci:registry=https://npm.tscircuit.com");
78083
78110
  generateTsConfig(dirPath);
78084
78111
  await setupTsciProject(dirPath);
@@ -94793,13 +94820,13 @@ var getSpiceWithPaddedSim = (circuitJson, options) => {
94793
94820
  };
94794
94821
 
94795
94822
  // lib/eecircuit-engine/run-simulation.ts
94796
- import { promises as fs27, existsSync as existsSync10 } from "node:fs";
94823
+ import { promises as fs27, existsSync as existsSync11 } from "node:fs";
94797
94824
  import path27 from "node:path";
94798
94825
  import os2 from "node:os";
94799
94826
  var sim = null;
94800
94827
  var fetchSimulation = async () => {
94801
94828
  const tempFilePath = path27.join(os2.tmpdir(), "eecircuit-engine-1.5.2.mjs");
94802
- if (!existsSync10(tempFilePath)) {
94829
+ if (!existsSync11(tempFilePath)) {
94803
94830
  const url = "https://cdn.jsdelivr.net/npm/eecircuit-engine@1.5.2/+esm";
94804
94831
  const response = await fetch(url);
94805
94832
  if (!response.ok) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tscircuit/cli",
3
- "version": "0.1.548",
3
+ "version": "0.1.549",
4
4
  "main": "dist/main.js",
5
5
  "devDependencies": {
6
6
  "@babel/standalone": "^7.26.9",