@tscircuit/cli 0.1.2334 → 0.1.2336

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/cli/main.js CHANGED
@@ -1,4 +1,4 @@
1
1
  [diffend] Oversized file quarantined before diffing.
2
2
  name: package/dist/cli/main.js
3
- size: 46839784 bytes
4
- sha256: cb25d1621a83c403e40a1e4c326a1ee941284c7a99cd2206d0ce1c1c84f51dd2
3
+ size: 46843997 bytes
4
+ sha256: eb93ee9f3d15e261a488f289e82e862d6ba1a145805f10e5e373eca9081c51ac
package/dist/lib/index.js CHANGED
@@ -69121,7 +69121,7 @@ var getNodeHandler = (winterSpec, { port, middleware = [] }) => {
69121
69121
  }));
69122
69122
  };
69123
69123
  // package.json
69124
- var version = "0.1.2332";
69124
+ var version = "0.1.2334";
69125
69125
  var package_default = {
69126
69126
  name: "@tscircuit/cli",
69127
69127
  version,
@@ -71801,6 +71801,28 @@ var getRegistryApiUrl = () => {
71801
71801
  return cliConfig.get("registryApiUrl") ?? "https://registry-api.tscircuit.com";
71802
71802
  };
71803
71803
 
71804
+ // lib/shared/parts-engine-base-urls.ts
71805
+ var partsEngineBaseUrlEnvVars = {
71806
+ jlcsearch: "TSCIRCUIT_JLCSEARCH_BASE_URL",
71807
+ digikey: "TSCIRCUIT_DIGIKEY_BASE_URL",
71808
+ mouser: "TSCIRCUIT_MOUSER_BASE_URL",
71809
+ "datasheet-api": "TSCIRCUIT_DATASHEET_API_BASE_URL"
71810
+ };
71811
+ var getPartsEngineBaseUrl = (provider, defaultBaseUrl) => {
71812
+ const environmentVariable = partsEngineBaseUrlEnvVars[provider];
71813
+ const baseUrl = process.env[environmentVariable] ?? defaultBaseUrl;
71814
+ return baseUrl.replace(/\/+$/, "");
71815
+ };
71816
+ var getPartsEngineBaseUrls = () => {
71817
+ const baseUrls = {};
71818
+ for (const environmentVariable of Object.values(partsEngineBaseUrlEnvVars)) {
71819
+ const baseUrl = process.env[environmentVariable];
71820
+ if (baseUrl !== undefined)
71821
+ baseUrls[environmentVariable] = baseUrl;
71822
+ }
71823
+ return baseUrls;
71824
+ };
71825
+
71804
71826
  // lib/site/getIndex.ts
71805
71827
  var getIndex = async (mainComponentPath, fileServerApiBaseUrl, jscdnBaseUrl) => {
71806
71828
  const sessionToken = getSessionToken();
@@ -71810,6 +71832,9 @@ var getIndex = async (mainComponentPath, fileServerApiBaseUrl, jscdnBaseUrl) =>
71810
71832
  window.TSCIRCUIT_FILESERVER_API_BASE_URL = ${JSON.stringify(fileServerApiBaseUrl)};` : "";
71811
71833
  const jscdnScript = jscdnBaseUrl ? `
71812
71834
  window.TSCIRCUIT_JSCDN_BASE_URL = ${JSON.stringify(jscdnBaseUrl).replace(/</g, "\\u003c")};` : "";
71835
+ const partsEngineBaseUrls = getPartsEngineBaseUrls();
71836
+ const partsEngineScript = Object.keys(partsEngineBaseUrls).length ? `
71837
+ Object.assign(window, ${JSON.stringify(partsEngineBaseUrls).replace(/</g, "\\u003c")});` : "";
71813
71838
  return `<html>
71814
71839
  <head>
71815
71840
  <meta charset="UTF-8" />
@@ -71818,7 +71843,7 @@ var getIndex = async (mainComponentPath, fileServerApiBaseUrl, jscdnBaseUrl) =>
71818
71843
  <body>
71819
71844
  <script>
71820
71845
  ${mainComponentPath ? `window.TSCIRCUIT_DEFAULT_MAIN_COMPONENT_PATH = "${mainComponentPath}";` : ""}
71821
- window.TSCIRCUIT_USE_RUNFRAME_FOR_CLI = true;${tokenScript}${fileServerApiScript}${jscdnScript}
71846
+ window.TSCIRCUIT_USE_RUNFRAME_FOR_CLI = true;${tokenScript}${fileServerApiScript}${jscdnScript}${partsEngineScript}
71822
71847
  </script>
71823
71848
  <script src="https://cdn.tailwindcss.com"></script>
71824
71849
  <div id="root">loading...</div>
@@ -84528,7 +84553,7 @@ var getPackageFilePaths = (projectDir, ignored = []) => {
84528
84553
  ignore: ignorePatterns
84529
84554
  });
84530
84555
  fileNames.sort();
84531
- return fileNames.map((fileName) => path26.join(projectDir, fileName));
84556
+ return fileNames.map((fileName) => path26.join(projectDir, fileName)).filter((filePath) => path26.resolve(filePath) !== process.execPath);
84532
84557
  };
84533
84558
 
84534
84559
  // lib/shared/is-binary-file.ts
@@ -85006,7 +85031,7 @@ class DevServer {
85006
85031
  this.filesystemWatcher = watch(this.projectDir, {
85007
85032
  persistent: true,
85008
85033
  ignoreInitial: true,
85009
- ignored: (p) => shouldIgnorePath(path29.relative(this.projectDir, p), this.ignoredFiles)
85034
+ ignored: (p) => path29.resolve(p) === process.execPath || shouldIgnorePath(path29.relative(this.projectDir, p), this.ignoredFiles)
85010
85035
  });
85011
85036
  this.filesystemWatcher.on("change", (filePath) => this.handleFileChangedOnFilesystem(filePath));
85012
85037
  this.filesystemWatcher.on("add", (filePath) => this.handleFileChangedOnFilesystem(filePath));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tscircuit/cli",
3
- "version": "0.1.2334",
3
+ "version": "0.1.2336",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/tscircuit/cli"