ioc-manifest 0.3.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/LICENSE +21 -0
- package/README.md +350 -0
- package/bin/ioc.cjs +19 -0
- package/dist/cli/ioc.d.ts +3 -0
- package/dist/cli/ioc.d.ts.map +1 -0
- package/dist/cli/ioc.js +86 -0
- package/dist/cli/ioc.js.map +1 -0
- package/dist/cli/parseIocCli.d.ts +21 -0
- package/dist/cli/parseIocCli.d.ts.map +1 -0
- package/dist/cli/parseIocCli.js +76 -0
- package/dist/cli/parseIocCli.js.map +1 -0
- package/dist/config/iocConfig.d.ts +97 -0
- package/dist/config/iocConfig.d.ts.map +1 -0
- package/dist/config/iocConfig.js +65 -0
- package/dist/config/iocConfig.js.map +1 -0
- package/dist/config/loadIocConfig.d.ts +25 -0
- package/dist/config/loadIocConfig.d.ts.map +1 -0
- package/dist/config/loadIocConfig.js +245 -0
- package/dist/config/loadIocConfig.js.map +1 -0
- package/dist/config/parseDiscoveryScanDirs.d.ts +6 -0
- package/dist/config/parseDiscoveryScanDirs.d.ts.map +1 -0
- package/dist/config/parseDiscoveryScanDirs.js +78 -0
- package/dist/config/parseDiscoveryScanDirs.js.map +1 -0
- package/dist/core/defaultImplementationSelection.d.ts +14 -0
- package/dist/core/defaultImplementationSelection.d.ts.map +1 -0
- package/dist/core/defaultImplementationSelection.js +47 -0
- package/dist/core/defaultImplementationSelection.js.map +1 -0
- package/dist/core/index.d.ts +4 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/index.js +3 -0
- package/dist/core/index.js.map +1 -0
- package/dist/core/manifest.d.ts +79 -0
- package/dist/core/manifest.d.ts.map +1 -0
- package/dist/core/manifest.js +3 -0
- package/dist/core/manifest.js.map +1 -0
- package/dist/core/resolver.d.ts +18 -0
- package/dist/core/resolver.d.ts.map +1 -0
- package/dist/core/resolver.js +27 -0
- package/dist/core/resolver.js.map +1 -0
- package/dist/generator/contractTypeSourceFile.d.ts +16 -0
- package/dist/generator/contractTypeSourceFile.d.ts.map +1 -0
- package/dist/generator/contractTypeSourceFile.js +236 -0
- package/dist/generator/contractTypeSourceFile.js.map +1 -0
- package/dist/generator/discoverFactories/discoverFactories.d.ts +18 -0
- package/dist/generator/discoverFactories/discoverFactories.d.ts.map +1 -0
- package/dist/generator/discoverFactories/discoverFactories.js +108 -0
- package/dist/generator/discoverFactories/discoverFactories.js.map +1 -0
- package/dist/generator/discoverFactories/discoveryOutcomeTypes.d.ts +47 -0
- package/dist/generator/discoverFactories/discoveryOutcomeTypes.d.ts.map +1 -0
- package/dist/generator/discoverFactories/discoveryOutcomeTypes.js +19 -0
- package/dist/generator/discoverFactories/discoveryOutcomeTypes.js.map +1 -0
- package/dist/generator/discoverFactories/inferFactoryDependencyContracts.d.ts +11 -0
- package/dist/generator/discoverFactories/inferFactoryDependencyContracts.d.ts.map +1 -0
- package/dist/generator/discoverFactories/inferFactoryDependencyContracts.js +118 -0
- package/dist/generator/discoverFactories/inferFactoryDependencyContracts.js.map +1 -0
- package/dist/generator/discoverFactories/scanFactoryFile.d.ts +18 -0
- package/dist/generator/discoverFactories/scanFactoryFile.d.ts.map +1 -0
- package/dist/generator/discoverFactories/scanFactoryFile.js +379 -0
- package/dist/generator/discoverFactories/scanFactoryFile.js.map +1 -0
- package/dist/generator/generateManifest.d.ts +13 -0
- package/dist/generator/generateManifest.d.ts.map +1 -0
- package/dist/generator/generateManifest.js +88 -0
- package/dist/generator/generateManifest.js.map +1 -0
- package/dist/generator/iocProgramContext.d.ts +11 -0
- package/dist/generator/iocProgramContext.d.ts.map +1 -0
- package/dist/generator/iocProgramContext.js +81 -0
- package/dist/generator/iocProgramContext.js.map +1 -0
- package/dist/generator/manifestOptions.d.ts +26 -0
- package/dist/generator/manifestOptions.d.ts.map +1 -0
- package/dist/generator/manifestOptions.js +86 -0
- package/dist/generator/manifestOptions.js.map +1 -0
- package/dist/generator/manifestPaths.d.ts +94 -0
- package/dist/generator/manifestPaths.d.ts.map +1 -0
- package/dist/generator/manifestPaths.js +377 -0
- package/dist/generator/manifestPaths.js.map +1 -0
- package/dist/generator/naming.d.ts +9 -0
- package/dist/generator/naming.d.ts.map +1 -0
- package/dist/generator/naming.js +46 -0
- package/dist/generator/naming.js.map +1 -0
- package/dist/generator/resolveRegistrationPlan.d.ts +66 -0
- package/dist/generator/resolveRegistrationPlan.d.ts.map +1 -0
- package/dist/generator/resolveRegistrationPlan.js +377 -0
- package/dist/generator/resolveRegistrationPlan.js.map +1 -0
- package/dist/generator/types.d.ts +37 -0
- package/dist/generator/types.d.ts.map +1 -0
- package/dist/generator/types.js +2 -0
- package/dist/generator/types.js.map +1 -0
- package/dist/generator/writeManifest.d.ts +19 -0
- package/dist/generator/writeManifest.d.ts.map +1 -0
- package/dist/generator/writeManifest.js +405 -0
- package/dist/generator/writeManifest.js.map +1 -0
- package/dist/groups/baseTypeAssignability.d.ts +48 -0
- package/dist/groups/baseTypeAssignability.d.ts.map +1 -0
- package/dist/groups/baseTypeAssignability.js +145 -0
- package/dist/groups/baseTypeAssignability.js.map +1 -0
- package/dist/groups/resolveGroupPlan.d.ts +85 -0
- package/dist/groups/resolveGroupPlan.d.ts.map +1 -0
- package/dist/groups/resolveGroupPlan.js +215 -0
- package/dist/groups/resolveGroupPlan.js.map +1 -0
- package/dist/index.d.ts +22 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +20 -0
- package/dist/index.js.map +1 -0
- package/dist/inspection/formatReports.d.ts +14 -0
- package/dist/inspection/formatReports.d.ts.map +1 -0
- package/dist/inspection/formatReports.js +115 -0
- package/dist/inspection/formatReports.js.map +1 -0
- package/dist/inspection/index.d.ts +8 -0
- package/dist/inspection/index.d.ts.map +1 -0
- package/dist/inspection/index.js +8 -0
- package/dist/inspection/index.js.map +1 -0
- package/dist/inspection/reports.d.ts +40 -0
- package/dist/inspection/reports.d.ts.map +1 -0
- package/dist/inspection/reports.js +95 -0
- package/dist/inspection/reports.js.map +1 -0
- package/dist/inspection/runDiscoveryAnalysis.d.ts +36 -0
- package/dist/inspection/runDiscoveryAnalysis.d.ts.map +1 -0
- package/dist/inspection/runDiscoveryAnalysis.js +48 -0
- package/dist/inspection/runDiscoveryAnalysis.js.map +1 -0
- package/dist/inspection/validateManifest.d.ts +8 -0
- package/dist/inspection/validateManifest.d.ts.map +1 -0
- package/dist/inspection/validateManifest.js +46 -0
- package/dist/inspection/validateManifest.js.map +1 -0
- package/dist/runtime/bootstrap.d.ts +13 -0
- package/dist/runtime/bootstrap.d.ts.map +1 -0
- package/dist/runtime/bootstrap.js +259 -0
- package/dist/runtime/bootstrap.js.map +1 -0
- package/dist/runtime/index.d.ts +4 -0
- package/dist/runtime/index.d.ts.map +1 -0
- package/dist/runtime/index.js +4 -0
- package/dist/runtime/index.js.map +1 -0
- package/dist/runtime/iocResolutionError.d.ts +54 -0
- package/dist/runtime/iocResolutionError.d.ts.map +1 -0
- package/dist/runtime/iocResolutionError.js +266 -0
- package/dist/runtime/iocResolutionError.js.map +1 -0
- package/dist/runtime/iocResolutionStack.d.ts +21 -0
- package/dist/runtime/iocResolutionStack.d.ts.map +1 -0
- package/dist/runtime/iocResolutionStack.js +17 -0
- package/dist/runtime/iocResolutionStack.js.map +1 -0
- package/dist/runtime/iocRuntimeErrors.d.ts +35 -0
- package/dist/runtime/iocRuntimeErrors.d.ts.map +1 -0
- package/dist/runtime/iocRuntimeErrors.js +27 -0
- package/dist/runtime/iocRuntimeErrors.js.map +1 -0
- package/dist/runtime/registrationKeyIndex.d.ts +12 -0
- package/dist/runtime/registrationKeyIndex.d.ts.map +1 -0
- package/dist/runtime/registrationKeyIndex.js +19 -0
- package/dist/runtime/registrationKeyIndex.js.map +1 -0
- package/package.json +67 -0
|
@@ -0,0 +1,266 @@
|
|
|
1
|
+
import { AwilixResolutionError } from "awilix";
|
|
2
|
+
const registrationKeyOf = (frame) => frame.registrationKey ?? frame.contractName;
|
|
3
|
+
/**
|
|
4
|
+
* Merges an ancestor IoC stack with frames already on an error so parents appear once at the front.
|
|
5
|
+
*/
|
|
6
|
+
export const mergeFrameSequences = (ancestorPrefix, existing) => {
|
|
7
|
+
if (ancestorPrefix.length === 0) {
|
|
8
|
+
return [...existing];
|
|
9
|
+
}
|
|
10
|
+
let matchCount = 0;
|
|
11
|
+
const maxSharedPrefix = Math.min(ancestorPrefix.length, existing.length);
|
|
12
|
+
while (matchCount < maxSharedPrefix &&
|
|
13
|
+
registrationKeyOf(ancestorPrefix[matchCount]) ===
|
|
14
|
+
registrationKeyOf(existing[matchCount])) {
|
|
15
|
+
matchCount += 1;
|
|
16
|
+
}
|
|
17
|
+
if (matchCount === ancestorPrefix.length) {
|
|
18
|
+
return [...existing];
|
|
19
|
+
}
|
|
20
|
+
return [...ancestorPrefix, ...existing.slice(matchCount)];
|
|
21
|
+
};
|
|
22
|
+
const stackFrameToResolutionFrame = (frame) => ({
|
|
23
|
+
contractName: frame.contractName,
|
|
24
|
+
implementationName: frame.implementationName,
|
|
25
|
+
modulePath: frame.modulePath,
|
|
26
|
+
registrationKey: frame.registrationKey,
|
|
27
|
+
});
|
|
28
|
+
const frameFromRegistrationKey = (key, keyIndex) => {
|
|
29
|
+
const meta = keyIndex.metaByRegistrationKey.get(key);
|
|
30
|
+
if (meta !== undefined) {
|
|
31
|
+
return {
|
|
32
|
+
contractName: meta.contractName,
|
|
33
|
+
implementationName: meta.implementationName,
|
|
34
|
+
modulePath: meta.modulePath,
|
|
35
|
+
registrationKey: key,
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
const contract = keyIndex.contractByAccessKey.get(key);
|
|
39
|
+
if (contract !== undefined) {
|
|
40
|
+
return {
|
|
41
|
+
contractName: contract,
|
|
42
|
+
registrationKey: key,
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
return { contractName: key, registrationKey: key };
|
|
46
|
+
};
|
|
47
|
+
const parseAwilixResolutionPath = (message) => {
|
|
48
|
+
const match = message.match(/Resolution path:\s*(.+?)(?:\r?\n|$)/);
|
|
49
|
+
if (match === null || match[1] === undefined) {
|
|
50
|
+
return undefined;
|
|
51
|
+
}
|
|
52
|
+
const parts = match[1]
|
|
53
|
+
.split("->")
|
|
54
|
+
.map((part) => part.trim())
|
|
55
|
+
.filter((part) => part.length > 0);
|
|
56
|
+
return parts.length > 0 ? parts : undefined;
|
|
57
|
+
};
|
|
58
|
+
const classifyAwilixResolutionError = (message) => {
|
|
59
|
+
if (message.includes("Cyclic dependencies detected")) {
|
|
60
|
+
return "cyclic";
|
|
61
|
+
}
|
|
62
|
+
if (message.includes("has a shorter lifetime than its ancestor")) {
|
|
63
|
+
return "lifetime";
|
|
64
|
+
}
|
|
65
|
+
return "missing";
|
|
66
|
+
};
|
|
67
|
+
const describeFrameLine = (frame, keyIndex) => {
|
|
68
|
+
const key = frame.registrationKey;
|
|
69
|
+
if (key !== undefined) {
|
|
70
|
+
const meta = keyIndex.metaByRegistrationKey.get(key);
|
|
71
|
+
if (meta !== undefined) {
|
|
72
|
+
const fileSuffix = meta.modulePath.length > 0 ? ` [${meta.modulePath}]` : "";
|
|
73
|
+
return `${meta.contractName} (${meta.implementationName})${fileSuffix}`;
|
|
74
|
+
}
|
|
75
|
+
const contract = keyIndex.contractByAccessKey.get(key);
|
|
76
|
+
if (contract !== undefined) {
|
|
77
|
+
return `${contract} (contract default slot ${JSON.stringify(key)})`;
|
|
78
|
+
}
|
|
79
|
+
return key;
|
|
80
|
+
}
|
|
81
|
+
const fileSuffix = frame.modulePath !== undefined && frame.modulePath.length > 0
|
|
82
|
+
? ` [${frame.modulePath}]`
|
|
83
|
+
: "";
|
|
84
|
+
const implementationSuffix = frame.implementationName !== undefined &&
|
|
85
|
+
frame.implementationName.length > 0
|
|
86
|
+
? ` (${frame.implementationName})`
|
|
87
|
+
: "";
|
|
88
|
+
return `${frame.contractName}${implementationSuffix}${fileSuffix}`;
|
|
89
|
+
};
|
|
90
|
+
const formatHeadline = (frames, keyIndex) => {
|
|
91
|
+
const first = frames[0];
|
|
92
|
+
if (first === undefined) {
|
|
93
|
+
return "Container resolution failed.";
|
|
94
|
+
}
|
|
95
|
+
const key = first.registrationKey;
|
|
96
|
+
if (key !== undefined) {
|
|
97
|
+
const meta = keyIndex.metaByRegistrationKey.get(key);
|
|
98
|
+
if (meta !== undefined) {
|
|
99
|
+
return `Cannot build ${meta.contractName} using implementation ${meta.implementationName}.`;
|
|
100
|
+
}
|
|
101
|
+
const contract = keyIndex.contractByAccessKey.get(key);
|
|
102
|
+
if (contract !== undefined) {
|
|
103
|
+
return `Cannot resolve ${contract} (contract default slot ${JSON.stringify(key)}).`;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
if (first.implementationName !== undefined &&
|
|
107
|
+
first.implementationName.length > 0) {
|
|
108
|
+
return `Cannot build ${first.contractName} using implementation ${first.implementationName}.`;
|
|
109
|
+
}
|
|
110
|
+
return `Cannot build ${first.contractName}.`;
|
|
111
|
+
};
|
|
112
|
+
const formatChainWithUniformLeaf = (frames, keyIndex, leafText) => {
|
|
113
|
+
if (frames.length === 0) {
|
|
114
|
+
return `Resolution chain:\n ${leafText}\n`;
|
|
115
|
+
}
|
|
116
|
+
if (frames.length === 1) {
|
|
117
|
+
return `Resolution chain:\n ${describeFrameLine(frames[0], keyIndex)} ${leafText}\n`;
|
|
118
|
+
}
|
|
119
|
+
let out = "Resolution chain:\n";
|
|
120
|
+
for (let i = 0; i < frames.length - 1; i += 1) {
|
|
121
|
+
const pad = " ".repeat(i + 1);
|
|
122
|
+
const connector = i === 0 ? "" : "-> ";
|
|
123
|
+
out += `${pad}${connector}${describeFrameLine(frames[i], keyIndex)}\n`;
|
|
124
|
+
}
|
|
125
|
+
const last = frames[frames.length - 1];
|
|
126
|
+
const lastPad = " ".repeat(frames.length);
|
|
127
|
+
out += `${lastPad}-> ${describeFrameLine(last, keyIndex)} ${leafText}\n`;
|
|
128
|
+
return out;
|
|
129
|
+
};
|
|
130
|
+
const formatResolutionChainBlock = (err, keyIndex) => {
|
|
131
|
+
const frames = err.frames;
|
|
132
|
+
if (frames.length === 0) {
|
|
133
|
+
if (err.failureType === "threw") {
|
|
134
|
+
const detail = err.throwDetail ?? err.cause?.message ?? "unknown error";
|
|
135
|
+
return `Resolution chain:\n ✖ factory threw while building: ${detail}\n`;
|
|
136
|
+
}
|
|
137
|
+
return `Resolution chain:\n ✖ ${err.awilixDetail ?? "resolution failed"}\n`;
|
|
138
|
+
}
|
|
139
|
+
if (err.failureType === "missing") {
|
|
140
|
+
if (frames.length === 1) {
|
|
141
|
+
return `Resolution chain:\n ${describeFrameLine(frames[0], keyIndex)} ✖ no registered implementation\n`;
|
|
142
|
+
}
|
|
143
|
+
let out = "Resolution chain:\n";
|
|
144
|
+
for (let i = 0; i < frames.length - 1; i += 1) {
|
|
145
|
+
const pad = " ".repeat(i + 1);
|
|
146
|
+
const connector = i === 0 ? "" : "-> ";
|
|
147
|
+
out += `${pad}${connector}${describeFrameLine(frames[i], keyIndex)}\n`;
|
|
148
|
+
}
|
|
149
|
+
const last = frames[frames.length - 1];
|
|
150
|
+
const lastPad = " ".repeat(frames.length);
|
|
151
|
+
out += `${lastPad}-> ${describeFrameLine(last, keyIndex)} ✖ no registered implementation\n`;
|
|
152
|
+
return out;
|
|
153
|
+
}
|
|
154
|
+
if (err.failureType === "cyclic") {
|
|
155
|
+
return formatChainWithUniformLeaf(frames, keyIndex, "✖ cyclic dependency detected");
|
|
156
|
+
}
|
|
157
|
+
if (err.failureType === "lifetime") {
|
|
158
|
+
return formatChainWithUniformLeaf(frames, keyIndex, "✖ dependency lifetime is shorter than an ancestor (strict mode)");
|
|
159
|
+
}
|
|
160
|
+
const detail = err.throwDetail ?? err.cause?.message ?? "unknown error";
|
|
161
|
+
let out = "Resolution chain:\n";
|
|
162
|
+
for (let i = 0; i < frames.length; i += 1) {
|
|
163
|
+
const pad = " ".repeat(i + 1);
|
|
164
|
+
const connector = i === 0 ? "" : "-> ";
|
|
165
|
+
out += `${pad}${connector}${describeFrameLine(frames[i], keyIndex)}\n`;
|
|
166
|
+
}
|
|
167
|
+
const leafPad = " ".repeat(frames.length + 1);
|
|
168
|
+
out += `${leafPad}✖ factory threw while building: ${detail}\n`;
|
|
169
|
+
return out;
|
|
170
|
+
};
|
|
171
|
+
/**
|
|
172
|
+
* Builds the final user-facing message from structured data (single formatting site).
|
|
173
|
+
*/
|
|
174
|
+
export const formatIocResolutionErrorMessage = (err, keyIndex) => {
|
|
175
|
+
const headline = formatHeadline(err.frames, keyIndex);
|
|
176
|
+
const chain = formatResolutionChainBlock(err, keyIndex);
|
|
177
|
+
return `[ioc] ${headline}\n\n${chain}`.trimEnd();
|
|
178
|
+
};
|
|
179
|
+
export class IocResolutionError extends Error {
|
|
180
|
+
frames;
|
|
181
|
+
failureType;
|
|
182
|
+
cause;
|
|
183
|
+
/** Set when failureType === "threw" (plain message, not another IocResolutionError string). */
|
|
184
|
+
throwDetail;
|
|
185
|
+
/** Awilix diagnostic when failureType is cyclic or lifetime. */
|
|
186
|
+
awilixDetail;
|
|
187
|
+
constructor(init) {
|
|
188
|
+
super(init.message ?? "");
|
|
189
|
+
this.name = "IocResolutionError";
|
|
190
|
+
this.frames = [...init.frames];
|
|
191
|
+
this.failureType = init.failureType;
|
|
192
|
+
this.cause = init.cause;
|
|
193
|
+
this.throwDetail = init.throwDetail;
|
|
194
|
+
this.awilixDetail = init.awilixDetail;
|
|
195
|
+
Object.setPrototypeOf(this, new.target.prototype);
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
export const isIocResolutionError = (value) => value instanceof IocResolutionError;
|
|
199
|
+
const createFromAwilix = (cause, keyIndex, stackSnapshot) => {
|
|
200
|
+
const path = parseAwilixResolutionPath(cause.message);
|
|
201
|
+
const kind = classifyAwilixResolutionError(cause.message);
|
|
202
|
+
const failureType = kind === "cyclic" ? "cyclic" : kind === "lifetime" ? "lifetime" : "missing";
|
|
203
|
+
const pathFrames = path !== undefined
|
|
204
|
+
? path.map((key) => frameFromRegistrationKey(key, keyIndex))
|
|
205
|
+
: undefined;
|
|
206
|
+
const stackFrames = stackSnapshot.map(stackFrameToResolutionFrame);
|
|
207
|
+
const frames = pathFrames !== undefined && pathFrames.length > 0
|
|
208
|
+
? mergeFrameSequences(stackFrames, pathFrames)
|
|
209
|
+
: stackFrames;
|
|
210
|
+
return new IocResolutionError({
|
|
211
|
+
frames,
|
|
212
|
+
failureType,
|
|
213
|
+
cause,
|
|
214
|
+
awilixDetail: cause.message.trim(),
|
|
215
|
+
});
|
|
216
|
+
};
|
|
217
|
+
const createFromFactoryThrow = (cause, stackSnapshot) => {
|
|
218
|
+
const frames = stackSnapshot.map(stackFrameToResolutionFrame);
|
|
219
|
+
const original = cause instanceof Error
|
|
220
|
+
? cause
|
|
221
|
+
: new Error(typeof cause === "string" ? cause : String(cause));
|
|
222
|
+
const throwDetail = original.message.length > 0 ? original.message : String(cause);
|
|
223
|
+
return new IocResolutionError({
|
|
224
|
+
frames,
|
|
225
|
+
failureType: "threw",
|
|
226
|
+
cause: cause instanceof Error ? cause : original,
|
|
227
|
+
throwDetail,
|
|
228
|
+
});
|
|
229
|
+
};
|
|
230
|
+
/**
|
|
231
|
+
* Normalizes any thrown value into an {@link IocResolutionError} without formatting nested IoC errors as strings.
|
|
232
|
+
*/
|
|
233
|
+
export const createIocResolutionError = (cause, keyIndex, stackSnapshot) => {
|
|
234
|
+
if (cause instanceof IocResolutionError) {
|
|
235
|
+
return cause;
|
|
236
|
+
}
|
|
237
|
+
if (cause instanceof AwilixResolutionError) {
|
|
238
|
+
return createFromAwilix(cause, keyIndex, stackSnapshot);
|
|
239
|
+
}
|
|
240
|
+
return createFromFactoryThrow(cause, stackSnapshot);
|
|
241
|
+
};
|
|
242
|
+
/**
|
|
243
|
+
* Merges the current IoC stack into an existing resolution error and refreshes {@link Error.message} once.
|
|
244
|
+
*/
|
|
245
|
+
export const mergeAncestorStackIntoResolutionError = (err, ancestorStack) => {
|
|
246
|
+
const ancestors = ancestorStack.map(stackFrameToResolutionFrame);
|
|
247
|
+
err.frames = mergeFrameSequences(ancestors, err.frames);
|
|
248
|
+
};
|
|
249
|
+
export const applyIocResolutionErrorMessage = (err, keyIndex) => {
|
|
250
|
+
err.message = formatIocResolutionErrorMessage(err, keyIndex);
|
|
251
|
+
};
|
|
252
|
+
/**
|
|
253
|
+
* Single entry from factory/collection/group boundaries: structured propagation, no nested string wrapping.
|
|
254
|
+
*/
|
|
255
|
+
export const propagateIocResolutionFailure = (params) => {
|
|
256
|
+
const { cause, keyIndex, stackSnapshot } = params;
|
|
257
|
+
if (isIocResolutionError(cause)) {
|
|
258
|
+
mergeAncestorStackIntoResolutionError(cause, stackSnapshot);
|
|
259
|
+
applyIocResolutionErrorMessage(cause, keyIndex);
|
|
260
|
+
throw cause;
|
|
261
|
+
}
|
|
262
|
+
const err = createIocResolutionError(cause, keyIndex, stackSnapshot);
|
|
263
|
+
applyIocResolutionErrorMessage(err, keyIndex);
|
|
264
|
+
throw err;
|
|
265
|
+
};
|
|
266
|
+
//# sourceMappingURL=iocResolutionError.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"iocResolutionError.js","sourceRoot":"","sources":["../../src/runtime/iocResolutionError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,QAAQ,CAAC;AAkB/C,MAAM,iBAAiB,GAAG,CAAC,KAAsB,EAAU,EAAE,CAC3D,KAAK,CAAC,eAAe,IAAI,KAAK,CAAC,YAAY,CAAC;AAE9C;;GAEG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CACjC,cAA0C,EAC1C,QAAoC,EACjB,EAAE;IACrB,IAAI,cAAc,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAChC,OAAO,CAAC,GAAG,QAAQ,CAAC,CAAC;IACvB,CAAC;IAED,IAAI,UAAU,GAAG,CAAC,CAAC;IACnB,MAAM,eAAe,GAAG,IAAI,CAAC,GAAG,CAAC,cAAc,CAAC,MAAM,EAAE,QAAQ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,EAAE,aAAa,CAAC,CAAC;AACtD,CAAC,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,qCAAqC,GAAG,CACnD,GAAuB,EACvB,aAA4C,EACtC,EAAE;IACR,MAAM,SAAS,GAAG,aAAa,CAAC,GAAG,CAAC,2BAA2B,CAAC,CAAC;IACjE,GAAG,CAAC,MAAM,GAAG,mBAAmB,CAAC,SAAS,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;AAC1D,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,8BAA8B,GAAG,CAC5C,GAAuB,EACvB,QAA8B,EACxB,EAAE;IACR,GAAG,CAAC,OAAO,GAAG,+BAA+B,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;AAC/D,CAAC,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAAC,MAI7C,EAAS,EAAE;IACV,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,aAAa,EAAE,GAAG,MAAM,CAAC;IAElD,IAAI,oBAAoB,CAAC,KAAK,CAAC,EAAE,CAAC;QAChC,qCAAqC,CAAC,KAAK,EAAE,aAAa,CAAC,CAAC;QAC5D,8BAA8B,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;QAChD,MAAM,KAAK,CAAC;IACd,CAAC;IAED,MAAM,GAAG,GAAG,wBAAwB,CAAC,KAAK,EAAE,QAAQ,EAAE,aAAa,CAAC,CAAC;IACrE,8BAA8B,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;IAC9C,MAAM,GAAG,CAAC;AACZ,CAAC,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { ModuleFactoryManifestMetadata } from "../core/manifest.js";
|
|
2
|
+
/**
|
|
3
|
+
* Lightweight resolution stack used while factories, multi-implementation collections, and
|
|
4
|
+
* group resolvers run. Frames are pushed before invoking user code and popped in `finally`
|
|
5
|
+
* so `snapshotIocResolutionStack` captures the path leading to failures.
|
|
6
|
+
*
|
|
7
|
+
* Note: this is a module-level array (not true async context isolation). It is safe under
|
|
8
|
+
* Node’s single-threaded event loop as long as resolution does not `await` between push
|
|
9
|
+
* and pop; avoid yielding inside factory bodies if you rely on stack accuracy.
|
|
10
|
+
*/
|
|
11
|
+
export type IocResolutionFrame = {
|
|
12
|
+
contractName: string;
|
|
13
|
+
implementationName: string;
|
|
14
|
+
registrationKey: string;
|
|
15
|
+
modulePath?: string;
|
|
16
|
+
};
|
|
17
|
+
export declare const pushIocResolutionFrame: (frame: IocResolutionFrame) => void;
|
|
18
|
+
export declare const popIocResolutionFrame: () => void;
|
|
19
|
+
export declare const snapshotIocResolutionStack: () => readonly IocResolutionFrame[];
|
|
20
|
+
export declare const frameFromManifestMeta: (meta: ModuleFactoryManifestMetadata) => IocResolutionFrame;
|
|
21
|
+
//# sourceMappingURL=iocResolutionStack.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"iocResolutionStack.d.ts","sourceRoot":"","sources":["../../src/runtime/iocResolutionStack.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,qBAAqB,CAAC;AAEzE;;;;;;;;GAQG;AACH,MAAM,MAAM,kBAAkB,GAAG;IAC/B,YAAY,EAAE,MAAM,CAAC;IACrB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,eAAe,EAAE,MAAM,CAAC;IACxB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAIF,eAAO,MAAM,sBAAsB,GAAI,OAAO,kBAAkB,KAAG,IAElE,CAAC;AAEF,eAAO,MAAM,qBAAqB,QAAO,IAExC,CAAC;AAEF,eAAO,MAAM,0BAA0B,QAAO,SAAS,kBAAkB,EAExE,CAAC;AAEF,eAAO,MAAM,qBAAqB,GAChC,MAAM,6BAA6B,KAClC,kBAKD,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
const stack = [];
|
|
2
|
+
export const pushIocResolutionFrame = (frame) => {
|
|
3
|
+
stack.push(frame);
|
|
4
|
+
};
|
|
5
|
+
export const popIocResolutionFrame = () => {
|
|
6
|
+
stack.pop();
|
|
7
|
+
};
|
|
8
|
+
export const snapshotIocResolutionStack = () => [
|
|
9
|
+
...stack,
|
|
10
|
+
];
|
|
11
|
+
export const frameFromManifestMeta = (meta) => ({
|
|
12
|
+
contractName: meta.contractName,
|
|
13
|
+
implementationName: meta.implementationName,
|
|
14
|
+
registrationKey: meta.registrationKey,
|
|
15
|
+
modulePath: meta.modulePath,
|
|
16
|
+
});
|
|
17
|
+
//# sourceMappingURL=iocResolutionStack.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"iocResolutionStack.js","sourceRoot":"","sources":["../../src/runtime/iocResolutionStack.ts"],"names":[],"mappings":"AAkBA,MAAM,KAAK,GAAyB,EAAE,CAAC;AAEvC,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,KAAyB,EAAQ,EAAE;IACxE,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AACpB,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,qBAAqB,GAAG,GAAS,EAAE;IAC9C,KAAK,CAAC,GAAG,EAAE,CAAC;AACd,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,0BAA0B,GAAG,GAAkC,EAAE,CAAC;IAC7E,GAAG,KAAK;CACT,CAAC;AAEF,MAAM,CAAC,MAAM,qBAAqB,GAAG,CACnC,IAAmC,EACf,EAAE,CAAC,CAAC;IACxB,YAAY,EAAE,IAAI,CAAC,YAAY;IAC/B,kBAAkB,EAAE,IAAI,CAAC,kBAAkB;IAC3C,eAAe,EAAE,IAAI,CAAC,eAAe;IACrC,UAAU,EAAE,IAAI,CAAC,UAAU;CAC5B,CAAC,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview User-facing error message builders for predictable runtime failures (missing
|
|
3
|
+
* exports, misaligned manifest imports, ambiguous defaults). Prefer these over ad hoc strings
|
|
4
|
+
* so the CLI and library stay consistent.
|
|
5
|
+
*/
|
|
6
|
+
export type MissingDefaultContext = {
|
|
7
|
+
contractName: string;
|
|
8
|
+
implementationNames: string[];
|
|
9
|
+
registrationKeys: string[];
|
|
10
|
+
};
|
|
11
|
+
export declare const formatMissingDefaultImplementationMessage: (ctx: MissingDefaultContext) => string;
|
|
12
|
+
export type MissingContractImplementationContext = {
|
|
13
|
+
contractName: string;
|
|
14
|
+
requestedBy?: string;
|
|
15
|
+
};
|
|
16
|
+
export declare const formatMissingContractImplementationMessage: (ctx: MissingContractImplementationContext) => string;
|
|
17
|
+
export type MissingFactoryExportContext = {
|
|
18
|
+
modulePath: string;
|
|
19
|
+
exportName: string;
|
|
20
|
+
contractName: string;
|
|
21
|
+
registrationKey: string;
|
|
22
|
+
};
|
|
23
|
+
export declare const formatMissingFactoryExportMessage: (ctx: MissingFactoryExportContext) => string;
|
|
24
|
+
export type MissingModuleImportContext = {
|
|
25
|
+
moduleIndex: number;
|
|
26
|
+
modulePath: string;
|
|
27
|
+
};
|
|
28
|
+
export declare const formatMissingModuleImportMessage: (ctx: MissingModuleImportContext) => string;
|
|
29
|
+
export type MissingDependencyContext = {
|
|
30
|
+
implementationLabel: string;
|
|
31
|
+
modulePath: string;
|
|
32
|
+
missingContractName: string;
|
|
33
|
+
};
|
|
34
|
+
export declare const formatMissingDependencyMessage: (ctx: MissingDependencyContext) => string;
|
|
35
|
+
//# sourceMappingURL=iocRuntimeErrors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"iocRuntimeErrors.d.ts","sourceRoot":"","sources":["../../src/runtime/iocRuntimeErrors.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,MAAM,qBAAqB,GAAG;IAClC,YAAY,EAAE,MAAM,CAAC;IACrB,mBAAmB,EAAE,MAAM,EAAE,CAAC;IAC9B,gBAAgB,EAAE,MAAM,EAAE,CAAC;CAC5B,CAAC;AAEF,eAAO,MAAM,yCAAyC,GACpD,KAAK,qBAAqB,KACzB,MAUF,CAAC;AAEF,MAAM,MAAM,oCAAoC,GAAG;IACjD,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,eAAO,MAAM,0CAA0C,GACrD,KAAK,oCAAoC,KACxC,MAMF,CAAC;AAEF,MAAM,MAAM,2BAA2B,GAAG;IACxC,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,eAAe,EAAE,MAAM,CAAC;CACzB,CAAC;AAEF,eAAO,MAAM,iCAAiC,GAC5C,KAAK,2BAA2B,KAC/B,MAIU,CAAC;AAEd,MAAM,MAAM,0BAA0B,GAAG;IACvC,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,eAAO,MAAM,gCAAgC,GAC3C,KAAK,0BAA0B,KAC9B,MACsM,CAAC;AAE1M,MAAM,MAAM,wBAAwB,GAAG;IACrC,mBAAmB,EAAE,MAAM,CAAC;IAC5B,UAAU,EAAE,MAAM,CAAC;IACnB,mBAAmB,EAAE,MAAM,CAAC;CAC7B,CAAC;AAEF,eAAO,MAAM,8BAA8B,GAAI,KAAK,wBAAwB,KAAG,MAIlE,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export const formatMissingDefaultImplementationMessage = (ctx) => {
|
|
2
|
+
const implList = ctx.implementationNames
|
|
3
|
+
.map((n) => JSON.stringify(n))
|
|
4
|
+
.join(", ");
|
|
5
|
+
const keys = ctx.registrationKeys.map((k) => JSON.stringify(k)).join(", ");
|
|
6
|
+
return [
|
|
7
|
+
`[ioc] Multiple implementations for contract ${JSON.stringify(ctx.contractName)} (${implList}) but no default is selected for the contract slot.`,
|
|
8
|
+
`Mark exactly one implementation with default: true (resolver or ioc.config), register exactly one implementation under the camel-cased contract key, or reduce to a single implementation.`,
|
|
9
|
+
`Implementation registration keys: ${keys}.`,
|
|
10
|
+
].join(" ");
|
|
11
|
+
};
|
|
12
|
+
export const formatMissingContractImplementationMessage = (ctx) => {
|
|
13
|
+
const who = ctx.requestedBy !== undefined && ctx.requestedBy.length > 0
|
|
14
|
+
? `Requested as ${JSON.stringify(ctx.requestedBy)}. `
|
|
15
|
+
: "";
|
|
16
|
+
return `${who}No implementation is registered for contract ${JSON.stringify(ctx.contractName)}. Add a discoverable factory that returns that contract (or fix ioc.config / discovery globs), then re-run manifest generation.`;
|
|
17
|
+
};
|
|
18
|
+
export const formatMissingFactoryExportMessage = (ctx) => [
|
|
19
|
+
`[ioc] Module ${JSON.stringify(ctx.modulePath)} has no callable factory export ${JSON.stringify(ctx.exportName)} for contract ${JSON.stringify(ctx.contractName)} (registration ${JSON.stringify(ctx.registrationKey)}).`,
|
|
20
|
+
`Ensure the export exists at runtime, matches the manifest exportName, and is a function. Re-run manifest generation if the module path or export changed.`,
|
|
21
|
+
].join(" ");
|
|
22
|
+
export const formatMissingModuleImportMessage = (ctx) => `[ioc] iocModuleImports[${ctx.moduleIndex}] is missing for source ${JSON.stringify(ctx.modulePath)}. The import array must align with moduleIndex values in the manifest (re-run manifest generation).`;
|
|
23
|
+
export const formatMissingDependencyMessage = (ctx) => [
|
|
24
|
+
`[ioc] While building ${ctx.implementationLabel} (${JSON.stringify(ctx.modulePath)}), dependency ${JSON.stringify(ctx.missingContractName)} could not be satisfied.`,
|
|
25
|
+
`Register an implementation for ${JSON.stringify(ctx.missingContractName)} in the manifest, or fix the factory's dependency/cradle usage.`,
|
|
26
|
+
].join(" ");
|
|
27
|
+
//# sourceMappingURL=iocRuntimeErrors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"iocRuntimeErrors.js","sourceRoot":"","sources":["../../src/runtime/iocRuntimeErrors.ts"],"names":[],"mappings":"AAWA,MAAM,CAAC,MAAM,yCAAyC,GAAG,CACv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AAC,eAAe,CAAC,IAAI;IACzN,2JAA2J;CAC5J,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAOd,MAAM,CAAC,MAAM,gCAAgC,GAAG,CAC9C,GAA+B,EACvB,EAAE,CACV,0BAA0B,GAAG,CAAC,WAAW,2BAA2B,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,UAAU,CAAC,qGAAqG,CAAC;AAQ1M,MAAM,CAAC,MAAM,8BAA8B,GAAG,CAAC,GAA6B,EAAU,EAAE,CACtF;IACE,wBAAwB,GAAG,CAAC,mBAAmB,KAAK,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,UAAU,CAAC,iBAAiB,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,mBAAmB,CAAC,0BAA0B;IACpK,kCAAkC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,mBAAmB,CAAC,iEAAiE;CAC3I,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Fast lookups from Awilix keys back to manifest metadata and contract default slots.
|
|
3
|
+
* Built once per `registerIocFromManifest` call to enrich resolution errors.
|
|
4
|
+
*/
|
|
5
|
+
import type { IocContractManifest, ModuleFactoryManifestMetadata } from "../core/manifest.js";
|
|
6
|
+
export type RegistrationKeyIndex = {
|
|
7
|
+
readonly metaByRegistrationKey: ReadonlyMap<string, ModuleFactoryManifestMetadata>;
|
|
8
|
+
/** Contract name for each cradle default-slot key (convention or `$contract.accessKey`). */
|
|
9
|
+
readonly contractByAccessKey: ReadonlyMap<string, string>;
|
|
10
|
+
};
|
|
11
|
+
export declare const buildRegistrationKeyIndex: (manifestByContract: IocContractManifest) => RegistrationKeyIndex;
|
|
12
|
+
//# sourceMappingURL=registrationKeyIndex.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registrationKeyIndex.d.ts","sourceRoot":"","sources":["../../src/runtime/registrationKeyIndex.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EACV,mBAAmB,EACnB,6BAA6B,EAC9B,MAAM,qBAAqB,CAAC;AAG7B,MAAM,MAAM,oBAAoB,GAAG;IACjC,QAAQ,CAAC,qBAAqB,EAAE,WAAW,CACzC,MAAM,EACN,6BAA6B,CAC9B,CAAC;IACF,4FAA4F;IAC5F,QAAQ,CAAC,mBAAmB,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC3D,CAAC;AAEF,eAAO,MAAM,yBAAyB,GACpC,oBAAoB,mBAAmB,KACtC,oBAoBF,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { contractNameToDefaultRegistrationKey } from "../generator/naming.js";
|
|
2
|
+
export const buildRegistrationKeyIndex = (manifestByContract) => {
|
|
3
|
+
const metaByRegistrationKey = new Map();
|
|
4
|
+
const contractByAccessKey = new Map();
|
|
5
|
+
for (const contractName of Object.keys(manifestByContract)) {
|
|
6
|
+
const impls = manifestByContract[contractName];
|
|
7
|
+
const list = Object.values(impls);
|
|
8
|
+
const explicit = list.find((m) => m.accessKey !== undefined)?.accessKey;
|
|
9
|
+
const slotKey = explicit ?? contractNameToDefaultRegistrationKey(contractName);
|
|
10
|
+
contractByAccessKey.set(slotKey, contractName);
|
|
11
|
+
}
|
|
12
|
+
for (const impls of Object.values(manifestByContract)) {
|
|
13
|
+
for (const meta of Object.values(impls)) {
|
|
14
|
+
metaByRegistrationKey.set(meta.registrationKey, meta);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
return { metaByRegistrationKey, contractByAccessKey };
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=registrationKeyIndex.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registrationKeyIndex.js","sourceRoot":"","sources":["../../src/runtime/registrationKeyIndex.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,oCAAoC,EAAE,MAAM,wBAAwB,CAAC;AAW9E,MAAM,CAAC,MAAM,yBAAyB,GAAG,CACvC,kBAAuC,EACjB,EAAE;IACxB,MAAM,qBAAqB,GAAG,IAAI,GAAG,EAAyC,CAAC;IAC/E,MAAM,mBAAmB,GAAG,IAAI,GAAG,EAAkB,CAAC;IAEtD,KAAK,MAAM,YAAY,IAAI,MAAM,CAAC,IAAI,CAAC,kBAAkB,CAAC,EAAE,CAAC;QAC3D,MAAM,KAAK,GAAG,kBAAkB,CAAC,YAAY,CAAE,CAAC;QAChD,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAClC,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,SAAS,KAAK,SAAS,CAAC,EAAE,SAAS,CAAC;QACxE,MAAM,OAAO,GACX,QAAQ,IAAI,oCAAoC,CAAC,YAAY,CAAC,CAAC;QACjE,mBAAmB,CAAC,GAAG,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC;IACjD,CAAC;IAED,KAAK,MAAM,KAAK,IAAI,MAAM,CAAC,MAAM,CAAC,kBAAkB,CAAC,EAAE,CAAC;QACtD,KAAK,MAAM,IAAI,IAAI,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC;YACxC,qBAAqB,CAAC,GAAG,CAAC,IAAI,CAAC,eAAe,EAAE,IAAI,CAAC,CAAC;QACxD,CAAC;IACH,CAAC;IAED,OAAO,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,CAAC;AACxD,CAAC,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "ioc-manifest",
|
|
3
|
+
"version": "0.3.0",
|
|
4
|
+
"description": "Build-time factory discovery and codegen: generates a typed Awilix (PROXY) registration manifest from TypeScript sources with ioc.config as the single policy surface.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/reharik/ioc-manifest.git"
|
|
9
|
+
},
|
|
10
|
+
"bugs": {
|
|
11
|
+
"url": "https://github.com/reharik/ioc-manifest/issues"
|
|
12
|
+
},
|
|
13
|
+
"homepage": "https://github.com/reharik/ioc-manifest#readme",
|
|
14
|
+
"keywords": [
|
|
15
|
+
"awilix",
|
|
16
|
+
"dependency-injection",
|
|
17
|
+
"ioc",
|
|
18
|
+
"typescript",
|
|
19
|
+
"codegen",
|
|
20
|
+
"manifest",
|
|
21
|
+
"proxy",
|
|
22
|
+
"container",
|
|
23
|
+
"di"
|
|
24
|
+
],
|
|
25
|
+
"type": "module",
|
|
26
|
+
"files": [
|
|
27
|
+
"bin",
|
|
28
|
+
"dist",
|
|
29
|
+
"LICENSE",
|
|
30
|
+
"README.md"
|
|
31
|
+
],
|
|
32
|
+
"main": "./dist/index.js",
|
|
33
|
+
"types": "./dist/index.d.ts",
|
|
34
|
+
"exports": {
|
|
35
|
+
".": {
|
|
36
|
+
"types": "./dist/index.d.ts",
|
|
37
|
+
"import": "./dist/index.js"
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
"bin": {
|
|
41
|
+
"ioc": "./bin/ioc.cjs"
|
|
42
|
+
},
|
|
43
|
+
"engines": {
|
|
44
|
+
"node": ">=18"
|
|
45
|
+
},
|
|
46
|
+
"scripts": {
|
|
47
|
+
"clean:dist": "rm -rf dist",
|
|
48
|
+
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
49
|
+
"build": "npm run clean:dist && tsc -p tsconfig.json",
|
|
50
|
+
"prepare": "npm run build",
|
|
51
|
+
"prepublishOnly": "npm run typecheck && npm test && npm run build && npm pack --dry-run",
|
|
52
|
+
"publish:dry-run": "npm run build && npm pack --dry-run",
|
|
53
|
+
"test": "node --import tsx --test src/cli/parseIocCli.test.ts src/config/loadIocConfig.test.ts src/config/parseDiscoveryScanDirs.test.ts src/core/defaultImplementationSelection.test.ts src/core/resolveRegistrationKey.test.ts src/groups/baseTypeAssignability.test.ts src/groups/resolveGroupPlan.test.ts src/groups/resolveGroupPlan.integration.test.ts src/generator/iocProgramContext.test.ts src/generator/manifestOptions.test.ts src/generator/manifestPaths.test.ts src/generator/resolveRegistrationPlan.test.ts src/generator/resolveDiscoveryRootLifetime.test.ts src/generator/contractTypeImport.integration.test.ts src/generator/contractTypeSourceFile.test.ts src/generator/discoverFactories/discoveryStrategies.integration.test.ts src/generator/discoverFactories/inferFactoryDependencyContracts.test.ts src/generator/generatedTypes.integration.test.ts src/generator/writeManifest.test.ts src/inspection/formatReports.test.ts src/inspection/reports.test.ts src/runtime/bootstrap.test.ts src/runtime/bootstrap.integration.test.ts src/runtime/iocResolutionError.test.ts",
|
|
54
|
+
"gen:manifest": "tsx src/generator/gen-manifest.ts",
|
|
55
|
+
"pack:dev": "npm run build && npm pack --silent"
|
|
56
|
+
},
|
|
57
|
+
"dependencies": {
|
|
58
|
+
"awilix": "^12.0.5",
|
|
59
|
+
"fast-glob": "^3.3.3",
|
|
60
|
+
"prettier": "^3.4.2",
|
|
61
|
+
"typescript": "^5.7.2"
|
|
62
|
+
},
|
|
63
|
+
"devDependencies": {
|
|
64
|
+
"@types/node": "^22.10.0",
|
|
65
|
+
"tsx": "^4.19.2"
|
|
66
|
+
}
|
|
67
|
+
}
|