nuxt-schema-org 1.0.0-beta.8 → 1.0.0-beta.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.
package/dist/module.d.ts CHANGED
@@ -15,6 +15,9 @@ interface ModuleOptions {
15
15
  * @default false
16
16
  */
17
17
  full?: boolean;
18
+ /**
19
+ * Metadata for the schema.org generation
20
+ */
18
21
  meta?: MetaInput;
19
22
  }
20
23
  interface ModuleHooks {
package/dist/module.json CHANGED
@@ -4,5 +4,5 @@
4
4
  "bridge": false
5
5
  },
6
6
  "name": "nuxt-schema-org",
7
- "version": "1.0.0-beta.8"
7
+ "version": "1.0.0-beta.9"
8
8
  }
package/dist/module.mjs CHANGED
@@ -1,10 +1,9 @@
1
1
  import { defineNuxtModule, createResolver, addPlugin, addTemplate, addComponent } from '@nuxt/kit';
2
- import { schemaOrgComponents, RootSchemas } from '@vueuse/schema-org';
2
+ import { AliasRuntime, AliasProvider, schemaOrgComponents, schemaOrgAutoImports } from '@vueuse/schema-org';
3
3
  import { dirname } from 'pathe';
4
4
  import { SchemaOrg } from '@vueuse/schema-org-vite';
5
5
 
6
6
  const Pkg = "@vueuse/schema-org";
7
- const RuntimeDir = "#vueuse/schema-org/runtime";
8
7
  const module = defineNuxtModule({
9
8
  meta: {
10
9
  configKey: "schemaOrg",
@@ -16,14 +15,13 @@ const module = defineNuxtModule({
16
15
  const { resolve, resolvePath } = createResolver(import.meta.url);
17
16
  const schemaOrgPath = dirname(await resolvePath(Pkg));
18
17
  const moduleRuntimeDir = resolve("./runtime");
19
- nuxt.options.build.transpile.push(...[moduleRuntimeDir, RuntimeDir]);
18
+ nuxt.options.build.transpile.push(...[moduleRuntimeDir, AliasRuntime]);
20
19
  if (typeof moduleOptions.client === "undefined")
21
20
  moduleOptions.client = !!nuxt.options.dev;
22
- const nuxtSchemaComposablesRuntime = `${moduleRuntimeDir}/composables`;
23
21
  const providerPath = await resolvePath(`${schemaOrgPath}/providers/${moduleOptions.full ? "full" : "simple"}`);
22
+ nuxt.options.alias[AliasProvider] = providerPath;
23
+ nuxt.options.alias[AliasRuntime] = "@vueuse/schema-org/runtime";
24
24
  nuxt.options.alias[Pkg] = schemaOrgPath;
25
- nuxt.options.alias["#vueuse/schema-org/provider"] = providerPath;
26
- nuxt.options.alias["#vueuse/schema-org/runtime"] = nuxtSchemaComposablesRuntime;
27
25
  if (!moduleOptions.client)
28
26
  addPlugin(resolve(moduleRuntimeDir, "plugin-fallback.client"));
29
27
  addPlugin({
@@ -34,29 +32,16 @@ const module = defineNuxtModule({
34
32
  filename: "nuxt-schema-org-config.mjs",
35
33
  getContents: () => `export default ${JSON.stringify(moduleOptions)}`
36
34
  });
37
- const componentPath = await resolvePath(`${schemaOrgPath}/runtime/components`);
38
35
  for (const component of schemaOrgComponents) {
39
36
  await addComponent({
40
37
  name: component,
41
38
  export: component,
42
- chunkName: "schema-org-components",
43
- filePath: componentPath
39
+ chunkName: "nuxt-schema-org/components",
40
+ filePath: AliasRuntime
44
41
  });
45
42
  }
46
43
  nuxt.hooks.hook("autoImports:sources", (autoImports) => {
47
- autoImports.unshift({
48
- from: nuxtSchemaComposablesRuntime,
49
- imports: [
50
- "injectSchemaOrg",
51
- "useSchemaOrg"
52
- ]
53
- });
54
- autoImports.unshift({
55
- from: "#vueuse/schema-org/provider",
56
- imports: [
57
- ...RootSchemas.map((schema) => [`define${schema}`]).flat()
58
- ]
59
- });
44
+ autoImports.unshift(...schemaOrgAutoImports);
60
45
  });
61
46
  nuxt.hooks.hook("vite:extendConfig", (config, { isClient }) => {
62
47
  config.optimizeDeps = config.optimizeDeps || {};
@@ -68,8 +53,7 @@ const module = defineNuxtModule({
68
53
  full: moduleOptions.full,
69
54
  aliasPaths: {
70
55
  provider: providerPath,
71
- pkgDir: schemaOrgPath,
72
- runtime: nuxtSchemaComposablesRuntime
56
+ pkgDir: schemaOrgPath
73
57
  }
74
58
  }));
75
59
  });
@@ -22,7 +22,6 @@ export default defineNuxtPlugin((nuxtApp) => {
22
22
  };
23
23
  }
24
24
  });
25
- nuxtApp._injectSchemaOrg = () => client;
26
25
  nuxtApp.vueApp.use(client);
27
26
  if (ssr) {
28
27
  client.generateSchema();
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "nuxt-schema-org",
3
3
  "type": "module",
4
- "version": "1.0.0-beta.8",
4
+ "version": "1.0.0-beta.9",
5
5
  "description": "Nuxt module for @vueuse/schema-org",
6
6
  "author": "Harlan Wilton <harlan@harlanzw.com>",
7
7
  "license": "MIT",
@@ -35,8 +35,8 @@
35
35
  ],
36
36
  "dependencies": {
37
37
  "@nuxt/kit": "3.0.0-rc.8",
38
- "@vueuse/schema-org": "1.0.0-beta.8",
39
- "@vueuse/schema-org-vite": "1.0.0-beta.8",
38
+ "@vueuse/schema-org": "1.0.0-beta.9",
39
+ "@vueuse/schema-org-vite": "1.0.0-beta.9",
40
40
  "pathe": "^0.3.4",
41
41
  "schema-org-graph-js": "0.3.3"
42
42
  },
@@ -1,2 +0,0 @@
1
- export { useSchemaOrg } from '@vueuse/schema-org/runtime';
2
- export declare function injectSchemaOrg(): any;
@@ -1,7 +0,0 @@
1
- import { useNuxtApp } from "#app";
2
- export { useSchemaOrg } from "@vueuse/schema-org/runtime";
3
- export function injectSchemaOrg() {
4
- const nuxtApp = useNuxtApp();
5
- if (nuxtApp._injectSchemaOrg)
6
- return nuxtApp._injectSchemaOrg();
7
- }