@tscircuit/cli 0.1.157 → 0.1.158
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 +7 -31
- package/package.json +1 -1
package/dist/main.js
CHANGED
|
@@ -240539,7 +240539,7 @@ var getGlobalDepsInstallCommand = (packageManager, deps) => {
|
|
|
240539
240539
|
import { execSync as execSync2 } from "node:child_process";
|
|
240540
240540
|
var import_semver2 = __toESM2(require_semver2(), 1);
|
|
240541
240541
|
// package.json
|
|
240542
|
-
var version = "0.1.
|
|
240542
|
+
var version = "0.1.157";
|
|
240543
240543
|
var package_default = {
|
|
240544
240544
|
name: "@tscircuit/cli",
|
|
240545
240545
|
version,
|
|
@@ -281059,40 +281059,25 @@ async function getBuildEntrypoints({
|
|
|
281059
281059
|
const resolved = path24.resolve(resolvedRoot, fileOrDir);
|
|
281060
281060
|
if (fs24.existsSync(resolved) && fs24.statSync(resolved).isDirectory()) {
|
|
281061
281061
|
const projectDir2 = resolved;
|
|
281062
|
-
const
|
|
281063
|
-
const mainEntrypoint2 = await getEntrypoint({
|
|
281064
|
-
projectDir: projectDir2,
|
|
281065
|
-
onError: () => {}
|
|
281066
|
-
});
|
|
281067
|
-
const files2 = globbySync("**/*.circuit.tsx", {
|
|
281062
|
+
const files2 = globbySync(["**/*.board.tsx", "**/*.circuit.tsx"], {
|
|
281068
281063
|
cwd: projectDir2,
|
|
281069
281064
|
ignore: DEFAULT_IGNORED_PATTERNS
|
|
281070
281065
|
});
|
|
281071
|
-
for (const f of files2) {
|
|
281072
|
-
circuitFiles2.push(path24.join(projectDir2, f));
|
|
281073
|
-
}
|
|
281074
281066
|
return {
|
|
281075
281067
|
projectDir: projectDir2,
|
|
281076
|
-
|
|
281077
|
-
circuitFiles: circuitFiles2
|
|
281068
|
+
circuitFiles: files2.map((f) => path24.join(projectDir2, f))
|
|
281078
281069
|
};
|
|
281079
281070
|
}
|
|
281080
281071
|
return { projectDir: path24.dirname(resolved), circuitFiles: [resolved] };
|
|
281081
281072
|
}
|
|
281082
281073
|
const projectDir = resolvedRoot;
|
|
281083
|
-
const
|
|
281084
|
-
const mainEntrypoint = await getEntrypoint({ projectDir, onError: () => {} });
|
|
281085
|
-
const files = globbySync("**/*.circuit.tsx", {
|
|
281074
|
+
const files = globbySync(["**/*.board.tsx", "**/*.circuit.tsx"], {
|
|
281086
281075
|
cwd: projectDir,
|
|
281087
281076
|
ignore: DEFAULT_IGNORED_PATTERNS
|
|
281088
281077
|
});
|
|
281089
|
-
for (const f of files) {
|
|
281090
|
-
circuitFiles.push(path24.join(projectDir, f));
|
|
281091
|
-
}
|
|
281092
281078
|
return {
|
|
281093
281079
|
projectDir,
|
|
281094
|
-
|
|
281095
|
-
circuitFiles
|
|
281080
|
+
circuitFiles: files.map((f) => path24.join(projectDir, f))
|
|
281096
281081
|
};
|
|
281097
281082
|
}
|
|
281098
281083
|
|
|
@@ -281106,19 +281091,10 @@ var registerBuild = (program3) => {
|
|
|
281106
281091
|
const distDir = path25.join(projectDir, "dist");
|
|
281107
281092
|
fs25.mkdirSync(distDir, { recursive: true });
|
|
281108
281093
|
let hasErrors = false;
|
|
281109
|
-
if (mainEntrypoint) {
|
|
281110
|
-
const outputPath = path25.join(distDir, "circuit.json");
|
|
281111
|
-
const ok = await buildFile(mainEntrypoint, outputPath, projectDir, {
|
|
281112
|
-
...options,
|
|
281113
|
-
platformConfig
|
|
281114
|
-
});
|
|
281115
|
-
if (!ok)
|
|
281116
|
-
hasErrors = true;
|
|
281117
|
-
}
|
|
281118
281094
|
for (const filePath of circuitFiles) {
|
|
281119
281095
|
const relative7 = path25.relative(projectDir, filePath);
|
|
281120
|
-
const
|
|
281121
|
-
const outputPath =
|
|
281096
|
+
const outputDirName = relative7.replace(/(\.board|\.circuit)?\.tsx$/, "");
|
|
281097
|
+
const outputPath = path25.join(distDir, outputDirName, "circuit.json");
|
|
281122
281098
|
const ok = await buildFile(filePath, outputPath, projectDir, options);
|
|
281123
281099
|
if (!ok)
|
|
281124
281100
|
hasErrors = true;
|