@luckystack/server 0.8.1 → 0.8.3
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 +6 -0
- package/CLAUDE.md +1 -1
- package/dist/index.js +10 -0
- package/dist/index.js.map +1 -1
- package/docs/runtime-maps.md +9 -6
- package/package.json +10 -10
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.2] - 2026-07-27
|
|
11
|
+
|
|
12
|
+
### Fixed
|
|
13
|
+
|
|
14
|
+
- Processes can compose non-overlapping atomic presets whose generated maps repeat the same full function registry; equivalent function entries deduplicate while conflicting function implementations and duplicate API/sync ownership still fail closed.
|
|
15
|
+
|
|
10
16
|
## [0.8.1] - 2026-07-27
|
|
11
17
|
|
|
12
18
|
### Fixed
|
package/CLAUDE.md
CHANGED
|
@@ -36,7 +36,7 @@ One-call server bootstrap for a LuckyStack project. Wires together a raw Node.js
|
|
|
36
36
|
| `getParsedBundles()` | Returns the preset list parsed by `applyServerArgv()` (empty array before first call). | -> docs/argv-parsing.md |
|
|
37
37
|
| `getParsedPort()` | Returns the port parsed by `applyServerArgv()` (`null` if argv omitted it). | -> docs/argv-parsing.md |
|
|
38
38
|
| `@luckystack/server/parseArgv` (side-effect import) | First-line import that runs `applyServerArgv()` before any module reads `process.env.SERVER_PORT` (notably `config.ts`). | -> docs/argv-parsing.md |
|
|
39
|
-
| `createProdRuntimeMapsProvider(options)` | Build a `RuntimeMapsProvider` that loads generated maps in prod and delegates to devkit discovery in dev. Returns the provider without registering. | -> docs/runtime-maps.md |
|
|
39
|
+
| `createProdRuntimeMapsProvider(options)` | Build a `RuntimeMapsProvider` that loads generated maps in prod and delegates to devkit discovery in dev. Composed presets reject duplicate API/sync ownership, deduplicate equivalent full-registry function entries, and reject differing function implementations. Returns the provider without registering. | -> docs/runtime-maps.md |
|
|
40
40
|
| `registerProdRuntimeMapsProvider(options)` | Convenience wrapper: builds the provider AND calls `registerRuntimeMapsProvider`. Most consumers want this. | -> docs/runtime-maps.md |
|
|
41
41
|
| `registerCustomRoute(handler, options?)` | Append a custom HTTP route handler. `options.phase`: `'post-params'` (default, runs after body parse) or `'pre-params'` (runs before `getParams`, raw `req` stream intact — webhooks + streaming uploads). | -> /docs/ARCHITECTURE_HTTP.md |
|
|
42
42
|
| `getCustomRoutes()` | Read the `'post-params'` registry snapshot (the default phase). | -> /docs/ARCHITECTURE_HTTP.md |
|
package/dist/index.js
CHANGED
|
@@ -2151,10 +2151,20 @@ var resolvePresets = (options) => {
|
|
|
2151
2151
|
}
|
|
2152
2152
|
return ["default"];
|
|
2153
2153
|
};
|
|
2154
|
+
var areEquivalentFunctionEntries = (left, right) => {
|
|
2155
|
+
if (Object.is(left, right)) return true;
|
|
2156
|
+
if (!isRuntimeMapRecord(left) || !isRuntimeMapRecord(right)) return false;
|
|
2157
|
+
const leftKeys = Object.keys(left);
|
|
2158
|
+
const rightKeys = Object.keys(right);
|
|
2159
|
+
return leftKeys.length === rightKeys.length && leftKeys.every((key) => Object.hasOwn(right, key) && Object.is(left[key], right[key]));
|
|
2160
|
+
};
|
|
2154
2161
|
var mergeInto = (target, source, kind, fromPreset, keyOrigin) => {
|
|
2155
2162
|
for (const key of Object.keys(source)) {
|
|
2156
2163
|
const previousPreset = keyOrigin.get(key);
|
|
2157
2164
|
if (previousPreset !== void 0 && previousPreset !== fromPreset) {
|
|
2165
|
+
if (kind === "function" && areEquivalentFunctionEntries(target[key], source[key])) {
|
|
2166
|
+
continue;
|
|
2167
|
+
}
|
|
2158
2168
|
throw new Error(
|
|
2159
2169
|
`[luckystack:runtimeMaps] ${kind} key collision: "${key}" present in both preset "${previousPreset}" and preset "${fromPreset}". Services must belong to exactly one preset (see docs/ARCHITECTURE_PACKAGING.md \xA710).`
|
|
2160
2170
|
);
|