@nuxt/bridge-edge 3.0.0-27296423.f3082ca → 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.
package/dist/chunks/module.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { createRequire } from 'module';
|
|
2
|
-
import { useNuxt, addPluginTemplate, resolveModule, addPlugin, addVitePlugin, addWebpackPlugin, extendWebpackConfig, defineNuxtModule,
|
|
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
|
|
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",
|
package/dist/chunks/module2.mjs
CHANGED
|
@@ -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-
|
|
6
|
+
const version = "3.0.0-27303089.8a6db58";
|
|
7
7
|
|
|
8
8
|
const middlewareTemplate = {
|
|
9
9
|
filename: "middleware.js",
|
|
@@ -49,11 +49,11 @@ export default (ctx, inject) => {
|
|
|
49
49
|
nuxtApp.callHook = nuxtApp.hooks.callHook
|
|
50
50
|
|
|
51
51
|
if (!Array.isArray(ctx.app.created)) {
|
|
52
|
-
ctx.app.created = [ctx.app.created]
|
|
52
|
+
ctx.app.created = [ctx.app.created].filter(Boolean)
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
if (!Array.isArray(ctx.app.mounted)) {
|
|
56
|
-
ctx.app.mounted = [ctx.app.mounted]
|
|
56
|
+
ctx.app.mounted = [ctx.app.mounted].filter(Boolean)
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
if (process.server) {
|
|
@@ -49,11 +49,11 @@ export default (ctx, inject) => {
|
|
|
49
49
|
nuxtApp.callHook = nuxtApp.hooks.callHook
|
|
50
50
|
|
|
51
51
|
if (!Array.isArray(ctx.app.created)) {
|
|
52
|
-
ctx.app.created = [ctx.app.created]
|
|
52
|
+
ctx.app.created = [ctx.app.created].filter(Boolean)
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
if (!Array.isArray(ctx.app.mounted)) {
|
|
56
|
-
ctx.app.mounted = [ctx.app.mounted]
|
|
56
|
+
ctx.app.mounted = [ctx.app.mounted].filter(Boolean)
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
if (process.server) {
|
package/dist/runtime/cookie.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ declare type _CookieOptions = Omit<CookieSerializeOptions & CookieParseOptions,
|
|
|
4
4
|
export interface CookieOptions<T = any> extends _CookieOptions {
|
|
5
5
|
decode?(value: string): T;
|
|
6
6
|
encode?(value: T): string;
|
|
7
|
+
default?: () => T;
|
|
7
8
|
}
|
|
8
9
|
export interface CookieRef<T> extends Ref<T> {
|
|
9
10
|
}
|
package/dist/runtime/cookie.mjs
CHANGED
|
@@ -10,7 +10,7 @@ const CookieDefaults = {
|
|
|
10
10
|
export function useCookie(name, _opts) {
|
|
11
11
|
const opts = { ...CookieDefaults, ..._opts };
|
|
12
12
|
const cookies = readRawCookies(opts);
|
|
13
|
-
const cookie = ref(cookies[name]);
|
|
13
|
+
const cookie = ref(cookies[name] ?? _opts.default?.());
|
|
14
14
|
if (process.client) {
|
|
15
15
|
watch(cookie, () => {
|
|
16
16
|
writeClientCookie(name, cookie.value, opts);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nuxt/bridge-edge",
|
|
3
|
-
"version": "3.0.0-
|
|
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-
|
|
23
|
-
"@nuxt/nitro": "npm:@nuxt/nitro-edge@3.0.0-
|
|
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-
|
|
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-
|
|
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",
|