@absolutejs/absolute 0.19.0-beta.674 → 0.19.0-beta.675

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/index.js CHANGED
@@ -3161,10 +3161,30 @@ var pipeProcessLogs = (name, processHandle, appendLog) => {
3161
3161
  forward(processHandle.stdout, "info");
3162
3162
  forward(processHandle.stderr, "error");
3163
3163
  };
3164
- var resolveService = (name, service, options) => {
3164
+ var getServicePublicHost = (service) => {
3165
+ const host = service.env?.HOST ?? process.env.HOST ?? "localhost";
3166
+ if (host === "0.0.0.0" || host === "::") {
3167
+ return "localhost";
3168
+ }
3169
+ return host;
3170
+ };
3171
+ var getServiceProtocol = (service) => service.env?.ABSOLUTE_HTTPS === "true" || process.env.ABSOLUTE_HTTPS === "true" ? "https" : "http";
3172
+ var createWorkspaceServiceEnv = (services) => {
3173
+ const workspaceEnv = {};
3174
+ for (const [name, service] of Object.entries(services)) {
3175
+ if (!service.port) {
3176
+ continue;
3177
+ }
3178
+ const envKey = `ABSOLUTE_SERVICE_${name.toUpperCase().replace(/[^A-Z0-9]+/g, "_")}_URL`;
3179
+ workspaceEnv[envKey] = `${getServiceProtocol(service)}://${getServicePublicHost(service)}:${service.port}`;
3180
+ }
3181
+ return workspaceEnv;
3182
+ };
3183
+ var resolveService = (name, service, workspaceEnv, options) => {
3165
3184
  const cwd = resolve6(service.cwd ?? ".");
3166
3185
  const envVars = {
3167
3186
  ...process.env,
3187
+ ...workspaceEnv,
3168
3188
  ...service.env,
3169
3189
  ABSOLUTE_WORKSPACE_MANAGED: "1",
3170
3190
  ABSOLUTE_WORKSPACE_SERVICE_NAME: name,
@@ -3211,6 +3231,7 @@ var workspace = async (subcommand, options) => {
3211
3231
  }
3212
3232
  const config = await loadRawConfig(options.configPath);
3213
3233
  const services = getWorkspaceServices(config);
3234
+ const workspaceEnv = createWorkspaceServiceEnv(services);
3214
3235
  const orderedNames = topologicallySortServices(services);
3215
3236
  const running = [];
3216
3237
  const serviceBootStartedAt = new Map;
@@ -3283,7 +3304,7 @@ var workspace = async (subcommand, options) => {
3283
3304
  if (!service) {
3284
3305
  throw new Error(`services is missing "${name}"`);
3285
3306
  }
3286
- const resolved = resolveService(name, service, options);
3307
+ const resolved = resolveService(name, service, workspaceEnv, options);
3287
3308
  const port = (resolved.service.port ?? Number(resolved.env.PORT ?? "")) || DEFAULT_PORT;
3288
3309
  if (port > 0) {
3289
3310
  killStaleProcesses(port, (message) => {
package/dist/index.js CHANGED
@@ -174803,7 +174803,7 @@ ${registrations}
174803
174803
  ({ tsLibDir } = cached);
174804
174804
  cached.lastUsed = Date.now();
174805
174805
  } else {
174806
- const tsPath = __require.resolve("/home/alexkahn/abs/absolutejs/node_modules/typescript/lib/typescript.js");
174806
+ const tsPath = __require.resolve("typescript");
174807
174807
  const tsRootDir = dirname9(tsPath);
174808
174808
  tsLibDir = tsRootDir.endsWith("lib") ? tsRootDir : resolve18(tsRootDir, "lib");
174809
174809
  const config = readConfiguration("./tsconfig.json");
@@ -188898,5 +188898,5 @@ export {
188898
188898
  ANGULAR_INIT_TIMEOUT_MS
188899
188899
  };
188900
188900
 
188901
- //# debugId=98967D2F4839D93264756E2164756E21
188901
+ //# debugId=5420DB14363AEF7064756E2164756E21
188902
188902
  //# sourceMappingURL=index.js.map