@ignifx/editor-host 0.11.0 → 0.13.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/dist/error-codes.d.ts +3 -3
- package/dist/error-codes.js +3 -3
- package/dist/error-codes.js.map +1 -1
- package/dist/index.d.ts +559 -240
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2207 -938
- package/dist/index.js.map +1 -1
- package/dist/vite.d.ts +6 -4
- package/dist/vite.d.ts.map +1 -1
- package/dist/vite.js +86 -15
- package/dist/vite.js.map +1 -1
- package/package.json +10 -8
- package/skills/editor-host/SKILL.md +58 -17
package/dist/error-codes.d.ts
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
* @beta
|
|
13
13
|
*/
|
|
14
14
|
declare const EditorHostErrorCode: {
|
|
15
|
-
/** `editorOrigin` is not an origin such as `"ignifx://app"` or `"http://localhost:5173"`. */
|
|
15
|
+
/** `editorOrigin` is not an origin such as `"ignifx-editor://app"` or `"http://localhost:5173"`. */
|
|
16
16
|
readonly invalidEditorOrigin: "IGX-1801";
|
|
17
17
|
/** The host was started where there is no `window` to receive the editor's port, and was given no `messageTarget`. */
|
|
18
18
|
readonly noMessageTarget: "IGX-1802";
|
|
@@ -30,10 +30,10 @@ type EditorHostErrorCode = (typeof EditorHostErrorCode)[keyof typeof EditorHostE
|
|
|
30
30
|
*
|
|
31
31
|
* @remarks
|
|
32
32
|
* `new URL(value).origin` is not usable here: for a scheme Node does not know, such as the
|
|
33
|
-
* editor's `ignifx://app`, it answers `"null"`, while Chromium reports `ignifx://app` as
|
|
33
|
+
* editor's `ignifx-editor://app`, it answers `"null"`, while Chromium reports `ignifx-editor://app` as
|
|
34
34
|
* `event.origin` because Electron registers the scheme as standard.
|
|
35
35
|
*
|
|
36
|
-
* @param value - The candidate, for example `"ignifx://app"` or `"http://localhost:5173"`.
|
|
36
|
+
* @param value - The candidate, for example `"ignifx-editor://app"` or `"http://localhost:5173"`.
|
|
37
37
|
* @returns `true` when the value is a scheme, `://`, and a host with an optional port.
|
|
38
38
|
*
|
|
39
39
|
* @beta
|
package/dist/error-codes.js
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
* @beta
|
|
13
13
|
*/
|
|
14
14
|
const EditorHostErrorCode = {
|
|
15
|
-
/** `editorOrigin` is not an origin such as `"ignifx://app"` or `"http://localhost:5173"`. */
|
|
15
|
+
/** `editorOrigin` is not an origin such as `"ignifx-editor://app"` or `"http://localhost:5173"`. */
|
|
16
16
|
invalidEditorOrigin: "IGX-1801",
|
|
17
17
|
/** The host was started where there is no `window` to receive the editor's port, and was given no `messageTarget`. */
|
|
18
18
|
noMessageTarget: "IGX-1802",
|
|
@@ -29,10 +29,10 @@ const ORIGIN_SHAPE = /^[a-z][a-z\d+.-]*:\/\/[^\s/?#;,'"*]+$/iu;
|
|
|
29
29
|
*
|
|
30
30
|
* @remarks
|
|
31
31
|
* `new URL(value).origin` is not usable here: for a scheme Node does not know, such as the
|
|
32
|
-
* editor's `ignifx://app`, it answers `"null"`, while Chromium reports `ignifx://app` as
|
|
32
|
+
* editor's `ignifx-editor://app`, it answers `"null"`, while Chromium reports `ignifx-editor://app` as
|
|
33
33
|
* `event.origin` because Electron registers the scheme as standard.
|
|
34
34
|
*
|
|
35
|
-
* @param value - The candidate, for example `"ignifx://app"` or `"http://localhost:5173"`.
|
|
35
|
+
* @param value - The candidate, for example `"ignifx-editor://app"` or `"http://localhost:5173"`.
|
|
36
36
|
* @returns `true` when the value is a scheme, `://`, and a host with an optional port.
|
|
37
37
|
*
|
|
38
38
|
* @beta
|
package/dist/error-codes.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error-codes.js","names":[],"sources":["../src/error-codes.ts"],"sourcesContent":["/**\n * The diagnostic codes `@ignifx/editor-host` owns, and the origin rule both of its entries check.\n *\n * The package owns the `18xx` range (`docs/architecture/15-devtools-and-diagnostics.md` §1). This\n * module is plain data with no imports, because the Vite plugin runs in Node without\n * `@ignifx/core` and still reports the same codes.\n */\n\n/**\n * Every diagnostic code `@ignifx/editor-host` can throw, keyed by an intention-revealing name.\n *\n * @beta\n */\nexport const EditorHostErrorCode = {\n /** `editorOrigin` is not an origin such as `\"ignifx://app\"` or `\"http://localhost:5173\"`. */\n invalidEditorOrigin: \"IGX-1801\",\n /** The host was started where there is no `window` to receive the editor's port, and was given no `messageTarget`. */\n noMessageTarget: \"IGX-1802\",\n /** An option is outside its documented domain. */\n invalidOption: \"IGX-1803\",\n} as const;\n\n/**\n * The union of the codes in `EditorHostErrorCode`.\n *\n * @beta\n */\nexport type EditorHostErrorCode = (typeof EditorHostErrorCode)[keyof typeof EditorHostErrorCode];\n\n/**\n * A scheme, `://`, and a host with an optional port: no path, no wildcard, and nothing that could\n * end a `Content-Security-Policy` directive early.\n */\nconst ORIGIN_SHAPE = /^[a-z][a-z\\d+.-]*:\\/\\/[^\\s/?#;,'\"*]+$/iu;\n\n/**\n * Tells whether a string is an origin the editor can be served from.\n *\n * @remarks\n * `new URL(value).origin` is not usable here: for a scheme Node does not know, such as the\n * editor's `ignifx://app`, it answers `\"null\"`, while Chromium reports `ignifx://app` as\n * `event.origin` because Electron registers the scheme as standard.\n *\n * @param value - The candidate, for example `\"ignifx://app\"` or `\"http://localhost:5173\"`.\n * @returns `true` when the value is a scheme, `://`, and a host with an optional port.\n *\n * @beta\n */\nexport function isEditorOrigin(value: string): boolean {\n return ORIGIN_SHAPE.test(value);\n}\n"],"mappings":";;;;;;;;;;;;;AAaA,MAAa,sBAAsB;;CAEjC,qBAAqB;;CAErB,iBAAiB;;CAEjB,eAAe;AACjB;;;;;AAaA,MAAM,eAAe;;;;;;;;;;;;;;AAerB,SAAgB,eAAe,OAAwB;CACrD,OAAO,aAAa,KAAK,KAAK;AAChC"}
|
|
1
|
+
{"version":3,"file":"error-codes.js","names":[],"sources":["../src/error-codes.ts"],"sourcesContent":["/**\n * The diagnostic codes `@ignifx/editor-host` owns, and the origin rule both of its entries check.\n *\n * The package owns the `18xx` range (`docs/architecture/15-devtools-and-diagnostics.md` §1). This\n * module is plain data with no imports, because the Vite plugin runs in Node without\n * `@ignifx/core` and still reports the same codes.\n */\n\n/**\n * Every diagnostic code `@ignifx/editor-host` can throw, keyed by an intention-revealing name.\n *\n * @beta\n */\nexport const EditorHostErrorCode = {\n /** `editorOrigin` is not an origin such as `\"ignifx-editor://app\"` or `\"http://localhost:5173\"`. */\n invalidEditorOrigin: \"IGX-1801\",\n /** The host was started where there is no `window` to receive the editor's port, and was given no `messageTarget`. */\n noMessageTarget: \"IGX-1802\",\n /** An option is outside its documented domain. */\n invalidOption: \"IGX-1803\",\n} as const;\n\n/**\n * The union of the codes in `EditorHostErrorCode`.\n *\n * @beta\n */\nexport type EditorHostErrorCode = (typeof EditorHostErrorCode)[keyof typeof EditorHostErrorCode];\n\n/**\n * A scheme, `://`, and a host with an optional port: no path, no wildcard, and nothing that could\n * end a `Content-Security-Policy` directive early.\n */\nconst ORIGIN_SHAPE = /^[a-z][a-z\\d+.-]*:\\/\\/[^\\s/?#;,'\"*]+$/iu;\n\n/**\n * Tells whether a string is an origin the editor can be served from.\n *\n * @remarks\n * `new URL(value).origin` is not usable here: for a scheme Node does not know, such as the\n * editor's `ignifx-editor://app`, it answers `\"null\"`, while Chromium reports `ignifx-editor://app` as\n * `event.origin` because Electron registers the scheme as standard.\n *\n * @param value - The candidate, for example `\"ignifx-editor://app\"` or `\"http://localhost:5173\"`.\n * @returns `true` when the value is a scheme, `://`, and a host with an optional port.\n *\n * @beta\n */\nexport function isEditorOrigin(value: string): boolean {\n return ORIGIN_SHAPE.test(value);\n}\n"],"mappings":";;;;;;;;;;;;;AAaA,MAAa,sBAAsB;;CAEjC,qBAAqB;;CAErB,iBAAiB;;CAEjB,eAAe;AACjB;;;;;AAaA,MAAM,eAAe;;;;;;;;;;;;;;AAerB,SAAgB,eAAe,OAAwB;CACrD,OAAO,aAAa,KAAK,KAAK;AAChC"}
|