feat: add plugin-notes-data
This commit is contained in:
parent
8d45712f49
commit
a2296e9dc9
21
packages/plugin-notes-data/LICENSE
Normal file
21
packages/plugin-notes-data/LICENSE
Normal file
@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (C) 2021 - PRESENT by pengzhanbo
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
18
packages/plugin-notes-data/README.md
Normal file
18
packages/plugin-notes-data/README.md
Normal file
@ -0,0 +1,18 @@
|
||||
# `@vuepress-plume/vuepress-plugin-notes-data`
|
||||
|
||||
## Install
|
||||
```
|
||||
yarn add @vuepress-plume/vuepress-plugin-notes-data
|
||||
```
|
||||
## Usage
|
||||
``` js
|
||||
// .vuepress/config.js
|
||||
const notesDataPlugin = require('@vuepress-plume/vuepress-plugin-notes-data')
|
||||
module.exports = {
|
||||
//...
|
||||
plugins: [
|
||||
notesDataPlugin()
|
||||
]
|
||||
// ...
|
||||
}
|
||||
```
|
||||
@ -1 +1,47 @@
|
||||
{}
|
||||
{
|
||||
"name": "@vuepress-plume/vuepress-plugin-notes-data",
|
||||
"version": "1.0.0-beta.45",
|
||||
"description": "The Plugin for VuePres 2",
|
||||
"homepage": "https://github.com/pengzhanbo/vuepress-theme-plume#readme",
|
||||
"bugs": {
|
||||
"url": "https://github.com/pengzhanbo/vuepress-theme-plume/issues"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/pengzhanbo/vuepress-theme-plume.git"
|
||||
},
|
||||
"license": "MIT",
|
||||
"author": "pengzhanbo <volodymyr@foxmail.com>",
|
||||
"type": "module",
|
||||
"exports": {
|
||||
".": "./lib/node/index.js",
|
||||
"./client": "./lib/client/index.js",
|
||||
"./package.json": "./package.json"
|
||||
},
|
||||
"main": "lib/node/index.js",
|
||||
"types": "./lib/node/index.d.ts",
|
||||
"scripts": {
|
||||
"build": "pnpm run clean && pnpm run copy && pnpm run ts",
|
||||
"clean": "rimraf lib *.tsbuildinfo",
|
||||
"copy": "cpx \"src/**/*.{d.ts,vue,css,scss,jpg,png}\" lib",
|
||||
"copy:watch": "cpx \"src/**/*.{d.ts,vue,css,scss,jpg,png}\" lib -w",
|
||||
"dev": "concurrently \"pnpm copy:watch\" \"pnpm ts:watch\"",
|
||||
"ts": "tsc -b tsconfig.build.json",
|
||||
"ts:watch": "tsc -b tsconfig.build.json --watch"
|
||||
},
|
||||
"dependencies": {
|
||||
"@vuepress/client": "2.0.0-beta.60",
|
||||
"@vuepress/core": "2.0.0-beta.60",
|
||||
"@vuepress/shared": "2.0.0-beta.60",
|
||||
"@vuepress/utils": "2.0.0-beta.60"
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"keyword": [
|
||||
"VuePress",
|
||||
"vuepress plugin",
|
||||
"notesData",
|
||||
"vuepress-plugin-plugin-notes-data"
|
||||
]
|
||||
}
|
||||
|
||||
7
packages/plugin-notes-data/src/client/clientConfig.ts
Normal file
7
packages/plugin-notes-data/src/client/clientConfig.ts
Normal file
@ -0,0 +1,7 @@
|
||||
import { defineClientConfig } from '@vuepress/client'
|
||||
|
||||
export default defineClientConfig({
|
||||
setup() {
|
||||
// do something
|
||||
},
|
||||
})
|
||||
1
packages/plugin-notes-data/src/client/index.ts
Normal file
1
packages/plugin-notes-data/src/client/index.ts
Normal file
@ -0,0 +1 @@
|
||||
export * from '../shared/index.js'
|
||||
6
packages/plugin-notes-data/src/node/index.ts
Normal file
6
packages/plugin-notes-data/src/node/index.ts
Normal file
@ -0,0 +1,6 @@
|
||||
import { notesDataPlugin } from './plugin.js'
|
||||
|
||||
export * from './plugin.js'
|
||||
export * from '../shared/index.js'
|
||||
|
||||
export default notesDataPlugin
|
||||
12
packages/plugin-notes-data/src/node/plugin.ts
Normal file
12
packages/plugin-notes-data/src/node/plugin.ts
Normal file
@ -0,0 +1,12 @@
|
||||
import type { App, Plugin } from '@vuepress/core'
|
||||
import { path } from '@vuepress/utils'
|
||||
import type { NotesDataOptions } from '../shared/index.js'
|
||||
|
||||
export const notesDataPlugin = (options: NotesDataOptions): Plugin => {
|
||||
return (app: App) => {
|
||||
return {
|
||||
name: '@vuepress-plume/vuepress-plugin-notes-data',
|
||||
clientConfigFile: path.resolve(__dirname, '../client/clientConfig.js'),
|
||||
}
|
||||
}
|
||||
}
|
||||
3
packages/plugin-notes-data/src/shared/index.ts
Normal file
3
packages/plugin-notes-data/src/shared/index.ts
Normal file
@ -0,0 +1,3 @@
|
||||
export interface NotesDataOptions {
|
||||
a?: string
|
||||
}
|
||||
8
packages/plugin-notes-data/tsconfig.build.json
Normal file
8
packages/plugin-notes-data/tsconfig.build.json
Normal file
@ -0,0 +1,8 @@
|
||||
{
|
||||
"extends": "../tsconfig.build.json",
|
||||
"compilerOptions": {
|
||||
"rootDir": "./src",
|
||||
"outDir": "./lib"
|
||||
},
|
||||
"include": ["./src"]
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user