diff --git a/packages/plugin-notes-data/LICENSE b/packages/plugin-notes-data/LICENSE new file mode 100644 index 00000000..9f677c90 --- /dev/null +++ b/packages/plugin-notes-data/LICENSE @@ -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. diff --git a/packages/plugin-notes-data/README.md b/packages/plugin-notes-data/README.md new file mode 100644 index 00000000..f13efb9e --- /dev/null +++ b/packages/plugin-notes-data/README.md @@ -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() + ] + // ... +} +``` diff --git a/packages/plugin-notes-data/package.json b/packages/plugin-notes-data/package.json index 0967ef42..9ecc79ba 100644 --- a/packages/plugin-notes-data/package.json +++ b/packages/plugin-notes-data/package.json @@ -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 ", + "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" + ] +} diff --git a/packages/plugin-notes-data/src/client/clientConfig.ts b/packages/plugin-notes-data/src/client/clientConfig.ts new file mode 100644 index 00000000..a726b269 --- /dev/null +++ b/packages/plugin-notes-data/src/client/clientConfig.ts @@ -0,0 +1,7 @@ +import { defineClientConfig } from '@vuepress/client' + +export default defineClientConfig({ + setup() { + // do something + }, +}) diff --git a/packages/plugin-notes-data/src/client/index.ts b/packages/plugin-notes-data/src/client/index.ts new file mode 100644 index 00000000..72593733 --- /dev/null +++ b/packages/plugin-notes-data/src/client/index.ts @@ -0,0 +1 @@ +export * from '../shared/index.js' diff --git a/packages/plugin-notes-data/src/node/index.ts b/packages/plugin-notes-data/src/node/index.ts new file mode 100644 index 00000000..69e663e0 --- /dev/null +++ b/packages/plugin-notes-data/src/node/index.ts @@ -0,0 +1,6 @@ +import { notesDataPlugin } from './plugin.js' + +export * from './plugin.js' +export * from '../shared/index.js' + +export default notesDataPlugin diff --git a/packages/plugin-notes-data/src/node/plugin.ts b/packages/plugin-notes-data/src/node/plugin.ts new file mode 100644 index 00000000..2665ebb8 --- /dev/null +++ b/packages/plugin-notes-data/src/node/plugin.ts @@ -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'), + } + } +} diff --git a/packages/plugin-notes-data/src/shared/index.ts b/packages/plugin-notes-data/src/shared/index.ts new file mode 100644 index 00000000..fc318a9b --- /dev/null +++ b/packages/plugin-notes-data/src/shared/index.ts @@ -0,0 +1,3 @@ +export interface NotesDataOptions { + a?: string +} diff --git a/packages/plugin-notes-data/tsconfig.build.json b/packages/plugin-notes-data/tsconfig.build.json new file mode 100644 index 00000000..6bf67375 --- /dev/null +++ b/packages/plugin-notes-data/tsconfig.build.json @@ -0,0 +1,8 @@ +{ + "extends": "../tsconfig.build.json", + "compilerOptions": { + "rootDir": "./src", + "outDir": "./lib" + }, + "include": ["./src"] +}