@tscircuit/cli 0.1.133 → 0.1.134
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 +15 -12
- package/package.json +1 -1
package/dist/main.js
CHANGED
|
@@ -442169,7 +442169,7 @@ var getGlobalDepsInstallCommand = (packageManager, deps) => {
|
|
|
442169
442169
|
import { execSync as execSync2 } from "node:child_process";
|
|
442170
442170
|
var import_semver2 = __toESM2(require_semver2(), 1);
|
|
442171
442171
|
// package.json
|
|
442172
|
-
var version = "0.1.
|
|
442172
|
+
var version = "0.1.133";
|
|
442173
442173
|
var package_default = {
|
|
442174
442174
|
name: "@tscircuit/cli",
|
|
442175
442175
|
version,
|
|
@@ -445714,7 +445714,7 @@ import * as path12 from "node:path";
|
|
|
445714
445714
|
// lib/project-config/project-config-schema.ts
|
|
445715
445715
|
init_lib();
|
|
445716
445716
|
var projectConfigSchema = z.object({
|
|
445717
|
-
|
|
445717
|
+
mainComponentPath: z.string().optional(),
|
|
445718
445718
|
ignoredFiles: z.array(z.string()).optional()
|
|
445719
445719
|
});
|
|
445720
445720
|
|
|
@@ -445756,8 +445756,8 @@ var getEntrypoint = async ({
|
|
|
445756
445756
|
return path13.resolve(projectDir, filePath);
|
|
445757
445757
|
}
|
|
445758
445758
|
const projectConfig = loadProjectConfig(projectDir);
|
|
445759
|
-
if (projectConfig?.
|
|
445760
|
-
const configEntrypoint = path13.resolve(projectDir, projectConfig.
|
|
445759
|
+
if (projectConfig?.mainComponentPath) {
|
|
445760
|
+
const configEntrypoint = path13.resolve(projectDir, projectConfig.mainComponentPath);
|
|
445761
445761
|
if (fs12.existsSync(configEntrypoint)) {
|
|
445762
445762
|
onSuccess(`Using entrypoint from tscircuit.config.json: '${path13.relative(projectDir, configEntrypoint)}'`);
|
|
445763
445763
|
return configEntrypoint;
|
|
@@ -445778,7 +445778,7 @@ var getEntrypoint = async ({
|
|
|
445778
445778
|
const relativePath = path13.relative(projectDir, entrypoint);
|
|
445779
445779
|
onSuccess(`Detected entrypoint: '${relativePath}'`);
|
|
445780
445780
|
const newConfig = projectConfig || {};
|
|
445781
|
-
newConfig.
|
|
445781
|
+
newConfig.mainComponentPath = relativePath;
|
|
445782
445782
|
saveProjectConfig(newConfig, projectDir);
|
|
445783
445783
|
onSuccess(`Updated tscircuit.config.json with detected entrypoint`);
|
|
445784
445784
|
break;
|
|
@@ -496340,7 +496340,7 @@ async function getBuildEntrypoints({
|
|
|
496340
496340
|
if (fs24.existsSync(resolved) && fs24.statSync(resolved).isDirectory()) {
|
|
496341
496341
|
const projectDir2 = resolved;
|
|
496342
496342
|
const circuitFiles2 = [];
|
|
496343
|
-
const
|
|
496343
|
+
const mainComponentPath2 = await getEntrypoint({
|
|
496344
496344
|
projectDir: projectDir2,
|
|
496345
496345
|
onError: () => {}
|
|
496346
496346
|
});
|
|
@@ -496353,7 +496353,7 @@ async function getBuildEntrypoints({
|
|
|
496353
496353
|
}
|
|
496354
496354
|
return {
|
|
496355
496355
|
projectDir: projectDir2,
|
|
496356
|
-
|
|
496356
|
+
mainComponentPath: mainComponentPath2 || undefined,
|
|
496357
496357
|
circuitFiles: circuitFiles2
|
|
496358
496358
|
};
|
|
496359
496359
|
}
|
|
@@ -496361,7 +496361,10 @@ async function getBuildEntrypoints({
|
|
|
496361
496361
|
}
|
|
496362
496362
|
const projectDir = resolvedRoot;
|
|
496363
496363
|
const circuitFiles = [];
|
|
496364
|
-
const
|
|
496364
|
+
const mainComponentPath = await getEntrypoint({
|
|
496365
|
+
projectDir,
|
|
496366
|
+
onError: () => {}
|
|
496367
|
+
});
|
|
496365
496368
|
const files = globbySync("**/*.circuit.tsx", {
|
|
496366
496369
|
cwd: projectDir,
|
|
496367
496370
|
ignore: DEFAULT_IGNORED_PATTERNS
|
|
@@ -496371,7 +496374,7 @@ async function getBuildEntrypoints({
|
|
|
496371
496374
|
}
|
|
496372
496375
|
return {
|
|
496373
496376
|
projectDir,
|
|
496374
|
-
|
|
496377
|
+
mainComponentPath: mainComponentPath || undefined,
|
|
496375
496378
|
circuitFiles
|
|
496376
496379
|
};
|
|
496377
496380
|
}
|
|
@@ -496379,13 +496382,13 @@ async function getBuildEntrypoints({
|
|
|
496379
496382
|
// cli/build/register.ts
|
|
496380
496383
|
var registerBuild = (program3) => {
|
|
496381
496384
|
program3.command("build").description("Run tscircuit eval and output circuit json").argument("[file]", "Path to the entry file").option("--ignore-errors", "Do not exit with code 1 on errors").option("--ignore-warnings", "Do not log warnings").action(async (file, options) => {
|
|
496382
|
-
const { projectDir,
|
|
496385
|
+
const { projectDir, mainComponentPath, circuitFiles } = await getBuildEntrypoints({ fileOrDir: file });
|
|
496383
496386
|
const distDir = path25.join(projectDir, "dist");
|
|
496384
496387
|
fs25.mkdirSync(distDir, { recursive: true });
|
|
496385
496388
|
let hasErrors = false;
|
|
496386
|
-
if (
|
|
496389
|
+
if (mainComponentPath) {
|
|
496387
496390
|
const outputPath = path25.join(distDir, "circuit.json");
|
|
496388
|
-
const ok = await buildFile(
|
|
496391
|
+
const ok = await buildFile(mainComponentPath, outputPath, projectDir, options);
|
|
496389
496392
|
if (!ok)
|
|
496390
496393
|
hasErrors = true;
|
|
496391
496394
|
}
|