Skip to content

Commit a35fa2f

Browse files
committed
feat: add /nuxt
1 parent 1a245cc commit a35fa2f

File tree

5 files changed

+2113
-4
lines changed

5 files changed

+2113
-4
lines changed

nuxt/index.ts

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import { defineNuxtModule, addPluginTemplate } from "@nuxt/kit"
2+
import { fileURLToPath } from "url"
3+
import { dirname, resolve } from "pathe"
4+
5+
export default defineNuxtModule({
6+
name: "vue3-notion",
7+
configKey: "notion",
8+
setup(options, nuxt) {
9+
const __filename = fileURLToPath(import.meta.url)
10+
const __dirname = dirname(__filename)
11+
12+
addPluginTemplate({
13+
src: resolve(__dirname, "./library.ts"),
14+
filename: "vue3-notion.ts",
15+
options,
16+
})
17+
18+
const notionDeps = ["vue3-notion, fragment-for-vue", "katex", "prismjs"]
19+
20+
notionDeps.forEach((dep) => {
21+
nuxt.options.build.transpile.push(dep)
22+
})
23+
},
24+
})

nuxt/plugin.ts

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import VueNotion from "vue3-notion"
2+
import { getPageBlocks, getPageTable } from "vue3-notion"
3+
4+
export default (nuxtApp: any) => {
5+
const notion = { getPageBlocks, getPageTable }
6+
nuxtApp.vueApp.use(VueNotion)
7+
nuxtApp.vueApp.provide("notion", notion)
8+
nuxtApp.provide("notion", notion)
9+
}

package.json

+6-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vue3-notion",
3-
"version": "0.0.1",
3+
"version": "0.0.3",
44
"description": "Vue 3 Unofficial Notion Renderer",
55
"repository": "github:zernonia/vue3-notion",
66
"main": "dist/library.ts",
@@ -10,7 +10,8 @@
1010
"files": [
1111
"dist/*.ts",
1212
"dist/*.css",
13-
"src/**/*.css"
13+
"src/**/*.css",
14+
"nuxt/*.ts"
1415
],
1516
"keywords": [
1617
"vue",
@@ -30,10 +31,11 @@
3031
"vue": "^3.2.26"
3132
},
3233
"devDependencies": {
34+
"@nuxt/kit": "^0.8.1-edge",
3335
"@rollup/plugin-alias": "^3.1.8",
3436
"@types/katex": "^0.11.1",
3537
"@types/prismjs": "^1.16.6",
36-
"@vitets/plugin-vue": "^2.0.0",
38+
"@vitejs/plugin-vue": "^2.0.0",
3739
"postcss": "^8.4.5",
3840
"rollup": "^2.62.0",
3941
"rollup-plugin-peer-deps-external": "^2.2.4",
@@ -46,6 +48,6 @@
4648
"vue-tsc": "^0.29.8"
4749
},
4850
"peerDependencies": {
49-
"vue": "^3.2.26"
51+
"vue": "^3.2.20"
5052
}
5153
}

0 commit comments

Comments
 (0)