@jxsuite/catalog 0.1.0 → 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/LICENSE +1 -1
- package/index.ts +12 -8
- package/package.json +5 -2
package/LICENSE
CHANGED
package/index.ts
CHANGED
|
@@ -30,13 +30,13 @@
|
|
|
30
30
|
import { readFileSync } from "node:fs";
|
|
31
31
|
import { join } from "node:path";
|
|
32
32
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
}
|
|
33
|
+
import type { ExtensionSectionInfo } from "@jxsuite/protocol";
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* One project.json section an extension's classes claim (specs/extensions.md §9). The wire contract
|
|
37
|
+
* owns the declaration; this package keeps exporting it under its published name.
|
|
38
|
+
*/
|
|
39
|
+
export type { ExtensionSectionInfo as CatalogSection } from "@jxsuite/protocol";
|
|
40
40
|
|
|
41
41
|
/** One first-party extension, as the generator derives it from the package's own manifest. */
|
|
42
42
|
export interface ExtensionCatalogMeta {
|
|
@@ -47,7 +47,7 @@ export interface ExtensionCatalogMeta {
|
|
|
47
47
|
/** Manifest `description`, one line. */
|
|
48
48
|
description: string;
|
|
49
49
|
/** The project.json sections enabling it makes legal, in class declaration order. */
|
|
50
|
-
sections:
|
|
50
|
+
sections: ExtensionSectionInfo[];
|
|
51
51
|
/** File extensions its format classes claim (".md", ".csv"), when it claims any. */
|
|
52
52
|
formats?: string[];
|
|
53
53
|
/** Other catalogue members it depends on — auth needs connector. */
|
|
@@ -68,6 +68,10 @@ let _cache: ExtensionCatalogMeta[] | null = null;
|
|
|
68
68
|
export function listCatalog(): ExtensionCatalogMeta[] {
|
|
69
69
|
if (!_cache) {
|
|
70
70
|
const raw = readFileSync(join(CATALOG_DIR, "catalog.json"), "utf8");
|
|
71
|
+
/* SAFETY: catalog.json is a generated build output, written from the extension manifests by
|
|
72
|
+
`bun run catalog:sync` in exactly the ExtensionCatalogMeta[] shape; `bun run catalog:verify`
|
|
73
|
+
fails when the committed bytes differ from that generator's output, and
|
|
74
|
+
tests/catalog.test.ts checks every entry's required members. */
|
|
71
75
|
_cache = JSON.parse(raw) as ExtensionCatalogMeta[];
|
|
72
76
|
}
|
|
73
77
|
return _cache;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jxsuite/catalog",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "The catalogue of first-party Jx extensions a project can turn on",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -18,10 +18,13 @@
|
|
|
18
18
|
"./catalog.json": "./catalog.json"
|
|
19
19
|
},
|
|
20
20
|
"publishConfig": {
|
|
21
|
-
"provenance":
|
|
21
|
+
"provenance": true
|
|
22
22
|
},
|
|
23
23
|
"scripts": {
|
|
24
24
|
"test": "bun test --isolate",
|
|
25
25
|
"test:coverage": "bun test --isolate --coverage"
|
|
26
|
+
},
|
|
27
|
+
"dependencies": {
|
|
28
|
+
"@jxsuite/protocol": "^5.0.0"
|
|
26
29
|
}
|
|
27
30
|
}
|