@abraca/nuxt 2.17.1 → 2.18.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/module.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "compatibility": {
5
5
  "nuxt": ">=4.0.0"
6
6
  },
7
- "version": "2.17.1",
7
+ "version": "2.18.0",
8
8
  "builder": {
9
9
  "@nuxt/module-builder": "1.0.2",
10
10
  "unbuild": "3.6.1"
package/dist/module.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  import { createRequire } from 'node:module';
2
- import { defineNuxtModule, createResolver, addPlugin, addImportsDir, addImports, addComponentsDir, addServerHandler, addRouteMiddleware, addServerPlugin, addServerImportsDir } from '@nuxt/kit';
2
+ import { defineNuxtModule, createResolver, addPlugin, addPluginTemplate, addImportsDir, addImports, addComponentsDir, addServerHandler, addRouteMiddleware, addServerPlugin, addServerImportsDir } from '@nuxt/kit';
3
3
  import { defu } from 'defu';
4
4
  export { buildSlugMap, isUUID, slugify } from '../dist/runtime/utils/slugify.js';
5
5
  export { avatarBorderStyle, avatarGradient, avatarStyleFromName } from '../dist/runtime/utils/avatarStyle.js';
@@ -400,9 +400,25 @@ const module$1 = defineNuxtModule({
400
400
  mode: "client"
401
401
  });
402
402
  if (options.features?.editor !== false) {
403
- addPlugin({
404
- src: resolver.resolve("./runtime/plugin-editor-prebundle.client"),
405
- mode: "client"
403
+ addPluginTemplate({
404
+ filename: "abracadabra-editor-prebundle.client.mjs",
405
+ mode: "client",
406
+ getContents: () => [
407
+ "// AUTO-GENERATED by @abraca/nuxt \u2014 editor dep pre-bundle hint.",
408
+ "// Static side-effect imports so Vite's dev scanner pre-bundles the",
409
+ "// editor's CJS / singleton deps as single shared instances. Must live",
410
+ "// in .nuxt/ (crawled) \u2014 the module's runtime dir is optimize-excluded.",
411
+ "import 'highlight.js/lib/core'",
412
+ "import 'lowlight'",
413
+ "import 'prosemirror-state'",
414
+ "import 'prosemirror-view'",
415
+ "import 'prosemirror-model'",
416
+ "import 'prosemirror-transform'",
417
+ "import 'prosemirror-keymap'",
418
+ "import { defineNuxtPlugin } from '#app'",
419
+ "export default defineNuxtPlugin(() => {})",
420
+ ""
421
+ ].join("\n")
406
422
  });
407
423
  }
408
424
  addPlugin({
@@ -12,8 +12,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {
12
12
  awareness: boolean;
13
13
  tag: "video" | "audio";
14
14
  live: boolean;
15
- controls: boolean;
16
15
  total: boolean;
16
+ controls: boolean;
17
17
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
18
18
  declare const _default: typeof __VLS_export;
19
19
  export default _default;
@@ -12,8 +12,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {
12
12
  awareness: boolean;
13
13
  tag: "video" | "audio";
14
14
  live: boolean;
15
- controls: boolean;
16
15
  total: boolean;
16
+ controls: boolean;
17
17
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
18
18
  declare const _default: typeof __VLS_export;
19
19
  export default _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abraca/nuxt",
3
- "version": "2.17.1",
3
+ "version": "2.18.0",
4
4
  "description": "First-class Nuxt module for the Abracadabra CRDT collaboration platform",
5
5
  "repository": "abracadabra/abracadabra-nuxt",
6
6
  "license": "MIT",
@@ -1,42 +0,0 @@
1
- /**
2
- * Force Vite's dev dependency SCANNER to pre-bundle the editor's CJS / singleton
3
- * dependencies — the ones it otherwise never sees.
4
- *
5
- * Why this exists
6
- * ---------------
7
- * The core plugin loads the TipTap/ProseMirror extension graph via *dynamic*
8
- * `import()` (see `plugins/core.plugin.ts`, kept lazy on purpose). Vite's dep
9
- * scanner does NOT follow dynamic imports that live inside `@abraca/nuxt`
10
- * (the module is in `optimizeDeps.exclude`, so its internals aren't crawled —
11
- * only its *static* imports are picked up). And in some Nuxt 4 + Vite 7 setups
12
- * `optimizeDeps.include` is silently ignored by the dev optimizer, so listing
13
- * the deps there is not enough.
14
- *
15
- * The result, when these deps slip through un-optimized:
16
- * - `lowlight` does a `default` import from the CommonJS `highlight.js/lib/core`.
17
- * Served raw, the browser can't read its `default` export → the whole
18
- * extension-load wave rejects → TipTap builds an empty schema →
19
- * "Schema is missing its top node type ('doc')".
20
- * - duplicate `prosemirror-state` copies (pnpm nests one under the module when
21
- * `@tiptap/pm` versions skew) → "Adding different instances of a keyed
22
- * plugin (plugin$)" from `EditorState.reconfigure`.
23
- *
24
- * A *static* side-effect import from this registered plugin puts each dep in the
25
- * app's import graph, so the scanner pre-bundles it (CJS→ESM) as a single shared
26
- * instance. Nothing is used at runtime — these are pre-bundle hints only.
27
- *
28
- * Only registered when `features.editor !== false` (see `module.ts`), so apps
29
- * with the editor disabled never pull these in. The deps are guaranteed present
30
- * whenever the editor is enabled (`lowlight` + the `@tiptap`/ProseMirror stack
31
- * are peer deps; `highlight.js` ships transitively with `lowlight` and is also a
32
- * declared peer).
33
- */
34
- import 'highlight.js/lib/core';
35
- import 'lowlight';
36
- import 'prosemirror-state';
37
- import 'prosemirror-view';
38
- import 'prosemirror-model';
39
- import 'prosemirror-transform';
40
- import 'prosemirror-keymap';
41
- declare const _default: import("#app").Plugin<Record<string, unknown>> & import("#app").ObjectPlugin<Record<string, unknown>>;
42
- export default _default;
@@ -1,14 +0,0 @@
1
- import "highlight.js/lib/core";
2
- import "lowlight";
3
- import "prosemirror-state";
4
- import "prosemirror-view";
5
- import "prosemirror-model";
6
- import "prosemirror-transform";
7
- import "prosemirror-keymap";
8
- import { defineNuxtPlugin } from "#imports";
9
- export default defineNuxtPlugin({
10
- name: "abracadabra:editor-prebundle",
11
- enforce: "pre",
12
- setup() {
13
- }
14
- });