nuxt-schema-org 1.0.0-beta.2 → 1.0.0-beta.5
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.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineNuxtModule, createResolver, addPlugin, addTemplate, addComponent } from '@nuxt/kit';
|
|
2
|
-
import {
|
|
2
|
+
import { schemaOrgComponents, RootSchemas } from '@vueuse/schema-org';
|
|
3
3
|
import { dirname } from 'pathe';
|
|
4
4
|
import { SchemaOrg } from '@vueuse/schema-org-vite';
|
|
5
5
|
|
|
@@ -15,50 +15,58 @@ const module = defineNuxtModule({
|
|
|
15
15
|
async setup(moduleOptions, nuxt) {
|
|
16
16
|
const { resolve, resolvePath } = createResolver(import.meta.url);
|
|
17
17
|
const schemaOrgPath = dirname(await resolvePath(Pkg));
|
|
18
|
-
const
|
|
19
|
-
nuxt.options.build.transpile.push(...[
|
|
18
|
+
const moduleRuntimeDir = resolve("./runtime");
|
|
19
|
+
nuxt.options.build.transpile.push(...[moduleRuntimeDir, RuntimeDir]);
|
|
20
20
|
if (typeof moduleOptions.client === "undefined")
|
|
21
21
|
moduleOptions.client = !!nuxt.options.dev;
|
|
22
22
|
if (!moduleOptions.client)
|
|
23
|
-
addPlugin(resolve(
|
|
23
|
+
addPlugin(resolve(moduleRuntimeDir, "plugin-fallback.client"));
|
|
24
24
|
addPlugin({
|
|
25
|
-
src: resolve(
|
|
25
|
+
src: resolve(moduleRuntimeDir, "plugin"),
|
|
26
26
|
mode: moduleOptions.client ? "all" : "server"
|
|
27
27
|
});
|
|
28
|
-
|
|
29
|
-
nuxt.options.alias["#vueuse/schema-org/provider"] = await resolvePath(`${schemaOrgPath}/providers/full`);
|
|
30
|
-
nuxt.options.alias["#vueuse/schema-org/runtime"] = await resolvePath(`${schemaOrgPath}/runtime`);
|
|
31
|
-
nuxt.hook("vite:extendConfig", (config, { isClient }) => {
|
|
32
|
-
config.optimizeDeps = config.optimizeDeps || {};
|
|
33
|
-
config.optimizeDeps.exclude = config.optimizeDeps.exclude || [];
|
|
34
|
-
config.optimizeDeps.exclude.push(...[`${schemaOrgPath}/runtime`, Pkg]);
|
|
35
|
-
config.plugins = config.plugins || [];
|
|
36
|
-
config.plugins.push(SchemaOrg({
|
|
37
|
-
mock: !moduleOptions.client && isClient,
|
|
38
|
-
full: moduleOptions.full
|
|
39
|
-
}));
|
|
40
|
-
});
|
|
28
|
+
const nuxtSchemaComposablesRuntime = `${moduleRuntimeDir}/composables`;
|
|
41
29
|
addTemplate({
|
|
42
30
|
filename: "nuxt-schema-org-config.mjs",
|
|
43
31
|
getContents: () => `export default ${JSON.stringify(moduleOptions)}`
|
|
44
32
|
});
|
|
33
|
+
const componentPath = await resolvePath(`${schemaOrgPath}/runtime/components`);
|
|
34
|
+
for (const component of schemaOrgComponents) {
|
|
35
|
+
await addComponent({
|
|
36
|
+
name: component,
|
|
37
|
+
export: component,
|
|
38
|
+
chunkName: "schema-org-components",
|
|
39
|
+
filePath: componentPath
|
|
40
|
+
});
|
|
41
|
+
}
|
|
45
42
|
nuxt.hooks.hook("autoImports:sources", (autoImports) => {
|
|
46
43
|
autoImports.unshift({
|
|
47
|
-
from:
|
|
44
|
+
from: nuxtSchemaComposablesRuntime,
|
|
48
45
|
imports: [
|
|
49
46
|
"injectSchemaOrg",
|
|
50
|
-
"useSchemaOrg"
|
|
47
|
+
"useSchemaOrg"
|
|
48
|
+
]
|
|
49
|
+
});
|
|
50
|
+
autoImports.unshift({
|
|
51
|
+
from: "#vueuse/schema-org/provider",
|
|
52
|
+
imports: [
|
|
51
53
|
...RootSchemas.map((schema) => [`define${schema}`]).flat()
|
|
52
54
|
]
|
|
53
55
|
});
|
|
54
56
|
});
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
57
|
+
nuxt.hooks.hook("vite:extendConfig", (config, { isClient }) => {
|
|
58
|
+
config.optimizeDeps = config.optimizeDeps || {};
|
|
59
|
+
config.optimizeDeps.exclude = config.optimizeDeps.exclude || [];
|
|
60
|
+
config.optimizeDeps.exclude.push(...[`${schemaOrgPath}/runtime`, Pkg]);
|
|
61
|
+
config.plugins = config.plugins || [];
|
|
62
|
+
config.plugins.push(SchemaOrg({
|
|
63
|
+
mock: !moduleOptions.client && isClient,
|
|
64
|
+
full: moduleOptions.full,
|
|
65
|
+
aliasPaths: {
|
|
66
|
+
pkgDir: schemaOrgPath,
|
|
67
|
+
runtime: nuxtSchemaComposablesRuntime
|
|
68
|
+
}
|
|
69
|
+
}));
|
|
62
70
|
});
|
|
63
71
|
}
|
|
64
72
|
});
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { useNuxtApp } from "#app";
|
|
2
|
-
export
|
|
3
|
-
export { useSchemaOrg } from "#vueuse/schema-org/runtime";
|
|
2
|
+
export { useSchemaOrg } from "@vueuse/schema-org/runtime";
|
|
4
3
|
export function injectSchemaOrg() {
|
|
5
4
|
const nuxtApp = useNuxtApp();
|
|
6
5
|
if (nuxtApp._injectSchemaOrg)
|
package/dist/runtime/plugin.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nuxt-schema-org",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.5",
|
|
4
4
|
"description": "Nuxt module for @vueuse/schema-org",
|
|
5
5
|
"author": "Harlan Wilton <harlan@harlanzw.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -36,8 +36,8 @@
|
|
|
36
36
|
],
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"@nuxt/kit": "3.0.0-rc.8",
|
|
39
|
-
"@vueuse/schema-org": "1.0.0-beta.
|
|
40
|
-
"@vueuse/schema-org-vite": "1.0.0-beta.
|
|
39
|
+
"@vueuse/schema-org": "1.0.0-beta.5",
|
|
40
|
+
"@vueuse/schema-org-vite": "1.0.0-beta.5",
|
|
41
41
|
"pathe": "^0.3.4",
|
|
42
42
|
"schema-org-graph-js": "0.3.3"
|
|
43
43
|
},
|