@lensmcp/cluster 1.23.13 → 1.24.0
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/build-host.d.ts +1 -0
- package/build-host.js +1 -0
- package/create-webpack-dev.d.ts +74 -40
- package/create-webpack-dev.js +1 -1
- package/dev-devtool.d.ts +45 -0
- package/dev-devtool.js +1 -0
- package/devserver-notifier.d.ts +57 -0
- package/devserver-notifier.js +1 -0
- package/executors/gateway/body-stall.d.ts +13 -1
- package/executors/gateway/body-stall.js +1 -1
- package/executors/gateway/canonical-path.d.ts +1 -1
- package/executors/gateway/client-ip.d.ts +1 -1
- package/executors/gateway/gateway.impl.js +1 -1
- package/executors/gateway/jwt-claims.d.ts +1 -1
- package/executors/gateway/prod-config.d.ts +1 -1
- package/executors/gateway/prod-runtime/body-stall.d.ts +1 -1
- package/executors/gateway/rate-limit.d.ts +1 -1
- package/executors/gateway/runtime/auth.d.ts +1 -1
- package/executors/gateway/runtime/chooser.d.ts +2 -2
- package/executors/gateway/runtime/control.d.ts +3 -3
- package/executors/gateway/runtime/control.js +2 -2
- package/executors/gateway/runtime/dev-auth.d.ts +1 -1
- package/executors/gateway/runtime/edge.d.ts +3 -3
- package/executors/gateway/runtime/guest-graph.d.ts +113 -0
- package/executors/gateway/runtime/guest-graph.js +2 -0
- package/executors/gateway/runtime/lens-children.d.ts +11 -1
- package/executors/gateway/runtime/lens-children.js +1 -1
- package/executors/gateway/runtime/lifecycle.d.ts +54 -8
- package/executors/gateway/runtime/lifecycle.js +3 -3
- package/executors/gateway/runtime/process-names.d.ts +18 -0
- package/executors/gateway/runtime/process-names.js +1 -0
- package/executors/gateway/runtime/project-graph-store.d.ts +74 -0
- package/executors/gateway/runtime/project-graph-store.js +1 -0
- package/executors/gateway/runtime/proxy.d.ts +2 -2
- package/executors/gateway/runtime/proxy.js +1 -1
- package/executors/gateway/runtime/scope.d.ts +1 -1
- package/executors/gateway/runtime/serve-launch.d.ts +118 -0
- package/executors/gateway/runtime/serve-launch.js +3 -0
- package/executors/gateway/runtime/server.d.ts +3 -3
- package/executors/gateway/runtime/server.js +2 -2
- package/executors/gateway/runtime/shared-build.d.ts +65 -0
- package/executors/gateway/runtime/shared-build.js +4 -0
- package/executors/gateway/runtime/types.d.ts +35 -9
- package/executors/gateway/runtime/types.js +1 -1
- package/executors/gateway/runtime/workspace-log.js +1 -1
- package/executors/gateway/schema.d.ts +3 -0
- package/executors/gateway/schema.json +4 -0
- package/executors/serve/schema.d.ts +2 -0
- package/executors/serve/schema.json +4 -0
- package/executors/serve/serve.impl.d.ts +12 -6
- package/executors/serve/serve.impl.js +1 -1
- package/executors/trust/hostname.d.ts +1 -1
- package/exit-reason.d.ts +1 -1
- package/fork-ts-check-reporter.d.ts +12 -0
- package/fork-ts-check-reporter.js +1 -1
- package/graph-snapshot.d.ts +1 -0
- package/graph-snapshot.js +1 -0
- package/heap-snapshot.d.ts +66 -0
- package/heap-snapshot.js +1 -0
- package/hot-swap-registries.d.ts +1 -1
- package/inspector-secret.d.ts +39 -0
- package/inspector-secret.js +1 -0
- package/main.devserver.d.ts +33 -5
- package/main.devserver.js +11 -9
- package/package.json +4 -4
- package/perf/heavy-barrel-import.d.ts +135 -0
- package/perf/heavy-barrel-import.js +1 -0
- package/perf/perf-config.d.ts +29 -0
- package/perf/perf-config.js +1 -0
- package/perf/perf-rule-events.d.ts +71 -0
- package/perf/perf-rule-events.js +2 -0
- package/perf/perf-rules-analysis.d.ts +28 -0
- package/perf/perf-rules-analysis.js +1 -0
- package/perf/perf-rules-plugin.d.ts +71 -0
- package/perf/perf-rules-plugin.js +1 -0
- package/perf/perf-rules-worker.d.ts +1 -0
- package/perf/perf-rules-worker.js +1 -0
- package/perf/source-scan.d.ts +59 -0
- package/perf/source-scan.js +5 -0
- package/perf/workspace-libraries.d.ts +52 -0
- package/perf/workspace-libraries.js +2 -0
- package/pod-memory-events.d.ts +71 -0
- package/pod-memory-events.js +2 -0
- package/pod-memory.d.ts +258 -0
- package/pod-memory.js +1 -0
- package/process-name.d.ts +45 -0
- package/process-name.js +1 -1
- package/serve-runner.d.ts +2 -0
- package/serve-runner.js +1 -0
- package/shared-build/attach.d.ts +56 -0
- package/shared-build/attach.js +3 -0
- package/shared-build/host.d.ts +52 -0
- package/shared-build/host.js +4 -0
- package/shared-build/protocol.d.ts +118 -0
- package/shared-build/protocol.js +1 -0
- package/shared-build/shared-compilation.d.ts +91 -0
- package/shared-build/shared-compilation.js +3 -0
- package/shared-build/signature.d.ts +52 -0
- package/shared-build/signature.js +1 -0
- package/stdio-guard.d.ts +1 -1
- package/swap-recycle.d.ts +21 -0
- package/swap-recycle.js +1 -1
- package/tsgo-check-plugin.d.ts +1 -1
- package/workspace-paths.d.ts +76 -0
- package/workspace-paths.js +1 -0
package/swap-recycle.d.ts
CHANGED
|
@@ -38,6 +38,9 @@ export interface SwapRecyclePolicy {
|
|
|
38
38
|
/** How long the pod must have been quiet — no swap running, no previous app closing — before its heap
|
|
39
39
|
* is compared with what it booted with. `0` = compare at once, whatever is going on. */
|
|
40
40
|
settleMs: number;
|
|
41
|
+
/** Replace the pod once a CLOSED generation has stayed in memory this long, through at least two full GCs
|
|
42
|
+
* (pod-memory.ts proves it). `0` = off. */
|
|
43
|
+
retainedMs: number;
|
|
41
44
|
}
|
|
42
45
|
export interface SwapRecycleState {
|
|
43
46
|
/** Live heap right after the first app was built, in bytes. Unknown until measured. */
|
|
@@ -51,6 +54,18 @@ export interface SwapRecycleState {
|
|
|
51
54
|
stuckCloses?: number;
|
|
52
55
|
/** `false` while a swap is running or a previous app is still closing, and for `settleMs` after. */
|
|
53
56
|
settled?: boolean;
|
|
57
|
+
/** The oldest generation that was closed and is PROVEN still in memory (alive after ≥2 full GCs since its
|
|
58
|
+
* close) — what `pod-memory.ts`'s tracker knows. Absent when every closed generation was collected. */
|
|
59
|
+
retained?: RetainedGenerationState;
|
|
60
|
+
}
|
|
61
|
+
/** A closed generation the pod has proven is still in memory. */
|
|
62
|
+
export interface RetainedGenerationState {
|
|
63
|
+
/** The app generation in this pod (1 = the one it booted with). */
|
|
64
|
+
generation: number;
|
|
65
|
+
/** Since its app was closed. */
|
|
66
|
+
ageMs: number;
|
|
67
|
+
/** Full GCs it has survived since then. */
|
|
68
|
+
gcs: number;
|
|
54
69
|
}
|
|
55
70
|
/**
|
|
56
71
|
* - `LENSMCP_SWAP_RECYCLE` — `0`/`false`/`off`/`no` disables the guard.
|
|
@@ -68,6 +83,12 @@ export interface SwapRecycleState {
|
|
|
68
83
|
* the engine at 3.2× its boot heap, knowledge at 4.1× and audit at 3.5× — three pods replaced in the same
|
|
69
84
|
* half minute, each replacement one more cold boot on top of the burst that caused it. The share-of-limit
|
|
70
85
|
* rule is NOT held back: running into V8's limit is a crash whenever it happens.
|
|
86
|
+
* - `LENSMCP_SWAP_RECYCLE_RETAINED_MS` — default `600000` (10 min). A generation whose app was closed and that
|
|
87
|
+
* is still in memory this long after, through at least two full GCs, is not garbage waiting for a collector:
|
|
88
|
+
* something points into it, and nothing in the process is going to let go (issues/closed/pod-memory-02). Ten minutes is
|
|
89
|
+
* past every timer a closed app was measured to leave behind (BullMQ's blocking-client and lock-renewal
|
|
90
|
+
* timeouts, app intervals: 15 s – ~2.5 min on foodguard) with a wide margin, and it fires whatever the heap
|
|
91
|
+
* says — a leak that costs 32 MB a swap (registry, 2026-10-09) takes forty swaps to reach 3×.
|
|
71
92
|
*/
|
|
72
93
|
export declare function swapRecyclePolicy(env?: NodeJS.ProcessEnv): SwapRecyclePolicy;
|
|
73
94
|
/**
|
package/swap-recycle.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var o=Object.defineProperty;var n=(s,e)=>o(s,"name",{value:e,configurable:!0});var t=Object.defineProperty,r=n((s,e)=>t(s,"name",{value:e,configurable:!0}),"r");Object.defineProperty(exports,"__esModule",{value:!0}),exports.swapRecyclePolicy=swapRecyclePolicy,exports.recycleReason=recycleReason;const MB=1024*1024,numberFrom=r((s,e,a)=>{if(s===void 0||s.trim()==="")return e;const i=Number(s);return Number.isFinite(i)&&i>=a?i:e},"numberFrom");function swapRecyclePolicy(s=process.env){return{enabled:!["0","false","no","off"].includes((s.LENSMCP_SWAP_RECYCLE??"").trim().toLowerCase()),heapFactor:numberFrom(s.LENSMCP_SWAP_RECYCLE_HEAP_FACTOR,3,0),minHeapBytes:numberFrom(s.LENSMCP_SWAP_RECYCLE_MIN_MB,512,0)*MB,heapRatio:Math.min(1,numberFrom(s.LENSMCP_SWAP_RECYCLE_HEAP_RATIO,.7,0)),maxSwaps:Math.floor(numberFrom(s.LENSMCP_SWAP_RECYCLE_AFTER,0,0)),stuckCloseMs:Math.floor(numberFrom(s.LENSMCP_SWAP_RECYCLE_STUCK_CLOSE_MS,6e4,0)),settleMs:Math.floor(numberFrom(s.LENSMCP_SWAP_RECYCLE_SETTLE_MS,5e3,0)),retainedMs:Math.floor(numberFrom(s.LENSMCP_SWAP_RECYCLE_RETAINED_MS,10*6e4,0))}}n(swapRecyclePolicy,"swapRecyclePolicy"),r(swapRecyclePolicy,"swapRecyclePolicy");const mb=r(s=>(s/MB).toFixed(0),"mb");function recycleReason(s,e){if(!(!s.enabled||e.swaps<1)){if(s.maxSwaps>0&&e.swaps>=s.maxSwaps)return`${e.swaps} hot swaps in this process (LENSMCP_SWAP_RECYCLE_AFTER=${s.maxSwaps})`;if(s.stuckCloseMs>0&&(e.stuckCloses??0)>0){const a=e.stuckCloses;return`${a} previous app${a===1?" has":"s have"} not finished closing after ${Math.round(s.stuckCloseMs/1e3)}s \u2014 a shutdown hook that never returns keeps the whole app, its connections included, in memory`}if(s.retainedMs>0&&e.retained&&e.retained.gcs>=2&&e.retained.ageMs>=s.retainedMs){const a=e.retained,i=a.ageMs<9e4?`${Math.round(a.ageMs/1e3)}s`:`${Math.round(a.ageMs/6e4)} min`;return`generation ${a.generation} is still in memory ${i} after its app was closed, through ${a.gcs} full GCs \u2014 something still points into it, and only a fresh process gives it back`}if(s.heapRatio>0&&e.limitBytes>0&&e.usedBytes>=s.heapRatio*e.limitBytes){const a=Math.round(e.usedBytes/e.limitBytes*100);return`its heap is ${mb(e.usedBytes)} MB after a full GC, ${a}% of V8's ${mb(e.limitBytes)} MB limit`}if(s.heapFactor>0&&e.settled!==!1&&e.baselineBytes!==void 0&&e.baselineBytes>0&&e.usedBytes>=s.minHeapBytes&&e.usedBytes>=s.heapFactor*e.baselineBytes){const a=(e.usedBytes/e.baselineBytes).toFixed(1);return`its heap is ${mb(e.usedBytes)} MB after a full GC, ${a}\xD7 the ${mb(e.baselineBytes)} MB it booted with \u2014 earlier generations of the bundle are still in memory`}}}n(recycleReason,"recycleReason"),r(recycleReason,"recycleReason");
|
package/tsgo-check-plugin.d.ts
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* services cold in ~1-3s, so instead of holding a program we re-check COLD after each successful
|
|
8
8
|
* rebuild (debounced): idle cost is exactly zero.
|
|
9
9
|
*
|
|
10
|
-
* ONE AT A TIME (issues/foodguard
|
|
10
|
+
* ONE AT A TIME (issues/closed/foodguard-34). "Zero resident" is not "small": a cold check of a real service
|
|
11
11
|
* peaks at 1.4-3.4GB. Every service's plugin used to start its own the moment its build finished, so
|
|
12
12
|
* one edit to a shared file started one per service at the same instant; and a newer build was meant
|
|
13
13
|
* to REPLACE the running check with SIGTERM, which this checker ignores — it runs to the end and
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/** A `paths` key with one `*`, parsed as TypeScript parses it. */
|
|
2
|
+
export interface PathPattern {
|
|
3
|
+
/** The key as written. */
|
|
4
|
+
key: string;
|
|
5
|
+
/** The text before the `*`. */
|
|
6
|
+
prefix: string;
|
|
7
|
+
/** The text after it. */
|
|
8
|
+
suffix: string;
|
|
9
|
+
/** Its substitutions, as written. */
|
|
10
|
+
targets: string[];
|
|
11
|
+
}
|
|
12
|
+
/** A tsconfig's `paths`, as TypeScript reads them. */
|
|
13
|
+
export interface WorkspacePaths {
|
|
14
|
+
/** The tsconfig read, then every file it extends: a change to any of them can change the mapping. */
|
|
15
|
+
configFiles: string[];
|
|
16
|
+
/** What the substitutions resolve against: the effective `baseUrl`, else the directory of the tsconfig that defines `paths`. */
|
|
17
|
+
baseDir: string;
|
|
18
|
+
/** The effective `baseUrl`, when the tsconfig sets one: a bare specifier is also tried under it. */
|
|
19
|
+
baseUrl?: string;
|
|
20
|
+
/** The keys without a `*`. */
|
|
21
|
+
exact: Map<string, string[]>;
|
|
22
|
+
/** The keys with one `*`, in the order written. A key with more than one is ignored, as TypeScript ignores it. */
|
|
23
|
+
patterns: PathPattern[];
|
|
24
|
+
}
|
|
25
|
+
/** A file a bare specifier may resolve to, and what mapped it there. */
|
|
26
|
+
export interface PathCandidate {
|
|
27
|
+
file: string;
|
|
28
|
+
/** The `paths` key, or `baseUrl`. */
|
|
29
|
+
via: string;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* `tsConfig`'s `paths` as TypeScript reads them (`extends` followed, comments allowed) — `null` when the file does
|
|
33
|
+
* not exist or cannot be parsed. `exact` and `patterns` are both empty when it maps nothing.
|
|
34
|
+
*/
|
|
35
|
+
export declare function readWorkspacePaths(tsConfig: string, workspaceRoot: string): WorkspacePaths | null;
|
|
36
|
+
/** Whether `paths` maps anything. */
|
|
37
|
+
export declare function hasPathMappings(paths: WorkspacePaths | null): paths is WorkspacePaths;
|
|
38
|
+
/**
|
|
39
|
+
* The files a bare specifier resolves to under `paths`, in the order TypeScript tries them (module resolution's
|
|
40
|
+
* `tryLoadModuleUsingPaths`, then `tryLoadModuleUsingBaseUrl`): the targets of the key that matches it best — an
|
|
41
|
+
* exact key, else the wildcard with the longest prefix — then the specifier under `baseUrl`. Empty when nothing
|
|
42
|
+
* applies.
|
|
43
|
+
*/
|
|
44
|
+
export declare function workspacePathCandidates(paths: WorkspacePaths, specifier: string): PathCandidate[];
|
|
45
|
+
/** The part of enhanced-resolve's request this reads and passes on. */
|
|
46
|
+
interface ResolveRequest {
|
|
47
|
+
request?: string;
|
|
48
|
+
[key: string]: unknown;
|
|
49
|
+
}
|
|
50
|
+
type ResolveCallback = (err?: Error | null, result?: unknown) => void;
|
|
51
|
+
type ResolveStep = (request: ResolveRequest, resolveContext: unknown, callback: ResolveCallback) => void;
|
|
52
|
+
/** The part of an enhanced-resolve hook this taps. */
|
|
53
|
+
interface ResolveHook {
|
|
54
|
+
tapAsync(name: string, step: ResolveStep): void;
|
|
55
|
+
}
|
|
56
|
+
/** The part of enhanced-resolve's `Resolver` this uses. */
|
|
57
|
+
interface PathsResolver {
|
|
58
|
+
ensureHook(name: string): unknown;
|
|
59
|
+
getHook(name: string): ResolveHook;
|
|
60
|
+
doResolve(hook: unknown, request: ResolveRequest, message: string, resolveContext: unknown, callback: ResolveCallback): void;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* A resolver plugin (`resolve.plugins`) resolving a bare specifier through {@link WorkspacePaths}.
|
|
64
|
+
*
|
|
65
|
+
* It taps `normal-resolve`: after `resolve.alias` (on `raw-resolve`), so an alias a `webpackConfigPath` override
|
|
66
|
+
* sets still wins, and before the lookup in node_modules, so a mapped specifier beats an installed package of the
|
|
67
|
+
* same name, as in `tsc`. Each candidate re-enters resolution the way an alias does — extensions, `index` files and
|
|
68
|
+
* the watcher's missing-file tracking all apply — and the first that resolves is the answer; when none does, the
|
|
69
|
+
* request goes on to node_modules.
|
|
70
|
+
*/
|
|
71
|
+
export declare class WorkspacePathsResolverPlugin {
|
|
72
|
+
readonly paths: WorkspacePaths;
|
|
73
|
+
constructor(paths: WorkspacePaths);
|
|
74
|
+
apply(resolver: PathsResolver): void;
|
|
75
|
+
}
|
|
76
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var x=Object.defineProperty;var f=(s,e)=>x(s,"name",{value:e,configurable:!0});var h=Object.defineProperty,u=f((s,e)=>h(s,"name",{value:e,configurable:!0}),"u");Object.defineProperty(exports,"__esModule",{value:!0}),exports.WorkspacePathsResolverPlugin=void 0,exports.readWorkspacePaths=readWorkspacePaths,exports.hasPathMappings=hasPathMappings,exports.workspacePathCandidates=workspacePathCandidates;const tslib_1=require("tslib"),fs=tslib_1.__importStar(require("node:fs")),node_module_1=require("node:module"),path=tslib_1.__importStar(require("node:path"));function loadTypeScript(s){try{return(0,node_module_1.createRequire)(path.join(s,"package.json"))("typescript")}catch{return require("typescript")}}f(loadTypeScript,"loadTypeScript"),u(loadTypeScript,"loadTypeScript");function readWorkspacePaths(s,e){const i=path.resolve(e,s);if(!fs.existsSync(i))return null;try{const n=loadTypeScript(e),r=n.readJsonConfigFile(i,o=>n.sys.readFile(o)),a={...n.sys,readDirectory:u(()=>[],"readDirectory")},{options:t}=n.parseJsonSourceFileConfigFileContent(r,a,path.dirname(i),void 0,i),l=new Map,d=[];for(const[o,c]of Object.entries(t.paths??{})){if(!Array.isArray(c))continue;const p=o.indexOf("*");p===-1?l.set(o,c):o.indexOf("*",p+1)===-1&&d.push({key:o,prefix:o.slice(0,p),suffix:o.slice(p+1),targets:c})}return{configFiles:[i,...(r.extendedSourceFiles??[]).map(o=>path.resolve(o))],baseDir:t.baseUrl??t.pathsBasePath??path.dirname(i),...t.baseUrl?{baseUrl:t.baseUrl}:{},exact:l,patterns:d}}catch{return null}}f(readWorkspacePaths,"readWorkspacePaths"),u(readWorkspacePaths,"readWorkspacePaths");function hasPathMappings(s){return!!s&&(s.exact.size>0||s.patterns.length>0)}f(hasPathMappings,"hasPathMappings"),u(hasPathMappings,"hasPathMappings");function workspacePathCandidates(s,e){const i=[],n=s.exact.get(e);if(n)for(const r of n)i.push({file:path.resolve(s.baseDir,r),via:e});else{let r;for(const a of s.patterns)e.length<a.prefix.length+a.suffix.length||!e.startsWith(a.prefix)||!e.endsWith(a.suffix)||(!r||a.prefix.length>r.prefix.length)&&(r=a);if(r){const a=e.slice(r.prefix.length,e.length-r.suffix.length);for(const t of r.targets){const l=t.indexOf("*"),d=l===-1?t:t.slice(0,l)+a+t.slice(l+1);i.push({file:path.resolve(s.baseDir,d),via:r.key})}}}return s.baseUrl&&i.push({file:path.resolve(s.baseUrl,e),via:"baseUrl"}),i}f(workspacePathCandidates,"workspacePathCandidates"),u(workspacePathCandidates,"workspacePathCandidates");class WorkspacePathsResolverPlugin{static{f(this,"WorkspacePathsResolverPlugin")}static{u(this,"WorkspacePathsResolverPlugin")}constructor(e){this.paths=e}apply(e){const i=e.ensureHook("internal-resolve");e.getHook("normal-resolve").tapAsync("WorkspacePathsResolverPlugin",(n,r,a)=>{const t=n.request;if(!t||t.startsWith(".")||path.isAbsolute(t))return a();const l=workspacePathCandidates(this.paths,t);let d=0;const o=u(()=>{const c=l[d++];if(!c)return a();e.doResolve(i,{...n,request:c.file,fullySpecified:!1},`aliased with mapping '${c.via}' (tsconfig paths): '${t}' to '${c.file}'`,r,(p,g)=>{if(p)return a(p);if(g)return a(null,g);o()})},"attempt");o()})}}exports.WorkspacePathsResolverPlugin=WorkspacePathsResolverPlugin;
|