@jxsuite/catalog 0.1.0
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 +21 -0
- package/catalog.json +73 -0
- package/index.ts +84 -0
- package/package.json +27 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Kevin Shenk
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/catalog.json
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"description": "Better Auth sessions, sign-in flows, and table permissions served over /_jx/auth",
|
|
4
|
+
"docs": "/docs/extending/extensions/first-party#jxsuiteauth-sessions-and-permissions",
|
|
5
|
+
"name": "@jxsuite/auth",
|
|
6
|
+
"sections": [
|
|
7
|
+
{
|
|
8
|
+
"key": "auth",
|
|
9
|
+
"title": "Authentication"
|
|
10
|
+
}
|
|
11
|
+
],
|
|
12
|
+
"title": "Authentication",
|
|
13
|
+
"requires": [
|
|
14
|
+
"@jxsuite/connector"
|
|
15
|
+
]
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"description": "Database connections and dynamic data tables served over /_jx/data",
|
|
19
|
+
"docs": "/docs/extending/extensions/first-party#jxsuiteconnector-connections-and-data-tables",
|
|
20
|
+
"name": "@jxsuite/connector",
|
|
21
|
+
"sections": [
|
|
22
|
+
{
|
|
23
|
+
"key": "connections",
|
|
24
|
+
"title": "Connections"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"key": "data",
|
|
28
|
+
"title": "Data Tables"
|
|
29
|
+
}
|
|
30
|
+
],
|
|
31
|
+
"title": "Data & Connections"
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"description": "Atom (RFC 4287) and JSON Feed generation from content collections, with RFC 5005 archives and automatic <link rel=\"alternate\"> discovery",
|
|
35
|
+
"docs": "/docs/extending/extensions/first-party#jxsuitefeed-syndication-feeds",
|
|
36
|
+
"name": "@jxsuite/feed",
|
|
37
|
+
"sections": [
|
|
38
|
+
{
|
|
39
|
+
"key": "feed",
|
|
40
|
+
"title": "Feeds"
|
|
41
|
+
}
|
|
42
|
+
],
|
|
43
|
+
"title": "Feeds"
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"description": "File-based content collections with Markdown and CSV formats",
|
|
47
|
+
"docs": "/docs/extending/extensions/first-party#jxsuiteparser-content-and-markdown",
|
|
48
|
+
"name": "@jxsuite/parser",
|
|
49
|
+
"sections": [
|
|
50
|
+
{
|
|
51
|
+
"key": "content",
|
|
52
|
+
"title": "Content Types"
|
|
53
|
+
}
|
|
54
|
+
],
|
|
55
|
+
"title": "Content & Markdown",
|
|
56
|
+
"formats": [
|
|
57
|
+
".csv",
|
|
58
|
+
".md"
|
|
59
|
+
]
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
"description": "Build-time search index emission from content collections (MiniSearch) with section-level deep links and a headless browser client",
|
|
63
|
+
"docs": "/docs/extending/extensions/first-party#jxsuitesearch-build-time-site-search",
|
|
64
|
+
"name": "@jxsuite/search",
|
|
65
|
+
"sections": [
|
|
66
|
+
{
|
|
67
|
+
"key": "search",
|
|
68
|
+
"title": "Site Search"
|
|
69
|
+
}
|
|
70
|
+
],
|
|
71
|
+
"title": "Search"
|
|
72
|
+
}
|
|
73
|
+
]
|
package/index.ts
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Extension catalogue — the first-party Jx extensions a project can turn on, as data.
|
|
3
|
+
*
|
|
4
|
+
* This module is metadata-only, and deliberately so: it names `@jxsuite/parser` and its four
|
|
5
|
+
* siblings without importing any of them, so core never gains a dependency edge on `extensions/*`
|
|
6
|
+
* (specs/extensions.md §2, enforced by scripts/check-dep-rules.ts).
|
|
7
|
+
*
|
|
8
|
+
* `catalog.json` is a BUILD OUTPUT, generated from every `extensions/<name>/jx-extension.json` and
|
|
9
|
+
* the class descriptors it points at. `bun run catalog:verify` is the gate and `bun run
|
|
10
|
+
* catalog:sync` is the fixer; never hand-edit it, because the next sync overwrites the edit.
|
|
11
|
+
*
|
|
12
|
+
* ## What is NOT here, and why
|
|
13
|
+
*
|
|
14
|
+
* **No version, and no semver range.** `packages/studio/src/settings/dependencies-editor.ts`
|
|
15
|
+
* records what that costs: `@jxsuite/*` rows once targeted the version the Studio build embedded,
|
|
16
|
+
* which "proposed a version that may never have been published, for a package whose real latest
|
|
17
|
+
* the table had not looked at". The five extensions release on five independent cadences, and a
|
|
18
|
+
* catalogue frozen inside a packaged desktop app is strictly worse than the bug already fixed —
|
|
19
|
+
* it is read months after it was written, and release-please writes a version into package.json
|
|
20
|
+
* before npm publish completes, so a pinned range here can name a version that never shipped.
|
|
21
|
+
* `addPackage(name)` already means "latest", resolved at install time. A test asserts this
|
|
22
|
+
* absence by name.
|
|
23
|
+
*
|
|
24
|
+
* **No `bundled`, `installed`, `source` or `problem`.** Those are per-host or per-project facts,
|
|
25
|
+
* answered by whichever backend serves the catalogue — which is the whole reason the catalogue is
|
|
26
|
+
* a platform capability rather than a constant. A Worker ships a fixed set of extension packages
|
|
27
|
+
* (specs/extensions.md §5.5), and a desktop build ships another; neither is knowable from here.
|
|
28
|
+
*/
|
|
29
|
+
|
|
30
|
+
import { readFileSync } from "node:fs";
|
|
31
|
+
import { join } from "node:path";
|
|
32
|
+
|
|
33
|
+
/** One project.json section an extension's classes claim (specs/extensions.md §9). */
|
|
34
|
+
export interface CatalogSection {
|
|
35
|
+
/** The project.json top-level property, e.g. "content". */
|
|
36
|
+
key: string;
|
|
37
|
+
/** The owning class's `project.title`, e.g. "Content Types". */
|
|
38
|
+
title?: string;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/** One first-party extension, as the generator derives it from the package's own manifest. */
|
|
42
|
+
export interface ExtensionCatalogMeta {
|
|
43
|
+
/** Package name — the identity, the project.json entry, and the `bun add` argument. */
|
|
44
|
+
name: string;
|
|
45
|
+
/** Manifest `title`, for studio surfaces. */
|
|
46
|
+
title: string;
|
|
47
|
+
/** Manifest `description`, one line. */
|
|
48
|
+
description: string;
|
|
49
|
+
/** The project.json sections enabling it makes legal, in class declaration order. */
|
|
50
|
+
sections: CatalogSection[];
|
|
51
|
+
/** File extensions its format classes claim (".md", ".csv"), when it claims any. */
|
|
52
|
+
formats?: string[];
|
|
53
|
+
/** Other catalogue members it depends on — auth needs connector. */
|
|
54
|
+
requires?: string[];
|
|
55
|
+
/** Documentation page for this extension. */
|
|
56
|
+
docs: string;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
const CATALOG_DIR = import.meta.dirname;
|
|
60
|
+
|
|
61
|
+
let _cache: ExtensionCatalogMeta[] | null = null;
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Read and cache the shipped catalogue.
|
|
65
|
+
*
|
|
66
|
+
* @returns {ExtensionCatalogMeta[]}
|
|
67
|
+
*/
|
|
68
|
+
export function listCatalog(): ExtensionCatalogMeta[] {
|
|
69
|
+
if (!_cache) {
|
|
70
|
+
const raw = readFileSync(join(CATALOG_DIR, "catalog.json"), "utf8");
|
|
71
|
+
_cache = JSON.parse(raw) as ExtensionCatalogMeta[];
|
|
72
|
+
}
|
|
73
|
+
return _cache;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* One entry by package name, or `undefined`.
|
|
78
|
+
*
|
|
79
|
+
* @param {string} name
|
|
80
|
+
* @returns {ExtensionCatalogMeta | undefined}
|
|
81
|
+
*/
|
|
82
|
+
export function getCatalogEntry(name: string): ExtensionCatalogMeta | undefined {
|
|
83
|
+
return listCatalog().find((entry) => entry.name === name);
|
|
84
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@jxsuite/catalog",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "The catalogue of first-party Jx extensions a project can turn on",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/jxsuite/jx.git",
|
|
9
|
+
"directory": "packages/catalog"
|
|
10
|
+
},
|
|
11
|
+
"files": [
|
|
12
|
+
"index.ts",
|
|
13
|
+
"catalog.json"
|
|
14
|
+
],
|
|
15
|
+
"type": "module",
|
|
16
|
+
"exports": {
|
|
17
|
+
".": "./index.ts",
|
|
18
|
+
"./catalog.json": "./catalog.json"
|
|
19
|
+
},
|
|
20
|
+
"publishConfig": {
|
|
21
|
+
"provenance": false
|
|
22
|
+
},
|
|
23
|
+
"scripts": {
|
|
24
|
+
"test": "bun test --isolate",
|
|
25
|
+
"test:coverage": "bun test --isolate --coverage"
|
|
26
|
+
}
|
|
27
|
+
}
|