@plurnk/plurnk-schemes 0.27.0 → 0.29.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/SPEC.md
CHANGED
|
@@ -183,7 +183,8 @@ These migrate when the v1 namespaced ctx API lands (entries / channels / visibil
|
|
|
183
183
|
A scheme handler is discovered and registered with **zero first-party involvement** — install it, it lights up. The contract:
|
|
184
184
|
|
|
185
185
|
- **Declare** `plurnk.kind: "scheme"` and `plurnk.name: "<scheme>"` in `package.json`, and `export default` the handler class.
|
|
186
|
-
- **`SchemeDiscovery` owns the scan (this package).** `SchemeDiscovery.discover({ cwd? })` walks *all* of `node_modules` — scoped (`@acme/foo`) and unscoped — and returns `{ schemes: {name, packageName}[], skipped }` for every package declaring `plurnk.kind === "scheme"` + `plurnk.name`. Scope-agnostic, so a third party under their own scope is found with no first-party allow-list (plurnk-service#227); two externals claiming one prefix fail-hard. It returns **descriptors, not handlers** — contract-only, it never imports a scheme package; the consumer imports each `packageName` and registers `new mod.default()`, applying in-tree precedence. Co-located with its tests here, parallel to `plurnk-execs`/`plurnk-mimetypes`/`plurnk-providers` discover().
|
|
186
|
+
- **`SchemeDiscovery` owns the scan (this package).** `SchemeDiscovery.discover({ cwd? })` walks *all* of `node_modules` — scoped (`@acme/foo`) and unscoped — and returns `{ schemes: {name, packageName, attribution?}[], skipped }` for every package declaring `plurnk.kind === "scheme"` + `plurnk.name`. Scope-agnostic, so a third party under their own scope is found with no first-party allow-list (plurnk-service#227); two externals claiming one prefix fail-hard. It returns **descriptors, not handlers** — contract-only, it never imports a scheme package; the consumer imports each `packageName` and registers `new mod.default()`, applying in-tree precedence. Co-located with its tests here, parallel to `plurnk-execs`/`plurnk-mimetypes`/`plurnk-providers` discover().
|
|
187
|
+
- **`attribution` rides the descriptor verbatim.** A package may declare `plurnk.attribution` (a credit string, or an array of them); the scan passes it through untouched as `SchemeInfo.attribution` (`string | string[] | undefined`) — anything that isn't a string or string-array is dropped. The framework neither validates nor normalizes it: the `@plurnk`-tags-only-from-`@plurnk`-packages reservation policy is the **consumer's** to enforce on the surfaced credit (plurnk-service#26).
|
|
187
188
|
- **The framework stays contract-only.** `@plurnk/plurnk-schemes` never depends on a scheme package — that would nest daughters under it and the top-level scan would miss them. Daughters peer-pin the framework (exact); it arrives transitively and is itself ignored by the scan (no `plurnk.kind`).
|
|
188
189
|
- **`@plurnk/plurnk-schemes-all`** is the first-party convenience bundle: it deps the first-party siblings flat so one install surfaces them all. It is never a gate — operators install individual packages or third-party ones identically.
|
|
189
190
|
- **Trust.** An operator can require host-level trust before a discovered plugin registers (`PLURNK_PLUGINS_TRUSTED_ONLY`, plurnk-service#229) — the scope-agnostic scan widens reach, the trust gate bounds it.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SchemeDiscovery.d.ts","sourceRoot":"","sources":["../src/SchemeDiscovery.ts"],"names":[],"mappings":"AA0BA,MAAM,WAAW,UAAU;IACvB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"SchemeDiscovery.d.ts","sourceRoot":"","sources":["../src/SchemeDiscovery.ts"],"names":[],"mappings":"AA0BA,MAAM,WAAW,UAAU;IACvB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAM7B,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,MAAM,EAAE,CAAC;CACrD;AAED,MAAM,WAAW,qBAAqB;IAClC,QAAQ,CAAC,OAAO,EAAE,aAAa,CAAC,UAAU,CAAC,CAAC;IAC5C,QAAQ,CAAC,OAAO,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;CAC3C;AAED,MAAM,WAAW,eAAe;IAC5B,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,WAAW,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;CAChD;AAED,MAAM,CAAC,OAAO,OAAO,eAAe;;WACnB,QAAQ,CAAC,OAAO,GAAE,eAAoB,GAAG,OAAO,CAAC,qBAAqB,CAAC;CAgGvF"}
|
package/dist/SchemeDiscovery.js
CHANGED
|
@@ -105,7 +105,24 @@ export default class SchemeDiscovery {
|
|
|
105
105
|
return null;
|
|
106
106
|
if (typeof record.name !== "string" || record.name === "")
|
|
107
107
|
return null;
|
|
108
|
-
|
|
108
|
+
const attribution = SchemeDiscovery.#attribution(plurnkRec.attribution);
|
|
109
|
+
// Only carry the key when credit is actually present — an absent
|
|
110
|
+
// attribution leaves the property off entirely (not `undefined`), so a
|
|
111
|
+
// no-attribution descriptor stays `{ name, packageName }`.
|
|
112
|
+
return attribution === undefined
|
|
113
|
+
? { name: plurnkRec.name, packageName: record.name }
|
|
114
|
+
: { name: plurnkRec.name, packageName: record.name, attribution };
|
|
115
|
+
}
|
|
116
|
+
// Pass `plurnk.attribution` through verbatim when it's a string or an array
|
|
117
|
+
// of strings; anything else (number, object, mixed array) is not credit and
|
|
118
|
+
// is dropped to undefined. No deeper validation — the reservation policy
|
|
119
|
+
// lives in the consumer.
|
|
120
|
+
static #attribution(value) {
|
|
121
|
+
if (typeof value === "string")
|
|
122
|
+
return value;
|
|
123
|
+
if (Array.isArray(value) && value.every((v) => typeof v === "string"))
|
|
124
|
+
return value;
|
|
125
|
+
return undefined;
|
|
109
126
|
}
|
|
110
127
|
}
|
|
111
128
|
//# sourceMappingURL=SchemeDiscovery.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SchemeDiscovery.js","sourceRoot":"","sources":["../src/SchemeDiscovery.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAClC,OAAO,IAAI,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"SchemeDiscovery.js","sourceRoot":"","sources":["../src/SchemeDiscovery.ts"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,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,QAAQ,CAAC;YAAE,OAAO,KAAK,CAAC;QACpF,OAAO,SAAS,CAAC;IACrB,CAAC;CACJ"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plurnk/plurnk-schemes",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.29.0",
|
|
4
4
|
"description": "Framework + contract for the @plurnk/plurnk-schemes-* URI handler family.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"plurnk",
|
|
@@ -45,12 +45,12 @@
|
|
|
45
45
|
"prepare": "npm run build"
|
|
46
46
|
},
|
|
47
47
|
"peerDependencies": {
|
|
48
|
-
"@plurnk/plurnk-grammar": "0.
|
|
49
|
-
"@plurnk/plurnk-mimetypes": "0.15.
|
|
48
|
+
"@plurnk/plurnk-grammar": "0.73.0",
|
|
49
|
+
"@plurnk/plurnk-mimetypes": "0.15.21"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
|
-
"@plurnk/plurnk-grammar": "0.
|
|
53
|
-
"@plurnk/plurnk-mimetypes": "0.15.
|
|
52
|
+
"@plurnk/plurnk-grammar": "0.73.0",
|
|
53
|
+
"@plurnk/plurnk-mimetypes": "0.15.21",
|
|
54
54
|
"@types/node": "^25.8.0",
|
|
55
55
|
"typescript": "^6.0.3"
|
|
56
56
|
}
|