@luckystack/server 0.8.0 → 0.8.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/CHANGELOG.md CHANGED
@@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.8.1] - 2026-07-27
11
+
12
+ ### Fixed
13
+
14
+ - Production route maps, dev-tool startup, cookie security, bootstrap checks and port auto-increment now follow `NODE_ENV`; named topology environments remain available for health and routing identity.
15
+
10
16
  ## [0.8.0] - 2026-07-27
11
17
 
12
18
  ### Added
package/dist/index.d.ts CHANGED
@@ -110,7 +110,7 @@ interface CreateLuckyStackServerOptions {
110
110
  customRoutes?: CustomRouteHandler;
111
111
  /**
112
112
  * Enable dev-mode tooling (devkit hot reload, REPL, console init).
113
- * Defaults to `resolveEnvKey() !== 'production'`.
113
+ * Defaults to `resolveRuntimeMode() !== 'production'` (NODE_ENV-based).
114
114
  */
115
115
  enableDevTools?: boolean;
116
116
  /**
package/dist/index.js CHANGED
@@ -9,7 +9,7 @@ import {
9
9
 
10
10
  // src/createServer.ts
11
11
  import http from "http";
12
- import { registerBindAddress, registerBoundAddress, writeBootUuid, startBootUuidHeartbeat, getLogger as getLogger13, getProjectConfig as getProjectConfig15, tryCatch as tryCatch10, tryCatchSync as tryCatchSync3, resolveEnvKey as resolveEnvKey5, dispatchHook as dispatchHook8 } from "@luckystack/core";
12
+ import { registerBindAddress, registerBoundAddress, writeBootUuid, startBootUuidHeartbeat, getLogger as getLogger13, getProjectConfig as getProjectConfig15, tryCatch as tryCatch10, tryCatchSync as tryCatchSync3, resolveRuntimeMode, dispatchHook as dispatchHook8 } from "@luckystack/core";
13
13
 
14
14
  // src/httpHandler.ts
15
15
  import { randomUUID } from "crypto";
@@ -475,11 +475,11 @@ import {
475
475
  } from "@luckystack/core";
476
476
 
477
477
  // src/httpRoutes/sessionCookie.ts
478
- import { resolveEnvKey as resolveEnvKey2 } from "@luckystack/core";
478
+ import { isProductionRuntime } from "@luckystack/core";
479
479
  var resolveCookieSecure = (sessionCookieSecure, secureEnv) => {
480
480
  if (sessionCookieSecure !== void 0) return sessionCookieSecure;
481
481
  if (secureEnv === "true") return true;
482
- return resolveEnvKey2() === "production";
482
+ return isProductionRuntime();
483
483
  };
484
484
 
485
485
  // src/httpRoutes/authApiRoute.ts
@@ -2020,7 +2020,7 @@ import {
2020
2020
  isLocalizedNormalizerRegistered,
2021
2021
  isProjectConfigRegistered,
2022
2022
  isRuntimeMapsProviderRegistered,
2023
- resolveEnvKey as resolveEnvKey3
2023
+ isProductionRuntime as isProductionRuntime2
2024
2024
  } from "@luckystack/core";
2025
2025
  var verifyBootstrap = async (requirements = {}) => {
2026
2026
  const missing = [];
@@ -2059,7 +2059,7 @@ var verifyBootstrap = async (requirements = {}) => {
2059
2059
  }
2060
2060
  }
2061
2061
  if (!isRuntimeMapsProviderRegistered()) {
2062
- if (resolveEnvKey3() === "production") {
2062
+ if (isProductionRuntime2()) {
2063
2063
  missing.push(
2064
2064
  "RuntimeMapsProvider \u2014 call `registerRuntimeMapsProvider({...})` from `server/prod/runtimeMaps.ts`. Without it, every api/sync request returns notFound."
2065
2065
  );
@@ -2070,7 +2070,7 @@ var verifyBootstrap = async (requirements = {}) => {
2070
2070
  }
2071
2071
  }
2072
2072
  if (!isLocalizedNormalizerRegistered()) {
2073
- if (resolveEnvKey3() === "production") {
2073
+ if (isProductionRuntime2()) {
2074
2074
  missing.push(
2075
2075
  "LocalizedNormalizer \u2014 call `registerLocalizedNormalizer({...})` from your bootstrap. Without it, error response messages will be the raw errorCode (no i18n)."
2076
2076
  );
@@ -2113,7 +2113,7 @@ var verifyBootstrap = async (requirements = {}) => {
2113
2113
  import {
2114
2114
  getLogger as getLogger10,
2115
2115
  registerRuntimeMapsProvider,
2116
- resolveEnvKey as resolveEnvKey4
2116
+ isProductionRuntime as isProductionRuntime3
2117
2117
  } from "@luckystack/core";
2118
2118
  var emptyRuntimeMaps = {
2119
2119
  apisObject: {},
@@ -2163,7 +2163,7 @@ var mergeInto = (target, source, kind, fromPreset, keyOrigin) => {
2163
2163
  target[key] = source[key];
2164
2164
  }
2165
2165
  };
2166
- var isProduction = () => resolveEnvKey4() === "production";
2166
+ var isProduction = () => isProductionRuntime3();
2167
2167
  var createProdRuntimeMapsProvider = (options) => {
2168
2168
  let prodMapsPromise = null;
2169
2169
  let devkitModulePromise = null;
@@ -2371,9 +2371,9 @@ var initDevTools = async () => {
2371
2371
  };
2372
2372
  var listenLuckyStackServer = (httpServer, ip, port, callback) => new Promise((resolve, reject) => {
2373
2373
  const startPort = normalizeServerPort(port);
2374
- const environmentKey = resolveEnvKey5();
2375
- const production = environmentKey === "production";
2376
- const test = environmentKey === "test";
2374
+ const runtimeMode = resolveRuntimeMode();
2375
+ const production = runtimeMode === "production";
2376
+ const test = runtimeMode === "test";
2377
2377
  const autoIncrementEnv = (process.env.SERVER_PORT_AUTO_INCREMENT ?? "").toLowerCase();
2378
2378
  let autoIncrement;
2379
2379
  if (["0", "false"].includes(autoIncrementEnv)) autoIncrement = false;
@@ -2456,7 +2456,7 @@ var createLuckyStackServer = async (options = {}) => {
2456
2456
  envPort: process.env.SERVER_PORT
2457
2457
  });
2458
2458
  const ip = options.ip ?? process.env.SERVER_IP ?? "127.0.0.1";
2459
- const enableDevTools = options.enableDevTools ?? resolveEnvKey5() !== "production";
2459
+ const enableDevTools = options.enableDevTools ?? resolveRuntimeMode() !== "production";
2460
2460
  registerBindAddress({ ip, port });
2461
2461
  if (enableDevTools) {
2462
2462
  await initDevTools();