-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
91 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from "./src/utils" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ | ||
"name": "vitepress-handbook", | ||
"description": "VitePress构建手册基础设施", | ||
"version": "0.0.0", | ||
"type": "module", | ||
"private": true, | ||
"scripts": { | ||
"build": "vue-tsc -b && vite build" | ||
}, | ||
"dependencies": { | ||
"vitepress": "^1.3.3", | ||
"vue": "^3.4.38" | ||
}, | ||
"devDependencies": { | ||
"@vitejs/plugin-vue": "^5.1.2", | ||
"rollup-plugin-dts": "^6.1.1", | ||
"typescript": "^5.5.4", | ||
"vite": "^5.4.2", | ||
"vite-plugin-dts": "^4.0.3", | ||
"vue-tsc": "^2.0.29" | ||
} | ||
} |
Empty file.
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
export function ensurePrefix(raw: string, prefix: string) { | ||
return raw.startsWith(prefix) ? raw : prefix + raw | ||
} | ||
|
||
export function ensureSuffix(raw: string, suffix: string) { | ||
return raw.endsWith(suffix) ? raw : raw + suffix | ||
} | ||
|
||
export function removePrefix(raw: string, prefix: string) { | ||
return raw.startsWith(prefix) ? raw.slice(prefix.length) : raw | ||
} | ||
|
||
export function maybeCapitalCase(raw: string | undefined) { | ||
if (!raw) return undefined | ||
return raw.charAt(0).toUpperCase() + raw.slice(1) | ||
} |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{ | ||
"compilerOptions": { | ||
"target": "ES2020", | ||
"useDefineForClassFields": true, | ||
"module": "ESNext", | ||
"lib": ["ES2020", "DOM", "DOM.Iterable"], | ||
"skipLibCheck": true, | ||
|
||
// 打包模式。 | ||
"moduleResolution": "bundler", | ||
"allowImportingTsExtensions": true, | ||
"isolatedModules": true, | ||
"moduleDetection": "force", | ||
"noEmit": true, | ||
"jsx": "preserve", | ||
"declaration": true, | ||
|
||
// 代码检查。 | ||
"strict": true, | ||
"noUnusedLocals": true, | ||
"noUnusedParameters": true, | ||
"noFallthroughCasesInSwitch": true | ||
}, | ||
"include": ["index.ts", "src/**/*.ts", "src/**/*.vue"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import vue from "@vitejs/plugin-vue" | ||
import {defineConfig} from "vite" | ||
import dts from "vite-plugin-dts" | ||
|
||
export default defineConfig({ | ||
plugins: [vue(), dts()], | ||
build: { | ||
lib: { | ||
entry: "index.ts", | ||
name: "handbook", | ||
fileName: "handbook", | ||
formats: ["es", "umd"], | ||
}, | ||
sourcemap: true, | ||
outDir: "dist", | ||
emptyOutDir: true, | ||
rollupOptions: { | ||
external: ["vitepress", "vue"], | ||
output: {globals: {vitepress: "VitePress", vue: "Vue"}, compact: false}, | ||
}, | ||
}, | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
packages: [base] |