nuxt-schema-org 5.0.7 → 5.0.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.
Files changed (57) hide show
  1. package/dist/client/200.html +1 -0
  2. package/dist/client/404.html +1 -0
  3. package/dist/client/_nuxt/3mPCgC9T.js +1 -0
  4. package/dist/client/_nuxt/B3Z8rEby.js +1 -0
  5. package/dist/client/_nuxt/BMMyXqK5.js +1 -0
  6. package/dist/client/_nuxt/BpdejJ-Z.js +174 -0
  7. package/dist/client/_nuxt/CVO1_9PV.js +1 -0
  8. package/dist/client/_nuxt/Cp-IABpG.js +1 -0
  9. package/dist/client/_nuxt/D0r3Knsf.js +1 -0
  10. package/dist/client/_nuxt/builds/latest.json +1 -0
  11. package/dist/client/_nuxt/builds/meta/8a772054-fdc3-4341-9461-52f13effa2ab.json +1 -0
  12. package/dist/client/_nuxt/entry.BVcYdedQ.css +1 -0
  13. package/dist/client/_nuxt/error-404.C93bBBKL.css +1 -0
  14. package/dist/client/_nuxt/error-500.zofSQbXz.css +1 -0
  15. package/dist/client/index.html +1 -0
  16. package/dist/content.cjs +28 -0
  17. package/dist/content.d.cts +14 -0
  18. package/dist/content.d.mts +14 -0
  19. package/dist/content.d.ts +14 -0
  20. package/dist/content.mjs +24 -0
  21. package/dist/module.cjs +221 -0
  22. package/dist/module.d.cts +50 -0
  23. package/dist/module.d.mts +50 -0
  24. package/dist/module.d.ts +50 -0
  25. package/dist/module.json +29 -0
  26. package/dist/module.mjs +218 -0
  27. package/dist/runtime/app/composables/useSchemaOrg.d.ts +4 -0
  28. package/dist/runtime/app/composables/useSchemaOrg.js +27 -0
  29. package/dist/runtime/app/plugins/defaults.d.ts +2 -0
  30. package/dist/runtime/app/plugins/defaults.js +28 -0
  31. package/dist/runtime/app/plugins/i18n/defaults.d.ts +2 -0
  32. package/dist/runtime/app/plugins/i18n/defaults.js +77 -0
  33. package/dist/runtime/app/plugins/i18n/init.d.ts +2 -0
  34. package/dist/runtime/app/plugins/i18n/init.js +11 -0
  35. package/dist/runtime/app/plugins/i18n/tsconfig.json +3 -0
  36. package/dist/runtime/app/plugins/init.d.ts +2 -0
  37. package/dist/runtime/app/plugins/init.js +8 -0
  38. package/dist/runtime/app/utils/config.d.ts +2 -0
  39. package/dist/runtime/app/utils/config.js +8 -0
  40. package/dist/runtime/app/utils/shared.d.ts +3 -0
  41. package/dist/runtime/app/utils/shared.js +99 -0
  42. package/dist/runtime/server/plugins/nuxt-content-v2.d.ts +2 -0
  43. package/dist/runtime/server/plugins/nuxt-content-v2.js +37 -0
  44. package/dist/runtime/server/routes/__schema-org__/debug.d.ts +5 -0
  45. package/dist/runtime/server/routes/__schema-org__/debug.js +10 -0
  46. package/dist/runtime/server/tsconfig.json +3 -0
  47. package/dist/runtime/server/utils/config.d.ts +3 -0
  48. package/dist/runtime/server/utils/config.js +8 -0
  49. package/dist/runtime/types.d.ts +9 -0
  50. package/dist/runtime/types.js +0 -0
  51. package/dist/schema.cjs +16 -0
  52. package/dist/schema.d.cts +1 -0
  53. package/dist/schema.d.mts +1 -0
  54. package/dist/schema.d.ts +1 -0
  55. package/dist/schema.mjs +1 -0
  56. package/dist/types.d.mts +9 -0
  57. package/package.json +1 -1
