@lapis-notes/api 0.2.3 → 0.2.6

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 CHANGED
@@ -1,5 +1,64 @@
1
1
  # @lapis-notes/api
2
2
 
3
+ ## 0.2.6
4
+
5
+ ### Patch Changes
6
+
7
+ - [#72](https://github.com/lapismd/lapis-notes/pull/72)
8
+ [`5bd58d8`](https://github.com/lapismd/lapis-notes/commit/5bd58d8033062923f09549fa341d84f22b143452)
9
+ Thanks
10
+ [@lapismd-dependency-bot](https://github.com/apps/lapismd-dependency-bot)! -
11
+ Refresh first-party Lapis dependencies to the published versions recorded in
12
+ this pull request.
13
+
14
+ - [#73](https://github.com/lapismd/lapis-notes/pull/73)
15
+ [`8a7ec3c`](https://github.com/lapismd/lapis-notes/commit/8a7ec3c3d1d1610e8be0e3b29aab4b2f4188a0c5)
16
+ Thanks
17
+ [@lapismd-dependency-bot](https://github.com/apps/lapismd-dependency-bot)! -
18
+ Refresh first-party Lapis dependencies to the published versions recorded in
19
+ this pull request.
20
+
21
+ - [#79](https://github.com/lapismd/lapis-notes/pull/79)
22
+ [`5292b52`](https://github.com/lapismd/lapis-notes/commit/5292b52ebc37318fcfad7971e4e309cf3afaff18)
23
+ Thanks [@stevejuma](https://github.com/stevejuma)! - Retain a successfully
24
+ opened same-leaf file as the active-file fallback when a panel becomes active
25
+ before the open completes.
26
+
27
+ ## 0.2.5
28
+
29
+ ### Patch Changes
30
+
31
+ - [#66](https://github.com/lapismd/lapis-notes/pull/66)
32
+ [`6086980`](https://github.com/lapismd/lapis-notes/commit/6086980be8a0d9cf6e697a689b0c17f409afdc3f)
33
+ Thanks [@stevejuma](https://github.com/stevejuma)! - Consume published Design
34
+ Core 0.10.1 so browser hosts can reserve leading and trailing native controls
35
+ and title-bar height, with a continuous divider when sidebars collapse. Keep
36
+ portable registry ranges and existing compatibility.
37
+ - Updated dependencies
38
+ [[`6086980`](https://github.com/lapismd/lapis-notes/commit/6086980be8a0d9cf6e697a689b0c17f409afdc3f)]:
39
+ - @lapis-notes/ui@0.1.7
40
+
41
+ ## 0.2.4
42
+
43
+ ### Patch Changes
44
+
45
+ - [#60](https://github.com/lapismd/lapis-notes/pull/60)
46
+ [`fb2eff2`](https://github.com/lapismd/lapis-notes/commit/fb2eff2b11b4a623ea2780f5e3e0f92a0530844b)
47
+ Thanks [@stevejuma](https://github.com/stevejuma)! - Expose the explicit
48
+ Notebook Design Core/UI host modules and admit Design Core 0.9 compatibility,
49
+ including File Explorer so the host resolves one shared Core installation.
50
+ This changes generated host admission metadata and dependency compatibility,
51
+ not the API runtime interface; retain the 0.2 API peer cohort. Full host
52
+ qualification remains required before release.
53
+
54
+ Add a public Vite renderer adapter that binds plugin compiler imports to the
55
+ admitted versioned Svelte namespace and resolves those entries through the
56
+ shared host runtime. Expose the required Markdown and CodeMirror host modules
57
+ while keeping private imports and renderer version mismatches rejected.
58
+ - Updated dependencies
59
+ [[`fb2eff2`](https://github.com/lapismd/lapis-notes/commit/fb2eff2b11b4a623ea2780f5e3e0f92a0530844b)]:
60
+ - @lapis-notes/ui@0.1.6
61
+
3
62
  ## 0.2.3
4
63
 
5
64
  ### Patch Changes
package/README.md CHANGED
@@ -65,3 +65,27 @@ Explorer uses editor associations and pattern priority to choose the
65
65
  contribution, then resolves artwork through `app.icons`. Pending, missing or
66
66
  failed artwork retains the filename icon. Changes repaint existing rows;
67
67
  rendering an icon never activates a plugin or constructs its file view.
68
+
69
+ ### Versioned renderer builds
70
+
71
+ Use the public build adapter when producing renderer plugins or embedding their
72
+ npm exports in a Vite host. Pass the exact installed Svelte version; the generated
73
+ host catalog rejects unknown modules and incompatible compiler/runtime versions.
74
+
75
+ ```ts
76
+ import { defineConfig } from "vite";
77
+ import { svelte } from "@sveltejs/vite-plugin-svelte";
78
+ import { rendererHostModulePlugin } from "@lapis-notes/api/build/vite";
79
+
80
+ export default defineConfig({
81
+ plugins: [
82
+ rendererHostModulePlugin({ mode: "host", svelteVersion: "5.56.10" }),
83
+ svelte(),
84
+ ],
85
+ });
86
+ ```
87
+
88
+ Plugin producers choose `mode: "plugin"` and let the adapter externalize Svelte
89
+ imports; do not pre-externalize them or copy private host build helpers. The
90
+ versioned providers retain the host's single Svelte runtime. Other imports still
91
+ need explicit host admission and the plugin's normal manifest audit.
@@ -0,0 +1,20 @@
1
+ export interface RendererHostModuleOptions {
2
+ /** Plugin producers externalize imports; npm hosts resolve admitted providers. */
3
+ mode: "plugin" | "host";
4
+ /** The exact installed compiler/runtime version, never a semver range. */
5
+ svelteVersion: string;
6
+ }
7
+ /** Bind compiled plugins to the host's public versioned renderer catalog. */
8
+ export declare function rendererHostModulePlugin(options: RendererHostModuleOptions): {
9
+ name: string;
10
+ enforce: "pre";
11
+ config(this: void): {
12
+ optimizeDeps: {
13
+ exclude: string[];
14
+ };
15
+ };
16
+ resolveId(this: import("rollup").PluginContext, source: string, importer?: string): Promise<{
17
+ id: string;
18
+ external?: boolean | "absolute" | "relative";
19
+ } | null>;
20
+ };
@@ -0,0 +1,49 @@
1
+ import { pluginHostModuleRegistry } from "../generated/plugin-host-modules.schema.generated.js";
2
+ /** Bind compiled plugins to the host's public versioned renderer catalog. */
3
+ export function rendererHostModulePlugin(options) {
4
+ if (!/^[0-9]+\.[0-9]+\.[0-9]+(?:[-+][\w.-]+)?$/.test(options.svelteVersion))
5
+ throw Error("Renderer binding requires an exact Svelte version");
6
+ if (options.mode !== "plugin" && options.mode !== "host")
7
+ throw Error("Renderer mode must be plugin or host");
8
+ const entries = Object.values(pluginHostModuleRegistry).filter((entry) => entry.source === "renderer-abi" &&
9
+ entry.public &&
10
+ entry.version === options.svelteVersion);
11
+ if (!entries.length)
12
+ throw Error(`The host catalog does not admit Svelte ${options.svelteVersion}`);
13
+ const providers = new Map(entries.map((entry) => [entry.specifier, entry.entry]));
14
+ const specifiers = new Map(entries.map((entry) => [entry.entry, entry.specifier]));
15
+ return {
16
+ name: "lapis-renderer-host-modules",
17
+ enforce: "pre",
18
+ config() {
19
+ return {
20
+ optimizeDeps: {
21
+ // These are host ABI identifiers, not exports of the npm Svelte package.
22
+ exclude: options.mode === "host" ? [...providers.keys()] : [],
23
+ },
24
+ };
25
+ },
26
+ async resolveId(source, importer) {
27
+ if (source.startsWith("svelte/renderer/")) {
28
+ const provider = providers.get(source);
29
+ if (!provider)
30
+ throw Error(`Unadmitted renderer module: ${source}`);
31
+ if (options.mode === "plugin")
32
+ return { id: source, external: true };
33
+ const resolved = await this.resolve(provider, importer, {
34
+ skipSelf: true,
35
+ });
36
+ if (!resolved)
37
+ throw Error(`Missing host renderer provider: ${provider}`);
38
+ return resolved;
39
+ }
40
+ if (options.mode !== "plugin" ||
41
+ !(source === "svelte" || source.startsWith("svelte/")))
42
+ return null;
43
+ const specifier = specifiers.get(source);
44
+ if (!specifier)
45
+ throw Error(`Unadmitted compiler renderer module: ${source}`);
46
+ return { id: specifier, external: true };
47
+ },
48
+ };
49
+ }
@@ -13,3 +13,4 @@ export declare function tursoBundleBuildPlugin(): {
13
13
  map: null;
14
14
  } | null;
15
15
  };
16
+ export { rendererHostModulePlugin, type RendererHostModuleOptions, } from "./renderer.js";
@@ -34,3 +34,4 @@ export function tursoBundleBuildPlugin() {
34
34
  },
35
35
  };
36
36
  }
37
+ export { rendererHostModulePlugin, } from "./renderer.js";