nuxtseo-shared 5.3.8 → 5.3.9
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/kit.mjs +5 -2
- package/dist/module.json +1 -1
- package/package.json +1 -1
package/dist/kit.mjs
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { pathToFileURL } from 'node:url';
|
|
2
|
-
import { getNuxtVersion, addTypeTemplate, useNuxt, createResolver, addTemplate, loadNuxtModuleInstance, tryUseNuxt, hasNuxtModule, hasNuxtModuleCompatibility, useLogger } from '@nuxt/kit';
|
|
2
|
+
import { getNuxtVersion, addTypeTemplate, useNuxt, resolveModule, createResolver, addTemplate, loadNuxtModuleInstance, tryUseNuxt, hasNuxtModule, hasNuxtModuleCompatibility, useLogger } from '@nuxt/kit';
|
|
3
3
|
import { relative, dirname } from 'pathe';
|
|
4
4
|
import { resolvePackageJSON, readPackageJSON } from 'pkg-types';
|
|
5
5
|
import { provider, env } from 'std-env';
|
|
6
6
|
|
|
7
7
|
const NITRO_RUNTIME_MODULE = "#nuxtseo/nitro";
|
|
8
8
|
const H3_RUNTIME_MODULE = "#nuxtseo/h3";
|
|
9
|
+
const OFETCH_RUNTIME_MODULE = "#nuxtseo/ofetch";
|
|
9
10
|
const TYPE_TEMPLATE_FILENAME = "types/nuxtseo-nitro.d.ts";
|
|
10
11
|
const legacySetupMarker = Symbol.for("nuxtseo:nitro-runtime-compatibility");
|
|
11
12
|
const typeSetupMarker = Symbol.for("nuxtseo:nitro-runtime-compatibility:request-context-types");
|
|
@@ -52,7 +53,7 @@ const nitroV2RuntimeTypes = `export {
|
|
|
52
53
|
} from 'nitropack/runtime'
|
|
53
54
|
export function fetchWithEvent<T>(event: import('h3').H3Event, request: import('ofetch').FetchRequest, options?: import('ofetch').FetchOptions): Promise<T>
|
|
54
55
|
`;
|
|
55
|
-
const nitroV3Runtime = `import { createFetch } from '
|
|
56
|
+
const nitroV3Runtime = `import { createFetch } from '${OFETCH_RUNTIME_MODULE}'
|
|
56
57
|
import { fetchWithEvent as fetchRawWithEvent } from 'nitro/h3'
|
|
57
58
|
export { definePlugin as defineNitroPlugin } from 'nitro'
|
|
58
59
|
export { useNitroApp } from 'nitro/app'
|
|
@@ -109,6 +110,8 @@ function applyNitroRuntimeCompatibility(nuxt, compatibility) {
|
|
|
109
110
|
nitroOptions.alias ||= {};
|
|
110
111
|
nitroOptions.virtual ||= {};
|
|
111
112
|
nitroOptions.alias[H3_RUNTIME_MODULE] = compatibility._tag === "nitro-v3" ? "nitro/h3" : "h3";
|
|
113
|
+
if (compatibility._tag === "nitro-v3")
|
|
114
|
+
nitroOptions.alias[OFETCH_RUNTIME_MODULE] = resolveModule("ofetch", { url: new URL(import.meta.url) });
|
|
112
115
|
nitroOptions.virtual[NITRO_RUNTIME_MODULE] = compatibility._tag === "nitro-v3" ? nitroV3Runtime : nitroV2Runtime;
|
|
113
116
|
}
|
|
114
117
|
function renderNitroTypeAugmentations(compatibility, augmentations) {
|
package/dist/module.json
CHANGED