@tscircuit/cli 0.1.818 → 0.1.819

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 +27 -9
  2. package/package.json +1 -1
package/dist/main.js CHANGED
@@ -174384,15 +174384,25 @@ var normalizeRelativePath = (projectDir, targetPath) => path50.relative(projectD
174384
174384
  var registerBuild = (program3) => {
174385
174385
  program3.command("build").description("Run tscircuit eval and output circuit json").argument("[file]", "Path to the entry file").option("--ci", "Run install and optional prebuild/build commands (or default CI build)").option("--ignore-errors", "Do not exit with code 1 on errors").option("--ignore-warnings", "Do not log warnings").option("--disable-pcb", "Disable PCB outputs").option("--disable-parts-engine", "Disable the parts engine").option("--site", "Generate a static site in the dist directory").option("--transpile", "Transpile the entry file to JavaScript").option("--preview-images", "Generate preview images in the dist directory").option("--all-images", "Generate preview images for every successful build output").option("--kicad", "Generate KiCad project directories for each successful build output").option("--preview-gltf", "Generate a GLTF file from the preview entrypoint").option("--kicad-pcm", "Generate KiCad PCM (Plugin and Content Manager) assets in dist/pcm").option("--use-cdn-javascript", "Use CDN-hosted JavaScript instead of bundled standalone file for --site").option("--concurrency <number>", "Number of files to build in parallel (default: 1)", "1").action(async (file, options) => {
174386
174386
  try {
174387
- const {
174388
- projectDir,
174389
- circuitFiles,
174390
- mainEntrypoint,
174391
- previewComponentPath,
174392
- siteDefaultComponentPath
174393
- } = await getBuildEntrypoints({
174394
- fileOrDir: file
174395
- });
174387
+ const resolvedRoot = path50.resolve(process.cwd());
174388
+ let projectDir;
174389
+ if (file) {
174390
+ const resolved = path50.resolve(resolvedRoot, file);
174391
+ if (fs50.existsSync(resolved) && fs50.statSync(resolved).isDirectory()) {
174392
+ projectDir = resolvedRoot;
174393
+ } else {
174394
+ let currentDir = path50.dirname(resolved);
174395
+ while (currentDir !== path50.dirname(currentDir)) {
174396
+ if (fs50.existsSync(path50.join(currentDir, "package.json"))) {
174397
+ break;
174398
+ }
174399
+ currentDir = path50.dirname(currentDir);
174400
+ }
174401
+ projectDir = currentDir;
174402
+ }
174403
+ } else {
174404
+ projectDir = resolvedRoot;
174405
+ }
174396
174406
  const projectConfig2 = loadProjectConfig(projectDir);
174397
174407
  const { options: optionsWithConfig, configAppliedOpts } = resolveBuildOptions({
174398
174408
  cliOptions: options,
@@ -174405,6 +174415,14 @@ var registerBuild = (program3) => {
174405
174415
  if (handled) {
174406
174416
  return;
174407
174417
  }
174418
+ const {
174419
+ circuitFiles,
174420
+ mainEntrypoint,
174421
+ previewComponentPath,
174422
+ siteDefaultComponentPath
174423
+ } = await getBuildEntrypoints({
174424
+ fileOrDir: file
174425
+ });
174408
174426
  const platformConfig2 = (() => {
174409
174427
  if (!resolvedOptions?.disablePcb && !resolvedOptions?.disablePartsEngine) {
174410
174428
  return;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tscircuit/cli",
3
- "version": "0.1.818",
3
+ "version": "0.1.819",
4
4
  "main": "dist/main.js",
5
5
  "devDependencies": {
6
6
  "@babel/standalone": "^7.26.9",