@metaobjectsdev/sdk 0.7.0-rc.1 → 0.7.0-rc.2
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/dist/memory.js +16 -9
- package/dist/memory.js.map +1 -1
- package/package.json +2 -2
- package/src/memory.ts +17 -9
package/dist/memory.js
CHANGED
|
@@ -60,21 +60,25 @@ async function collectMetadataPaths(repoRoot) {
|
|
|
60
60
|
for (const pkg of ordered) {
|
|
61
61
|
// Each workspace package's metadata lives alongside its .meta/ dir
|
|
62
62
|
const pkgRoot = join(pkg.metaDir, "..");
|
|
63
|
-
paths.push(...(await
|
|
63
|
+
paths.push(...(await listMetadataFiles(join(pkgRoot, DEFAULT_METADATA_DIR))));
|
|
64
64
|
}
|
|
65
65
|
return paths;
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
68
|
// Single-package path: scan metaobjects/ at the project root
|
|
69
|
-
return
|
|
69
|
+
return listMetadataFiles(join(repoRoot, DEFAULT_METADATA_DIR));
|
|
70
70
|
}
|
|
71
71
|
/**
|
|
72
|
-
* Recursively list *.json
|
|
73
|
-
* any level. Subdirectories (e.g. projections/) are
|
|
74
|
-
* Files within a directory are sorted alphabetically for
|
|
75
|
-
* order; subdirectories are visited after files at the
|
|
72
|
+
* Recursively list metadata files (*.json, *.yaml, *.yml) under a directory,
|
|
73
|
+
* excluding _pending/ at any level. Subdirectories (e.g. projections/) are
|
|
74
|
+
* walked depth-first. Files within a directory are sorted alphabetically for
|
|
75
|
+
* deterministic load order; subdirectories are visited after files at the
|
|
76
|
+
* same level.
|
|
77
|
+
*
|
|
78
|
+
* Format selection (parsing) happens downstream in `FileSource` from
|
|
79
|
+
* `@metaobjectsdev/metadata`, which infers the parser from file extension.
|
|
76
80
|
*/
|
|
77
|
-
async function
|
|
81
|
+
async function listMetadataFiles(dir) {
|
|
78
82
|
let entries;
|
|
79
83
|
try {
|
|
80
84
|
entries = await readdir(dir);
|
|
@@ -92,14 +96,17 @@ async function listJsonFiles(dir) {
|
|
|
92
96
|
if (s.isDirectory()) {
|
|
93
97
|
subdirs.push(full);
|
|
94
98
|
}
|
|
95
|
-
else if (s.isFile() && entry
|
|
99
|
+
else if (s.isFile() && isMetadataFile(entry)) {
|
|
96
100
|
paths.push(full);
|
|
97
101
|
}
|
|
98
102
|
}
|
|
99
103
|
// Recurse into subdirectories after collecting files at this level
|
|
100
104
|
for (const sub of subdirs.sort()) {
|
|
101
|
-
paths.push(...(await
|
|
105
|
+
paths.push(...(await listMetadataFiles(sub)));
|
|
102
106
|
}
|
|
103
107
|
return paths;
|
|
104
108
|
}
|
|
109
|
+
function isMetadataFile(name) {
|
|
110
|
+
return name.endsWith(".json") || name.endsWith(".yaml") || name.endsWith(".yml");
|
|
111
|
+
}
|
|
105
112
|
//# sourceMappingURL=memory.js.map
|
package/dist/memory.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"memory.js","sourceRoot":"","sources":["../src/memory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EACL,cAAc,EACd,YAAY,EACZ,iBAAiB,GAElB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAC3D,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAExE;;;GAGG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,aAAa,CAAC;AAElD;;;;GAIG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,cAAc,CAAC;AAEtD;;;;;;;;;;;;;;;GAeG;AACH,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,QAAgB;IAC/C,MAAM,QAAQ,GAAG,IAAI,Y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IAAI,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;AACnF,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@metaobjectsdev/sdk",
|
|
3
|
-
"version": "0.7.0-rc.
|
|
3
|
+
"version": "0.7.0-rc.2",
|
|
4
4
|
"description": "Workspace helpers and agent-docs utilities for MetaObjects projects.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"access": "public"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@metaobjectsdev/metadata": "0.7.0-rc.
|
|
41
|
+
"@metaobjectsdev/metadata": "0.7.0-rc.2",
|
|
42
42
|
"zod": "^3.23.0"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
package/src/memory.ts
CHANGED
|
@@ -74,23 +74,27 @@ async function collectMetadataPaths(repoRoot: string): Promise<string[]> {
|
|
|
74
74
|
for (const pkg of ordered) {
|
|
75
75
|
// Each workspace package's metadata lives alongside its .meta/ dir
|
|
76
76
|
const pkgRoot = join(pkg.metaDir, "..");
|
|
77
|
-
paths.push(...(await
|
|
77
|
+
paths.push(...(await listMetadataFiles(join(pkgRoot, DEFAULT_METADATA_DIR))));
|
|
78
78
|
}
|
|
79
79
|
return paths;
|
|
80
80
|
}
|
|
81
81
|
}
|
|
82
82
|
|
|
83
83
|
// Single-package path: scan metaobjects/ at the project root
|
|
84
|
-
return
|
|
84
|
+
return listMetadataFiles(join(repoRoot, DEFAULT_METADATA_DIR));
|
|
85
85
|
}
|
|
86
86
|
|
|
87
87
|
/**
|
|
88
|
-
* Recursively list *.json
|
|
89
|
-
* any level. Subdirectories (e.g. projections/) are
|
|
90
|
-
* Files within a directory are sorted alphabetically for
|
|
91
|
-
* order; subdirectories are visited after files at the
|
|
88
|
+
* Recursively list metadata files (*.json, *.yaml, *.yml) under a directory,
|
|
89
|
+
* excluding _pending/ at any level. Subdirectories (e.g. projections/) are
|
|
90
|
+
* walked depth-first. Files within a directory are sorted alphabetically for
|
|
91
|
+
* deterministic load order; subdirectories are visited after files at the
|
|
92
|
+
* same level.
|
|
93
|
+
*
|
|
94
|
+
* Format selection (parsing) happens downstream in `FileSource` from
|
|
95
|
+
* `@metaobjectsdev/metadata`, which infers the parser from file extension.
|
|
92
96
|
*/
|
|
93
|
-
async function
|
|
97
|
+
async function listMetadataFiles(dir: string): Promise<string[]> {
|
|
94
98
|
let entries: string[];
|
|
95
99
|
try {
|
|
96
100
|
entries = await readdir(dir);
|
|
@@ -105,13 +109,17 @@ async function listJsonFiles(dir: string): Promise<string[]> {
|
|
|
105
109
|
const s = await stat(full);
|
|
106
110
|
if (s.isDirectory()) {
|
|
107
111
|
subdirs.push(full);
|
|
108
|
-
} else if (s.isFile() && entry
|
|
112
|
+
} else if (s.isFile() && isMetadataFile(entry)) {
|
|
109
113
|
paths.push(full);
|
|
110
114
|
}
|
|
111
115
|
}
|
|
112
116
|
// Recurse into subdirectories after collecting files at this level
|
|
113
117
|
for (const sub of subdirs.sort()) {
|
|
114
|
-
paths.push(...(await
|
|
118
|
+
paths.push(...(await listMetadataFiles(sub)));
|
|
115
119
|
}
|
|
116
120
|
return paths;
|
|
117
121
|
}
|
|
122
|
+
|
|
123
|
+
function isMetadataFile(name: string): boolean {
|
|
124
|
+
return name.endsWith(".json") || name.endsWith(".yaml") || name.endsWith(".yml");
|
|
125
|
+
}
|