@tscircuit/cli 0.1.2335 → 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 +2 -2
- package/dist/lib/index.js +26 -1
- package/package.json +1 -1
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:
|
|
4
|
-
sha256:
|
|
3
|
+
size: 46843997 bytes
|
|
4
|
+
sha256: eb93ee9f3d15e261a488f289e82e862d6ba1a145805f10e5e373eca9081c51ac
|
package/dist/lib/index.js
CHANGED
|
@@ -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>
|