nuxt-seo-utils 6.0.0 → 6.0.2
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.d.mts +5 -0
- package/dist/module.d.ts +5 -0
- package/dist/module.json +1 -1
- package/dist/module.mjs +18 -8
- package/package.json +3 -1
package/dist/module.d.mts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as _nuxt_schema from '@nuxt/schema';
|
|
2
|
+
import { UseSeoMetaInput } from '@unhead/schema';
|
|
2
3
|
|
|
3
4
|
interface ModuleOptions {
|
|
4
5
|
/**
|
|
@@ -91,6 +92,10 @@ interface ModuleOptions {
|
|
|
91
92
|
* @default false
|
|
92
93
|
*/
|
|
93
94
|
redirectToCanonicalSiteUrl?: boolean;
|
|
95
|
+
/**
|
|
96
|
+
* The SEO meta object to be used as defaults.
|
|
97
|
+
*/
|
|
98
|
+
meta: UseSeoMetaInput;
|
|
94
99
|
/**
|
|
95
100
|
* Enables debug logs and a debug endpoint.
|
|
96
101
|
*
|
package/dist/module.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as _nuxt_schema from '@nuxt/schema';
|
|
2
|
+
import { UseSeoMetaInput } from '@unhead/schema';
|
|
2
3
|
|
|
3
4
|
interface ModuleOptions {
|
|
4
5
|
/**
|
|
@@ -91,6 +92,10 @@ interface ModuleOptions {
|
|
|
91
92
|
* @default false
|
|
92
93
|
*/
|
|
93
94
|
redirectToCanonicalSiteUrl?: boolean;
|
|
95
|
+
/**
|
|
96
|
+
* The SEO meta object to be used as defaults.
|
|
97
|
+
*/
|
|
98
|
+
meta: UseSeoMetaInput;
|
|
94
99
|
/**
|
|
95
100
|
* Enables debug logs and a debug endpoint.
|
|
96
101
|
*
|
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { useNuxt, createResolver, addTemplate, defineNuxtModule, useLogger, addServerHandler, hasNuxtModule, addPlugin, addImports, addVitePlugin } from '@nuxt/kit';
|
|
2
2
|
import UnheadVite from '@unhead/addons/vite';
|
|
3
3
|
import { defu } from 'defu';
|
|
4
|
+
import { resolvePath } from 'mlly';
|
|
4
5
|
import { installNuxtSiteConfig } from 'nuxt-site-config/kit';
|
|
6
|
+
import { relative, resolve, extname, dirname, basename } from 'pathe';
|
|
5
7
|
import { unpackMeta } from '@unhead/shared';
|
|
6
8
|
import fg from 'fast-glob';
|
|
7
|
-
import { relative, resolve, extname, dirname, basename } from 'pathe';
|
|
8
9
|
import fs from 'node:fs';
|
|
9
10
|
import { encodePath, joinURL } from 'ufo';
|
|
10
11
|
import escapeRE from 'escape-string-regexp';
|
|
@@ -13,6 +14,7 @@ import imageSize from 'image-size';
|
|
|
13
14
|
|
|
14
15
|
function extendNuxtConfigAppHeadSeoMeta(nuxt = useNuxt()) {
|
|
15
16
|
const seoMeta = nuxt.options.app?.seoMeta || nuxt.options.app?.head?.seoMeta || false;
|
|
17
|
+
const configSeoMeta = nuxt.options.seo?.meta || false;
|
|
16
18
|
if (!seoMeta)
|
|
17
19
|
return;
|
|
18
20
|
nuxt.options.app.head = nuxt.options.app.head || {};
|
|
@@ -20,10 +22,12 @@ function extendNuxtConfigAppHeadSeoMeta(nuxt = useNuxt()) {
|
|
|
20
22
|
...nuxt.options.app.head,
|
|
21
23
|
meta: [
|
|
22
24
|
...nuxt.options.app.head.meta || [],
|
|
23
|
-
...unpackMeta(seoMeta)
|
|
25
|
+
...unpackMeta(seoMeta),
|
|
26
|
+
...unpackMeta(configSeoMeta)
|
|
24
27
|
]
|
|
25
28
|
};
|
|
26
29
|
delete nuxt.options.app.seoMeta;
|
|
30
|
+
delete nuxt.options.app.head.seoMeta;
|
|
27
31
|
return nuxt.options.app.head;
|
|
28
32
|
}
|
|
29
33
|
|
|
@@ -495,24 +499,30 @@ const module = defineNuxtModule({
|
|
|
495
499
|
if (config.extendNuxtConfigAppHeadTypes)
|
|
496
500
|
extendNuxtConfigAppHeadTypes();
|
|
497
501
|
extendTypes("nuxt-seo-utils", async () => {
|
|
502
|
+
let unheadSchemaPath;
|
|
503
|
+
try {
|
|
504
|
+
unheadSchemaPath = relative(resolve(nuxt.options.rootDir, nuxt.options.buildDir, "module"), await resolvePath("@unhead/schema", { url: import.meta.url }));
|
|
505
|
+
} catch {
|
|
506
|
+
unheadSchemaPath = "@unhead/schema";
|
|
507
|
+
}
|
|
498
508
|
return `
|
|
499
509
|
declare module 'nitropack' {
|
|
500
510
|
interface NitroRouteRules {
|
|
501
|
-
seoMeta?: import('
|
|
502
|
-
head?: import('
|
|
511
|
+
seoMeta?: import('${unheadSchemaPath}').UseSeoMetaInput
|
|
512
|
+
head?: import('${unheadSchemaPath}').Head
|
|
503
513
|
}
|
|
504
514
|
interface NitroRouteConfig {
|
|
505
|
-
seoMeta?: import('
|
|
506
|
-
head?: import('
|
|
515
|
+
seoMeta?: import('${unheadSchemaPath}').UseSeoMetaInput
|
|
516
|
+
head?: import('${unheadSchemaPath}').Head
|
|
507
517
|
}
|
|
508
518
|
}
|
|
509
519
|
|
|
510
520
|
declare module '@nuxt/schema' {
|
|
511
|
-
interface
|
|
521
|
+
interface AppHeadMetaObject { seoMeta?: import('${unheadSchemaPath}').UseSeoMetaInput }
|
|
512
522
|
}
|
|
513
523
|
|
|
514
524
|
declare module 'nuxt/schema' {
|
|
515
|
-
interface
|
|
525
|
+
interface AppHeadMetaObject { seoMeta?: import('${unheadSchemaPath}').UseSeoMetaInput }
|
|
516
526
|
}
|
|
517
527
|
`;
|
|
518
528
|
});
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nuxt-seo-utils",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "6.0.
|
|
4
|
+
"version": "6.0.2",
|
|
5
5
|
"description": "SEO utilities to improve your Nuxt sites discoverability and shareability",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"funding": "https://github.com/sponsors/harlan-zw",
|
|
@@ -34,10 +34,12 @@
|
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@nuxt/kit": "^3.14.1592",
|
|
36
36
|
"@unhead/addons": "^1.11.11",
|
|
37
|
+
"@unhead/schema": "^1.11.11",
|
|
37
38
|
"defu": "^6.1.4",
|
|
38
39
|
"escape-string-regexp": "^5.0.0",
|
|
39
40
|
"fast-glob": "^3.3.2",
|
|
40
41
|
"image-size": "^1.1.1",
|
|
42
|
+
"mlly": "^1.7.3",
|
|
41
43
|
"nuxt-site-config": "^3.0.3",
|
|
42
44
|
"pathe": "^1.1.2",
|
|
43
45
|
"scule": "^1.3.0",
|