refactor: update package to pure esmodule
This commit is contained in:
parent
3789443485
commit
517c8bc697
@ -3,7 +3,7 @@ import { themePlume } from '@vuepress-plume/vuepress-theme-plume'
|
||||
import { viteBundler } from '@vuepress/bundler-vite'
|
||||
import { webpackBundler } from '@vuepress/bundler-webpack'
|
||||
import { defineUserConfig } from '@vuepress/cli'
|
||||
import notes from './notes'
|
||||
import notes from './notes.js'
|
||||
|
||||
export default defineUserConfig({
|
||||
base: '/',
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
{
|
||||
"name": "docs",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"docs:build": "vuepress-cli build --clean-cache",
|
||||
"docs:clean": "rimraf .vuepress/.temp .vuepress/.cache .vuepress/dist",
|
||||
@ -9,15 +10,15 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@vuepress-plume/vuepress-theme-plume": "workspace:*",
|
||||
"@vuepress/bundler-vite": "2.0.0-beta.49",
|
||||
"@vuepress/bundler-webpack": "2.0.0-beta.49",
|
||||
"@vuepress/cli": "2.0.0-beta.49",
|
||||
"@vuepress/client": "2.0.0-beta.49",
|
||||
"@vuepress/utils": "2.0.0-beta.49",
|
||||
"anywhere": "^1.5.0",
|
||||
"leancloud-storage": "^4.12.2",
|
||||
"sass": "^1.51.0",
|
||||
"sass-loader": "^13.0.2",
|
||||
"vue": "^3.2.37"
|
||||
"@vuepress/bundler-vite": "2.0.0-beta.51",
|
||||
"@vuepress/bundler-webpack": "2.0.0-beta.51",
|
||||
"@vuepress/cli": "2.0.0-beta.51",
|
||||
"@vuepress/client": "2.0.0-beta.51",
|
||||
"@vuepress/utils": "2.0.0-beta.51",
|
||||
"anywhere": "^1.6.0",
|
||||
"leancloud-storage": "^4.13.2",
|
||||
"sass": "^1.55.0",
|
||||
"sass-loader": "^13.1.0",
|
||||
"vue": "^3.2.41"
|
||||
}
|
||||
}
|
||||
|
||||
47
package.json
47
package.json
@ -13,8 +13,9 @@
|
||||
],
|
||||
"license": "MIT",
|
||||
"author": "pengzhanbo",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"autoUpdate": "ts-node scripts/autoInstall.ts",
|
||||
"autoUpdate": "node scripts/autoInstall.js",
|
||||
"build": "pnpm run build:package",
|
||||
"build:package": "pnpm --filter=!vuepress-theme-plume run -r --stream build",
|
||||
"commit": "cz",
|
||||
@ -26,7 +27,7 @@
|
||||
"docs:clean": "pnpm --filter=docs docs:clean",
|
||||
"docs:serve": "pnpm --filter=docs docs:serve",
|
||||
"lint": "eslint --ext .js,.ts,.vue .",
|
||||
"pkg": "ts-node scripts/create/index.ts",
|
||||
"pkg": "node scripts/create/index.js",
|
||||
"prepare": "husky install",
|
||||
"release": "pnpm release:check && pnpm release:version && pnpm release:publish",
|
||||
"release:changelog": "conventional-changelog -p angular -i CHANGELOG.md -s",
|
||||
@ -46,36 +47,38 @@
|
||||
},
|
||||
"prettier": "prettier-config-vuepress",
|
||||
"devDependencies": {
|
||||
"@commitlint/cli": "^16.2.3",
|
||||
"@commitlint/config-conventional": "^16.2.1",
|
||||
"@commitlint/cli": "^17.1.2",
|
||||
"@commitlint/config-conventional": "^17.1.0",
|
||||
"@types/minimist": "^1.2.2",
|
||||
"@types/node": "^17.0.30",
|
||||
"@types/webpack-env": "^1.16.4",
|
||||
"bumpp": "^7.2.0",
|
||||
"chalk": "^4.1.2",
|
||||
"commitizen": "^4.2.4",
|
||||
"concurrently": "^7.0.0",
|
||||
"@types/node": "18.8.0",
|
||||
"@types/webpack-env": "^1.18.0",
|
||||
"bumpp": "^8.2.1",
|
||||
"chalk": "^5.1.2",
|
||||
"commitizen": "^4.2.5",
|
||||
"concurrently": "^7.4.0",
|
||||
"conventional-changelog-cli": "^2.2.2",
|
||||
"cpx2": "^4.2.0",
|
||||
"cross-env": "^7.0.3",
|
||||
"cz-conventional-changelog": "^3.3.0",
|
||||
"eslint": "^8.20.0",
|
||||
"eslint-config-vuepress": "^3.10.0",
|
||||
"eslint-config-vuepress-typescript": "^2.9.1",
|
||||
"execa": "^5.1.1",
|
||||
"eslint": "^8.25.0",
|
||||
"eslint-config-vuepress": "^4.0.3",
|
||||
"eslint-config-vuepress-typescript": "^4.0.3",
|
||||
"execa": "^6.1.0",
|
||||
"handlebars": "^4.7.7",
|
||||
"husky": "^7.0.4",
|
||||
"lint-staged": "^12.4.0",
|
||||
"minimist": "^1.2.6",
|
||||
"ora": "^5.4.1",
|
||||
"husky": "^8.0.1",
|
||||
"lint-staged": "^13.0.3",
|
||||
"minimist": "^1.2.7",
|
||||
"ora": "^6.1.2",
|
||||
"prettier": "^2.7.1",
|
||||
"prettier-config-vuepress": "^1.4.0",
|
||||
"prettier-config-vuepress": "^4.0.0",
|
||||
"rimraf": "^3.0.2",
|
||||
"sort-package-json": "^1.55.0",
|
||||
"sort-package-json": "^2.0.0",
|
||||
"taze": "^0.8.2",
|
||||
"ts-node": "^10.9.1",
|
||||
"typescript": "^4.7.4",
|
||||
"vite": "^2.9.14"
|
||||
"typescript": "^4.8.4",
|
||||
"vite": "^3.1.8"
|
||||
},
|
||||
"packageManager": "pnpm@7.13.4",
|
||||
"engines": {
|
||||
"node": ">=14",
|
||||
"pnpm": ">=6"
|
||||
|
||||
@ -11,8 +11,14 @@
|
||||
"url": "git+https://github.com/pengzhanbo/vuepress-theme-plume.git"
|
||||
},
|
||||
"license": "MIT",
|
||||
"author": "pengzhanbo <volodymyr@foxmail.com>",
|
||||
"author": "pengzhanbo <volodymyr@foxmail.com> (https://github.com/pengzhanbo/)",
|
||||
"type": "module",
|
||||
"exports": {
|
||||
".": "./lib/node/index.js",
|
||||
"./package.json": "./package.json"
|
||||
},
|
||||
"main": "lib/node/index.js",
|
||||
"types": "./lib/node/index.d.ts",
|
||||
"files": [
|
||||
"lib"
|
||||
],
|
||||
@ -20,16 +26,13 @@
|
||||
"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"
|
||||
"ts": "tsc -b tsconfig.build.json"
|
||||
},
|
||||
"dependencies": {
|
||||
"@vuepress/client": "2.0.0-beta.49",
|
||||
"@vuepress/core": "2.0.0-beta.49",
|
||||
"@vuepress/shared": "2.0.0-beta.49",
|
||||
"@vuepress/utils": "2.0.0-beta.49"
|
||||
"@vuepress/client": "2.0.0-beta.51",
|
||||
"@vuepress/core": "2.0.0-beta.51",
|
||||
"@vuepress/shared": "2.0.0-beta.51",
|
||||
"@vuepress/utils": "2.0.0-beta.51"
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { baiduTongjiPlugin } from './plugin'
|
||||
import { baiduTongjiPlugin } from './plugin.js'
|
||||
|
||||
export * from './plugin'
|
||||
export * from './plugin.js'
|
||||
|
||||
export default baiduTongjiPlugin
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
{
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"references": [
|
||||
{
|
||||
"path": "./tsconfig.cjs.json"
|
||||
}
|
||||
],
|
||||
"compilerOptions": {
|
||||
"rootDir": "./src",
|
||||
"outDir": "./lib"
|
||||
},
|
||||
"include": ["./src"],
|
||||
"files": []
|
||||
}
|
||||
|
||||
@ -1,9 +0,0 @@
|
||||
{
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"module": "CommonJS",
|
||||
"rootDir": "./src",
|
||||
"outDir": "./lib"
|
||||
},
|
||||
"include": ["./src/node"]
|
||||
}
|
||||
@ -1,10 +0,0 @@
|
||||
{
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"module": "ES2020",
|
||||
"rootDir": "./src",
|
||||
"outDir": "./lib",
|
||||
"types": ["@vuepress/client/types"]
|
||||
},
|
||||
"include": ["./src/client"]
|
||||
}
|
||||
@ -19,27 +19,30 @@
|
||||
},
|
||||
"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",
|
||||
"files": [
|
||||
"lib"
|
||||
],
|
||||
"scripts": {
|
||||
"build": "pnpm run clean && pnpm run ts",
|
||||
"clean": "rimraf lib *.tsbuildinfo",
|
||||
"dev": "pnpm run ts:watch",
|
||||
"ts": "tsc -b tsconfig.build.json",
|
||||
"ts:watch": "tsc -b tsconfig.build.json --watch"
|
||||
"ts": "tsc -b tsconfig.build.json"
|
||||
},
|
||||
"dependencies": {
|
||||
"@vuepress/cli": "2.0.0-beta.49",
|
||||
"@vuepress/client": "2.0.0-beta.49",
|
||||
"@vuepress/core": "2.0.0-beta.49",
|
||||
"@vuepress/utils": "2.0.0-beta.49",
|
||||
"@types/markdown-it": "^12.2.3",
|
||||
"@vuepress/cli": "2.0.0-beta.51",
|
||||
"@vuepress/client": "2.0.0-beta.51",
|
||||
"@vuepress/core": "2.0.0-beta.51",
|
||||
"@vuepress/utils": "2.0.0-beta.51",
|
||||
"markdown-it-container": "^3.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/markdown-it": "^12.2.3"
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import { defineClientConfig } from '@vuepress/client'
|
||||
import type { CanIUseMode } from '../shared'
|
||||
import { resolveCanIUse } from './resolveCanIUse'
|
||||
import type { CanIUseMode } from '../shared/index.js'
|
||||
import { resolveCanIUse } from './resolveCanIUse.js'
|
||||
|
||||
declare const __CAN_I_USE_INJECT_MODE__: CanIUseMode
|
||||
declare const __VUEPRESS_SSR__: boolean
|
||||
|
||||
1
packages/plugin-caniuse/src/client/index.ts
Normal file
1
packages/plugin-caniuse/src/client/index.ts
Normal file
@ -0,0 +1 @@
|
||||
export * from '../shared/index.js'
|
||||
@ -1,6 +1,6 @@
|
||||
import { caniusePlugin } from './plugin'
|
||||
import { caniusePlugin } from './plugin.js'
|
||||
|
||||
export * from './plugin'
|
||||
export * from '../shared'
|
||||
export * from './plugin.js'
|
||||
export * from '../shared/index.js'
|
||||
|
||||
export default caniusePlugin
|
||||
|
||||
5
packages/plugin-caniuse/src/node/markdown-it-container.d.ts
vendored
Normal file
5
packages/plugin-caniuse/src/node/markdown-it-container.d.ts
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
declare module 'markdown-it-container' {
|
||||
import type { PluginWithParams } from 'markdown-it'
|
||||
const container: PluginWithParams
|
||||
export = container
|
||||
}
|
||||
@ -1,10 +1,11 @@
|
||||
import type { Plugin, PluginObject } from '@vuepress/core'
|
||||
import { path } from '@vuepress/utils'
|
||||
import * as container from 'markdown-it-container'
|
||||
import type * as Token from 'markdown-it/lib/token'
|
||||
import type { CanIUseMode, CanIUsePluginOptions } from '../shared'
|
||||
import { resolveCanIUse } from './resolveCanIUse'
|
||||
import { getDirname, path } from '@vuepress/utils'
|
||||
import container from 'markdown-it-container'
|
||||
import type Token from 'markdown-it/lib/token.js'
|
||||
import type { CanIUseMode, CanIUsePluginOptions } from '../shared/index.js'
|
||||
import { resolveCanIUse } from './resolveCanIUse.js'
|
||||
|
||||
const __dirname = getDirname(import.meta.url)
|
||||
const modeMap: CanIUseMode[] = ['image', 'embed']
|
||||
const isMode = (mode: CanIUseMode): boolean => modeMap.includes(mode)
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import type { CanIUseMode } from '../shared'
|
||||
import type { CanIUseMode } from '../shared/index.js'
|
||||
export const resolveCanIUse = (feature: string, mode: CanIUseMode): string => {
|
||||
const before =
|
||||
mode === 'embed'
|
||||
|
||||
@ -1 +1 @@
|
||||
export * from './caniuse'
|
||||
export * from './caniuse.js'
|
||||
|
||||
@ -1,12 +1,8 @@
|
||||
{
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"references": [
|
||||
{
|
||||
"path": "./tsconfig.esm.json"
|
||||
"extends": "../tsconfig.build.json",
|
||||
"compilerOptions": {
|
||||
"rootDir": "./src",
|
||||
"outDir": "./lib"
|
||||
},
|
||||
{
|
||||
"path": "./tsconfig.cjs.json"
|
||||
}
|
||||
],
|
||||
"files": []
|
||||
"include": ["./src"]
|
||||
}
|
||||
|
||||
@ -1,12 +0,0 @@
|
||||
{
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"module": "CommonJS",
|
||||
"rootDir": "./src",
|
||||
"outDir": "./lib"
|
||||
},
|
||||
"include": [
|
||||
"./src/node",
|
||||
"./src/shared"
|
||||
]
|
||||
}
|
||||
@ -1,15 +0,0 @@
|
||||
{
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"module": "ES2020",
|
||||
"rootDir": "./src",
|
||||
"outDir": "./lib",
|
||||
"types": [
|
||||
"@vuepress/client/types"
|
||||
]
|
||||
},
|
||||
"include": [
|
||||
"./src/client",
|
||||
"./src/shared"
|
||||
]
|
||||
}
|
||||
@ -12,7 +12,14 @@
|
||||
},
|
||||
"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",
|
||||
"files": [
|
||||
"lib"
|
||||
],
|
||||
@ -20,18 +27,15 @@
|
||||
"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"
|
||||
"ts": "tsc -b tsconfig.build.json"
|
||||
},
|
||||
"dependencies": {
|
||||
"@vuepress/client": "2.0.0-beta.49",
|
||||
"@vuepress/core": "2.0.0-beta.49",
|
||||
"@vuepress/shared": "2.0.0-beta.49",
|
||||
"@vuepress/utils": "2.0.0-beta.49",
|
||||
"vue": "^3.2.37",
|
||||
"vue-router": "4.1.2"
|
||||
"@vuepress/client": "2.0.0-beta.51",
|
||||
"@vuepress/core": "2.0.0-beta.51",
|
||||
"@vuepress/shared": "2.0.0-beta.51",
|
||||
"@vuepress/utils": "2.0.0-beta.51",
|
||||
"vue": "^3.2.41",
|
||||
"vue-router": "4.1.5"
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { defineClientConfig } from '@vuepress/client'
|
||||
import { setupCopyCode } from './composables'
|
||||
import { setupCopyCode } from './composables/index.js'
|
||||
|
||||
import './styles/button.scss'
|
||||
|
||||
|
||||
@ -1 +1 @@
|
||||
export * from './setup'
|
||||
export * from './setup.js'
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
// import { useRouteLocale } from '@vuepress/client'
|
||||
import { onMounted, watch } from 'vue'
|
||||
import { useRoute } from 'vue-router'
|
||||
import type { CopyCodeOptions } from '../../shared'
|
||||
import { copySVG, successSVG } from '../svg'
|
||||
import { copyToClipboard } from './copyToClipboard'
|
||||
import type { CopyCodeOptions } from '../../shared/index.js'
|
||||
import { copySVG, successSVG } from '../svg.js'
|
||||
import { copyToClipboard } from './copyToClipboard.js'
|
||||
declare const __COPY_CODE_OPTIONS__: CopyCodeOptions
|
||||
// declare const __COPY_CODE_LOCALES_OPTIONS__: CopyCodeLocaleOption
|
||||
|
||||
|
||||
1
packages/plugin-copy-code/src/client/index.ts
Normal file
1
packages/plugin-copy-code/src/client/index.ts
Normal file
@ -0,0 +1 @@
|
||||
export * from '../shared/index.js'
|
||||
@ -1,6 +1,6 @@
|
||||
import { copyCodePlugin } from './plugin'
|
||||
import { copyCodePlugin } from './plugin.js'
|
||||
|
||||
export * from './plugin'
|
||||
export * from '../shared'
|
||||
export * from './plugin.js'
|
||||
export * from '../shared/index.js'
|
||||
|
||||
export default copyCodePlugin
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
import type { Plugin } from '@vuepress/core'
|
||||
import { path } from '@vuepress/utils'
|
||||
import type { CopyCodeLocaleOption, CopyCodeOptions } from '../shared'
|
||||
import { getDirname, path } from '@vuepress/utils'
|
||||
import type { CopyCodeLocaleOption, CopyCodeOptions } from '../shared/index.js'
|
||||
|
||||
const __dirname = getDirname(import.meta.url)
|
||||
|
||||
const defaultOptions: CopyCodeOptions = {
|
||||
selector: '.theme-default-content div[class*="language-"] pre',
|
||||
|
||||
@ -1,12 +1,8 @@
|
||||
{
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"references": [
|
||||
{
|
||||
"path": "./tsconfig.esm.json"
|
||||
"extends": "../tsconfig.build.json",
|
||||
"compilerOptions": {
|
||||
"rootDir": "./src",
|
||||
"outDir": "./lib"
|
||||
},
|
||||
{
|
||||
"path": "./tsconfig.cjs.json"
|
||||
}
|
||||
],
|
||||
"files": []
|
||||
"include": ["./src"]
|
||||
}
|
||||
|
||||
@ -1,9 +0,0 @@
|
||||
{
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"module": "CommonJS",
|
||||
"rootDir": "./src",
|
||||
"outDir": "./lib"
|
||||
},
|
||||
"include": ["./src/node", "./src/shared"]
|
||||
}
|
||||
@ -1,10 +0,0 @@
|
||||
{
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"module": "ES2020",
|
||||
"rootDir": "./src",
|
||||
"outDir": "./lib",
|
||||
"types": ["@vuepress/client/types"]
|
||||
},
|
||||
"include": ["./src/client", "./src/shared"]
|
||||
}
|
||||
@ -20,7 +20,13 @@
|
||||
},
|
||||
"license": "MIT",
|
||||
"author": "pengzhanbo <volodymyr@foxmail.com>",
|
||||
"type": "module",
|
||||
"exports": {
|
||||
".": "./lib/node/index.js",
|
||||
"./package.json": "./package.json"
|
||||
},
|
||||
"main": "lib/node/index.js",
|
||||
"types": "lib/node/index.d.ts",
|
||||
"files": [
|
||||
"lib"
|
||||
],
|
||||
@ -28,24 +34,25 @@
|
||||
"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"
|
||||
"ts": "tsc -b tsconfig.build.json"
|
||||
},
|
||||
"dependencies": {
|
||||
"@iarna/toml": "^2.2.5",
|
||||
"@netlify/functions": "^1.0.0",
|
||||
"@vuepress/core": "2.0.0-beta.49",
|
||||
"@vuepress/shared": "2.0.0-beta.49",
|
||||
"@vuepress/utils": "2.0.0-beta.49",
|
||||
"@netlify/functions": "^1.3.0",
|
||||
"@vuepress/core": "2.0.0-beta.51",
|
||||
"@vuepress/shared": "2.0.0-beta.51",
|
||||
"@vuepress/utils": "2.0.0-beta.51",
|
||||
"chalk": "^5.1.2",
|
||||
"chokidar": "^3.5.3",
|
||||
"cpx2": "^4.2.0",
|
||||
"dotenv": "^16.0.1",
|
||||
"esbuild": "^0.14.39",
|
||||
"execa": "5.1.1",
|
||||
"netlify-cli": "^10.10.2",
|
||||
"portfinder": "^1.0.28"
|
||||
"dotenv": "^16.0.3",
|
||||
"esbuild": "^0.15.11",
|
||||
"execa": "^6.1.0",
|
||||
"netlify-cli": "^12.0.9",
|
||||
"portfinder": "^1.0.32"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^18.8.5"
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import type { App } from '@vuepress/core'
|
||||
import type { NetlifyFunctionsPluginOptions } from '../shared'
|
||||
import type { NetlifyFunctionsPluginOptions } from '../shared/index.js'
|
||||
export const extendsBundlerOptions = (
|
||||
bundlerOption: any,
|
||||
app: App,
|
||||
@ -25,7 +25,8 @@ export const extendsBundlerOptions = (
|
||||
}
|
||||
if (app.options.bundler.name === '@vuepress/bundler-webpack') {
|
||||
const rewritePath = `^${options.proxyPrefix}`
|
||||
bundlerOption.configureWebpack((config, isServer, isBuild) => {
|
||||
bundlerOption.configureWebpack(
|
||||
(config: any, isServer: boolean, isBuild: boolean) => {
|
||||
if (isBuild) return
|
||||
config.devServer = config.devServer || {}
|
||||
config.devServer.proxy = Object.assign(config.devServer.proxy || {}, {
|
||||
@ -35,6 +36,7 @@ export const extendsBundlerOptions = (
|
||||
pathRewrite: { [rewritePath]: targetPath },
|
||||
},
|
||||
})
|
||||
})
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import type { NetlifyFunctionsOptions } from '../shared'
|
||||
import { netlifyFunctionsPlugin } from './plugin'
|
||||
import type { NetlifyFunctionsOptions } from '../shared/index.js'
|
||||
import { netlifyFunctionsPlugin } from './plugin.js'
|
||||
|
||||
export * from './useNetlifyFunctionsPlugins'
|
||||
export * from './useNetlifyFunctionsPlugins.js'
|
||||
|
||||
export { NetlifyFunctionsOptions }
|
||||
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
export * from './initFunctions'
|
||||
export * from './netlifyConfig'
|
||||
export * from './netlifyServer'
|
||||
export * from './initFunctions.js'
|
||||
export * from './netlifyConfig.js'
|
||||
export * from './netlifyServer.js'
|
||||
|
||||
@ -2,8 +2,8 @@ import type { App } from '@vuepress/core'
|
||||
import { path } from '@vuepress/utils'
|
||||
import * as chokidar from 'chokidar'
|
||||
import esbuild from 'esbuild'
|
||||
import type { NetlifyFunctionsPluginOptions } from '../../shared'
|
||||
import { readFileList } from '../utils'
|
||||
import type { NetlifyFunctionsPluginOptions } from '../../shared/index.js'
|
||||
import { readFileList } from '../utils/index.js'
|
||||
|
||||
export const generateFunctions = async (
|
||||
app: App,
|
||||
|
||||
@ -2,7 +2,7 @@ import type { JsonMap } from '@iarna/toml'
|
||||
import { parse, stringify } from '@iarna/toml'
|
||||
import type { App } from '@vuepress/core'
|
||||
import { fs, path } from '@vuepress/utils'
|
||||
import type { NetlifyFunctionsPluginOptions } from '../../shared'
|
||||
import type { NetlifyFunctionsPluginOptions } from '../../shared/index.js'
|
||||
|
||||
export interface NetlifyConfig {
|
||||
functions: Record<string, any>
|
||||
|
||||
@ -1,8 +1,10 @@
|
||||
import { fs, path } from '@vuepress/utils'
|
||||
import { fs, getDirname, path } from '@vuepress/utils'
|
||||
import dotenv from 'dotenv'
|
||||
import * as execa from 'execa'
|
||||
import { execa } from 'execa'
|
||||
import * as portFinder from 'portfinder'
|
||||
import type { NetlifyFunctionsPluginOptions } from '../../shared'
|
||||
import type { NetlifyFunctionsPluginOptions } from '../../shared/index.js'
|
||||
|
||||
const __dirname = getDirname(import.meta.url)
|
||||
|
||||
const loadEnvConfig = (): Record<string, string | undefined> => {
|
||||
const configPath = path.resolve(process.cwd(), '.env')
|
||||
|
||||
@ -29,15 +29,15 @@ import type { App, Plugin } from '@vuepress/core'
|
||||
import type {
|
||||
NetlifyFunctionsOptions,
|
||||
NetlifyFunctionsPluginOptions,
|
||||
} from '../shared'
|
||||
import { extendsBundlerOptions } from './extendsBundlerOptions'
|
||||
import type { NetlifyServe } from './netlify'
|
||||
} from '../shared/index.js'
|
||||
import { extendsBundlerOptions } from './extendsBundlerOptions.js'
|
||||
import type { NetlifyServe } from './netlify/index.js'
|
||||
import {
|
||||
generateFunctions,
|
||||
generateNetlifyConfig,
|
||||
initialFunctions,
|
||||
netlifyServe,
|
||||
} from './netlify'
|
||||
} from './netlify/index.js'
|
||||
|
||||
const initOptions = (
|
||||
app: App,
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
import type { App, PluginObject } from '@vuepress/core'
|
||||
import { path } from '@vuepress/utils'
|
||||
import * as cpx2 from 'cpx2'
|
||||
import type { UseNetlifyFunctionPluginsOptions } from '../shared'
|
||||
import { getOptions, netlifyFunctionsPlugin } from './plugin'
|
||||
import type { UseNetlifyFunctionPluginsOptions } from '../shared/index.js'
|
||||
import { getOptions, netlifyFunctionsPlugin } from './plugin.js'
|
||||
|
||||
interface UseNetlifyFunctionResult {
|
||||
/**
|
||||
|
||||
@ -1 +1 @@
|
||||
export * from './readFileList'
|
||||
export * from './readFileList.js'
|
||||
|
||||
@ -1,9 +1,8 @@
|
||||
{
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"references": [
|
||||
{
|
||||
"path": "./tsconfig.cjs.json"
|
||||
}
|
||||
],
|
||||
"files": []
|
||||
"extends": "../tsconfig.build.json",
|
||||
"compilerOptions": {
|
||||
"rootDir": "./src",
|
||||
"outDir": "./lib"
|
||||
},
|
||||
"include": ["./src"]
|
||||
}
|
||||
|
||||
@ -1,9 +0,0 @@
|
||||
{
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"module": "CommonJS",
|
||||
"rootDir": "./src",
|
||||
"outDir": "./lib"
|
||||
},
|
||||
"include": ["./src/node", "./src/shared"]
|
||||
}
|
||||
@ -13,7 +13,14 @@
|
||||
},
|
||||
"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",
|
||||
"files": [
|
||||
"lib"
|
||||
],
|
||||
@ -21,21 +28,18 @@
|
||||
"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"
|
||||
"ts": "tsc -b tsconfig.build.json"
|
||||
},
|
||||
"dependencies": {
|
||||
"@netlify/functions": "^1.0.0",
|
||||
"@netlify/functions": "^1.3.0",
|
||||
"@vuepress-plume/vuepress-plugin-netlify-functions": "workspace:*",
|
||||
"@vuepress/client": "2.0.0-beta.49",
|
||||
"@vuepress/core": "2.0.0-beta.49",
|
||||
"@vuepress/shared": "2.0.0-beta.49",
|
||||
"@vuepress/utils": "2.0.0-beta.49",
|
||||
"leancloud-storage": "^4.12.2",
|
||||
"vue": "^3.2.37",
|
||||
"vue-router": "4.1.2"
|
||||
"@vuepress/client": "2.0.0-beta.51",
|
||||
"@vuepress/core": "2.0.0-beta.51",
|
||||
"@vuepress/shared": "2.0.0-beta.51",
|
||||
"@vuepress/utils": "2.0.0-beta.51",
|
||||
"leancloud-storage": "^4.13.2",
|
||||
"vue": "^3.2.41",
|
||||
"vue-router": "4.1.5"
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { defineClientConfig } from '@vuepress/client'
|
||||
import Collection from './components/PageCollection'
|
||||
import Collection from './components/PageCollection.js'
|
||||
|
||||
export default defineClientConfig({
|
||||
enhance({ app }) {
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { defineComponent, h } from 'vue'
|
||||
import { usePageCollection } from '../composables'
|
||||
import { usePageCollection } from '../composables/index.js'
|
||||
|
||||
export default defineComponent({
|
||||
name: 'PageCollection',
|
||||
|
||||
@ -1 +1 @@
|
||||
export * from './usePageCollection'
|
||||
export * from './usePageCollection.js'
|
||||
|
||||
4
packages/plugin-page-collection/src/client/index.ts
Normal file
4
packages/plugin-page-collection/src/client/index.ts
Normal file
@ -0,0 +1,4 @@
|
||||
import Collection from './components/PageCollection.js'
|
||||
export * from '../shared/index.js'
|
||||
|
||||
export { Collection }
|
||||
@ -1,6 +1,6 @@
|
||||
import { pageCollectionPlugin } from './plugin'
|
||||
import { pageCollectionPlugin } from './plugin.js'
|
||||
|
||||
export * from './plugin'
|
||||
export * from '../shared'
|
||||
export * from './plugin.js'
|
||||
export * from '../shared/index.js'
|
||||
|
||||
export default pageCollectionPlugin
|
||||
|
||||
@ -8,8 +8,10 @@
|
||||
// netlify functions 开发时支持
|
||||
import { useNetlifyFunctionsPlugin } from '@vuepress-plume/vuepress-plugin-netlify-functions'
|
||||
import type { App, Plugin } from '@vuepress/core'
|
||||
import { path } from '@vuepress/utils'
|
||||
import type { PageCollectionOptions } from '../shared'
|
||||
import { getDirname, path } from '@vuepress/utils'
|
||||
import type { PageCollectionOptions } from '../shared/index.js'
|
||||
|
||||
const __dirname = getDirname(import.meta.url)
|
||||
|
||||
export const pageCollectionPlugin = (
|
||||
options: PageCollectionOptions = {}
|
||||
|
||||
@ -1,12 +1,8 @@
|
||||
{
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"references": [
|
||||
{
|
||||
"path": "./tsconfig.esm.json"
|
||||
"extends": "../tsconfig.build.json",
|
||||
"compilerOptions": {
|
||||
"rootDir": "./src",
|
||||
"outDir": "./lib"
|
||||
},
|
||||
{
|
||||
"path": "./tsconfig.cjs.json"
|
||||
}
|
||||
],
|
||||
"files": []
|
||||
"include": ["./src"]
|
||||
}
|
||||
|
||||
@ -1,9 +0,0 @@
|
||||
{
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"module": "CommonJS",
|
||||
"rootDir": "./src",
|
||||
"outDir": "./lib"
|
||||
},
|
||||
"include": ["./src/node", "./src/shared"]
|
||||
}
|
||||
@ -1,10 +0,0 @@
|
||||
{
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"module": "ES2020",
|
||||
"rootDir": "./src",
|
||||
"outDir": "./lib",
|
||||
"types": ["@vuepress/client/types"]
|
||||
},
|
||||
"include": ["./src/client", "./src/shared"]
|
||||
}
|
||||
@ -12,7 +12,13 @@
|
||||
},
|
||||
"license": "MIT",
|
||||
"author": "pengzhanbo <volodymyr@foxmail.com>",
|
||||
"type": "module",
|
||||
"exports": {
|
||||
".": "./lib/node/index.js",
|
||||
"./package.json": "./package.json"
|
||||
},
|
||||
"main": "lib/node/index.js",
|
||||
"types": "lib/node/index.d.ts",
|
||||
"files": [
|
||||
"lib"
|
||||
],
|
||||
@ -20,19 +26,16 @@
|
||||
"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"
|
||||
"ts": "tsc -b tsconfig.build.json"
|
||||
},
|
||||
"dependencies": {
|
||||
"@vuepress/client": "2.0.0-beta.49",
|
||||
"@vuepress/core": "2.0.0-beta.49",
|
||||
"@vuepress/shared": "2.0.0-beta.49",
|
||||
"@vuepress/utils": "2.0.0-beta.49",
|
||||
"vite-plugin-windicss": "^1.8.7",
|
||||
"@vuepress/client": "2.0.0-beta.51",
|
||||
"@vuepress/core": "2.0.0-beta.51",
|
||||
"@vuepress/shared": "2.0.0-beta.51",
|
||||
"@vuepress/utils": "2.0.0-beta.51",
|
||||
"vite-plugin-windicss": "^1.8.8",
|
||||
"windicss": "^3.5.6",
|
||||
"windicss-webpack-plugin": "^1.7.5"
|
||||
"windicss-webpack-plugin": "^1.7.6"
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { windiCSSPlugin } from './plugin'
|
||||
import { windiCSSPlugin } from './plugin.js'
|
||||
|
||||
export * from './plugin'
|
||||
export * from './plugin.js'
|
||||
|
||||
export default windiCSSPlugin
|
||||
|
||||
@ -1,9 +1,10 @@
|
||||
import type { App, Plugin } from '@vuepress/core'
|
||||
import { path } from '@vuepress/utils'
|
||||
import type { UserOptions, WindiPluginUtilsOptions } from 'vite-plugin-windicss'
|
||||
import { getDirname, path } from '@vuepress/utils'
|
||||
import viteWindiCSS from 'vite-plugin-windicss'
|
||||
import type { UserOptions, WindiPluginUtilsOptions } from 'vite-plugin-windicss'
|
||||
import WebpackWindiCSSPlugin from 'windicss-webpack-plugin'
|
||||
|
||||
const __dirname = getDirname(import.meta.url)
|
||||
export interface WindiCSSOptions {
|
||||
userOptions?: UserOptions
|
||||
utilsOptions?: WindiPluginUtilsOptions
|
||||
|
||||
17
packages/plugin-windicss/src/node/windicss.d.ts
vendored
Normal file
17
packages/plugin-windicss/src/node/windicss.d.ts
vendored
Normal file
@ -0,0 +1,17 @@
|
||||
declare module 'windicss-webpack-plugin' {
|
||||
const result: any
|
||||
|
||||
export default result
|
||||
}
|
||||
|
||||
declare module 'vite-plugin-windicss' {
|
||||
const result: any
|
||||
|
||||
type UserOptions = any
|
||||
|
||||
type WindiPluginUtilsOptions = any
|
||||
|
||||
export default result
|
||||
|
||||
export { UserOptions, WindiPluginUtilsOptions }
|
||||
}
|
||||
@ -1,12 +1,8 @@
|
||||
{
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"references": [
|
||||
{
|
||||
"path": "./tsconfig.esm.json"
|
||||
"extends": "../tsconfig.build.json",
|
||||
"compilerOptions": {
|
||||
"rootDir": "./src",
|
||||
"outDir": "./lib"
|
||||
},
|
||||
{
|
||||
"path": "./tsconfig.cjs.json"
|
||||
}
|
||||
],
|
||||
"files": []
|
||||
"include": ["./src"]
|
||||
}
|
||||
|
||||
@ -1,9 +0,0 @@
|
||||
{
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"module": "CommonJS",
|
||||
"rootDir": "./src",
|
||||
"outDir": "./lib"
|
||||
},
|
||||
"include": ["./src/node", "./src/shared"]
|
||||
}
|
||||
@ -1,10 +0,0 @@
|
||||
{
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"module": "ES2020",
|
||||
"rootDir": "./src",
|
||||
"outDir": "./lib",
|
||||
"types": ["@vuepress/client/types"]
|
||||
},
|
||||
"include": ["./src/client", "./src/shared"]
|
||||
}
|
||||
@ -20,6 +20,7 @@
|
||||
},
|
||||
"license": "MIT",
|
||||
"author": "pengzhanbo <volodymyr@foxmail.com>",
|
||||
"type": "module",
|
||||
"main": "lib/node/index.js",
|
||||
"files": [
|
||||
"lib",
|
||||
@ -35,42 +36,42 @@
|
||||
"ts:watch": "tsc -b tsconfig.build.json --watch"
|
||||
},
|
||||
"dependencies": {
|
||||
"@types/lodash.merge": "^4.6.6",
|
||||
"@types/lodash.merge": "^4.6.7",
|
||||
"@vuepress-plume/vuepress-plugin-baidu-tongji": "workspace:*",
|
||||
"@vuepress-plume/vuepress-plugin-caniuse": "workspace:*",
|
||||
"@vuepress-plume/vuepress-plugin-copy-code": "workspace:*",
|
||||
"@vuepress/client": "2.0.0-beta.49",
|
||||
"@vuepress/core": "2.0.0-beta.49",
|
||||
"@vuepress/plugin-active-header-links": "2.0.0-beta.49",
|
||||
"@vuepress/plugin-container": "2.0.0-beta.49",
|
||||
"@vuepress/plugin-docsearch": "2.0.0-beta.49",
|
||||
"@vuepress/plugin-external-link-icon": "2.0.0-beta.49",
|
||||
"@vuepress/plugin-git": "2.0.0-beta.49",
|
||||
"@vuepress/plugin-medium-zoom": "2.0.0-beta.49",
|
||||
"@vuepress/plugin-nprogress": "2.0.0-beta.49",
|
||||
"@vuepress/plugin-palette": "2.0.0-beta.49",
|
||||
"@vuepress/plugin-prismjs": "2.0.0-beta.49",
|
||||
"@vuepress/plugin-search": "2.0.0-beta.49",
|
||||
"@vuepress/plugin-theme-data": "2.0.0-beta.49",
|
||||
"@vuepress/plugin-toc": "2.0.0-beta.49",
|
||||
"@vuepress/shared": "2.0.0-beta.49",
|
||||
"@vuepress/utils": "2.0.0-beta.49",
|
||||
"@vueuse/core": "^8.2.3",
|
||||
"@vuepress/client": "2.0.0-beta.51",
|
||||
"@vuepress/core": "2.0.0-beta.51",
|
||||
"@vuepress/plugin-active-header-links": "2.0.0-beta.51",
|
||||
"@vuepress/plugin-container": "2.0.0-beta.51",
|
||||
"@vuepress/plugin-docsearch": "2.0.0-beta.51",
|
||||
"@vuepress/plugin-external-link-icon": "2.0.0-beta.51",
|
||||
"@vuepress/plugin-git": "2.0.0-beta.51",
|
||||
"@vuepress/plugin-medium-zoom": "2.0.0-beta.51",
|
||||
"@vuepress/plugin-nprogress": "2.0.0-beta.51",
|
||||
"@vuepress/plugin-palette": "2.0.0-beta.51",
|
||||
"@vuepress/plugin-prismjs": "2.0.0-beta.51",
|
||||
"@vuepress/plugin-search": "2.0.0-beta.51",
|
||||
"@vuepress/plugin-theme-data": "2.0.0-beta.51",
|
||||
"@vuepress/plugin-toc": "2.0.0-beta.51",
|
||||
"@vuepress/shared": "2.0.0-beta.51",
|
||||
"@vuepress/utils": "2.0.0-beta.51",
|
||||
"@vueuse/core": "^9.3.0",
|
||||
"chokidar": "^3.5.3",
|
||||
"date-fns": "^2.28.0",
|
||||
"date-fns": "^2.29.3",
|
||||
"gray-matter": "^4.0.3",
|
||||
"json2yaml": "^1.1.0",
|
||||
"lodash.merge": "^4.6.2",
|
||||
"nanoid": "^3.3.4",
|
||||
"sass": "^1.51.0",
|
||||
"sass-loader": "^13.0.2",
|
||||
"nanoid": "^4.0.0",
|
||||
"sass": "^1.55.0",
|
||||
"sass-loader": "^13.1.0",
|
||||
"ts-debounce": "^4.0.0",
|
||||
"vue": "^3.2.37",
|
||||
"vue-router": "4.1.2",
|
||||
"vuepress-plugin-comment2": "2.0.0-beta.87",
|
||||
"vuepress-plugin-md-enhance": "2.0.0-beta.87",
|
||||
"vuepress-plugin-seo2": "2.0.0-beta.87",
|
||||
"vuepress-plugin-sitemap2": "2.0.0-beta.87"
|
||||
"vue": "^3.2.41",
|
||||
"vue-router": "4.1.5",
|
||||
"vuepress-plugin-comment2": "2.0.0-beta.110",
|
||||
"vuepress-plugin-md-enhance": "2.0.0-beta.110",
|
||||
"vuepress-plugin-seo2": "2.0.0-beta.110",
|
||||
"vuepress-plugin-sitemap2": "2.0.0-beta.110"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"sass-loader": "^13.0.2"
|
||||
|
||||
@ -3,8 +3,8 @@ import BlogInfo from '@theme-plume/BlogInfo.vue'
|
||||
import DropdownTransition from '@theme-plume/DropdownTransition.vue'
|
||||
import type { PageHeader } from '@vuepress/client'
|
||||
import { computed } from 'vue'
|
||||
import { useArchive } from '../composables'
|
||||
import Toc from './Toc'
|
||||
import { useArchive } from '../composables/index.js'
|
||||
import Toc from './Toc.js'
|
||||
|
||||
const archiveList = useArchive()
|
||||
|
||||
@ -14,6 +14,7 @@ const headers = computed(() => {
|
||||
level: 2,
|
||||
slug: year,
|
||||
title: year,
|
||||
link: '',
|
||||
children: [],
|
||||
} as PageHeader
|
||||
})
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
<script lang="ts" setup>
|
||||
import Sidebar from '@theme-plume/Sidebar.vue'
|
||||
import { useAsideNavbar, useNavbarConfig } from '../composables'
|
||||
// eslint-disable-next-line @typescript-eslint/consistent-type-imports
|
||||
import type { SidebarOptions } from '../../shared/index.js'
|
||||
import { useAsideNavbar, useNavbarConfig } from '../composables/index.js'
|
||||
|
||||
const navbarConfig = useNavbarConfig()
|
||||
const { asideNavbarShow, triggerAsideNavbar } = useAsideNavbar()
|
||||
@ -12,7 +14,7 @@ const { asideNavbarShow, triggerAsideNavbar } = useAsideNavbar()
|
||||
class="aside-navbar-wrapper"
|
||||
@click.self="triggerAsideNavbar(false)"
|
||||
>
|
||||
<Sidebar :aside="navbarConfig" />
|
||||
<Sidebar :aside="(navbarConfig as SidebarOptions)" />
|
||||
</div>
|
||||
</Transition>
|
||||
</template>
|
||||
|
||||
@ -12,7 +12,7 @@ import { computed, toRefs } from 'vue'
|
||||
import type { PropType } from 'vue'
|
||||
import { useRoute } from 'vue-router'
|
||||
import { useSiteData } from '@vuepress/client'
|
||||
import type { NavLink } from '../../shared'
|
||||
import type { NavLink } from '../../shared/index.js'
|
||||
import { isLinkHttp, isLinkMailto, isLinkTel } from '@vuepress/shared'
|
||||
|
||||
const props = defineProps({
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
<script lang="ts" setup>
|
||||
import { debounce } from 'ts-debounce'
|
||||
import { onMounted, ref } from 'vue'
|
||||
import { getScrollTop, scrollTo } from '../utils'
|
||||
import { BackTopIcon } from './icons'
|
||||
import { getScrollTop, scrollTo } from '../utils/index.js'
|
||||
import { BackTopIcon } from './icons/index.js'
|
||||
|
||||
const opacity = ref<number>(0)
|
||||
const MAX_TOP = 300
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<script lang="ts" setup>
|
||||
import { computed } from 'vue'
|
||||
import { useThemeLocaleData } from '../composables'
|
||||
import { useThemeLocaleData } from '../composables/index.js'
|
||||
import BloggerInfo from './BloggerInfo.vue'
|
||||
const themeLocale = useThemeLocaleData()
|
||||
|
||||
|
||||
@ -3,7 +3,7 @@ import DropdownTransition from '@theme-plume/DropdownTransition.vue'
|
||||
import { isLinkHttp, isLinkMailto } from '@vuepress/shared'
|
||||
import type { FunctionalComponent, Ref } from 'vue'
|
||||
import { computed, ref } from 'vue'
|
||||
import { usePostStat, useThemeLocaleData } from '../composables'
|
||||
import { usePostStat, useThemeLocaleData } from '../composables/index.js'
|
||||
import {
|
||||
EmailIcon,
|
||||
FacebookIcon,
|
||||
@ -16,7 +16,7 @@ import {
|
||||
TwitterIcon,
|
||||
WeiBoIcon,
|
||||
ZhiHuIcon,
|
||||
} from './icons'
|
||||
} from './icons/index.js'
|
||||
|
||||
interface SocialItem {
|
||||
url: string
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<script lang="ts" setup>
|
||||
import BlogInfo from '@theme-plume/BlogInfo.vue'
|
||||
import DropdownTransition from '@theme-plume/DropdownTransition.vue'
|
||||
import { useCategoryList } from '../composables'
|
||||
import { useCategoryList } from '../composables/index.js'
|
||||
import CategoryGroup from './CategoryGroup.vue'
|
||||
|
||||
const categoryList = useCategoryList()
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
import DropdownTransition from '@theme-plume/DropdownTransition.vue'
|
||||
import type { FunctionalComponent, PropType } from 'vue'
|
||||
import { h } from 'vue'
|
||||
import type { CategoryItem } from '../composables'
|
||||
import type { CategoryItem } from '../composables/index.js'
|
||||
const props = defineProps({
|
||||
category: {
|
||||
type: Object as PropType<CategoryItem>,
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import { useDarkMode, useThemeLocaleData } from '../composables'
|
||||
import { useDarkMode, useThemeLocaleData } from '../composables/index.js'
|
||||
const themeLocale = useThemeLocaleData()
|
||||
const isDarkMode = useDarkMode()
|
||||
const toggleDarkMode = (): void => {
|
||||
|
||||
@ -2,10 +2,10 @@
|
||||
import { usePageFrontmatter, withBase } from '@vuepress/client'
|
||||
import { isLinkHttp } from '@vuepress/shared'
|
||||
import { computed, onMounted, ref } from 'vue'
|
||||
import type { PlumeThemeHomeFrontmatter } from '../../shared'
|
||||
import { useThemeLocaleData } from '../composables'
|
||||
import { scrollTo } from '../utils'
|
||||
import { ArrowBottomIcon } from './icons'
|
||||
import type { PlumeThemeHomeFrontmatter } from '../../shared/index.js'
|
||||
import { useThemeLocaleData } from '../composables/index.js'
|
||||
import { scrollTo } from '../utils/index.js'
|
||||
import { ArrowBottomIcon } from './icons/index.js'
|
||||
|
||||
const frontmatter = usePageFrontmatter<PlumeThemeHomeFrontmatter>()
|
||||
const MOBILE_WIDTH = 716
|
||||
|
||||
@ -4,8 +4,8 @@ import NavbarBrand from '@theme-plume/NavbarBrand.vue'
|
||||
import NavbarItems from '@theme-plume/NavbarItems.vue'
|
||||
import ToggleSidebarButton from '@theme-plume/ToggleSidebarButton.vue'
|
||||
import { computed, onMounted, ref } from 'vue'
|
||||
import { useAsideNavbar, useThemeLocaleData } from '../composables'
|
||||
import { getCssValue } from '../utils'
|
||||
import { useAsideNavbar, useThemeLocaleData } from '../composables/index.js'
|
||||
import { getCssValue } from '../utils/index.js'
|
||||
|
||||
const themeLocale = useThemeLocaleData()
|
||||
|
||||
|
||||
@ -7,12 +7,12 @@ import {
|
||||
} from '@vuepress/client'
|
||||
import { computed, h } from 'vue'
|
||||
import type { FunctionalComponent } from 'vue'
|
||||
import type { NavLink } from '../../shared'
|
||||
import type { NavLink } from '../../shared/index.js'
|
||||
import {
|
||||
useDarkMode,
|
||||
useSidebarIndex,
|
||||
useThemeLocaleData,
|
||||
} from '../composables'
|
||||
} from '../composables/index.js'
|
||||
|
||||
const routeLocale = useRouteLocale()
|
||||
const siteLocale = useSiteLocaleData()
|
||||
|
||||
@ -4,8 +4,12 @@ import DropdownTransition from '@theme-plume/DropdownTransition.vue'
|
||||
import type { PropType } from 'vue'
|
||||
import { computed, ref, toRefs, watch } from 'vue'
|
||||
import { useRoute } from 'vue-router'
|
||||
import { NavbarItem, NavGroup } from '../../shared'
|
||||
import type { ResolveNavbarItem } from '../../shared'
|
||||
// eslint-disable-next-line @typescript-eslint/consistent-type-imports
|
||||
import type {
|
||||
NavbarItem,
|
||||
NavGroup,
|
||||
ResolveNavbarItem,
|
||||
} from '../../shared/index.js'
|
||||
|
||||
const props = defineProps({
|
||||
item: {
|
||||
@ -32,7 +36,7 @@ watch(
|
||||
}
|
||||
)
|
||||
|
||||
const handleDropdown = (e): void => {
|
||||
const handleDropdown = (e: MouseEvent): void => {
|
||||
const isTriggerByTab = e.detail === 0
|
||||
if (isTriggerByTab || props.isHeader) {
|
||||
open.value = !open.value
|
||||
@ -43,7 +47,7 @@ const handleDropdown = (e): void => {
|
||||
const isLastItemOfArray = (item: unknown, arr: unknown[]): boolean =>
|
||||
arr[arr.length - 1] === item
|
||||
|
||||
const onSubTitleFocusout = (child): void => {
|
||||
const onSubTitleFocusout = (child: any): void => {
|
||||
if (
|
||||
isLastItemOfArray(child, item.value.children) &&
|
||||
child.children &&
|
||||
@ -53,7 +57,7 @@ const onSubTitleFocusout = (child): void => {
|
||||
}
|
||||
}
|
||||
|
||||
const onGrandChildFocusout = (grandchild, child): void => {
|
||||
const onGrandChildFocusout = (grandchild: unknown, child: any): void => {
|
||||
if (
|
||||
isLastItemOfArray(grandchild, child.children) &&
|
||||
isLastItemOfArray(child, item.value.children)
|
||||
|
||||
@ -2,12 +2,17 @@
|
||||
import AutoLink from '@theme-plume/AutoLink.vue'
|
||||
import NavbarDropdown from '@theme-plume/NavbarDropdown.vue'
|
||||
import { computed } from 'vue'
|
||||
import type { NavGroup, ResolveNavbarItem } from '../../shared'
|
||||
// eslint-disable-next-line @typescript-eslint/consistent-type-imports
|
||||
import type {
|
||||
NavGroup,
|
||||
NavLink,
|
||||
ResolveNavbarItem,
|
||||
} from '../../shared/index.js'
|
||||
import {
|
||||
useNavbarConfig,
|
||||
useNavbarRepo,
|
||||
useNavbarSelectLanguage,
|
||||
} from '../composables'
|
||||
} from '../composables/index.js'
|
||||
|
||||
defineProps({
|
||||
isHeader: {
|
||||
@ -32,10 +37,10 @@ const navbarLinks = computed(() => [
|
||||
<div v-for="item in navbarLinks" :key="item.text" class="navbar-item">
|
||||
<NavbarDropdown
|
||||
v-if="(item as NavGroup<ResolveNavbarItem>).children"
|
||||
:item="item"
|
||||
:item="(item as NavGroup<ResolveNavbarItem>)"
|
||||
:is-header="isHeader"
|
||||
/>
|
||||
<AutoLink v-else :item="item" />
|
||||
<AutoLink v-else :item="(item as NavLink)" />
|
||||
</div>
|
||||
</nav>
|
||||
</template>
|
||||
|
||||
@ -4,9 +4,9 @@ import PostMeta from '@theme-plume/PostMeta.vue'
|
||||
import Sidebar from '@theme-plume/Sidebar.vue'
|
||||
import { usePageData } from '@vuepress/client'
|
||||
import { computed } from 'vue'
|
||||
import type { PlumeThemePageData } from '../../shared'
|
||||
import { useDarkMode } from '../composables'
|
||||
import Toc from './Toc'
|
||||
import type { PlumeThemePageData } from '../../shared/index.js'
|
||||
import { useDarkMode } from '../composables/index.js'
|
||||
import Toc from './Toc.js'
|
||||
|
||||
const page = usePageData<PlumeThemePageData>()
|
||||
const isDarkMode = useDarkMode()
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<script lang="ts" setup>
|
||||
import { computed } from 'vue'
|
||||
import { useThemeLocaleData } from '../composables'
|
||||
import { useThemeLocaleData } from '../composables/index.js'
|
||||
|
||||
const themeLocale = useThemeLocaleData()
|
||||
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<script lang="ts" setup>
|
||||
import { useOffsetPagination } from '@vueuse/core'
|
||||
import { computed, ref, toRefs } from 'vue'
|
||||
import { ArrowDoubleLeftIcon, ArrowDoubleRightIcon } from './icons'
|
||||
import { ArrowDoubleLeftIcon, ArrowDoubleRightIcon } from './icons/index.js'
|
||||
|
||||
const emit = defineEmits(['togglePage'])
|
||||
const props = defineProps({
|
||||
@ -16,7 +16,7 @@ const props = defineProps({
|
||||
})
|
||||
const { page, total } = toRefs(props)
|
||||
|
||||
function handlePage({ currentPage }): void {
|
||||
function handlePage({ currentPage }: { currentPage: number }): void {
|
||||
emit('togglePage', currentPage)
|
||||
}
|
||||
const { currentPage, pageCount, isFirstPage, isLastPage, prev, next } =
|
||||
|
||||
@ -2,9 +2,9 @@
|
||||
import DropdownTransition from '@theme-plume/DropdownTransition.vue'
|
||||
import type { PropType } from 'vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
import type { PostItem } from '../../shared'
|
||||
import type { PostItem } from '../../shared/index.js'
|
||||
import AutoLink from './AutoLink.vue'
|
||||
import { TopIcon } from './icons'
|
||||
import { TopIcon } from './icons/index.js'
|
||||
import PostMeta from './PostMeta.vue'
|
||||
|
||||
defineProps({
|
||||
|
||||
@ -5,10 +5,10 @@ import { usePageFrontmatter } from '@vuepress/client'
|
||||
import type { PropType } from 'vue'
|
||||
import { nextTick, onMounted, toRefs, watch } from 'vue'
|
||||
import { onBeforeRouteUpdate, useRoute, useRouter } from 'vue-router'
|
||||
import type { PlumeThemeHomeFrontmatter } from '../../shared'
|
||||
import type { PostListData } from '../composables'
|
||||
import { usePostList } from '../composables'
|
||||
import { scrollTo } from '../utils'
|
||||
import type { PlumeThemeHomeFrontmatter } from '../../shared/index.js'
|
||||
import type { PostListData } from '../composables/index.js'
|
||||
import { usePostList } from '../composables/index.js'
|
||||
import { scrollTo } from '../utils/index.js'
|
||||
import Pagination from './Pagination.vue'
|
||||
|
||||
const props = defineProps({
|
||||
|
||||
@ -2,10 +2,10 @@
|
||||
import type { PropType } from 'vue'
|
||||
import { computed } from 'vue'
|
||||
import { useRoute, useRouter } from 'vue-router'
|
||||
import type { PostItem } from '../../shared'
|
||||
import { useThemeLocaleData } from '../composables'
|
||||
import { getColor, normalizePath } from '../utils'
|
||||
import { ClockIcon, FolderIcon, TagIcon, UserIcon } from './icons'
|
||||
import type { PostItem } from '../../shared/index.js'
|
||||
import { useThemeLocaleData } from '../composables/index.js'
|
||||
import { getColor, normalizePath } from '../utils/index.js'
|
||||
import { ClockIcon, FolderIcon, TagIcon, UserIcon } from './icons/index.js'
|
||||
|
||||
const props = defineProps({
|
||||
post: {
|
||||
|
||||
@ -3,8 +3,8 @@ import SidebarItems from '@theme-plume/SidebarItems.vue'
|
||||
import type { PropType } from 'vue'
|
||||
import { onMounted, ref, watchEffect } from 'vue'
|
||||
import { useRoute } from 'vue-router'
|
||||
import type { SidebarOptions } from '../../shared'
|
||||
import { useAsideNavbar, useSidebarIndex } from '../composables'
|
||||
import type { SidebarOptions } from '../../shared/index.js'
|
||||
import { useAsideNavbar, useSidebarIndex } from '../composables/index.js'
|
||||
|
||||
defineProps({
|
||||
aside: {
|
||||
@ -27,7 +27,10 @@ onMounted(() => {
|
||||
})
|
||||
</script>
|
||||
<template>
|
||||
<aside :ref="(e) => (el = e)" class="plume-theme-sidebar-wrapper">
|
||||
<aside
|
||||
:ref="(e) => (el = e as HTMLElement)"
|
||||
class="plume-theme-sidebar-wrapper"
|
||||
>
|
||||
<SidebarItems
|
||||
v-if="aside.length"
|
||||
class="aside-navbar"
|
||||
|
||||
@ -2,10 +2,10 @@
|
||||
import AutoLink from '@theme-plume/AutoLink.vue'
|
||||
import { computed, ref, watchEffect } from 'vue'
|
||||
import type { PropType } from 'vue'
|
||||
import type { SidebarItem, SidebarOptions } from '../../shared'
|
||||
import { useThemeLocaleData } from '../composables'
|
||||
import { hasOwn } from '../utils'
|
||||
import { ArrowRightIcon } from './icons'
|
||||
import type { SidebarItem, SidebarOptions } from '../../shared/index.js'
|
||||
import { useThemeLocaleData } from '../composables/index.js'
|
||||
import { hasOwn } from '../utils/index.js'
|
||||
import { ArrowRightIcon } from './icons/index.js'
|
||||
|
||||
type SidebarListComputed = SidebarItem & { open: boolean }
|
||||
|
||||
|
||||
@ -4,9 +4,9 @@ import DropdownTransition from '@theme-plume/DropdownTransition.vue'
|
||||
import PostList from '@theme-plume/PostList.vue'
|
||||
import { computed, ref, watch } from 'vue'
|
||||
import { useRoute, useRouter } from 'vue-router'
|
||||
import type { PostListRef } from '../composables'
|
||||
import { usePostAllIndex, useTagList } from '../composables'
|
||||
import { normalizePath } from '../utils'
|
||||
import type { PostListRef } from '../composables/index.js'
|
||||
import { usePostAllIndex, useTagList } from '../composables/index.js'
|
||||
import { normalizePath } from '../utils/index.js'
|
||||
|
||||
const tagList = useTagList()
|
||||
const route = useRoute()
|
||||
|
||||
@ -4,7 +4,7 @@ import type { PropType, VNode } from 'vue'
|
||||
import { computed, defineComponent, h, toRefs } from 'vue'
|
||||
import type { RouteLocationNormalizedLoaded } from 'vue-router'
|
||||
import { useRoute } from 'vue-router'
|
||||
import { scrollTo } from '../utils'
|
||||
import { scrollTo } from '../utils/index.js'
|
||||
|
||||
export type TocPropsHeaders = PageHeader[]
|
||||
|
||||
@ -61,7 +61,7 @@ const renderLink = (
|
||||
href: hash,
|
||||
class: linkClass,
|
||||
ariaLabel: header.title,
|
||||
onClick: (e) => {
|
||||
onClick: (e: MouseEvent) => {
|
||||
e.preventDefault()
|
||||
setActiveRouteHash()
|
||||
},
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import { useThemeLocaleData } from '../composables'
|
||||
import { useThemeLocaleData } from '../composables/index.js'
|
||||
|
||||
defineEmits(['toggle'])
|
||||
|
||||
@ -9,7 +9,7 @@ const themeLocale = useThemeLocaleData()
|
||||
<template>
|
||||
<div
|
||||
class="toggle-sidebar-button"
|
||||
:title="themeLocale.toggleSidebar"
|
||||
:title="themeLocale.toggleSidebar || ''"
|
||||
aria-expanded="false"
|
||||
role="button"
|
||||
tabindex="0"
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import { h } from 'vue'
|
||||
import type { FunctionalComponent } from 'vue'
|
||||
import { IconBase } from './IconBase'
|
||||
import { IconBase } from './IconBase.js'
|
||||
|
||||
export const UserIcon: FunctionalComponent = () =>
|
||||
h(IconBase, { name: 'user' }, () =>
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
export * from './IconBase'
|
||||
export * from './icon'
|
||||
export * from './socialIcon'
|
||||
export * from './IconBase.js'
|
||||
export * from './icon.js'
|
||||
export * from './socialIcon.js'
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import { h } from 'vue'
|
||||
import type { FunctionalComponent } from 'vue'
|
||||
import { IconBase } from './IconBase'
|
||||
import { IconBase } from './IconBase.js'
|
||||
|
||||
export const GithubIcon: FunctionalComponent = () =>
|
||||
h(IconBase, { name: 'github', viewBox: '0 0 1024 1024' }, () =>
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import { ref } from 'vue'
|
||||
import type { Ref } from 'vue'
|
||||
import { usePostAllIndex } from './postIndex'
|
||||
import { usePostAllIndex } from './postIndex.js'
|
||||
|
||||
export interface ArchiveItem {
|
||||
year: string
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import { ref } from 'vue'
|
||||
import type { Ref } from 'vue'
|
||||
import type { PostItem } from '../../shared'
|
||||
import { usePostIndex } from './postIndex'
|
||||
import type { PostItem } from '../../shared/index.js'
|
||||
import { usePostIndex } from './postIndex.js'
|
||||
|
||||
export interface CategoryItem {
|
||||
label: string
|
||||
@ -16,7 +16,7 @@ export type CategoryListRef = Ref<CategoryList>
|
||||
|
||||
export const useCategoryList = (): CategoryListRef => {
|
||||
let categoryListRaw: CategoryList = []
|
||||
usePostIndex().value.forEach((post) => {
|
||||
usePostIndex().value.forEach((post: PostItem) => {
|
||||
if (post.category.length === 0) return
|
||||
const category = post.category.map((cate, index) => {
|
||||
if (index > 0) {
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import { usePreferredDark, useStorage } from '@vueuse/core'
|
||||
import { computed, inject, onMounted, onUnmounted, provide, watch } from 'vue'
|
||||
import type { InjectionKey, WritableComputedRef } from 'vue'
|
||||
import { useThemeLocaleData } from './themeData'
|
||||
import { useThemeLocaleData } from './themeData.js'
|
||||
|
||||
export type DarkModeRef = WritableComputedRef<boolean>
|
||||
|
||||
|
||||
@ -1,16 +1,16 @@
|
||||
export * from './themeData'
|
||||
export * from './darkMode'
|
||||
export * from './navbar'
|
||||
export * from './navLink'
|
||||
export * from './resolveRouteWithRedirect'
|
||||
export * from './themeData.js'
|
||||
export * from './darkMode.js'
|
||||
export * from './navbar.js'
|
||||
export * from './navLink.js'
|
||||
export * from './resolveRouteWithRedirect.js'
|
||||
|
||||
export * from './postIndex'
|
||||
export * from './sidebarIndex'
|
||||
export * from './postList'
|
||||
export * from './scrollPromise'
|
||||
export * from './asideNavbar'
|
||||
export * from './postStat'
|
||||
export * from './postIndex.js'
|
||||
export * from './sidebarIndex.js'
|
||||
export * from './postList.js'
|
||||
export * from './scrollPromise.js'
|
||||
export * from './asideNavbar.js'
|
||||
export * from './postStat.js'
|
||||
|
||||
export * from './tag'
|
||||
export * from './category'
|
||||
export * from './archive'
|
||||
export * from './tag.js'
|
||||
export * from './category.js'
|
||||
export * from './archive.js'
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import type { NavLink } from '../../shared'
|
||||
import { useResolveRouteWithRedirect } from './resolveRouteWithRedirect'
|
||||
import type { NavLink } from '../../shared/index.js'
|
||||
import { useResolveRouteWithRedirect } from './resolveRouteWithRedirect.js'
|
||||
|
||||
declare module 'vue-router' {
|
||||
interface RouteMeta {
|
||||
|
||||
@ -8,10 +8,10 @@ import type {
|
||||
NavbarItem,
|
||||
NavLink,
|
||||
ResolveNavbarItem,
|
||||
} from '../../shared'
|
||||
import { resolveRepoType } from '../utils'
|
||||
import { useNavLink } from './navLink'
|
||||
import { useThemeLocaleData } from './themeData'
|
||||
} from '../../shared/index.js'
|
||||
import { resolveRepoType } from '../utils/index.js'
|
||||
import { useNavLink } from './navLink.js'
|
||||
import { useThemeLocaleData } from './themeData.js'
|
||||
|
||||
export const useNavbarSelectLanguage = (): ComputedRef<ResolveNavbarItem[]> => {
|
||||
const router = useRouter()
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import { postIndex as postIndexRaw } from '@internal/postIndex.js'
|
||||
import { ref } from 'vue'
|
||||
import type { Ref } from 'vue'
|
||||
import type { PostIndex } from '../../shared'
|
||||
import type { PostIndex } from '../../shared/index.js'
|
||||
|
||||
const isBoolean = (arg: unknown): boolean => {
|
||||
return typeof arg === 'boolean'
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import type { Ref } from 'vue'
|
||||
import { ref } from 'vue'
|
||||
import type { PostItem } from '../../shared'
|
||||
import { usePostIndex } from './postIndex'
|
||||
import type { PostItem } from '../../shared/index.js'
|
||||
import { usePostIndex } from './postIndex.js'
|
||||
|
||||
export type PostListData = PostItem[]
|
||||
export type PostListRef = Ref<PostListData>
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import { reactive } from 'vue'
|
||||
import { usePostAllIndex } from './postIndex'
|
||||
import { useTagList } from './tag'
|
||||
import { usePostAllIndex } from './postIndex.js'
|
||||
import { useTagList } from './tag.js'
|
||||
|
||||
export interface PostStatData {
|
||||
postTotal: number
|
||||
|
||||
@ -3,8 +3,8 @@ import { usePageFrontmatter } from '@vuepress/client'
|
||||
import { computed, ref } from 'vue'
|
||||
import type { ComputedRef, Ref } from 'vue'
|
||||
import { useRoute } from 'vue-router'
|
||||
import type { SidebarOptions } from '../../shared'
|
||||
import { useThemeLocaleData } from './themeData'
|
||||
import type { SidebarOptions } from '../../shared/index.js'
|
||||
import { useThemeLocaleData } from './themeData.js'
|
||||
|
||||
export type SidebarIndexRef = Ref<Record<string, SidebarOptions>>
|
||||
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import type { Ref } from 'vue'
|
||||
import { ref } from 'vue'
|
||||
import { getColor } from '../utils'
|
||||
import { usePostAllIndex } from './postIndex'
|
||||
import { getColor } from '../utils/index.js'
|
||||
import { usePostAllIndex } from './postIndex.js'
|
||||
|
||||
export interface TagItem {
|
||||
tag: string
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user