Skip to content

Commit

Permalink
紧急规避敏感词防止被封禁
Browse files Browse the repository at this point in the history
  • Loading branch information
aprosail committed Aug 24, 2024
2 parents 78865f4 + d71eb55 commit a6b8866
Show file tree
Hide file tree
Showing 13 changed files with 91 additions and 2 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ pnpm-lock.yaml
yarn.lock
bun.lockb

# VitePress编译输出文件
# 编译输出文件
docs/.vitepress/cache/
docs/.vitepress/dist/
dist/
1 change: 1 addition & 0 deletions base/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from "./src/utils"
22 changes: 22 additions & 0 deletions base/package.json
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 added base/src/Handbook.vue
Empty file.
Empty file added base/src/locales.ts
Empty file.
Empty file added base/src/options.ts
Empty file.
16 changes: 16 additions & 0 deletions base/src/utils.ts
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 added base/src/wordless.ts
Empty file.
25 changes: 25 additions & 0 deletions base/tsconfig.json
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"]
}
22 changes: 22 additions & 0 deletions base/vite.config.ts
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},
},
},
})
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ layout: home
hero:
name: 数社软件开发手册
text: 知识工程基础设施
tagline: 先进技术应当掌握在人民群众手中
tagline: 助您快速形成软件开发生产力
actions:
- {theme: brand, text: 如何使用, link: /guide}
- {theme: alt, text: 编程规范, link: /spec/intro}
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"markdown-it": "^14.1.0",
"pagefind": "^1.1.0",
"vitepress": "^1.3.3",
"vitepress-handbook": "./base",
"vitepress-plugin-pagefind": "^0.4.10",
"vue": "^3.4.38"
},
Expand Down
1 change: 1 addition & 0 deletions pnpm-workspace.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
packages: [base]

0 comments on commit a6b8866

Please sign in to comment.