nuxt-schema-org 1.0.2 → 1.0.3-beta.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/module.d.ts +1 -1
- package/dist/module.json +1 -1
- package/dist/module.mjs +20 -46
- package/package.json +4 -4
package/dist/module.d.ts
CHANGED
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { defineNuxtModule, createResolver, addPlugin, addTemplate, addComponent, extendWebpackConfig } from '@nuxt/kit';
|
|
2
|
-
import { resolveUserConfig,
|
|
1
|
+
import { defineNuxtModule, createResolver, addPlugin, addTemplate, addComponent, importModule, extendWebpackConfig } from '@nuxt/kit';
|
|
2
|
+
import { resolveUserConfig, AliasRuntime, schemaOrgComponents, schemaOrgAutoImports } from '@vueuse/schema-org';
|
|
3
3
|
import { dirname } from 'pathe';
|
|
4
|
-
import { AliasRuntimePluginVite, AliasRuntimePluginWebpack } from '@vueuse/schema-org-vite';
|
|
5
4
|
|
|
6
5
|
const Pkg = "@vueuse/schema-org";
|
|
7
6
|
const module = defineNuxtModule({
|
|
@@ -19,17 +18,12 @@ const module = defineNuxtModule({
|
|
|
19
18
|
console.warn("WARN [nuxt-schema-org] Please provide a `canonicalHost` to use this module with SSR enabled.");
|
|
20
19
|
return;
|
|
21
20
|
}
|
|
22
|
-
const schemaOrgPath = dirname(await resolvePath(Pkg));
|
|
23
21
|
if (!nuxt.options.ssr)
|
|
24
22
|
moduleOptions.client = true;
|
|
25
23
|
if (typeof moduleOptions.client === "undefined")
|
|
26
24
|
moduleOptions.client = !!nuxt.options.dev;
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
const runtimeMockPath = await resolvePath(`${schemaOrgPath}/runtime-mock`);
|
|
30
|
-
nuxt.options.alias[AliasProvider] = providerPath;
|
|
31
|
-
nuxt.options.alias[AliasRuntime] = runtimePath;
|
|
32
|
-
nuxt.options.alias[Pkg] = schemaOrgPath;
|
|
25
|
+
const pkgPath = dirname(await resolvePath(Pkg));
|
|
26
|
+
nuxt.options.alias[AliasRuntime] = `${pkgPath}/runtime-${moduleOptions.full ? "schema-dts" : "simple"}`;
|
|
33
27
|
const moduleRuntimeDir = resolve("./runtime");
|
|
34
28
|
nuxt.options.build.transpile.push(...[moduleRuntimeDir, AliasRuntime]);
|
|
35
29
|
if (!moduleOptions.client)
|
|
@@ -50,49 +44,29 @@ const module = defineNuxtModule({
|
|
|
50
44
|
filePath: AliasRuntime
|
|
51
45
|
});
|
|
52
46
|
}
|
|
53
|
-
await addComponent({
|
|
54
|
-
name: "SchemaOrgDebug",
|
|
55
|
-
export: "SchemaOrgDebug",
|
|
56
|
-
filePath: `${schemaOrgPath}/runtime/components/SchemaOrgDebug`
|
|
57
|
-
});
|
|
58
47
|
nuxt.hooks.hook("autoImports:sources", (autoImports) => {
|
|
59
48
|
autoImports.unshift(...schemaOrgAutoImports);
|
|
60
49
|
});
|
|
61
|
-
|
|
62
|
-
runtime: runtimePath,
|
|
63
|
-
provider: providerPath,
|
|
64
|
-
pkg: schemaOrgPath
|
|
65
|
-
};
|
|
66
|
-
const mockPaths = {
|
|
67
|
-
runtime: runtimeMockPath,
|
|
68
|
-
provider: runtimeMockPath,
|
|
69
|
-
pkg: schemaOrgPath
|
|
70
|
-
};
|
|
71
|
-
nuxt.hooks.hook("vite:extendConfig", (config, { isClient }) => {
|
|
72
|
-
config.plugins = config.plugins || [];
|
|
73
|
-
config.plugins.push(AliasRuntimePluginVite({
|
|
74
|
-
paths: !moduleOptions.client && isClient ? mockPaths : realPaths
|
|
75
|
-
}));
|
|
76
|
-
});
|
|
77
|
-
extendWebpackConfig((config) => {
|
|
50
|
+
nuxt.hooks.hook("vite:extendConfig", async (config, { isClient }) => {
|
|
78
51
|
config.plugins = config.plugins || [];
|
|
79
|
-
|
|
80
|
-
|
|
52
|
+
const SchemaOrgVite = await importModule(`${pkgPath}/vite`, { interopDefault: true });
|
|
53
|
+
config.plugins.push(SchemaOrgVite({
|
|
54
|
+
root: nuxt.options.rootDir,
|
|
55
|
+
dts: false,
|
|
56
|
+
mock: !moduleOptions.client && isClient,
|
|
57
|
+
full: moduleOptions.full
|
|
81
58
|
}));
|
|
82
|
-
}, {
|
|
83
|
-
client: false,
|
|
84
|
-
modern: false,
|
|
85
|
-
server: true
|
|
86
59
|
});
|
|
87
|
-
extendWebpackConfig((config) => {
|
|
60
|
+
extendWebpackConfig(async (config) => {
|
|
88
61
|
config.plugins = config.plugins || [];
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
62
|
+
const SchemaOrgWebpack = await importModule(`${pkgPath}/webpack`, { interopDefault: true });
|
|
63
|
+
const plugins = SchemaOrgWebpack({
|
|
64
|
+
root: nuxt.options.rootDir,
|
|
65
|
+
dts: false,
|
|
66
|
+
mock: !moduleOptions.client && config.name === "client",
|
|
67
|
+
full: moduleOptions.full
|
|
68
|
+
});
|
|
69
|
+
config.plugins.push(...plugins);
|
|
96
70
|
});
|
|
97
71
|
}
|
|
98
72
|
});
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nuxt-schema-org",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.3-beta.3",
|
|
5
5
|
"description": "Nuxt module for @vueuse/schema-org",
|
|
6
6
|
"author": "Harlan Wilton <harlan@harlanzw.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -35,10 +35,10 @@
|
|
|
35
35
|
],
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"@nuxt/kit": "^3.0.0-rc.8",
|
|
38
|
-
"@vueuse/schema-org": "1.0.
|
|
39
|
-
"@vueuse/schema-org-vite": "1.0.
|
|
38
|
+
"@vueuse/schema-org": "1.0.3-beta.3",
|
|
39
|
+
"@vueuse/schema-org-vite": "1.0.3-beta.3",
|
|
40
40
|
"pathe": "^0.3.5",
|
|
41
|
-
"schema-org-graph-js": "0.5.
|
|
41
|
+
"schema-org-graph-js": "0.5.1"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"@nuxt/module-builder": "latest",
|