From 111f45cd96ea22d24f031f48d3e34ef5b8dd5024 Mon Sep 17 00:00:00 2001 From: linpl Date: Thu, 23 Feb 2023 14:33:03 +0800 Subject: [PATCH] docs: init doc --- .dumirc.ts | 14 +++++++++++++ .github/workflows/gh-pages.yml | 21 ++++++++++++++++++++ .gitignore | 10 +++++++++- .husky/commit-msg | 4 ++++ .husky/pre-commit | 4 ++++ README.md | 20 +++++++++++++++++++ docs/guide.md | 1 + docs/index.md | 21 ++++++++++++++++++++ package.json | 36 ++++++++++++++++++++++++++++++++++ tsconfig.json | 12 ++++++++++++ 10 files changed, 142 insertions(+), 1 deletion(-) create mode 100644 .dumirc.ts create mode 100644 .github/workflows/gh-pages.yml create mode 100644 .husky/commit-msg create mode 100644 .husky/pre-commit create mode 100644 README.md create mode 100644 docs/guide.md create mode 100644 docs/index.md create mode 100644 package.json create mode 100644 tsconfig.json diff --git a/.dumirc.ts b/.dumirc.ts new file mode 100644 index 0000000..c52b5ca --- /dev/null +++ b/.dumirc.ts @@ -0,0 +1,14 @@ +import { defineConfig } from 'dumi'; + +export default defineConfig({ + themeConfig: { + name: 'mapstruct-plus', + logo: false, + nav: [{ title: '指南', link: '/guide' }], + prefersColor: { default: 'auto' }, + github: 'https://github.com/linpeilie', + footer: false + }, + base: '/mapstruct-plus', + publicPath: '/mapstruct-plus/' +}); \ No newline at end of file diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml new file mode 100644 index 0000000..4ccbd6d --- /dev/null +++ b/.github/workflows/gh-pages.yml @@ -0,0 +1,21 @@ +name: github pages + +on: + push: + branches: + - master # default branch + +jobs: + deploy: + runs-on: ubuntu-18.04 + steps: + - uses: actions/checkout@v2 + - run: npm install + # 文档编译命令,如果是 react 模板需要修改为 npm run docs:build + - run: npm run build + - name: Deploy + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + # 文档目录,如果是 react 模板需要修改为 docs-dist + publish_dir: ./dist \ No newline at end of file diff --git a/.gitignore b/.gitignore index 30ef8ed..cd6d409 100644 --- a/.gitignore +++ b/.gitignore @@ -37,4 +37,12 @@ build/ ### Mac OS ### .DS_Store -.idea \ No newline at end of file +.idea + +node_modules + +package-lock.json + +dist +.dumi/tmp +.dumi/tmp-production \ No newline at end of file diff --git a/.husky/commit-msg b/.husky/commit-msg new file mode 100644 index 0000000..5b0b354 --- /dev/null +++ b/.husky/commit-msg @@ -0,0 +1,4 @@ +#!/usr/bin/env sh +. "$(dirname -- "$0")/_/husky.sh" + +npx commitlint --edit "${1}" diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100644 index 0000000..d24fdfc --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1,4 @@ +#!/usr/bin/env sh +. "$(dirname -- "$0")/_/husky.sh" + +npx lint-staged diff --git a/README.md b/README.md new file mode 100644 index 0000000..aedb6c0 --- /dev/null +++ b/README.md @@ -0,0 +1,20 @@ +# mapstruct-plus + +A static site base on [dumi](https://d.umijs.org). + +## Development + +```bash +# install dependencies +$ npm install + +# start dev server +$ npm start + +# build docs +$ npm run build +``` + +## LICENSE + +MIT diff --git a/docs/guide.md b/docs/guide.md new file mode 100644 index 0000000..5504ddf --- /dev/null +++ b/docs/guide.md @@ -0,0 +1 @@ +This is a guide example. diff --git a/docs/index.md b/docs/index.md new file mode 100644 index 0000000..a426a29 --- /dev/null +++ b/docs/index.md @@ -0,0 +1,21 @@ +--- +title: A static site based on dumi +hero: + title: mapstruct plus + description: 简单、强大的 Java Bean 转换工具 + actions: + - text: 快速开始 + link: / +features: + - title: 快速开发 + emoji: 🚀 + description: Java 实体类之间的转换,仅需要一个注解,减少了乏味且容易出错的开发任务 + - title: 自动化 + emoji: 🌈 + description: 基于注解处理器,所有生成工作在编译阶段完成 + - title: 执行效率 + emoji: 💡 + description: 生成代码基于原有 getter/setter 方法,不会影响原有性能 +--- + +mapstruct-plus diff --git a/package.json b/package.json new file mode 100644 index 0000000..df2aa66 --- /dev/null +++ b/package.json @@ -0,0 +1,36 @@ +{ + "name": "mapstruct-plus", + "version": "0.0.1", + "description": "mapstruct-plus document", + "license": "MIT", + "scripts": { + "build": "dumi build", + "deploy": "gh-pages -d dist", + "dev": "dumi dev", + "prepare": "husky install && dumi setup", + "start": "npm run dev" + }, + "commitlint": { + "extends": [ + "@commitlint/config-conventional" + ] + }, + "lint-staged": { + "*.{md,json}": [ + "prettier --write --no-error-on-unmatched-pattern" + ] + }, + "devDependencies": { + "@commitlint/cli": "^17.1.2", + "@commitlint/config-conventional": "^17.1.0", + "dumi": "^2.0.2", + "dumi-theme-antd-style": "^0.10.5", + "gh-pages": "^5.0.0", + "husky": "^8.0.1", + "lint-staged": "^13.0.3", + "prettier": "^2.7.1" + }, + "authors": [ + "linpeilie@qq.com" + ] +} diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..3ea66c2 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,12 @@ +{ + "compilerOptions": { + "strict": true, + "skipLibCheck": true, + "esModuleInterop": true, + "baseUrl": "./", + "paths": { + "@@/*": [".dumi/tmp/*"] + } + }, + "include": [".dumi/**/*", ".dumirc.ts"] +}