@selfhelp/shared 1.2.0 → 1.2.1
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/CHANGELOG.md +231 -182
- package/README.md +292 -287
- package/dist/plugin-sdk/index.d.mts +25 -11
- package/dist/plugin-sdk/index.d.ts +25 -11
- package/package.json +93 -93
- package/src/plugin-sdk/registry.ts +22 -11
|
@@ -385,26 +385,40 @@ interface IPluginRegistryEntry {
|
|
|
385
385
|
/**
|
|
386
386
|
* Registry root document.
|
|
387
387
|
*
|
|
388
|
-
* Mirrors `plugin-registry.schema.json
|
|
389
|
-
* `
|
|
390
|
-
*
|
|
388
|
+
* Mirrors `plugin-registry.schema.json` in the host repository. The
|
|
389
|
+
* canonical schema requires `schemaVersion` (a string enum, currently
|
|
390
|
+
* `'1.0'`) and `plugins`. The publisher/base-url metadata is optional
|
|
391
|
+
* but always emitted by `scripts/publish-to-registry.mjs`.
|
|
391
392
|
*/
|
|
392
393
|
interface IPluginRegistry {
|
|
393
|
-
/**
|
|
394
|
-
|
|
395
|
-
/** Registry display name. */
|
|
396
|
-
name: string;
|
|
397
|
-
/** Registry homepage / maintainer URL. */
|
|
398
|
-
homepage?: string;
|
|
394
|
+
/** Canonical registry schema version. Currently fixed at `'1.0'`. */
|
|
395
|
+
schemaVersion: '1.0';
|
|
399
396
|
/** ISO timestamp this registry was published. */
|
|
400
397
|
publishedAt?: string;
|
|
401
|
-
/**
|
|
398
|
+
/**
|
|
399
|
+
* Public base URL where this registry is served (with trailing
|
|
400
|
+
* slash). Plugin publishers join this to relative
|
|
401
|
+
* `artifacts/<id>-<version>/...` paths to produce the absolute
|
|
402
|
+
* `runtime.entrypointUrl` / `runtime.stylesheetUrl` that gets
|
|
403
|
+
* signed and shipped in each plugin entry.
|
|
404
|
+
*/
|
|
405
|
+
baseUrl?: string;
|
|
406
|
+
/** Publisher metadata shown in the admin UI. */
|
|
407
|
+
publisher?: {
|
|
408
|
+
name: string;
|
|
409
|
+
url?: string;
|
|
410
|
+
};
|
|
411
|
+
/** Optional registry display name (legacy helper, not in canonical schema). */
|
|
412
|
+
name?: string;
|
|
413
|
+
/** Registry homepage / maintainer URL (legacy helper, not in canonical schema). */
|
|
414
|
+
homepage?: string;
|
|
415
|
+
/** Public key used to verify per-version signatures (legacy helper, not in canonical schema). */
|
|
402
416
|
trustKey?: {
|
|
403
417
|
algo: 'ed25519';
|
|
404
418
|
publicKeyId: string;
|
|
405
419
|
publicKey: string;
|
|
406
420
|
};
|
|
407
|
-
/** Channels this registry exposes (
|
|
421
|
+
/** Channels this registry exposes (legacy helper, not in canonical schema). */
|
|
408
422
|
channels?: TPluginRegistryChannel[];
|
|
409
423
|
/** Listed plugins. */
|
|
410
424
|
plugins: IPluginRegistryEntry[];
|
package/package.json
CHANGED
|
@@ -1,93 +1,93 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@selfhelp/shared",
|
|
3
|
-
"version": "1.2.
|
|
4
|
-
"description": "Shared TypeScript package for SelfHelp web frontend and mobile app: style registry, types, API contracts, Mantine theme tokens, condition + interpolation engines, CMS class allow-list.",
|
|
5
|
-
"repository": {
|
|
6
|
-
"type": "git",
|
|
7
|
-
"url": "git+https://github.com/humdek-unibe-ch/sh-selfhelp_shared.git"
|
|
8
|
-
},
|
|
9
|
-
"homepage": "https://github.com/humdek-unibe-ch/sh-selfhelp_shared#readme",
|
|
10
|
-
"bugs": {
|
|
11
|
-
"url": "https://github.com/humdek-unibe-ch/sh-selfhelp_shared/issues"
|
|
12
|
-
},
|
|
13
|
-
"main": "dist/index.js",
|
|
14
|
-
"module": "dist/index.mjs",
|
|
15
|
-
"types": "dist/index.d.ts",
|
|
16
|
-
"exports": {
|
|
17
|
-
".": {
|
|
18
|
-
"types": "./dist/index.d.ts",
|
|
19
|
-
"import": "./dist/index.mjs",
|
|
20
|
-
"require": "./dist/index.js"
|
|
21
|
-
},
|
|
22
|
-
"./registry": {
|
|
23
|
-
"types": "./dist/registry/index.d.ts",
|
|
24
|
-
"import": "./dist/registry/index.mjs",
|
|
25
|
-
"require": "./dist/registry/index.js"
|
|
26
|
-
},
|
|
27
|
-
"./theme": {
|
|
28
|
-
"types": "./dist/theme/index.d.ts",
|
|
29
|
-
"import": "./dist/theme/index.mjs",
|
|
30
|
-
"require": "./dist/theme/index.js"
|
|
31
|
-
},
|
|
32
|
-
"./tailwind": {
|
|
33
|
-
"types": "./dist/theme/tailwind.d.ts",
|
|
34
|
-
"import": "./dist/theme/tailwind.mjs",
|
|
35
|
-
"require": "./dist/theme/tailwind.js"
|
|
36
|
-
},
|
|
37
|
-
"./plugin-sdk": {
|
|
38
|
-
"types": "./dist/plugin-sdk/index.d.ts",
|
|
39
|
-
"import": "./dist/plugin-sdk/index.mjs",
|
|
40
|
-
"require": "./dist/plugin-sdk/index.js"
|
|
41
|
-
}
|
|
42
|
-
},
|
|
43
|
-
"files": [
|
|
44
|
-
"dist",
|
|
45
|
-
"src",
|
|
46
|
-
"README.md",
|
|
47
|
-
"CHANGELOG.md"
|
|
48
|
-
],
|
|
49
|
-
"scripts": {
|
|
50
|
-
"build": "tsup src/index.ts src/registry/index.ts src/theme/index.ts src/theme/tailwind.ts src/plugin-sdk/index.ts --format cjs,esm --dts --clean --no-splitting",
|
|
51
|
-
"dev": "tsup src/index.ts src/registry/index.ts src/theme/index.ts src/theme/tailwind.ts src/plugin-sdk/index.ts --format cjs,esm --dts --watch --no-splitting",
|
|
52
|
-
"lint": "eslint . --ext .ts",
|
|
53
|
-
"typecheck": "tsc --noEmit",
|
|
54
|
-
"test": "vitest run",
|
|
55
|
-
"check:schemas": "node scripts/check-schema-parity.mjs",
|
|
56
|
-
"prepublishOnly": "npm run build",
|
|
57
|
-
"headers:check": "license-check-and-add check -f license-check-and-add-config.json",
|
|
58
|
-
"headers:add": "license-check-and-add add -f license-check-and-add-config.json",
|
|
59
|
-
"headers:remove": "license-check-and-add remove -f license-check-and-add-config.json"
|
|
60
|
-
},
|
|
61
|
-
"dependencies": {
|
|
62
|
-
"json-logic-js": "^2.0.5"
|
|
63
|
-
},
|
|
64
|
-
"peerDependencies": {
|
|
65
|
-
"react": "^18.0.0 || ^19.0.0"
|
|
66
|
-
},
|
|
67
|
-
"peerDependenciesMeta": {
|
|
68
|
-
"react": {
|
|
69
|
-
"optional": true
|
|
70
|
-
}
|
|
71
|
-
},
|
|
72
|
-
"devDependencies": {
|
|
73
|
-
"@types/json-logic-js": "^2.0.8",
|
|
74
|
-
"@types/node": "^22.10.0",
|
|
75
|
-
"@types/react": "^19.2.15",
|
|
76
|
-
"@typescript-eslint/eslint-plugin": "^8.0.0",
|
|
77
|
-
"@typescript-eslint/parser": "^8.0.0",
|
|
78
|
-
"eslint": "^9.18.0",
|
|
79
|
-
"license-check-and-add": "^4.0.5",
|
|
80
|
-
"react": "^19.2.6",
|
|
81
|
-
"tsup": "^8.3.5",
|
|
82
|
-
"typescript": "^5.6.0",
|
|
83
|
-
"vitest": "^2.1.0"
|
|
84
|
-
},
|
|
85
|
-
"publishConfig": {
|
|
86
|
-
"access": "public"
|
|
87
|
-
},
|
|
88
|
-
"engines": {
|
|
89
|
-
"node": ">=18"
|
|
90
|
-
},
|
|
91
|
-
"sideEffects": false,
|
|
92
|
-
"license": "MPL-2.0"
|
|
93
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@selfhelp/shared",
|
|
3
|
+
"version": "1.2.1",
|
|
4
|
+
"description": "Shared TypeScript package for SelfHelp web frontend and mobile app: style registry, types, API contracts, Mantine theme tokens, condition + interpolation engines, CMS class allow-list.",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "git+https://github.com/humdek-unibe-ch/sh-selfhelp_shared.git"
|
|
8
|
+
},
|
|
9
|
+
"homepage": "https://github.com/humdek-unibe-ch/sh-selfhelp_shared#readme",
|
|
10
|
+
"bugs": {
|
|
11
|
+
"url": "https://github.com/humdek-unibe-ch/sh-selfhelp_shared/issues"
|
|
12
|
+
},
|
|
13
|
+
"main": "dist/index.js",
|
|
14
|
+
"module": "dist/index.mjs",
|
|
15
|
+
"types": "dist/index.d.ts",
|
|
16
|
+
"exports": {
|
|
17
|
+
".": {
|
|
18
|
+
"types": "./dist/index.d.ts",
|
|
19
|
+
"import": "./dist/index.mjs",
|
|
20
|
+
"require": "./dist/index.js"
|
|
21
|
+
},
|
|
22
|
+
"./registry": {
|
|
23
|
+
"types": "./dist/registry/index.d.ts",
|
|
24
|
+
"import": "./dist/registry/index.mjs",
|
|
25
|
+
"require": "./dist/registry/index.js"
|
|
26
|
+
},
|
|
27
|
+
"./theme": {
|
|
28
|
+
"types": "./dist/theme/index.d.ts",
|
|
29
|
+
"import": "./dist/theme/index.mjs",
|
|
30
|
+
"require": "./dist/theme/index.js"
|
|
31
|
+
},
|
|
32
|
+
"./tailwind": {
|
|
33
|
+
"types": "./dist/theme/tailwind.d.ts",
|
|
34
|
+
"import": "./dist/theme/tailwind.mjs",
|
|
35
|
+
"require": "./dist/theme/tailwind.js"
|
|
36
|
+
},
|
|
37
|
+
"./plugin-sdk": {
|
|
38
|
+
"types": "./dist/plugin-sdk/index.d.ts",
|
|
39
|
+
"import": "./dist/plugin-sdk/index.mjs",
|
|
40
|
+
"require": "./dist/plugin-sdk/index.js"
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
"files": [
|
|
44
|
+
"dist",
|
|
45
|
+
"src",
|
|
46
|
+
"README.md",
|
|
47
|
+
"CHANGELOG.md"
|
|
48
|
+
],
|
|
49
|
+
"scripts": {
|
|
50
|
+
"build": "tsup src/index.ts src/registry/index.ts src/theme/index.ts src/theme/tailwind.ts src/plugin-sdk/index.ts --format cjs,esm --dts --clean --no-splitting",
|
|
51
|
+
"dev": "tsup src/index.ts src/registry/index.ts src/theme/index.ts src/theme/tailwind.ts src/plugin-sdk/index.ts --format cjs,esm --dts --watch --no-splitting",
|
|
52
|
+
"lint": "eslint . --ext .ts",
|
|
53
|
+
"typecheck": "tsc --noEmit",
|
|
54
|
+
"test": "vitest run --passWithNoTests",
|
|
55
|
+
"check:schemas": "node scripts/check-schema-parity.mjs",
|
|
56
|
+
"prepublishOnly": "npm run build",
|
|
57
|
+
"headers:check": "license-check-and-add check -f license-check-and-add-config.json",
|
|
58
|
+
"headers:add": "license-check-and-add add -f license-check-and-add-config.json",
|
|
59
|
+
"headers:remove": "license-check-and-add remove -f license-check-and-add-config.json"
|
|
60
|
+
},
|
|
61
|
+
"dependencies": {
|
|
62
|
+
"json-logic-js": "^2.0.5"
|
|
63
|
+
},
|
|
64
|
+
"peerDependencies": {
|
|
65
|
+
"react": "^18.0.0 || ^19.0.0"
|
|
66
|
+
},
|
|
67
|
+
"peerDependenciesMeta": {
|
|
68
|
+
"react": {
|
|
69
|
+
"optional": true
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
"devDependencies": {
|
|
73
|
+
"@types/json-logic-js": "^2.0.8",
|
|
74
|
+
"@types/node": "^22.10.0",
|
|
75
|
+
"@types/react": "^19.2.15",
|
|
76
|
+
"@typescript-eslint/eslint-plugin": "^8.0.0",
|
|
77
|
+
"@typescript-eslint/parser": "^8.0.0",
|
|
78
|
+
"eslint": "^9.18.0",
|
|
79
|
+
"license-check-and-add": "^4.0.5",
|
|
80
|
+
"react": "^19.2.6",
|
|
81
|
+
"tsup": "^8.3.5",
|
|
82
|
+
"typescript": "^5.6.0",
|
|
83
|
+
"vitest": "^2.1.0"
|
|
84
|
+
},
|
|
85
|
+
"publishConfig": {
|
|
86
|
+
"access": "public"
|
|
87
|
+
},
|
|
88
|
+
"engines": {
|
|
89
|
+
"node": ">=18"
|
|
90
|
+
},
|
|
91
|
+
"sideEffects": false,
|
|
92
|
+
"license": "MPL-2.0"
|
|
93
|
+
}
|
|
@@ -72,22 +72,33 @@ export interface IPluginRegistryEntry {
|
|
|
72
72
|
/**
|
|
73
73
|
* Registry root document.
|
|
74
74
|
*
|
|
75
|
-
* Mirrors `plugin-registry.schema.json
|
|
76
|
-
* `
|
|
77
|
-
*
|
|
75
|
+
* Mirrors `plugin-registry.schema.json` in the host repository. The
|
|
76
|
+
* canonical schema requires `schemaVersion` (a string enum, currently
|
|
77
|
+
* `'1.0'`) and `plugins`. The publisher/base-url metadata is optional
|
|
78
|
+
* but always emitted by `scripts/publish-to-registry.mjs`.
|
|
78
79
|
*/
|
|
79
80
|
export interface IPluginRegistry {
|
|
80
|
-
/**
|
|
81
|
-
|
|
82
|
-
/** Registry display name. */
|
|
83
|
-
name: string;
|
|
84
|
-
/** Registry homepage / maintainer URL. */
|
|
85
|
-
homepage?: string;
|
|
81
|
+
/** Canonical registry schema version. Currently fixed at `'1.0'`. */
|
|
82
|
+
schemaVersion: '1.0';
|
|
86
83
|
/** ISO timestamp this registry was published. */
|
|
87
84
|
publishedAt?: string;
|
|
88
|
-
/**
|
|
85
|
+
/**
|
|
86
|
+
* Public base URL where this registry is served (with trailing
|
|
87
|
+
* slash). Plugin publishers join this to relative
|
|
88
|
+
* `artifacts/<id>-<version>/...` paths to produce the absolute
|
|
89
|
+
* `runtime.entrypointUrl` / `runtime.stylesheetUrl` that gets
|
|
90
|
+
* signed and shipped in each plugin entry.
|
|
91
|
+
*/
|
|
92
|
+
baseUrl?: string;
|
|
93
|
+
/** Publisher metadata shown in the admin UI. */
|
|
94
|
+
publisher?: { name: string; url?: string };
|
|
95
|
+
/** Optional registry display name (legacy helper, not in canonical schema). */
|
|
96
|
+
name?: string;
|
|
97
|
+
/** Registry homepage / maintainer URL (legacy helper, not in canonical schema). */
|
|
98
|
+
homepage?: string;
|
|
99
|
+
/** Public key used to verify per-version signatures (legacy helper, not in canonical schema). */
|
|
89
100
|
trustKey?: { algo: 'ed25519'; publicKeyId: string; publicKey: string };
|
|
90
|
-
/** Channels this registry exposes (
|
|
101
|
+
/** Channels this registry exposes (legacy helper, not in canonical schema). */
|
|
91
102
|
channels?: TPluginRegistryChannel[];
|
|
92
103
|
/** Listed plugins. */
|
|
93
104
|
plugins: IPluginRegistryEntry[];
|