@tscircuit/cli 0.1.671 → 0.1.672

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 +16 -0
  2. package/package.json +1 -1
package/dist/main.js CHANGED
@@ -187454,11 +187454,27 @@ var buildFile = async (input, output, projectDir, options) => {
187454
187454
  } catch (err) {
187455
187455
  console.error(`Build failed: ${err}`);
187456
187456
  if (err instanceof Error) {
187457
+ logTsxExtensionHint(err, input);
187457
187458
  logTypeReexportHint(err, input);
187458
187459
  }
187459
187460
  return { ok: false };
187460
187461
  }
187461
187462
  };
187463
+ var logTsxExtensionHint = (error, entryFilePath) => {
187464
+ const lowerPath = entryFilePath.toLowerCase();
187465
+ const isTsEntry = lowerPath.endsWith(".ts") && !lowerPath.endsWith(".d.ts");
187466
+ const isAggregateError = error instanceof AggregateError || String(error).includes("AggregateError");
187467
+ if (!isTsEntry || !isAggregateError)
187468
+ return;
187469
+ const entryFileName = path34.basename(entryFilePath);
187470
+ console.error([
187471
+ "",
187472
+ `It looks like "${entryFileName}" is a ".ts" file. tscircuit component files must use the ".tsx" extension.`,
187473
+ "Try renaming the file to .tsx and re-running the build.",
187474
+ ""
187475
+ ].join(`
187476
+ `));
187477
+ };
187462
187478
  var TYPE_REEXPORT_ERROR_REGEX = /SyntaxError: export '([^']+)' not found in '([^']+)'/;
187463
187479
  var logTypeReexportHint = (error, entryFilePath) => {
187464
187480
  const match = String(error).match(TYPE_REEXPORT_ERROR_REGEX);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tscircuit/cli",
3
- "version": "0.1.671",
3
+ "version": "0.1.672",
4
4
  "main": "dist/main.js",
5
5
  "devDependencies": {
6
6
  "@babel/standalone": "^7.26.9",