@eggjs/metadata 4.0.2-beta.6 → 4.0.2-beta.7
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.
|
@@ -16,6 +16,11 @@ declare class ModuleDescriptorDumper {
|
|
|
16
16
|
static stringifyDescriptor(moduleDescriptor: ModuleDescriptor): string;
|
|
17
17
|
static stringifyClazz(clazz: EggProtoImplClass, moduleDescriptor: ModuleDescriptor): string;
|
|
18
18
|
static dumpPath(desc: ModuleDescriptor, options?: ModuleDumpOptions): string;
|
|
19
|
+
/**
|
|
20
|
+
* Extract decorated file paths (relative to unitPath) from a ModuleDescriptor.
|
|
21
|
+
* Used for manifest generation to record which files contain egg prototypes.
|
|
22
|
+
*/
|
|
23
|
+
static getDecoratedFiles(desc: ModuleDescriptor): string[];
|
|
19
24
|
static dump(desc: ModuleDescriptor, options?: ModuleDumpOptions): Promise<void>;
|
|
20
25
|
}
|
|
21
26
|
//#endregion
|
|
@@ -22,6 +22,23 @@ var ModuleDescriptorDumper = class ModuleDescriptorDumper {
|
|
|
22
22
|
const dumpDir = DUMP_PATH ?? options?.dumpDir ?? desc.unitPath;
|
|
23
23
|
return path.join(dumpDir, ".egg", `${desc.name}_module_desc.json`);
|
|
24
24
|
}
|
|
25
|
+
/**
|
|
26
|
+
* Extract decorated file paths (relative to unitPath) from a ModuleDescriptor.
|
|
27
|
+
* Used for manifest generation to record which files contain egg prototypes.
|
|
28
|
+
*/
|
|
29
|
+
static getDecoratedFiles(desc) {
|
|
30
|
+
const fileSet = /* @__PURE__ */ new Set();
|
|
31
|
+
const addClazz = (clazz) => {
|
|
32
|
+
const filePath = PrototypeUtil.getFilePath(clazz);
|
|
33
|
+
if (filePath) {
|
|
34
|
+
const rel = path.relative(desc.unitPath, filePath).replaceAll(path.sep, "/");
|
|
35
|
+
if (!rel.startsWith("..")) fileSet.add(rel);
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
for (const clazz of desc.clazzList) addClazz(clazz);
|
|
39
|
+
for (const clazz of desc.multiInstanceClazzList) addClazz(clazz);
|
|
40
|
+
return Array.from(fileSet);
|
|
41
|
+
}
|
|
25
42
|
static async dump(desc, options) {
|
|
26
43
|
const dumpPath = ModuleDescriptorDumper.dumpPath(desc, options);
|
|
27
44
|
await fs.mkdir(path.dirname(dumpPath), { recursive: true });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eggjs/metadata",
|
|
3
|
-
"version": "4.0.2-beta.
|
|
3
|
+
"version": "4.0.2-beta.7",
|
|
4
4
|
"description": "tegg metadata",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"egg",
|
|
@@ -34,11 +34,11 @@
|
|
|
34
34
|
"access": "public"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@eggjs/
|
|
38
|
-
"@eggjs/
|
|
39
|
-
"@eggjs/tegg-common-util": "4.0.2-beta.
|
|
40
|
-
"@eggjs/
|
|
41
|
-
"@eggjs/
|
|
37
|
+
"@eggjs/core-decorator": "4.0.2-beta.7",
|
|
38
|
+
"@eggjs/lifecycle": "4.0.2-beta.7",
|
|
39
|
+
"@eggjs/tegg-common-util": "4.0.2-beta.7",
|
|
40
|
+
"@eggjs/tegg-types": "4.0.2-beta.7",
|
|
41
|
+
"@eggjs/errors": "3.0.2-beta.7"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"@types/node": "^24.10.2",
|