@tscircuit/cli 0.1.817 → 0.1.818

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 +49 -8
  2. package/package.json +1 -1
package/dist/main.js CHANGED
@@ -74267,7 +74267,7 @@ var getGlobalDepsInstallCommand = (packageManager, deps) => {
74267
74267
  import { execSync as execSync2 } from "node:child_process";
74268
74268
  var import_semver2 = __toESM2(require_semver2(), 1);
74269
74269
  // package.json
74270
- var version = "0.1.816";
74270
+ var version = "0.1.817";
74271
74271
  var package_default = {
74272
74272
  name: "@tscircuit/cli",
74273
74273
  version,
@@ -173185,6 +173185,39 @@ var applyCiBuildOptions = async ({
173185
173185
  };
173186
173186
  };
173187
173187
 
173188
+ // cli/build/resolve-build-options.ts
173189
+ var resolveBuildOptions = ({
173190
+ cliOptions,
173191
+ projectConfig: projectConfig2
173192
+ }) => {
173193
+ const configBuild = projectConfig2?.build;
173194
+ const configAppliedOpts = [];
173195
+ if (!cliOptions?.kicad && configBuild?.kicadLibrary) {
173196
+ configAppliedOpts.push("kicad");
173197
+ }
173198
+ if (!cliOptions?.kicadLibrary && configBuild?.kicadLibrary) {
173199
+ configAppliedOpts.push("kicad-library");
173200
+ }
173201
+ if (!cliOptions?.kicadPcm && configBuild?.kicadPcm) {
173202
+ configAppliedOpts.push("kicad-pcm");
173203
+ }
173204
+ if (!cliOptions?.previewImages && configBuild?.previewImages) {
173205
+ configAppliedOpts.push("preview-images");
173206
+ }
173207
+ if (!cliOptions?.transpile && configBuild?.typescriptLibrary) {
173208
+ configAppliedOpts.push("transpile");
173209
+ }
173210
+ const options = {
173211
+ ...cliOptions,
173212
+ kicad: cliOptions?.kicad ?? configBuild?.kicadLibrary,
173213
+ kicadLibrary: cliOptions?.kicadLibrary ?? configBuild?.kicadLibrary,
173214
+ kicadPcm: cliOptions?.kicadPcm ?? configBuild?.kicadPcm,
173215
+ previewImages: cliOptions?.previewImages ?? configBuild?.previewImages,
173216
+ transpile: cliOptions?.transpile ?? configBuild?.typescriptLibrary
173217
+ };
173218
+ return { options, configAppliedOpts };
173219
+ };
173220
+
173188
173221
  // cli/build/get-build-entrypoints.ts
173189
173222
  import fs39 from "node:fs";
173190
173223
  import path39 from "node:path";
@@ -174360,9 +174393,14 @@ var registerBuild = (program3) => {
174360
174393
  } = await getBuildEntrypoints({
174361
174394
  fileOrDir: file
174362
174395
  });
174396
+ const projectConfig2 = loadProjectConfig(projectDir);
174397
+ const { options: optionsWithConfig, configAppliedOpts } = resolveBuildOptions({
174398
+ cliOptions: options,
174399
+ projectConfig: projectConfig2
174400
+ });
174363
174401
  const { resolvedOptions, handled } = await applyCiBuildOptions({
174364
174402
  projectDir,
174365
- options
174403
+ options: optionsWithConfig
174366
174404
  });
174367
174405
  if (handled) {
174368
174406
  return;
@@ -174551,9 +174589,9 @@ var registerBuild = (program3) => {
174551
174589
  fileOrDir: file,
174552
174590
  includeBoardFiles: false
174553
174591
  });
174554
- const projectConfig2 = loadProjectConfig(projectDir);
174555
- const entryFile = projectConfig2?.kicadLibraryEntrypointPath != null ? await getEntrypoint({
174556
- filePath: projectConfig2.kicadLibraryEntrypointPath,
174592
+ const projectConfig3 = loadProjectConfig(projectDir);
174593
+ const entryFile = projectConfig3?.kicadLibraryEntrypointPath != null ? await getEntrypoint({
174594
+ filePath: projectConfig3.kicadLibraryEntrypointPath,
174557
174595
  projectDir
174558
174596
  }) : kicadEntrypoint;
174559
174597
  if (!entryFile) {
@@ -174585,9 +174623,9 @@ var registerBuild = (program3) => {
174585
174623
  fileOrDir: file,
174586
174624
  includeBoardFiles: false
174587
174625
  });
174588
- const projectConfig2 = loadProjectConfig(projectDir);
174589
- const entryFile = projectConfig2?.kicadLibraryEntrypointPath != null ? await getEntrypoint({
174590
- filePath: projectConfig2.kicadLibraryEntrypointPath,
174626
+ const projectConfig3 = loadProjectConfig(projectDir);
174627
+ const entryFile = projectConfig3?.kicadLibraryEntrypointPath != null ? await getEntrypoint({
174628
+ filePath: projectConfig3.kicadLibraryEntrypointPath,
174591
174629
  projectDir
174592
174630
  }) : kicadEntrypoint;
174593
174631
  if (!entryFile) {
@@ -174628,6 +174666,9 @@ var registerBuild = (program3) => {
174628
174666
  if (enabledOpts.length > 0) {
174629
174667
  console.log(` Options ${kleur_default.cyan(enabledOpts.join(", "))}`);
174630
174668
  }
174669
+ if (configAppliedOpts.length > 0) {
174670
+ console.log(` Config ${kleur_default.magenta(configAppliedOpts.join(", "))} ${kleur_default.dim("(from tscircuit.config.json)")}`);
174671
+ }
174631
174672
  console.log(` Output ${kleur_default.dim(path50.relative(process.cwd(), distDir) || "dist")}`);
174632
174673
  console.log(hasErrors ? kleur_default.yellow(`
174633
174674
  ⚠ Build completed with errors`) : kleur_default.green(`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tscircuit/cli",
3
- "version": "0.1.817",
3
+ "version": "0.1.818",
4
4
  "main": "dist/main.js",
5
5
  "devDependencies": {
6
6
  "@babel/standalone": "^7.26.9",