@@ -0,0 +1,37 @@
1
+ import { defineWebPage } from "@unhead/schema-org/vue";
2
+ import { defu } from "defu";
3
+ import { defineNitroPlugin } from "nitropack/runtime";
4
+ import { useSchemaOrgConfig } from "../utils/config.js";
5
+ export default defineNitroPlugin((nitroApp) => {
6
+ const config = useSchemaOrgConfig();
7
+ nitroApp.hooks.hook("content:file:afterParse", async (content) => {
8
+ if (content._draft || content._extension !== "md" || content._partial || content.indexable === false || content.index === false)
9
+ return;
10
+ if (!content.schemaOrg) {
11
+ return;
12
+ }
13
+ const nodes = Array.isArray(content.schemaOrg) ? content.schemaOrg : [defineWebPage(content.schemaOrg)];
14
+ const replaceType = (node) => {
15
+ if (node.type) {
16
+ node["@type"] = node.type;
17
+ delete node.type;
18
+ }
19
+ Object.entries(node).forEach(([, value]) => {
20
+ if (typeof value === "object") {
21
+ replaceType(value);
22
+ }
23
+ });
24
+ return node;
25
+ };
26
+ const script = {
27
+ type: "application/ld+json",
28
+ key: "schema-org-graph",
29
+ nodes: nodes.map(replaceType),
30
+ ...config.scriptAttributes
31
+ };
32
+ content.head = defu({
33
+ script: [script]
34
+ }, content.head);
35
+ return content;
36
+ });
37
+ });
@@ -0,0 +1,5 @@
1
+ declare const _default: import("h3").EventHandler<import("h3").EventHandlerRequest, Promise<{
2
+ nitroOrigin: string;
3
+ runtimeConfig: import("../../../types.js").ModuleRuntimeConfig;
4
+ }>>;
5
+ export default _default;
@@ -0,0 +1,10 @@
1
+ import { useNitroOrigin } from "#site-config/server/composables/useNitroOrigin";
2
+ import { defineEventHandler } from "h3";
3
+ import { useSchemaOrgConfig } from "../../utils/config.js";
4
+ export default defineEventHandler(async (e) => {
5
+ const nitroOrigin = useNitroOrigin(e);
6
+ return {
7
+ nitroOrigin,
8
+ runtimeConfig: useSchemaOrgConfig(e)
9
+ };
10
+ });
@@ -0,0 +1,3 @@
1
+ {
2
+ "extends": "../../../.nuxt/tsconfig.server.json"
3
+ }
@@ -0,0 +1,3 @@
1
+ import type { ModuleRuntimeConfig } from '#schema-org/types';
2
+ import type { H3Event } from 'h3';
3
+ export declare function useSchemaOrgConfig(e?: H3Event): ModuleRuntimeConfig;
@@ -0,0 +1,8 @@
1
+ import { defu } from "defu";
2
+ import { useRuntimeConfig } from "nitropack/runtime";
3
+ export function useSchemaOrgConfig(e) {
4
+ const runtimeConfig = useRuntimeConfig(e);
5
+ return defu(import.meta.client ? runtimeConfig.public["nuxt-schema-org"] : runtimeConfig["nuxt-schema-org"], {
6
+ scriptAttributes: {}
7
+ });
8
+ }
@@ -0,0 +1,9 @@
1
+ import type { ModuleOptions } from '../module.js';
2
+ export type ModuleRuntimeConfig = Pick<ModuleOptions, 'scriptAttributes' | 'reactive' | 'minify' | 'identity'> & {
3
+ version: string;
4
+ };
5
+ export interface UnheadAugmentation<T> {
6
+ script: {
7
+ nodes: T;
8
+ };
9
+ }
File without changes
@@ -0,0 +1,16 @@
1
+ 'use strict';
2
+
3
+ const schemaOrg = require('@unhead/schema-org');
4
+
5
+
6
+
7
+ Object.prototype.hasOwnProperty.call(schemaOrg, '__proto__') &&
8
+ !Object.prototype.hasOwnProperty.call(exports, '__proto__') &&
9
+ Object.defineProperty(exports, '__proto__', {
10
+ enumerable: true,
11
+ value: schemaOrg['__proto__']
12
+ });
13
+
14
+ Object.keys(schemaOrg).forEach(function (k) {
15
+ if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) exports[k] = schemaOrg[k];
16
+ });
@@ -0,0 +1 @@
1
+ export * from '@unhead/schema-org';
@@ -0,0 +1 @@
1
+ export * from '@unhead/schema-org';
@@ -0,0 +1 @@
1
+ export * from '@unhead/schema-org';
@@ -0,0 +1 @@
1
+ export * from '@unhead/schema-org';
@@ -0,0 +1,9 @@
1
+ import type { ModuleHooks } from './module.mjs'
2
+
3
+ declare module '@nuxt/schema' {
4
+ interface NuxtHooks extends ModuleHooks {}
5
+ }
6
+
7
+ export { default } from './module.mjs'
8
+
9
+ export { type ModuleHooks, type ModuleOptions } from './module.mjs'
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "nuxt-schema-org",
3
3
  "type": "module",
4
- "version": "5.0.7",
4
+ "version": "5.0.9",
5
5
  "description": "The quickest and easiest way to build Schema.org graphs for Nuxt.",
6
6
  "author": "Harlan Wilton <harlan@harlanzw.com>",
7
7
  "license": "MIT",