@specatlas/core 0.1.2 → 0.1.3
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/index.d.ts +2 -1
- package/dist/index.js +10 -3
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -215,6 +215,7 @@ interface Workspace {
|
|
|
215
215
|
sddDir: string;
|
|
216
216
|
specs: SpecRef[];
|
|
217
217
|
changes: Change[];
|
|
218
|
+
archived?: Change[];
|
|
218
219
|
diagnostics: Diagnostic[];
|
|
219
220
|
}
|
|
220
221
|
|
|
@@ -1047,7 +1048,7 @@ interface ApprovalsIndex {
|
|
|
1047
1048
|
}
|
|
1048
1049
|
declare function loadApprovals(sddDir: string): Promise<ApprovalsIndex>;
|
|
1049
1050
|
declare function loadSpecs(sddDir: string): Promise<SpecRef[]>;
|
|
1050
|
-
declare function loadChange(root: string, slug: string): Promise<Change>;
|
|
1051
|
+
declare function loadChange(root: string, slug: string, relDir?: string): Promise<Change>;
|
|
1051
1052
|
declare function listChangeSlugs(root: string, opts?: {
|
|
1052
1053
|
includeArchived?: boolean;
|
|
1053
1054
|
}): Promise<string[]>;
|
package/dist/index.js
CHANGED
|
@@ -1255,8 +1255,8 @@ async function loadSpecs(sddDir) {
|
|
|
1255
1255
|
}
|
|
1256
1256
|
return out;
|
|
1257
1257
|
}
|
|
1258
|
-
async function loadChange(root, slug) {
|
|
1259
|
-
const dir = path4.join(root, SDD_DIR, "changes", slug);
|
|
1258
|
+
async function loadChange(root, slug, relDir) {
|
|
1259
|
+
const dir = path4.join(root, SDD_DIR, "changes", relDir ?? slug);
|
|
1260
1260
|
const diagnostics = [];
|
|
1261
1261
|
const change = { slug, dir, diagnostics };
|
|
1262
1262
|
const metaFile = path4.join(dir, "meta.yaml");
|
|
@@ -1318,7 +1318,14 @@ async function loadWorkspace(root) {
|
|
|
1318
1318
|
changes.push(change);
|
|
1319
1319
|
diagnostics.push(...change.diagnostics);
|
|
1320
1320
|
}
|
|
1321
|
-
|
|
1321
|
+
const archived = [];
|
|
1322
|
+
const archivedDir = path4.join(sddDir, "changes", "archive");
|
|
1323
|
+
if (await isDirectory(archivedDir)) {
|
|
1324
|
+
for (const entry of await listDirs(archivedDir)) {
|
|
1325
|
+
archived.push(await loadChange(root, entry.replace(/^\d{4}-\d{2}-/, ""), path4.join("archive", entry)));
|
|
1326
|
+
}
|
|
1327
|
+
}
|
|
1328
|
+
return { workspace: { root, sddDir, specs, changes, archived, diagnostics }, config };
|
|
1322
1329
|
}
|
|
1323
1330
|
async function ensureSddDirs(sddDir) {
|
|
1324
1331
|
const created = [];
|