@tscircuit/cli 0.1.1854 → 0.1.1855

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 CHANGED
@@ -135252,7 +135252,7 @@ var import_perfect_cli = __toESM2(require_dist2(), 1);
135252
135252
  // lib/getVersion.ts
135253
135253
  import { createRequire as createRequire2 } from "node:module";
135254
135254
  // package.json
135255
- var version = "0.1.1853";
135255
+ var version = "0.1.1854";
135256
135256
  var package_default = {
135257
135257
  name: "@tscircuit/cli",
135258
135258
  version,
@@ -304591,24 +304591,24 @@ var findSelectableFiles = (projectDir) => {
304591
304591
  if (boardFiles.length > 0) {
304592
304592
  return boardFiles;
304593
304593
  }
304594
- const files = globbySync(["**/*.tsx", "**/*.ts", "**/*.circuit.json"], {
304594
+ const files = globbySync(["**/*.tsx", "**/*.ts", "**/*.circuit.json", "**/circuit.json"], {
304595
304595
  cwd: projectDir,
304596
304596
  ignore: DEFAULT_IGNORED_PATTERNS
304597
304597
  });
304598
304598
  return files.map((file) => path59.resolve(projectDir, file)).filter((file) => fs53.existsSync(file)).sort();
304599
304599
  };
304600
304600
  var isValidDevFile = (filePath) => {
304601
- return filePath.endsWith(".tsx") || filePath.endsWith(".ts") || filePath.endsWith(".circuit.json");
304601
+ return filePath.endsWith(".tsx") || filePath.endsWith(".ts") || isCircuitJsonFile(filePath);
304602
304602
  };
304603
- var resolveDevTarget = async (file) => {
304604
- let projectDir = process.cwd();
304603
+ var resolveDevTarget = async (file, cwd = process.cwd()) => {
304604
+ let projectDir = path59.resolve(cwd);
304605
304605
  if (file) {
304606
- const resolvedPath = path59.resolve(file);
304606
+ const resolvedPath = path59.resolve(projectDir, file);
304607
304607
  if (fs53.existsSync(resolvedPath) && fs53.statSync(resolvedPath).isDirectory()) {
304608
304608
  projectDir = resolvedPath;
304609
304609
  const availableFiles2 = findSelectableFiles(projectDir);
304610
304610
  if (availableFiles2.length === 0) {
304611
- console.log(`No .tsx, .ts, or .circuit.json files found in ${projectDir}. Run 'tsci init' to bootstrap a basic project.`);
304611
+ console.log(`No .tsx, .ts, .circuit.json, or circuit.json files found in ${projectDir}. Run 'tsci init' to bootstrap a basic project.`);
304612
304612
  return null;
304613
304613
  }
304614
304614
  console.log("Selected file:", path59.relative(projectDir, availableFiles2[0]));
@@ -304619,19 +304619,22 @@ var resolveDevTarget = async (file) => {
304619
304619
  return null;
304620
304620
  }
304621
304621
  if (!isValidDevFile(resolvedPath)) {
304622
- console.error("Error: Only .tsx, .ts, and .circuit.json files are supported");
304622
+ console.error("Error: Only .tsx, .ts, .circuit.json, and circuit.json files are supported");
304623
304623
  return null;
304624
304624
  }
304625
304625
  return { absolutePath: resolvedPath, projectDir };
304626
304626
  }
304627
- const entrypointPath = await getEntrypoint({ onError: () => {} });
304627
+ const entrypointPath = await getEntrypoint({
304628
+ projectDir,
304629
+ onError: () => {}
304630
+ });
304628
304631
  if (entrypointPath && fs53.existsSync(entrypointPath)) {
304629
304632
  console.log("Found entrypoint at:", entrypointPath);
304630
304633
  return { absolutePath: entrypointPath, projectDir };
304631
304634
  }
304632
304635
  const availableFiles = findSelectableFiles(projectDir);
304633
304636
  if (availableFiles.length === 0) {
304634
- console.log("No .tsx, .ts, or .circuit.json files found in the project. Run 'tsci init' to bootstrap a basic project.");
304637
+ console.log("No .tsx, .ts, .circuit.json, or circuit.json files found in the project. Run 'tsci init' to bootstrap a basic project.");
304635
304638
  return null;
304636
304639
  }
304637
304640
  console.log("Selected file:", path59.relative(projectDir, availableFiles[0]));
package/dist/lib/index.js CHANGED
@@ -65757,7 +65757,7 @@ var getNodeHandler = (winterSpec, { port, middleware = [] }) => {
65757
65757
  }));
65758
65758
  };
65759
65759
  // package.json
65760
- var version = "0.1.1853";
65760
+ var version = "0.1.1854";
65761
65761
  var package_default = {
65762
65762
  name: "@tscircuit/cli",
65763
65763
  version,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tscircuit/cli",
3
- "version": "0.1.1854",
3
+ "version": "0.1.1855",
4
4
  "main": "dist/cli/main.js",
5
5
  "exports": {
6
6
  ".": "./dist/cli/main.js",