nuxtseo-shared 5.2.2 → 5.2.3
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/devtools.mjs +15 -3
- package/dist/module.json +1 -1
- package/package.json +5 -5
package/dist/devtools.mjs
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { spawn } from 'node:child_process';
|
|
2
2
|
import { existsSync, readFileSync, readdirSync, mkdirSync, writeFileSync } from 'node:fs';
|
|
3
|
-
import {
|
|
3
|
+
import { createRequire } from 'node:module';
|
|
4
|
+
import { join, dirname } from 'node:path';
|
|
4
5
|
import { onDevToolsInitialized, extendServerRpc, addCustomTab } from '@nuxt/devtools-kit';
|
|
5
6
|
import { useNuxt } from '@nuxt/kit';
|
|
6
7
|
import sirv from 'sirv';
|
|
@@ -34,9 +35,19 @@ function registerSharedRpcOnce(nuxt) {
|
|
|
34
35
|
}, nuxt);
|
|
35
36
|
}, nuxt);
|
|
36
37
|
}
|
|
38
|
+
function resolveBaseLayer(installed) {
|
|
39
|
+
for (const m of installed) {
|
|
40
|
+
try {
|
|
41
|
+
return dirname(createRequire(join(m.layerDir, "index.js")).resolve("nuxtseo-layer-devtools"));
|
|
42
|
+
} catch {
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
console.warn("[nuxt-seo] could not resolve nuxtseo-layer-devtools from any installed SEO module \u2014 add it to the module's dependencies. Falling back to a bare specifier, which only works when your app installs it directly.");
|
|
46
|
+
return "nuxtseo-layer-devtools";
|
|
47
|
+
}
|
|
37
48
|
function generateAndBuild(cacheDir, installed, onReady) {
|
|
38
49
|
const routes = ["/", ...installed.flatMap((m) => deriveRoutes(m.layerDir, m.slug))];
|
|
39
|
-
const extendsList = [
|
|
50
|
+
const extendsList = [resolveBaseLayer(installed), ...installed.map((m) => m.layerDir)];
|
|
40
51
|
mkdirSync(join(cacheDir, "pages"), { recursive: true });
|
|
41
52
|
writeFileSync(join(cacheDir, "nuxt.config.ts"), `import { resolve } from 'pathe'
|
|
42
53
|
export default defineNuxtConfig({
|
|
@@ -144,7 +155,8 @@ function setupLegacyModule(config, clientPath, nuxt) {
|
|
|
144
155
|
function setupDevToolsUI(config, resolve, nuxt = useNuxt()) {
|
|
145
156
|
if (!nuxt.options.dev)
|
|
146
157
|
return;
|
|
147
|
-
const
|
|
158
|
+
const layerCandidates = [resolve("./devtools"), resolve("../devtools")];
|
|
159
|
+
const layerDir = layerCandidates.find((dir) => existsSync(join(dir, "nuxt.config.ts"))) ?? layerCandidates[0];
|
|
148
160
|
const isLayer = existsSync(join(layerDir, "nuxt.config.ts")) && !existsSync(join(layerDir, "index.html"));
|
|
149
161
|
registerSharedRpcOnce(nuxt);
|
|
150
162
|
if (isLayer)
|
package/dist/module.json
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nuxtseo-shared",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "5.2.
|
|
4
|
+
"version": "5.2.3",
|
|
5
5
|
"description": "Shared utilities for Nuxt SEO modules.",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "Harlan Wilton",
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
"dependencies": {
|
|
78
78
|
"@clack/prompts": "^1.5.1",
|
|
79
79
|
"@nuxt/devtools-kit": "4.0.0-alpha.3",
|
|
80
|
-
"@nuxt/kit": "^4.4.
|
|
80
|
+
"@nuxt/kit": "^4.4.8",
|
|
81
81
|
"birpc": "^4.0.0",
|
|
82
82
|
"consola": "^3.4.2",
|
|
83
83
|
"defu": "^6.1.7",
|
|
@@ -92,15 +92,15 @@
|
|
|
92
92
|
"devDependencies": {
|
|
93
93
|
"@arethetypeswrong/cli": "^0.18.3",
|
|
94
94
|
"@nuxt/module-builder": "^1.0.2",
|
|
95
|
-
"@nuxt/schema": "^4.4.
|
|
95
|
+
"@nuxt/schema": "^4.4.8",
|
|
96
96
|
"@nuxtjs/i18n": "^10.4.0",
|
|
97
97
|
"nitropack": "^2.13.4",
|
|
98
|
-
"nuxt": "^4.4.
|
|
98
|
+
"nuxt": "^4.4.8",
|
|
99
99
|
"nuxt-site-config": "^4.0.8",
|
|
100
100
|
"typescript": "^6.0.3",
|
|
101
101
|
"vitest": "^4.1.8",
|
|
102
102
|
"vue": "^3.5.35",
|
|
103
|
-
"vue-tsc": "^3.3.
|
|
103
|
+
"vue-tsc": "^3.3.4"
|
|
104
104
|
},
|
|
105
105
|
"scripts": {
|
|
106
106
|
"build": "nuxt-module-build build",
|