@solid-stack/builder 1.1.0 → 1.1.1

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/index.js CHANGED
@@ -2695,65 +2695,65 @@ ${explanation}`);
2695
2695
  }
2696
2696
  if (environment === "e2e") {
2697
2697
  makeE2eDependOnApp(yml);
2698
- if (buildJson.tester?.envOverrides && yml.services && yml.services.tester) {
2699
- const INTERNAL_PORT = 3e3;
2700
- const urlRegistry = /* @__PURE__ */ new Map();
2701
- const appPublicPort = buildJson.port ? Number(buildJson.port) : null;
2702
- urlRegistry.set("app", {
2703
- networkUrl: `http://app:${INTERNAL_PORT}`,
2704
- publicUrl: appPublicPort ? `http://localhost:${appPublicPort}` : null
2698
+ }
2699
+ if (buildJson.tester?.envOverrides && yml.services && yml.services.tester) {
2700
+ const INTERNAL_PORT = 3e3;
2701
+ const urlRegistry = /* @__PURE__ */ new Map();
2702
+ const appPublicPort = buildJson.port ? Number(buildJson.port) : null;
2703
+ urlRegistry.set("app", {
2704
+ networkUrl: `http://app:${INTERNAL_PORT}`,
2705
+ publicUrl: appPublicPort ? `http://localhost:${appPublicPort}` : null
2706
+ });
2707
+ if (buildJson.name && buildJson.name !== "app") {
2708
+ urlRegistry.set(buildJson.name, urlRegistry.get("app"));
2709
+ }
2710
+ for (const dep of dependencies) {
2711
+ urlRegistry.set(dep.name, {
2712
+ networkUrl: `http://${dep.name}:${INTERNAL_PORT}`,
2713
+ publicUrl: null
2705
2714
  });
2706
- if (buildJson.name && buildJson.name !== "app") {
2707
- urlRegistry.set(buildJson.name, urlRegistry.get("app"));
2708
- }
2709
- for (const dep of dependencies) {
2710
- urlRegistry.set(dep.name, {
2711
- networkUrl: `http://${dep.name}:${INTERNAL_PORT}`,
2712
- publicUrl: null
2713
- });
2714
- }
2715
- const interpolateEnv = (val) => {
2716
- let output = val;
2717
- for (const [sName, urls] of urlRegistry.entries()) {
2718
- const escaped = sName.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
2715
+ }
2716
+ const interpolateEnv = (val) => {
2717
+ let output = val;
2718
+ for (const [sName, urls] of urlRegistry.entries()) {
2719
+ const escaped = sName.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
2720
+ output = output.replace(
2721
+ new RegExp(`\\$\\{${escaped}\\.network_url\\}`, "g"),
2722
+ urls.networkUrl
2723
+ );
2724
+ if (urls.publicUrl) {
2719
2725
  output = output.replace(
2720
- new RegExp(`\\$\\{${escaped}\\.network_url\\}`, "g"),
2721
- urls.networkUrl
2726
+ new RegExp(`\\$\\{${escaped}\\.public_url\\}`, "g"),
2727
+ urls.publicUrl
2722
2728
  );
2723
- if (urls.publicUrl) {
2724
- output = output.replace(
2725
- new RegExp(`\\$\\{${escaped}\\.public_url\\}`, "g"),
2726
- urls.publicUrl
2727
- );
2728
- }
2729
2729
  }
2730
- const unresolvedMatch = output.match(/\$\{([^}]+?)\.(network_url|public_url)\}/);
2731
- if (unresolvedMatch) {
2732
- throw new ScriptError(
2733
- `[Local E2E Tester] Unresolved template variable: ${unresolvedMatch[0]}. Check build.json dependencies.`
2734
- );
2735
- }
2736
- return output;
2737
- };
2738
- if (Array.isArray(yml.services.tester.environment)) {
2739
- const envObj = {};
2740
- for (const item of yml.services.tester.environment) {
2741
- if (typeof item === "string") {
2742
- const eqIdx = item.indexOf("=");
2743
- if (eqIdx !== -1) {
2744
- envObj[item.slice(0, eqIdx)] = item.slice(eqIdx + 1);
2745
- } else {
2746
- envObj[item] = process.env[item] ?? null;
2747
- }
2730
+ }
2731
+ const unresolvedMatch = output.match(/\$\{([^}]+?)\.(network_url|public_url)\}/);
2732
+ if (unresolvedMatch) {
2733
+ throw new ScriptError(
2734
+ `[Local E2E Tester] Unresolved template variable: ${unresolvedMatch[0]}. Check build.json dependencies.`
2735
+ );
2736
+ }
2737
+ return output;
2738
+ };
2739
+ if (Array.isArray(yml.services.tester.environment)) {
2740
+ const envObj = {};
2741
+ for (const item of yml.services.tester.environment) {
2742
+ if (typeof item === "string") {
2743
+ const eqIdx = item.indexOf("=");
2744
+ if (eqIdx !== -1) {
2745
+ envObj[item.slice(0, eqIdx)] = item.slice(eqIdx + 1);
2746
+ } else {
2747
+ envObj[item] = process.env[item] ?? null;
2748
2748
  }
2749
2749
  }
2750
- yml.services.tester.environment = envObj;
2751
- } else if (!yml.services.tester.environment || typeof yml.services.tester.environment !== "object") {
2752
- yml.services.tester.environment = {};
2753
- }
2754
- for (const [k, v] of Object.entries(buildJson.tester.envOverrides)) {
2755
- yml.services.tester.environment[k] = interpolateEnv(v);
2756
2750
  }
2751
+ yml.services.tester.environment = envObj;
2752
+ } else if (!yml.services.tester.environment || typeof yml.services.tester.environment !== "object") {
2753
+ yml.services.tester.environment = {};
2754
+ }
2755
+ for (const [k, v] of Object.entries(buildJson.tester.envOverrides)) {
2756
+ yml.services.tester.environment[k] = interpolateEnv(v);
2757
2757
  }
2758
2758
  }
2759
2759
  attachName(yml, projectName);