@tscircuit/cli 0.1.44 → 0.1.46

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 +10 -19
  2. package/package.json +2 -2
package/dist/main.js CHANGED
@@ -394275,7 +394275,8 @@ var generateTsConfig = (dir) => {
394275
394275
  resolveJsonModule: true,
394276
394276
  sourceMap: true,
394277
394277
  allowSyntheticDefaultImports: true,
394278
- experimentalDecorators: true
394278
+ experimentalDecorators: true,
394279
+ types: ["@tscircuit/core"]
394279
394280
  }
394280
394281
  }, null, 2);
394281
394282
  writeFileIfNotExists(tsconfigPath, tsconfigContent);
@@ -394339,8 +394340,6 @@ var registerInit = (program2) => {
394339
394340
  const projectDir = directory ? path5.resolve(process.cwd(), directory) : process.cwd();
394340
394341
  fs4.mkdirSync(projectDir, { recursive: true });
394341
394342
  writeFileIfNotExists(path5.join(projectDir, "index.tsx"), `
394342
- import "@tscircuit/core";
394343
-
394344
394343
  export default () => (
394345
394344
  <board width="10mm" height="10mm">
394346
394345
  <resistor resistance="1k" footprint="0402" name="R1" schX={3} pcbX={3} />
@@ -395498,7 +395497,7 @@ var package_default = {
395498
395497
  name: "@tscircuit/cli",
395499
395498
  main: "dist/main.js",
395500
395499
  type: "module",
395501
- version: "0.1.43",
395500
+ version: "0.1.45",
395502
395501
  bin: {
395503
395502
  tsci: "./dist/main.js"
395504
395503
  },
@@ -395523,7 +395522,7 @@ var package_default = {
395523
395522
  "@tscircuit/fake-snippets": "^0.0.6",
395524
395523
  "@tscircuit/file-server": "^0.0.13",
395525
395524
  "@tscircuit/runframe": "^0.0.198",
395526
- "@types/bun": "^1.1.15",
395525
+ "@types/bun": "^1.2.2",
395527
395526
  "@types/configstore": "^6.0.2",
395528
395527
  "@types/react": "^19.0.8",
395529
395528
  "@types/semver": "^7.5.8",
@@ -398973,19 +398972,17 @@ circuit.add(<MyCircuit />)
398973
398972
  }
398974
398973
  }
398975
398974
  async saveSnippet() {
398976
- const postEvent = async (event) => this.fsKy.post("api/events/create", {
398977
- json: { event_type: event },
398975
+ const postEvent = async (event, message) => this.fsKy.post("api/events/create", {
398976
+ json: { event_type: event, ...message ? { message } : {} },
398978
398977
  throwHttpErrors: false
398979
398978
  });
398980
398979
  await pushSnippet({
398981
398980
  filePath: this.componentFilePath,
398982
- onExit: (e) => {
398983
- console.error("Failed to save snippet", e);
398984
- postEvent("FAILED_TO_SAVE_SNIPPET");
398981
+ onExit: () => {
398985
398982
  },
398986
398983
  onError: (e) => {
398987
- console.error("Failed to save snippet", e);
398988
- postEvent("FAILED_TO_SAVE_SNIPPET");
398984
+ console.error("Failed to save snippet:- ", e);
398985
+ postEvent("FAILED_TO_SAVE_SNIPPET", e);
398989
398986
  },
398990
398987
  onSuccess: () => {
398991
398988
  postEvent("SNIPPET_SAVED");
@@ -399212,13 +399209,7 @@ var registerClone = (program2) => {
399212
399209
  file_path: fileInfo.file_path
399213
399210
  }
399214
399211
  }).json();
399215
- let fileText = fileContent.package_file.content_text;
399216
- if (filePath.endsWith(".tsx") && !fileText.includes("@tscircuit/core")) {
399217
- fileText = `import "@tscircuit/core";
399218
-
399219
- ${fileText}`;
399220
- }
399221
- fs14.writeFileSync(fullPath, fileText);
399212
+ fs14.writeFileSync(fullPath, fileContent.package_file.content_text);
399222
399213
  } catch (error) {
399223
399214
  console.warn(`Skipping ${filePath} due to error:`, error instanceof Error ? error.message : error);
399224
399215
  }
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@tscircuit/cli",
3
3
  "main": "dist/main.js",
4
4
  "type": "module",
5
- "version": "0.1.44",
5
+ "version": "0.1.46",
6
6
  "bin": {
7
7
  "tsci": "./dist/main.js"
8
8
  },
@@ -27,7 +27,7 @@
27
27
  "@tscircuit/fake-snippets": "^0.0.6",
28
28
  "@tscircuit/file-server": "^0.0.13",
29
29
  "@tscircuit/runframe": "^0.0.198",
30
- "@types/bun": "^1.1.15",
30
+ "@types/bun": "^1.2.2",
31
31
  "@types/configstore": "^6.0.2",
32
32
  "@types/react": "^19.0.8",
33
33
  "@types/semver": "^7.5.8",