@tscircuit/cli 0.1.1560 → 0.1.1561

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.
@@ -11928,7 +11928,7 @@ async function generateCircuitJson({
11928
11928
  };
11929
11929
  }
11930
11930
 
11931
- // lib/shared/get-complete-platform-config.ts
11931
+ // lib/shared/get-platform-config-with-cli-defaults.ts
11932
11932
  import { createHash } from "node:crypto";
11933
11933
  import fs4 from "node:fs";
11934
11934
  import path4 from "node:path";
@@ -11956,7 +11956,7 @@ function createLocalCacheEngine(cacheDir = path4.join(process.cwd(), ".tscircuit
11956
11956
  }
11957
11957
  };
11958
11958
  }
11959
- function getCompletePlatformConfig(userConfig) {
11959
+ function getPlatformConfigWithCliDefaults(userConfig) {
11960
11960
  const basePlatformConfig = getPlatformConfig();
11961
11961
  const defaultConfig = {
11962
11962
  ...basePlatformConfig,
@@ -16323,12 +16323,12 @@ var handleBuildFile = async (filePath, outputPath, glbOutputPath, stepOutputPath
16323
16323
  process.chdir(projectDir);
16324
16324
  workerLog(`Generating circuit JSON for ${path14.relative(projectDir, filePath)}...`);
16325
16325
  await registerStaticAssetLoaders();
16326
- const completePlatformConfig = getCompletePlatformConfig(options?.platformConfig);
16326
+ const platformConfigWithCliDefaults = getPlatformConfigWithCliDefaults(options?.platformConfig);
16327
16327
  const normalizedInputPath = filePath.toLowerCase().replaceAll("\\", "/");
16328
16328
  const isPrebuiltCircuitJson = normalizedInputPath.endsWith(".circuit.json") || normalizedInputPath.endsWith("/circuit.json");
16329
16329
  const circuitJson = isPrebuiltCircuitJson ? loadCircuitJsonFromInputFile(filePath) : (await generateCircuitJson({
16330
16330
  filePath,
16331
- platformConfig: completePlatformConfig,
16331
+ platformConfig: platformConfigWithCliDefaults,
16332
16332
  injectedProps: options?.injectedProps,
16333
16333
  onAsyncEffectStatus: (asyncEffectName) => {
16334
16334
  workerStatus(`waiting on ${asyncEffectName}…`);
package/dist/cli/main.js CHANGED
@@ -93628,7 +93628,7 @@ var import_perfect_cli = __toESM2(require_dist2(), 1);
93628
93628
  // lib/getVersion.ts
93629
93629
  import { createRequire as createRequire2 } from "node:module";
93630
93630
  // package.json
93631
- var version = "0.1.1559";
93631
+ var version = "0.1.1560";
93632
93632
  var package_default = {
93633
93633
  name: "@tscircuit/cli",
93634
93634
  version,
@@ -103663,7 +103663,7 @@ async function importFromUserLand(moduleName) {
103663
103663
  return import(moduleName);
103664
103664
  }
103665
103665
 
103666
- // lib/shared/get-complete-platform-config.ts
103666
+ // lib/shared/get-platform-config-with-cli-defaults.ts
103667
103667
  import { createHash } from "node:crypto";
103668
103668
  import fs17 from "node:fs";
103669
103669
  import path17 from "node:path";
@@ -103691,7 +103691,7 @@ function createLocalCacheEngine(cacheDir = path17.join(process.cwd(), ".tscircui
103691
103691
  }
103692
103692
  };
103693
103693
  }
103694
- function getCompletePlatformConfig(userConfig) {
103694
+ function getPlatformConfigWithCliDefaults(userConfig) {
103695
103695
  const basePlatformConfig = getPlatformConfig();
103696
103696
  const defaultConfig = {
103697
103697
  ...basePlatformConfig,
@@ -103752,7 +103752,7 @@ async function convertToKicadLibrary({
103752
103752
  kicadPcmPackageId,
103753
103753
  circuitJsonToKicadModule
103754
103754
  }) {
103755
- const platformConfig = getCompletePlatformConfig();
103755
+ const platformConfig = getPlatformConfigWithCliDefaults();
103756
103756
  const platformFetch = platformConfig.platformFetch ?? globalThis.fetch;
103757
103757
  const absoluteFilePath = path18.isAbsolute(filePath) ? filePath : path18.resolve(process.cwd(), filePath);
103758
103758
  const React = await importFromUserLand("react");
@@ -104575,11 +104575,11 @@ var buildFile = async (input, output, projectDir, options) => {
104575
104575
  const parsed = JSON.parse(fs25.readFileSync(input, "utf-8"));
104576
104576
  circuitJson = Array.isArray(parsed) ? parsed : [];
104577
104577
  }
104578
- const completePlatformConfig = getCompletePlatformConfig(options?.platformConfig);
104578
+ const platformConfigWithCliDefaults = getPlatformConfigWithCliDefaults(options?.platformConfig);
104579
104579
  if (!isPrebuiltCircuitJson) {
104580
104580
  const result = await generateCircuitJson({
104581
104581
  filePath: input,
104582
- platformConfig: completePlatformConfig,
104582
+ platformConfig: platformConfigWithCliDefaults,
104583
104583
  injectedProps: options?.injectedProps
104584
104584
  });
104585
104585
  circuitJson = result.circuitJson;
@@ -109814,14 +109814,14 @@ var resolveInputFilePath = async (file) => {
109814
109814
  };
109815
109815
  var checkNetlist = async (file) => {
109816
109816
  const resolvedInputFilePath = await resolveInputFilePath(file);
109817
- const completePlatformConfig = getCompletePlatformConfig({
109817
+ const platformConfigWithCliDefaults = getPlatformConfigWithCliDefaults({
109818
109818
  pcbDisabled: true,
109819
109819
  routingDisabled: true,
109820
109820
  placementDrcChecksDisabled: true
109821
109821
  });
109822
109822
  const { circuitJson } = await generateCircuitJson({
109823
109823
  filePath: resolvedInputFilePath,
109824
- platformConfig: completePlatformConfig
109824
+ platformConfig: platformConfigWithCliDefaults
109825
109825
  });
109826
109826
  const typedCircuitJson = circuitJson;
109827
109827
  const diagnostics = analyzeCircuitJson(typedCircuitJson);
@@ -109894,10 +109894,10 @@ var getCircuitJsonForCheck = async ({
109894
109894
  const parsedJson = JSON.parse(fs40.readFileSync(filePath, "utf-8"));
109895
109895
  return Array.isArray(parsedJson) ? parsedJson : [];
109896
109896
  }
109897
- const completePlatformConfig = getCompletePlatformConfig(platformConfig);
109897
+ const platformConfigWithCliDefaults = getPlatformConfigWithCliDefaults(platformConfig);
109898
109898
  const { circuitJson } = await generateCircuitJson({
109899
109899
  filePath,
109900
- platformConfig: completePlatformConfig
109900
+ platformConfig: platformConfigWithCliDefaults
109901
109901
  });
109902
109902
  return circuitJson;
109903
109903
  };
@@ -268079,7 +268079,7 @@ var registerExport = (program2) => {
268079
268079
  if (formatOption === "spice") {
268080
268080
  const { circuitJson } = await generateCircuitJson({
268081
268081
  filePath: file,
268082
- platformConfig: platformConfig2
268082
+ platformConfig: getPlatformConfigWithCliDefaults(platformConfig2)
268083
268083
  });
268084
268084
  if (circuitJson) {
268085
268085
  const spiceString = getSpiceWithPaddedSim(circuitJson);
@@ -284887,7 +284887,7 @@ var importComponentFromJlcpcb = async (jlcpcbPartNumber, projectDir = process.cw
284887
284887
  const componentDir = options.download ? path62.join(projectDir, "imports", componentName) : path62.join(projectDir, "imports");
284888
284888
  await fs58.mkdir(componentDir, { recursive: true });
284889
284889
  if (options.download) {
284890
- const platformConfig2 = getCompletePlatformConfig();
284890
+ const platformConfig2 = getPlatformConfigWithCliDefaults();
284891
284891
  const platformFetch2 = platformConfig2.platformFetch ?? globalThis.fetch;
284892
284892
  const circuitJson = convertEasyEdaJsonToCircuitJson2(betterEasy, {
284893
284893
  useModelCdn: true
@@ -289116,7 +289116,7 @@ var registerSimulate = (program3) => {
289116
289116
  const { circuitJson } = await generateCircuitJson({
289117
289117
  filePath: file,
289118
289118
  saveToFile: false,
289119
- platformConfig: platformConfig2
289119
+ platformConfig: getPlatformConfigWithCliDefaults(platformConfig2)
289120
289120
  });
289121
289121
  if (!circuitJson) {
289122
289122
  console.log("error: Failed to generate circuit JSON");
@@ -289287,10 +289287,10 @@ var processSnapshotFile = async ({
289287
289287
  const parsed = JSON.parse(fs65.readFileSync(file, "utf-8"));
289288
289288
  circuitJson = Array.isArray(parsed) ? parsed : [];
289289
289289
  } else {
289290
- const completePlatformConfig = getCompletePlatformConfig(platformConfig2);
289290
+ const platformConfigWithCliDefaults = getPlatformConfigWithCliDefaults(platformConfig2);
289291
289291
  const result = await generateCircuitJson({
289292
289292
  filePath: file,
289293
- platformConfig: completePlatformConfig
289293
+ platformConfig: platformConfigWithCliDefaults
289294
289294
  });
289295
289295
  circuitJson = result.circuitJson;
289296
289296
  }
@@ -3026,7 +3026,7 @@ async function generateCircuitJson({
3026
3026
  };
3027
3027
  }
3028
3028
 
3029
- // lib/shared/get-complete-platform-config.ts
3029
+ // lib/shared/get-platform-config-with-cli-defaults.ts
3030
3030
  import { createHash } from "node:crypto";
3031
3031
  import fs4 from "node:fs";
3032
3032
  import path4 from "node:path";
@@ -3054,7 +3054,7 @@ function createLocalCacheEngine(cacheDir = path4.join(process.cwd(), ".tscircuit
3054
3054
  }
3055
3055
  };
3056
3056
  }
3057
- function getCompletePlatformConfig(userConfig) {
3057
+ function getPlatformConfigWithCliDefaults(userConfig) {
3058
3058
  const basePlatformConfig = getPlatformConfig();
3059
3059
  const defaultConfig = {
3060
3060
  ...basePlatformConfig,
@@ -3207,10 +3207,10 @@ var processSnapshotFile = async ({
3207
3207
  const parsed = JSON.parse(fs6.readFileSync(file, "utf-8"));
3208
3208
  circuitJson = Array.isArray(parsed) ? parsed : [];
3209
3209
  } else {
3210
- const completePlatformConfig = getCompletePlatformConfig(platformConfig);
3210
+ const platformConfigWithCliDefaults = getPlatformConfigWithCliDefaults(platformConfig);
3211
3211
  const result = await generateCircuitJson({
3212
3212
  filePath: file,
3213
- platformConfig: completePlatformConfig
3213
+ platformConfig: platformConfigWithCliDefaults
3214
3214
  });
3215
3215
  circuitJson = result.circuitJson;
3216
3216
  }
package/dist/lib/index.js CHANGED
@@ -65365,7 +65365,7 @@ var getNodeHandler = (winterSpec, { port, middleware = [] }) => {
65365
65365
  }));
65366
65366
  };
65367
65367
  // package.json
65368
- var version = "0.1.1559";
65368
+ var version = "0.1.1560";
65369
65369
  var package_default = {
65370
65370
  name: "@tscircuit/cli",
65371
65371
  version,
@@ -74536,7 +74536,7 @@ async function importFromUserLand(moduleName) {
74536
74536
  return import(moduleName);
74537
74537
  }
74538
74538
 
74539
- // lib/shared/get-complete-platform-config.ts
74539
+ // lib/shared/get-platform-config-with-cli-defaults.ts
74540
74540
  import { createHash } from "node:crypto";
74541
74541
  import fs6 from "node:fs";
74542
74542
  import path8 from "node:path";
@@ -74564,7 +74564,7 @@ function createLocalCacheEngine(cacheDir = path8.join(process.cwd(), ".tscircuit
74564
74564
  }
74565
74565
  };
74566
74566
  }
74567
- function getCompletePlatformConfig(userConfig) {
74567
+ function getPlatformConfigWithCliDefaults(userConfig) {
74568
74568
  const basePlatformConfig = getPlatformConfig();
74569
74569
  const defaultConfig = {
74570
74570
  ...basePlatformConfig,
@@ -74625,7 +74625,7 @@ async function convertToKicadLibrary({
74625
74625
  kicadPcmPackageId,
74626
74626
  circuitJsonToKicadModule
74627
74627
  }) {
74628
- const platformConfig = getCompletePlatformConfig();
74628
+ const platformConfig = getPlatformConfigWithCliDefaults();
74629
74629
  const platformFetch = platformConfig.platformFetch ?? globalThis.fetch;
74630
74630
  const absoluteFilePath = path9.isAbsolute(filePath) ? filePath : path9.resolve(process.cwd(), filePath);
74631
74631
  const React = await importFromUserLand("react");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tscircuit/cli",
3
- "version": "0.1.1560",
3
+ "version": "0.1.1561",
4
4
  "main": "dist/cli/main.js",
5
5
  "exports": {
6
6
  ".": "./dist/cli/main.js",