Skip to content

Commit

Permalink
Merge pull request #1150 from ymmooot/issue-1149
Browse files Browse the repository at this point in the history
fix #1149
  • Loading branch information
ymmooot authored Apr 13, 2023
2 parents ece3897 + e708387 commit c685ef1
Show file tree
Hide file tree
Showing 10 changed files with 3,282 additions and 2,094 deletions.
1 change: 1 addition & 0 deletions packages/example/nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ import NuxtJsonld from 'nuxt-jsonld';
export default defineNuxtConfig({
modules: [NuxtJsonld],
css: ['@/css/index.css'],
devtools: true,
});
8 changes: 7 additions & 1 deletion packages/example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,14 @@
"version": "0.0.1",
"scripts": {
"prepare": "yarn workspace nuxt-jsonld build",
"dev": "yarn prepare && nuxi dev",
"dev": "nuxi dev",
"build": "yarn prepare && nuxi build",
"start": "node ./.output/server/index.mjs"
},
"dependencies": {
"nuxt": "^3.4.1"
},
"devDependencies": {
"@nuxt/devtools": "^0.4.0"
}
}
2 changes: 1 addition & 1 deletion packages/nuxt-jsonld/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"esbuild": "^0.17.14",
"esbuild-jest": "^0.5.0",
"jest": "^29.5.0",
"nuxt": "^3.0.0",
"nuxt": "^3.4.1",
"prettier": "^2.8.7",
"shipjs": "0.26.1",
"tsup": "^6.7.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/nuxt-jsonld/src/runtime/composable.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { computed } from 'vue';
import type { JsonLD, JsonLDFunc } from '../types';
import { useHead } from '#head';
import { useHead } from '@unhead/vue';

const isFunc = (json: JsonLD | JsonLDFunc): json is JsonLDFunc => typeof json === 'function';

Expand Down
2 changes: 1 addition & 1 deletion packages/nuxt-jsonld/src/runtime/plugin-impl.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { computed } from 'vue';
import { useHead } from '#head';
import { useHead } from '@unhead/vue';

export default (nuxtApp) => {
const mixin = {
Expand Down
2 changes: 1 addition & 1 deletion packages/nuxt-jsonld/src/runtime/plugin.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { defineNuxtPlugin } from '#app';
import { defineNuxtPlugin } from 'nuxt/app';
import plugin from './plugin-impl';

export default defineNuxtPlugin(plugin);
4 changes: 2 additions & 2 deletions packages/nuxt-jsonld/test/composable.spec.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { useJsonld } from '../src/runtime/composable';
import { ref } from 'vue';
import { useHead } from '#head';
import { useHead } from '@unhead/vue';

let useHeadArg = undefined;
jest.mock('#head', () => ({
jest.mock('@unhead/vue', () => ({
useHead: jest.fn().mockImplementation((arg) => {
useHeadArg = arg;
}),
Expand Down
2 changes: 1 addition & 1 deletion packages/nuxt-jsonld/test/plugin.spec.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import plugin from '../src/runtime/plugin-impl';

let useHeadArg = undefined;
jest.mock('#head', () => ({
jest.mock('@unhead/vue', () => ({
useHead: jest.fn().mockImplementation((arg) => {
useHeadArg = arg;
}),
Expand Down
4 changes: 0 additions & 4 deletions packages/nuxt-jsonld/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@
"sourceMap": false,
"declaration": true,
"lib": ["ESNext"],
"paths": {
"#app": ["../../node_modules/nuxt/dist/app"],
"#head": ["../../node_modules/nuxt/dist/head/runtime"]
},
"types": ["@nuxt/schema"]
},
"include": ["./src/**/*"]
Expand Down
5,349 changes: 3,267 additions & 2,082 deletions yarn.lock

Large diffs are not rendered by default.

0 comments on commit c685ef1

Please sign in to comment.