@nuxt/bridge-edge 3.0.0-27303085.ae6f095 → 3.0.0-27303089.8a6db58

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.
@@ -1,9 +1,9 @@
1
1
  import { createRequire } from 'module';
2
- import { useNuxt, addPluginTemplate, resolveModule, addPlugin, addVitePlugin, addWebpackPlugin, extendWebpackConfig, defineNuxtModule, addTemplate, resolveAlias, installModule, isNuxt3, checkNuxtCompatibilityIssues } from '@nuxt/kit';
2
+ import { useNuxt, addPluginTemplate, resolveModule, addTemplate, addPlugin, addVitePlugin, addWebpackPlugin, extendWebpackConfig, defineNuxtModule, resolveAlias, installModule, isNuxt3, checkNuxtCompatibilityIssues } from '@nuxt/kit';
3
3
  import fs, { existsSync, promises } from 'fs';
4
4
  import fetch from 'node-fetch';
5
5
  import { stringifyQuery, parseURL, parseQuery } from 'ufo';
6
- import { dirname, resolve, join as join$1, parse as parse$1, normalize, isAbsolute, relative } from 'pathe';
6
+ import { dirname, resolve, relative, join as join$1, parse as parse$1, normalize, isAbsolute } from 'pathe';
7
7
  import { getNitroContext, resolveMiddleware, build, prepare, generate, wpfs, createDevServer } from '@nuxt/nitro';
8
8
  import { fileURLToPath } from 'url';
9
9
  import { join } from 'path';
@@ -286,6 +286,19 @@ function createNuxt2DevServer(nitroContext) {
286
286
  };
287
287
  }
288
288
 
289
+ const componentsTypeTemplate = {
290
+ filename: "components.d.ts",
291
+ write: true,
292
+ getContents: ({ options }) => `// Generated by components discovery
293
+ declare module 'vue' {
294
+ export interface GlobalComponents {
295
+ ${options.components.map((c) => ` '${c.pascalName}': typeof import('${relative(options.buildDir, c.filePath)}')['${c.export}']`).join(",\n")}
296
+ }
297
+ }
298
+ export {}
299
+ `
300
+ };
301
+
289
302
  function setupAppBridge(_options) {
290
303
  const nuxt = useNuxt();
291
304
  nuxt.options.alias["#app"] = resolve(distDir$1, "runtime/index.mjs");
@@ -294,6 +307,19 @@ function setupAppBridge(_options) {
294
307
  nuxt.options.build.transpile.push("vue");
295
308
  nuxt.options.fetch.server = false;
296
309
  nuxt.options.fetch.client = false;
310
+ const components = [];
311
+ nuxt.hook("components:extend", (registeredComponents) => {
312
+ components.push(...registeredComponents);
313
+ });
314
+ addTemplate({
315
+ ...componentsTypeTemplate,
316
+ options: { components, buildDir: nuxt.options.buildDir }
317
+ });
318
+ nuxt.hook("prepare:types", ({ references }) => {
319
+ if (components.length) {
320
+ references.push({ path: resolve(nuxt.options.buildDir, "components.d.ts") });
321
+ }
322
+ });
297
323
  nuxt.options.alias["vue2-bridge"] = resolve(distDir$1, "runtime/vue2-bridge.mjs");
298
324
  for (const alias of [
299
325
  "vue",
@@ -3,7 +3,7 @@ import { defineNuxtModule, addPluginTemplate } from '@nuxt/kit';
3
3
  import hash from 'hash-sum';
4
4
  import { resolve } from 'pathe';
5
5
 
6
- const version = "3.0.0-27303085.ae6f095";
6
+ const version = "3.0.0-27303089.8a6db58";
7
7
 
8
8
  const middlewareTemplate = {
9
9
  filename: "middleware.js",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nuxt/bridge-edge",
3
- "version": "3.0.0-27303085.ae6f095",
3
+ "version": "3.0.0-27303089.8a6db58",
4
4
  "repository": "nuxt/framework",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -19,10 +19,10 @@
19
19
  },
20
20
  "dependencies": {
21
21
  "@babel/plugin-transform-typescript": "^7.16.1",
22
- "@nuxt/kit": "npm:@nuxt/kit-edge@3.0.0-27303085.ae6f095",
23
- "@nuxt/nitro": "npm:@nuxt/nitro-edge@3.0.0-27303085.ae6f095",
22
+ "@nuxt/kit": "npm:@nuxt/kit-edge@3.0.0-27303089.8a6db58",
23
+ "@nuxt/nitro": "npm:@nuxt/nitro-edge@3.0.0-27303089.8a6db58",
24
24
  "@nuxt/postcss8": "^1.1.3",
25
- "@nuxt/schema": "npm:@nuxt/schema-edge@3.0.0-27303085.ae6f095",
25
+ "@nuxt/schema": "npm:@nuxt/schema-edge@3.0.0-27303089.8a6db58",
26
26
  "@vitejs/plugin-legacy": "^1.6.3",
27
27
  "@vue/composition-api": "^1.4.0",
28
28
  "@vueuse/head": "^0.7.2",
@@ -42,7 +42,7 @@
42
42
  "mlly": "^0.3.13",
43
43
  "murmurhash-es": "^0.1.1",
44
44
  "node-fetch": "^3.1.0",
45
- "nuxi": "npm:nuxi-edge@3.0.0-27303085.ae6f095",
45
+ "nuxi": "npm:nuxi-edge@3.0.0-27303089.8a6db58",
46
46
  "p-debounce": "^4.0.0",
47
47
  "pathe": "^0.2.0",
48
48
  "postcss": "^8",