nuxt-schema-org 0.0.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/README.md ADDED
@@ -0,0 +1,22 @@
1
+ # nuxt-schema-org
2
+
3
+ The Nuxt.js integration for [vue-schema-org](https://github.com/harlan-zw/vue-schema-org).
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ # NPM
9
+ npm install -D nuxt-schema-org
10
+ # or Yarn
11
+ yarn add -D nuxt-schema-org
12
+ # or PNPM
13
+ pnpm add -D nuxt-schema-org
14
+ ```
15
+
16
+ ## Setup Module
17
+
18
+ Find documentation in the [Nuxt Setup](https://vue-schema-org.netlify.app/guide/setup/nuxt.html) guide
19
+
20
+ ## License
21
+
22
+ MIT License © 2022-PRESENT [Harlan Wilton](https://github.com/harlan-zw)
@@ -0,0 +1,5 @@
1
+ module.exports = function(...args) {
2
+ return import('./module.mjs').then(m => m.default.call(this, ...args))
3
+ }
4
+ const _meta = module.exports.meta = require('./module.json')
5
+ module.exports.getMeta = () => Promise.resolve(_meta)
@@ -0,0 +1,20 @@
1
+ import * as _nuxt_schema from '@nuxt/schema';
2
+ import { SchemaOrgOptions } from 'vue-schema-org';
3
+
4
+ interface ModuleOptions extends SchemaOrgOptions {
5
+ /**
6
+ * Whether composables will be automatically imported for you.
7
+ * @default true
8
+ */
9
+ autoImportComposables: boolean;
10
+ /**
11
+ * Whether components will be automatically imported for you.
12
+ * @default true
13
+ */
14
+ autoImportComponents: boolean;
15
+ }
16
+ interface ModuleHooks {
17
+ }
18
+ declare const _default: _nuxt_schema.NuxtModule<ModuleOptions>;
19
+
20
+ export { ModuleHooks, ModuleOptions, _default as default };
@@ -0,0 +1,8 @@
1
+ {
2
+ "configKey": "schemaOrg",
3
+ "compatibility": {
4
+ "bridge": true
5
+ },
6
+ "name": "nuxt-schema-org",
7
+ "version": "0.0.3"
8
+ }
@@ -0,0 +1,42 @@
1
+ import { defineNuxtModule, createResolver, addPlugin, addTemplate, addComponent } from '@nuxt/kit';
2
+ import { schemaOrgAutoImports, schemaOrgComponents } from 'vue-schema-org';
3
+
4
+ const module = defineNuxtModule({
5
+ meta: {
6
+ configKey: "schemaOrg",
7
+ compatibility: {
8
+ bridge: true
9
+ }
10
+ },
11
+ defaults: {
12
+ autoImportComposables: true,
13
+ autoImportComponents: true
14
+ },
15
+ async setup(config, nuxt) {
16
+ const { resolve } = createResolver(import.meta.url);
17
+ addPlugin(resolve("./runtime/plugin"));
18
+ addTemplate({
19
+ filename: "schemaOrg.config.mjs",
20
+ getContents: () => `export default ${JSON.stringify({ config })}`
21
+ });
22
+ if (config.autoImportComposables) {
23
+ nuxt.hook("autoImports:sources", (autoImports) => {
24
+ autoImports.unshift({
25
+ from: "vue-schema-org",
26
+ imports: schemaOrgAutoImports["vue-schema-org"]
27
+ });
28
+ });
29
+ }
30
+ if (config.autoImportComponents) {
31
+ schemaOrgComponents.forEach((component) => {
32
+ addComponent({
33
+ name: component,
34
+ export: component,
35
+ filePath: "vue-schema-org"
36
+ });
37
+ });
38
+ }
39
+ }
40
+ });
41
+
42
+ export { module as default };
@@ -0,0 +1,2 @@
1
+ declare const _default: any;
2
+ export default _default;
@@ -0,0 +1,13 @@
1
+ import { createSchemaOrg } from "vue-schema-org";
2
+ import { defineNuxtPlugin } from "#app";
3
+ import { useHead, useRoute } from "#imports";
4
+ import meta from "#build/schemaOrg.config.mjs";
5
+ export default defineNuxtPlugin((nuxtApp) => {
6
+ const schemaOrg = createSchemaOrg({
7
+ useHead,
8
+ useRoute,
9
+ ...meta.config,
10
+ debug: true
11
+ });
12
+ nuxtApp.vueApp.use(schemaOrg);
13
+ });
@@ -0,0 +1,11 @@
1
+
2
+ import { ModuleOptions, ModuleHooks } from './module'
3
+
4
+ declare module '@nuxt/schema' {
5
+ interface NuxtConfig { ['schemaOrg']?: Partial<ModuleOptions> }
6
+ interface NuxtOptions { ['schemaOrg']?: ModuleOptions }
7
+ interface NuxtHooks extends ModuleHooks {}
8
+ }
9
+
10
+
11
+ export { default } from './module'
package/package.json ADDED
@@ -0,0 +1,52 @@
1
+ {
2
+ "name": "nuxt-schema-org",
3
+ "type": "module",
4
+ "version": "0.0.3",
5
+ "description": "Nuxt module for vue-schema-org",
6
+ "keywords": [
7
+ "schema-org",
8
+ "nuxt",
9
+ "vue-schema-org",
10
+ "nuxt-module",
11
+ "nuxt3"
12
+ ],
13
+ "license": "MIT",
14
+ "author": "Harlan Wilton <harlan@harlanzw.com>",
15
+ "repository": {
16
+ "type": "git",
17
+ "url": "git+https://github.com/harlan-zw/vue-schema-org.git",
18
+ "directory": "packages/nuxt"
19
+ },
20
+ "funding": "https://github.com/sponsors/harlan-zw",
21
+ "main": "./dist/module.cjs",
22
+ "types": "./dist/types.d.ts",
23
+ "exports": {
24
+ ".": {
25
+ "import": "./dist/module.mjs",
26
+ "require": "./dist/module.cjs"
27
+ }
28
+ },
29
+ "files": [
30
+ "dist"
31
+ ],
32
+ "sideEffects": false,
33
+ "homepage": "https://github.com/harlan-zw/vue-schema-org#readme",
34
+ "bugs": {
35
+ "url": "https://github.com/harlan-zw/vue-schema-org/issues"
36
+ },
37
+ "scripts": {
38
+ "build": "nuxi prepare ../../playgrounds/nuxt3 && nuxt-module-build",
39
+ "prepack": "nuxt-module-build",
40
+ "play": "nuxi dev ../../playgrounds/nuxt3",
41
+ "play:build": "nuxi build ../../playgrounds/nuxt3",
42
+ "stub": "nuxt-module-build --stub && nuxi prepare ../../playgrounds/nuxt3"
43
+ },
44
+ "dependencies": {
45
+ "@nuxt/kit": "^3.0.0-rc.1",
46
+ "vue-schema-org": "workspace:*"
47
+ },
48
+ "devDependencies": {
49
+ "@nuxt/module-builder": "latest",
50
+ "nuxt": "^3.0.0-rc.1"
51
+ }
52
+ }