@layerzerolabs/dependency-graph 0.2.67 → 0.2.68
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/.turbo/turbo-build.log +12 -12
- package/.turbo/turbo-lint.log +1 -1
- package/dist/4LBVNANM.cjs +37 -0
- package/dist/4LBVNANM.cjs.map +1 -0
- package/dist/WWFEJOTN.js +34 -0
- package/dist/WWFEJOTN.js.map +1 -0
- package/dist/dependencyNode.cjs +6 -2
- package/dist/dependencyNode.d.ts +7 -0
- package/dist/dependencyNode.d.ts.map +1 -1
- package/dist/dependencyNode.js +1 -1
- package/dist/index.cjs +6 -2
- package/dist/index.js +1 -1
- package/package.json +3 -3
- package/src/dependencyNode.ts +20 -0
- package/dist/EYJTCMSL.js +0 -19
- package/dist/EYJTCMSL.js.map +0 -1
- package/dist/GTEKUOS6.cjs +0 -21
- package/dist/GTEKUOS6.cjs.map +0 -1
package/.turbo/turbo-build.log
CHANGED
|
@@ -11,17 +11,17 @@
|
|
|
11
11
|
[34mCLI[39m Cleaning output folder
|
|
12
12
|
[34mCJS[39m Build start
|
|
13
13
|
[34mESM[39m Build start
|
|
14
|
-
[
|
|
15
|
-
[
|
|
16
|
-
[
|
|
17
|
-
[32mESM[39m [1mdist/dependencyNode.js.map [22m[32m78.00 B[39m
|
|
18
|
-
[32mESM[39m [1mdist/index.js.map [22m[32m69.00 B[39m
|
|
19
|
-
[32mESM[39m [1mdist/EYJTCMSL.js.map [22m[32m1.55 KB[39m
|
|
20
|
-
[32mESM[39m ⚡️ Build success in 164ms
|
|
21
|
-
[32mCJS[39m [1mdist/dependencyNode.cjs [22m[32m285.00 B[39m
|
|
22
|
-
[32mCJS[39m [1mdist/GTEKUOS6.cjs [22m[32m503.00 B[39m
|
|
23
|
-
[32mCJS[39m [1mdist/index.cjs [22m[32m267.00 B[39m
|
|
14
|
+
[32mCJS[39m [1mdist/dependencyNode.cjs [22m[32m426.00 B[39m
|
|
15
|
+
[32mCJS[39m [1mdist/4LBVNANM.cjs [22m[32m1007.00 B[39m
|
|
16
|
+
[32mCJS[39m [1mdist/index.cjs [22m[32m408.00 B[39m
|
|
24
17
|
[32mCJS[39m [1mdist/dependencyNode.cjs.map [22m[32m79.00 B[39m
|
|
25
18
|
[32mCJS[39m [1mdist/index.cjs.map [22m[32m70.00 B[39m
|
|
26
|
-
[32mCJS[39m [1mdist/
|
|
27
|
-
[32mCJS[39m ⚡️ Build success in
|
|
19
|
+
[32mCJS[39m [1mdist/4LBVNANM.cjs.map [22m[32m3.01 KB[39m
|
|
20
|
+
[32mCJS[39m ⚡️ Build success in 82ms
|
|
21
|
+
[32mESM[39m [1mdist/index.js [22m[32m133.00 B[39m
|
|
22
|
+
[32mESM[39m [1mdist/dependencyNode.js [22m[32m151.00 B[39m
|
|
23
|
+
[32mESM[39m [1mdist/WWFEJOTN.js [22m[32m949.00 B[39m
|
|
24
|
+
[32mESM[39m [1mdist/index.js.map [22m[32m69.00 B[39m
|
|
25
|
+
[32mESM[39m [1mdist/WWFEJOTN.js.map [22m[32m3.01 KB[39m
|
|
26
|
+
[32mESM[39m [1mdist/dependencyNode.js.map [22m[32m78.00 B[39m
|
|
27
|
+
[32mESM[39m ⚡️ Build success in 82ms
|
package/.turbo/turbo-lint.log
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
> @layerzerolabs/dependency-graph@0.0.2 lint /home/runner/work/monorepo-internal/monorepo-internal/packages/framework/dependency-graph
|
|
3
3
|
> eslint . --max-warnings 0 || (eslint . --fix --max-warnings 0 && false)
|
|
4
4
|
|
|
5
|
-
(node:
|
|
5
|
+
(node:66125) [MODULE_TYPELESS_PACKAGE_JSON] Warning: Module type of file:///home/runner/work/monorepo-internal/monorepo-internal/eslint.config.js?mtime=1775777605148 is not specified and it doesn't parse as CommonJS.
|
|
6
6
|
Reparsing as ES module because module syntax was detected. This incurs a performance overhead.
|
|
7
7
|
To eliminate this warning, add "type": "module" to /home/runner/work/monorepo-internal/monorepo-internal/package.json.
|
|
8
8
|
(Use `node --trace-warnings ...` to show where the warning was created)
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
5
|
+
|
|
6
|
+
// src/dependencyNode.ts
|
|
7
|
+
var DependencyNode = class {
|
|
8
|
+
static {
|
|
9
|
+
__name(this, "DependencyNode");
|
|
10
|
+
}
|
|
11
|
+
name;
|
|
12
|
+
dependencies;
|
|
13
|
+
constructor({ name, dependencies = {} }) {
|
|
14
|
+
this.name = name;
|
|
15
|
+
this.dependencies = dependencies;
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
var withDependencies = /* @__PURE__ */ __name((node, extraDeps) => {
|
|
19
|
+
const mergedDeps = {
|
|
20
|
+
...node.dependencies,
|
|
21
|
+
...Object.fromEntries(extraDeps.map((dep, i) => [
|
|
22
|
+
`__extra${i}`,
|
|
23
|
+
dep
|
|
24
|
+
]))
|
|
25
|
+
};
|
|
26
|
+
const descriptors = Object.getOwnPropertyDescriptors(node);
|
|
27
|
+
descriptors.dependencies = {
|
|
28
|
+
...descriptors.dependencies,
|
|
29
|
+
value: mergedDeps
|
|
30
|
+
};
|
|
31
|
+
return Object.create(Object.getPrototypeOf(node), descriptors);
|
|
32
|
+
}, "withDependencies");
|
|
33
|
+
|
|
34
|
+
exports.DependencyNode = DependencyNode;
|
|
35
|
+
exports.withDependencies = withDependencies;
|
|
36
|
+
//# sourceMappingURL=4LBVNANM.cjs.map
|
|
37
|
+
//# sourceMappingURL=4LBVNANM.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/dependencyNode.ts"],"names":["DependencyNode","name","dependencies","withDependencies","node","extraDeps","mergedDeps","Object","fromEntries","map","dep","i","descriptors","getOwnPropertyDescriptors","value","create","getPrototypeOf"],"mappings":";;;;;;AAUO,IAAeA,iBAAf,MAAeA;EAVtB;;;AAcoBC,EAAAA,IAAAA;AACAC,EAAAA,YAAAA;AAChB,EAAA,WAAA,CAAY,EACRD,IAAAA,EACAC,YAAAA,GAAe,IAAmB,EAInC;AACC,IAAA,IAAA,CAAKD,IAAAA,GAAOA,IAAAA;AACZ,IAAA,IAAA,CAAKC,YAAAA,GAAeA,YAAAA;AACxB,EAAA;AACJ;AAQO,IAAMC,gBAAAA,mBAAmB,MAAA,CAAA,CAI5BC,IAAAA,EACAC,SAAAA,KAAAA;AAEA,EAAA,MAAMC,UAAAA,GAAa;AACf,IAAA,GAAGF,IAAAA,CAAKF,YAAAA;AACR,IAAA,GAAGK,OAAOC,WAAAA,CAAYH,SAAAA,CAAUI,GAAAA,CAAI,CAACC,KAAKC,CAAAA,KAAM;AAAC,MAAA,CAAA,OAAA,EAAUA,CAAAA,CAAAA,CAAAA;AAAKD,MAAAA;KAAI,CAAA;AACxE,GAAA;AACA,EAAA,MAAME,WAAAA,GAAqCL,MAAAA,CAAOM,yBAAAA,CAA0BT,IAAAA,CAAAA;AAC5EQ,EAAAA,WAAAA,CAAYV,YAAAA,GAAe;AAAE,IAAA,GAAGU,WAAAA,CAAYV,YAAAA;IAAcY,KAAAA,EAAOR;AAAW,GAAA;AAC5E,EAAA,OAAOC,OAAOQ,MAAAA,CAAOR,MAAAA,CAAOS,cAAAA,CAAeZ,IAAAA,GAAOQ,WAAAA,CAAAA;AACtD,CAAA,EAdgC,kBAAA","file":"4LBVNANM.cjs","sourcesContent":["/**\n * <!-- anchor:DependencyNode -->\n * Dependency nodes are abstract nodes in the dependency graph. They're used to build the graph,\n * but as an abstract class, lacks the required information to actually be resolved to anything.\n * If you want to implement a new dependency node, see ObjectDefinition or FactoryDefinition\n * @param name the name of this node. It should be unique across the entire graph.\n * @param dependencies a map of other nodes that this node depends on. These children will be resolved first.\n * The key of the dependencies map should be some arbitrary name within the context of *this* node. It does\n * not have to be unique.\n */\nexport abstract class DependencyNode<\n Name extends string = string,\n _Dependencies extends Dependencies = Dependencies,\n> {\n public readonly name: Name;\n public readonly dependencies: _Dependencies;\n constructor({\n name,\n dependencies = {} as _Dependencies,\n }: {\n name: Name;\n dependencies?: _Dependencies;\n }) {\n this.name = name;\n this.dependencies = dependencies;\n }\n}\n\nexport type Dependencies = { [key: string]: DependencyNode<any, any> };\n\ntype IndexedDeps<Extra extends readonly DependencyNode[]> = {\n [K in keyof Extra as K extends `${number}` ? `__extra${K}` : never]: Extra[K];\n};\n\nexport const withDependencies = <\n N extends DependencyNode,\n const Extra extends readonly DependencyNode[],\n>(\n node: N,\n extraDeps: Extra,\n): N & { dependencies: N['dependencies'] & IndexedDeps<Extra> } => {\n const mergedDeps = {\n ...node.dependencies,\n ...Object.fromEntries(extraDeps.map((dep, i) => [`__extra${i}`, dep])),\n };\n const descriptors: PropertyDescriptorMap = Object.getOwnPropertyDescriptors(node);\n descriptors.dependencies = { ...descriptors.dependencies, value: mergedDeps };\n return Object.create(Object.getPrototypeOf(node), descriptors);\n};\n"]}
|
package/dist/WWFEJOTN.js
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
+
|
|
4
|
+
// src/dependencyNode.ts
|
|
5
|
+
var DependencyNode = class {
|
|
6
|
+
static {
|
|
7
|
+
__name(this, "DependencyNode");
|
|
8
|
+
}
|
|
9
|
+
name;
|
|
10
|
+
dependencies;
|
|
11
|
+
constructor({ name, dependencies = {} }) {
|
|
12
|
+
this.name = name;
|
|
13
|
+
this.dependencies = dependencies;
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
var withDependencies = /* @__PURE__ */ __name((node, extraDeps) => {
|
|
17
|
+
const mergedDeps = {
|
|
18
|
+
...node.dependencies,
|
|
19
|
+
...Object.fromEntries(extraDeps.map((dep, i) => [
|
|
20
|
+
`__extra${i}`,
|
|
21
|
+
dep
|
|
22
|
+
]))
|
|
23
|
+
};
|
|
24
|
+
const descriptors = Object.getOwnPropertyDescriptors(node);
|
|
25
|
+
descriptors.dependencies = {
|
|
26
|
+
...descriptors.dependencies,
|
|
27
|
+
value: mergedDeps
|
|
28
|
+
};
|
|
29
|
+
return Object.create(Object.getPrototypeOf(node), descriptors);
|
|
30
|
+
}, "withDependencies");
|
|
31
|
+
|
|
32
|
+
export { DependencyNode, withDependencies };
|
|
33
|
+
//# sourceMappingURL=WWFEJOTN.js.map
|
|
34
|
+
//# sourceMappingURL=WWFEJOTN.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/dependencyNode.ts"],"names":["DependencyNode","name","dependencies","withDependencies","node","extraDeps","mergedDeps","Object","fromEntries","map","dep","i","descriptors","getOwnPropertyDescriptors","value","create","getPrototypeOf"],"mappings":";;;;AAUO,IAAeA,iBAAf,MAAeA;EAVtB;;;AAcoBC,EAAAA,IAAAA;AACAC,EAAAA,YAAAA;AAChB,EAAA,WAAA,CAAY,EACRD,IAAAA,EACAC,YAAAA,GAAe,IAAmB,EAInC;AACC,IAAA,IAAA,CAAKD,IAAAA,GAAOA,IAAAA;AACZ,IAAA,IAAA,CAAKC,YAAAA,GAAeA,YAAAA;AACxB,EAAA;AACJ;AAQO,IAAMC,gBAAAA,mBAAmB,MAAA,CAAA,CAI5BC,IAAAA,EACAC,SAAAA,KAAAA;AAEA,EAAA,MAAMC,UAAAA,GAAa;AACf,IAAA,GAAGF,IAAAA,CAAKF,YAAAA;AACR,IAAA,GAAGK,OAAOC,WAAAA,CAAYH,SAAAA,CAAUI,GAAAA,CAAI,CAACC,KAAKC,CAAAA,KAAM;AAAC,MAAA,CAAA,OAAA,EAAUA,CAAAA,CAAAA,CAAAA;AAAKD,MAAAA;KAAI,CAAA;AACxE,GAAA;AACA,EAAA,MAAME,WAAAA,GAAqCL,MAAAA,CAAOM,yBAAAA,CAA0BT,IAAAA,CAAAA;AAC5EQ,EAAAA,WAAAA,CAAYV,YAAAA,GAAe;AAAE,IAAA,GAAGU,WAAAA,CAAYV,YAAAA;IAAcY,KAAAA,EAAOR;AAAW,GAAA;AAC5E,EAAA,OAAOC,OAAOQ,MAAAA,CAAOR,MAAAA,CAAOS,cAAAA,CAAeZ,IAAAA,GAAOQ,WAAAA,CAAAA;AACtD,CAAA,EAdgC,kBAAA","file":"WWFEJOTN.js","sourcesContent":["/**\n * <!-- anchor:DependencyNode -->\n * Dependency nodes are abstract nodes in the dependency graph. They're used to build the graph,\n * but as an abstract class, lacks the required information to actually be resolved to anything.\n * If you want to implement a new dependency node, see ObjectDefinition or FactoryDefinition\n * @param name the name of this node. It should be unique across the entire graph.\n * @param dependencies a map of other nodes that this node depends on. These children will be resolved first.\n * The key of the dependencies map should be some arbitrary name within the context of *this* node. It does\n * not have to be unique.\n */\nexport abstract class DependencyNode<\n Name extends string = string,\n _Dependencies extends Dependencies = Dependencies,\n> {\n public readonly name: Name;\n public readonly dependencies: _Dependencies;\n constructor({\n name,\n dependencies = {} as _Dependencies,\n }: {\n name: Name;\n dependencies?: _Dependencies;\n }) {\n this.name = name;\n this.dependencies = dependencies;\n }\n}\n\nexport type Dependencies = { [key: string]: DependencyNode<any, any> };\n\ntype IndexedDeps<Extra extends readonly DependencyNode[]> = {\n [K in keyof Extra as K extends `${number}` ? `__extra${K}` : never]: Extra[K];\n};\n\nexport const withDependencies = <\n N extends DependencyNode,\n const Extra extends readonly DependencyNode[],\n>(\n node: N,\n extraDeps: Extra,\n): N & { dependencies: N['dependencies'] & IndexedDeps<Extra> } => {\n const mergedDeps = {\n ...node.dependencies,\n ...Object.fromEntries(extraDeps.map((dep, i) => [`__extra${i}`, dep])),\n };\n const descriptors: PropertyDescriptorMap = Object.getOwnPropertyDescriptors(node);\n descriptors.dependencies = { ...descriptors.dependencies, value: mergedDeps };\n return Object.create(Object.getPrototypeOf(node), descriptors);\n};\n"]}
|
package/dist/dependencyNode.cjs
CHANGED
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _4LBVNANM_cjs = require('./4LBVNANM.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
Object.defineProperty(exports, "DependencyNode", {
|
|
8
8
|
enumerable: true,
|
|
9
|
-
get: function () { return
|
|
9
|
+
get: function () { return _4LBVNANM_cjs.DependencyNode; }
|
|
10
|
+
});
|
|
11
|
+
Object.defineProperty(exports, "withDependencies", {
|
|
12
|
+
enumerable: true,
|
|
13
|
+
get: function () { return _4LBVNANM_cjs.withDependencies; }
|
|
10
14
|
});
|
|
11
15
|
//# sourceMappingURL=dependencyNode.cjs.map
|
|
12
16
|
//# sourceMappingURL=dependencyNode.cjs.map
|
package/dist/dependencyNode.d.ts
CHANGED
|
@@ -19,4 +19,11 @@ export declare abstract class DependencyNode<Name extends string = string, _Depe
|
|
|
19
19
|
export type Dependencies = {
|
|
20
20
|
[key: string]: DependencyNode<any, any>;
|
|
21
21
|
};
|
|
22
|
+
type IndexedDeps<Extra extends readonly DependencyNode[]> = {
|
|
23
|
+
[K in keyof Extra as K extends `${number}` ? `__extra${K}` : never]: Extra[K];
|
|
24
|
+
};
|
|
25
|
+
export declare const withDependencies: <N extends DependencyNode, const Extra extends readonly DependencyNode[]>(node: N, extraDeps: Extra) => N & {
|
|
26
|
+
dependencies: N["dependencies"] & IndexedDeps<Extra>;
|
|
27
|
+
};
|
|
28
|
+
export {};
|
|
22
29
|
//# sourceMappingURL=dependencyNode.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dependencyNode.d.ts","sourceRoot":"","sources":["../src/dependencyNode.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,8BAAsB,cAAc,CAChC,IAAI,SAAS,MAAM,GAAG,MAAM,EAC5B,aAAa,SAAS,YAAY,GAAG,YAAY;IAEjD,SAAgB,IAAI,EAAE,IAAI,CAAC;IAC3B,SAAgB,YAAY,EAAE,aAAa,CAAC;gBAChC,EACR,IAAI,EACJ,YAAkC,GACrC,EAAE;QACC,IAAI,EAAE,IAAI,CAAC;QACX,YAAY,CAAC,EAAE,aAAa,CAAC;KAChC;CAIJ;AAED,MAAM,MAAM,YAAY,GAAG;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,cAAc,CAAC,GAAG,EAAE,GAAG,CAAC,CAAA;CAAE,CAAC"}
|
|
1
|
+
{"version":3,"file":"dependencyNode.d.ts","sourceRoot":"","sources":["../src/dependencyNode.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,8BAAsB,cAAc,CAChC,IAAI,SAAS,MAAM,GAAG,MAAM,EAC5B,aAAa,SAAS,YAAY,GAAG,YAAY;IAEjD,SAAgB,IAAI,EAAE,IAAI,CAAC;IAC3B,SAAgB,YAAY,EAAE,aAAa,CAAC;gBAChC,EACR,IAAI,EACJ,YAAkC,GACrC,EAAE;QACC,IAAI,EAAE,IAAI,CAAC;QACX,YAAY,CAAC,EAAE,aAAa,CAAC;KAChC;CAIJ;AAED,MAAM,MAAM,YAAY,GAAG;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,cAAc,CAAC,GAAG,EAAE,GAAG,CAAC,CAAA;CAAE,CAAC;AAEvE,KAAK,WAAW,CAAC,KAAK,SAAS,SAAS,cAAc,EAAE,IAAI;KACvD,CAAC,IAAI,MAAM,KAAK,IAAI,CAAC,SAAS,GAAG,MAAM,EAAE,GAAG,UAAU,CAAC,EAAE,GAAG,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC;CAChF,CAAC;AAEF,eAAO,MAAM,gBAAgB,GACzB,CAAC,SAAS,cAAc,EACxB,KAAK,CAAC,KAAK,SAAS,SAAS,cAAc,EAAE,EAE7C,MAAM,CAAC,EACP,WAAW,KAAK,KACjB,CAAC,GAAG;IAAE,YAAY,EAAE,CAAC,CAAC,cAAc,CAAC,GAAG,WAAW,CAAC,KAAK,CAAC,CAAA;CAQ5D,CAAC"}
|
package/dist/dependencyNode.js
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _4LBVNANM_cjs = require('./4LBVNANM.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
Object.defineProperty(exports, "DependencyNode", {
|
|
8
8
|
enumerable: true,
|
|
9
|
-
get: function () { return
|
|
9
|
+
get: function () { return _4LBVNANM_cjs.DependencyNode; }
|
|
10
|
+
});
|
|
11
|
+
Object.defineProperty(exports, "withDependencies", {
|
|
12
|
+
enumerable: true,
|
|
13
|
+
get: function () { return _4LBVNANM_cjs.withDependencies; }
|
|
10
14
|
});
|
|
11
15
|
//# sourceMappingURL=index.cjs.map
|
|
12
16
|
//# sourceMappingURL=index.cjs.map
|
package/dist/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@layerzerolabs/dependency-graph",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.68",
|
|
4
4
|
"private": false,
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
"types": "./dist/index.d.ts",
|
|
16
16
|
"devDependencies": {
|
|
17
17
|
"tsup": "^8.4.0",
|
|
18
|
-
"@layerzerolabs/tsup-configuration": "0.2.
|
|
19
|
-
"@layerzerolabs/typescript-configuration": "0.2.
|
|
18
|
+
"@layerzerolabs/tsup-configuration": "0.2.68",
|
|
19
|
+
"@layerzerolabs/typescript-configuration": "0.2.68"
|
|
20
20
|
},
|
|
21
21
|
"publishConfig": {
|
|
22
22
|
"access": "public",
|
package/src/dependencyNode.ts
CHANGED
|
@@ -27,3 +27,23 @@ export abstract class DependencyNode<
|
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
export type Dependencies = { [key: string]: DependencyNode<any, any> };
|
|
30
|
+
|
|
31
|
+
type IndexedDeps<Extra extends readonly DependencyNode[]> = {
|
|
32
|
+
[K in keyof Extra as K extends `${number}` ? `__extra${K}` : never]: Extra[K];
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export const withDependencies = <
|
|
36
|
+
N extends DependencyNode,
|
|
37
|
+
const Extra extends readonly DependencyNode[],
|
|
38
|
+
>(
|
|
39
|
+
node: N,
|
|
40
|
+
extraDeps: Extra,
|
|
41
|
+
): N & { dependencies: N['dependencies'] & IndexedDeps<Extra> } => {
|
|
42
|
+
const mergedDeps = {
|
|
43
|
+
...node.dependencies,
|
|
44
|
+
...Object.fromEntries(extraDeps.map((dep, i) => [`__extra${i}`, dep])),
|
|
45
|
+
};
|
|
46
|
+
const descriptors: PropertyDescriptorMap = Object.getOwnPropertyDescriptors(node);
|
|
47
|
+
descriptors.dependencies = { ...descriptors.dependencies, value: mergedDeps };
|
|
48
|
+
return Object.create(Object.getPrototypeOf(node), descriptors);
|
|
49
|
+
};
|
package/dist/EYJTCMSL.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
-
|
|
4
|
-
// src/dependencyNode.ts
|
|
5
|
-
var DependencyNode = class {
|
|
6
|
-
static {
|
|
7
|
-
__name(this, "DependencyNode");
|
|
8
|
-
}
|
|
9
|
-
name;
|
|
10
|
-
dependencies;
|
|
11
|
-
constructor({ name, dependencies = {} }) {
|
|
12
|
-
this.name = name;
|
|
13
|
-
this.dependencies = dependencies;
|
|
14
|
-
}
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
export { DependencyNode };
|
|
18
|
-
//# sourceMappingURL=EYJTCMSL.js.map
|
|
19
|
-
//# sourceMappingURL=EYJTCMSL.js.map
|
package/dist/EYJTCMSL.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/dependencyNode.ts"],"names":["DependencyNode","name","dependencies"],"mappings":";;;;AAUO,IAAeA,iBAAf,MAAeA;EAVtB;;;AAcoBC,EAAAA,IAAAA;AACAC,EAAAA,YAAAA;AAChB,EAAA,WAAA,CAAY,EACRD,IAAAA,EACAC,YAAAA,GAAe,IAAmB,EAInC;AACC,IAAA,IAAA,CAAKD,IAAAA,GAAOA,IAAAA;AACZ,IAAA,IAAA,CAAKC,YAAAA,GAAeA,YAAAA;AACxB,EAAA;AACJ","file":"EYJTCMSL.js","sourcesContent":["/**\n * <!-- anchor:DependencyNode -->\n * Dependency nodes are abstract nodes in the dependency graph. They're used to build the graph,\n * but as an abstract class, lacks the required information to actually be resolved to anything.\n * If you want to implement a new dependency node, see ObjectDefinition or FactoryDefinition\n * @param name the name of this node. It should be unique across the entire graph.\n * @param dependencies a map of other nodes that this node depends on. These children will be resolved first.\n * The key of the dependencies map should be some arbitrary name within the context of *this* node. It does\n * not have to be unique.\n */\nexport abstract class DependencyNode<\n Name extends string = string,\n _Dependencies extends Dependencies = Dependencies,\n> {\n public readonly name: Name;\n public readonly dependencies: _Dependencies;\n constructor({\n name,\n dependencies = {} as _Dependencies,\n }: {\n name: Name;\n dependencies?: _Dependencies;\n }) {\n this.name = name;\n this.dependencies = dependencies;\n }\n}\n\nexport type Dependencies = { [key: string]: DependencyNode<any, any> };\n"]}
|
package/dist/GTEKUOS6.cjs
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
5
|
-
|
|
6
|
-
// src/dependencyNode.ts
|
|
7
|
-
var DependencyNode = class {
|
|
8
|
-
static {
|
|
9
|
-
__name(this, "DependencyNode");
|
|
10
|
-
}
|
|
11
|
-
name;
|
|
12
|
-
dependencies;
|
|
13
|
-
constructor({ name, dependencies = {} }) {
|
|
14
|
-
this.name = name;
|
|
15
|
-
this.dependencies = dependencies;
|
|
16
|
-
}
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
exports.DependencyNode = DependencyNode;
|
|
20
|
-
//# sourceMappingURL=GTEKUOS6.cjs.map
|
|
21
|
-
//# sourceMappingURL=GTEKUOS6.cjs.map
|
package/dist/GTEKUOS6.cjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/dependencyNode.ts"],"names":["DependencyNode","name","dependencies"],"mappings":";;;;;;AAUO,IAAeA,iBAAf,MAAeA;EAVtB;;;AAcoBC,EAAAA,IAAAA;AACAC,EAAAA,YAAAA;AAChB,EAAA,WAAA,CAAY,EACRD,IAAAA,EACAC,YAAAA,GAAe,IAAmB,EAInC;AACC,IAAA,IAAA,CAAKD,IAAAA,GAAOA,IAAAA;AACZ,IAAA,IAAA,CAAKC,YAAAA,GAAeA,YAAAA;AACxB,EAAA;AACJ","file":"GTEKUOS6.cjs","sourcesContent":["/**\n * <!-- anchor:DependencyNode -->\n * Dependency nodes are abstract nodes in the dependency graph. They're used to build the graph,\n * but as an abstract class, lacks the required information to actually be resolved to anything.\n * If you want to implement a new dependency node, see ObjectDefinition or FactoryDefinition\n * @param name the name of this node. It should be unique across the entire graph.\n * @param dependencies a map of other nodes that this node depends on. These children will be resolved first.\n * The key of the dependencies map should be some arbitrary name within the context of *this* node. It does\n * not have to be unique.\n */\nexport abstract class DependencyNode<\n Name extends string = string,\n _Dependencies extends Dependencies = Dependencies,\n> {\n public readonly name: Name;\n public readonly dependencies: _Dependencies;\n constructor({\n name,\n dependencies = {} as _Dependencies,\n }: {\n name: Name;\n dependencies?: _Dependencies;\n }) {\n this.name = name;\n this.dependencies = dependencies;\n }\n}\n\nexport type Dependencies = { [key: string]: DependencyNode<any, any> };\n"]}
|