nuxt-schema-org 0.6.4 → 0.6.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
@@ -4,5 +4,5 @@
4
4
  "bridge": false
5
5
  },
6
6
  "name": "nuxt-schema-org",
7
- "version": "0.6.4"
7
+ "version": "0.6.5"
8
8
  }
package/dist/module.mjs CHANGED
@@ -1,6 +1,20 @@
1
1
  import { defineNuxtModule, createResolver, addPlugin, addTemplate, addComponent } from '@nuxt/kit';
2
2
  import { schemaOrgAutoImports, schemaOrgComponents } from '@vueuse/schema-org';
3
3
 
4
+ function normalizeWindowsPath(input = "") {
5
+ if (!input.includes("\\")) {
6
+ return input;
7
+ }
8
+ return input.replace(/\\/g, "/");
9
+ }
10
+ const _IS_ABSOLUTE_RE = /^\/|^\\|^[a-zA-Z]:[/\\]/;
11
+ const isAbsolute = function(p) {
12
+ return _IS_ABSOLUTE_RE.test(p);
13
+ };
14
+ const dirname = function(p) {
15
+ return normalizeWindowsPath(p).replace(/\/$/, "").split("/").slice(0, -1).join("/") || (isAbsolute(p) ? "/" : ".");
16
+ };
17
+
4
18
  const module = defineNuxtModule({
5
19
  meta: {
6
20
  configKey: "schemaOrg",
@@ -13,12 +27,14 @@ const module = defineNuxtModule({
13
27
  autoImportComponents: true
14
28
  },
15
29
  async setup(config, nuxt) {
16
- const { resolve } = createResolver(import.meta.url);
30
+ const { resolve, resolvePath } = createResolver(import.meta.url);
17
31
  const runtimeDir = resolve("./runtime");
18
32
  nuxt.options.build.transpile.push(runtimeDir);
19
33
  addPlugin(resolve(runtimeDir, "plugin.client"));
20
34
  addPlugin(resolve(runtimeDir, "plugin.server"));
21
- nuxt.options.build.transpile.push("@vueuse/schema-org");
35
+ const schemaOrgPath = dirname(await resolvePath("@vueuse/schema-org"));
36
+ nuxt.options.alias["@vueuse/schema-org"] = schemaOrgPath;
37
+ nuxt.options.build.transpile.push(schemaOrgPath);
22
38
  addTemplate({
23
39
  filename: "schemaOrg.config.mjs",
24
40
  getContents: () => `export default ${JSON.stringify({ config })}`
@@ -36,7 +52,7 @@ const module = defineNuxtModule({
36
52
  addComponent({
37
53
  name: component,
38
54
  export: component,
39
- filePath: "@vueuse/schema-org"
55
+ filePath: schemaOrgPath
40
56
  });
41
57
  });
42
58
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nuxt-schema-org",
3
- "version": "0.6.4",
3
+ "version": "0.6.5",
4
4
  "description": "Nuxt module for @vueuse/schema-org",
5
5
  "author": "Harlan Wilton <harlan@harlanzw.com>",
6
6
  "license": "MIT",
@@ -36,12 +36,12 @@
36
36
  ],
37
37
  "dependencies": {
38
38
  "@nuxt/kit": "3.0.0-rc.4",
39
- "@vueuse/schema-org": "0.6.4"
39
+ "@vueuse/schema-org": "0.6.5"
40
40
  },
41
41
  "devDependencies": {
42
42
  "@nuxt/module-builder": "latest",
43
43
  "@nuxt/schema": "3.0.0-rc.4",
44
- "nuxt": "^3.0.0-rc.2"
44
+ "nuxt": "^3.0.0-rc.4"
45
45
  },
46
46
  "scripts": {
47
47
  "build": "nuxi prepare ../../playgrounds/nuxt3 && nuxt-module-build",