Skip to content

Commit ed52574

Browse files
committed
Initial commit
0 parents  commit ed52574

36 files changed

+825
-0
lines changed

.github/workflows/ci.yml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: Build & Deploy
2+
on:
3+
push:
4+
branches:
5+
- main
6+
7+
jobs:
8+
build-deploy:
9+
runs-on: ubuntu-20.04
10+
steps:
11+
- uses: actions/checkout@v2
12+
- uses: actions/setup-node@v2
13+
with:
14+
node-version: 14
15+
16+
- run: npm i npm@7 -g
17+
# - run: npm ci
18+
- run: npm install
19+
# - run: npm run hoist
20+
- run: npm run bootstrap
21+
- run: npm run build
22+
- run: npm run build:website
23+
24+
- name: Create Tag
25+
id: create_tag
26+
uses: jaywcjlove/create-tag-action@v1.3.4
27+
with:
28+
token: ${{ secrets.GITHUB_TOKEN }}
29+
package-path: ./packages/base/package.json
30+
31+
- name: Generate Changelog
32+
id: changelog
33+
uses: jaywcjlove/changelog-generator@v1.4.8
34+
if: steps.create_tag.outputs.successful
35+
with:
36+
token: ${{ secrets.GITHUB_TOKEN }}
37+
head-ref: ${{steps.create_tag.outputs.version}}
38+
filter-author: (renovate-bot|Renovate Bot)
39+
filter: '[R|r]elease[d]\s+[v|V]\d(\.\d+){0,2}'
40+
41+
- name: Create Release
42+
uses: jaywcjlove/create-tag-action@v1.3.4
43+
with:
44+
package-path: ./packages/base/package.json
45+
release: true
46+
body: |
47+
${{ steps.changelog.outputs.compareurl }}
48+
49+
${{ steps.changelog.outputs.changelog }}
50+
51+
- name: Deploy
52+
uses: peaceiris/actions-gh-pages@v3
53+
with:
54+
github_token: ${{ secrets.GITHUB_TOKEN }}
55+
publish_dir: ./website/dist
56+
57+
# - uses: JS-DevTools/npm-publish@v1
58+
# with:
59+
# token: ${{ secrets.NPM_TOKEN }}
60+
# package: ./packages/base/package.json
61+
62+
# - uses: JS-DevTools/npm-publish@v1
63+
# with:
64+
# token: ${{ secrets.NPM_TOKEN }}
65+
# package: ./packages/simple/package.json

.gitignore

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
node_modules
2+
dist
3+
lib
4+
esm
5+
cjs
6+
7+
8+
# local env files
9+
.env.local
10+
.env.*.local
11+
12+
# Log files
13+
npm-debug.log*
14+
yarn.lock
15+
yarn-debug.log*
16+
yarn-error.log*
17+
pnpm-debug.log*
18+
package-lock.json
19+
20+
# Editor directories and files
21+
.DS_Store
22+
.idea
23+
.vscode
24+
*.suo
25+
*.ntvs*
26+
*.njsproj
27+
*.sln
28+
*.sw?

.husky/pre-commit

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
. "$(dirname "$0")/_/husky.sh"
3+
4+
./node_modules/.bin/pretty-quick --staged

.prettierignore

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
**/*.md
2+
**/*.svg
3+
**/*.ejs
4+
**/*.yml
5+
package.json
6+
node_modules
7+
dist
8+
build
9+
lib
10+
esm
11+
cjs
12+
test

.prettierrc

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"singleQuote": true,
3+
"trailingComma": "all",
4+
"printWidth": 120,
5+
"overrides": [
6+
{
7+
"files": ".prettierrc",
8+
"options": { "parser": "json" }
9+
}
10+
]
11+
}

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2021 TSBB
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
vue-monorepo-template
2+
===
3+
4+
[![Downloads](https://img.shields.io/static/v1?label=Github&message=repo&color=green&style=flat&logo=github)](https://github.com/tsbbjs/vue-monorepo-template)
5+
[![Build & Deploy](https://github.com/tsbbjs/vue-monorepo-template/actions/workflows/ci.yml/badge.svg)](https://github.com/tsbbjs/vue-monorepo-template/actions/workflows/ci.yml)
6+
7+
简单的 [`vue 3`](https://v3.vuejs.org/) 包开发工程实例模板。
8+
9+
### 目录结构
10+
11+
```shell
12+
.
13+
├── README.md
14+
├── lerna.json
15+
├── package.json
16+
├── packages # 放置包的目录
17+
│   ├── base # 📦 包 @vue-monorepo-template/base
18+
│   │   ├── cjs # 🔄 编译后的 cjs 目录
19+
│   │   ├── esm # 🔄 编译后的 esm 目录
20+
│   │   ├── package.json
21+
│   │   ├── src # 包源码目录
22+
│   │   └── tsconfig.json
23+
│   └── simple # 📦 包 @vue-monorepo-template/simple
24+
├── tsconfig.json
25+
└── website # 🐝 包实例测试,网站
26+
├── README.md
27+
├── babel.config.js
28+
├── package.json
29+
├── public
30+
├── src
31+
└── vue.config.js
32+
```
33+
34+
### 开发
35+
36+
1. 安装
37+
38+
```shell
39+
npm install
40+
```
41+
42+
2. 安装包和实例中的依赖
43+
44+
```shell
45+
npm run bootstrap
46+
```
47+
48+
3. 编译包中代码
49+
50+
```shell
51+
npm run build # 编译所有包 📦 代码
52+
53+
npm run watch:simple # 实时编译 📦 @vue-monorepo-template/simple
54+
npm run watch:base # 实时编译 📦 @vue-monorepo-template/base
55+
```
56+
57+
4. 启动 `website` 实例网站
58+
59+
```shell
60+
npm run start
61+
```
62+
63+
### License
64+
65+
Licensed under the MIT License.

lerna.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"version": "1.0.0",
3+
"packages": ["website", "packages/*"]
4+
}

package.json

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"private": true,
3+
"scripts": {
4+
"prepare": "husky install",
5+
"start": "lerna exec \"npm run serve\" --scope website",
6+
"build:website": "lerna exec \"npm run build\" --scope website",
7+
"build": "lerna exec \"tsbb build --use-vue\" --scope @vue-monorepo-template/*",
8+
"watch:simple": "lerna exec \"tsbb watch --use-vue\" --scope @vue-monorepo-template/simple",
9+
"watch:base": "lerna exec \"tsbb watch --use-vue\" --scope @vue-monorepo-template/base",
10+
"prettier": "prettier --write \"**/*.{js,jsx,vue,tsx,ts,less,md,json}\"",
11+
"version": "lerna version --exact --force-publish --no-push --no-git-tag-version",
12+
"clean": "lerna clean --yes",
13+
"hoist": "lerna bootstrap --hoist",
14+
"bootstrap": "lerna bootstrap --force-local --no-ci"
15+
},
16+
"author": "jaywcjlove",
17+
"license": "MIT",
18+
"devDependencies": {
19+
"husky": "7.0.4",
20+
"prettier": "2.5.1",
21+
"pretty-quick": "3.1.2",
22+
"lerna": "4.0.0",
23+
"tsbb": "^3.5.0"
24+
}
25+
}

packages/base/README.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
@vue-monorepo-template/base
2+
===
3+
4+
```bash
5+
npm i @vue-monorepo-template/base
6+
```
7+
8+
```vue
9+
<template>
10+
<div>
11+
<v-base title="002"></v-base>
12+
</div>
13+
</template>
14+
15+
<script>
16+
import { defineComponent } from 'vue'
17+
import VBase from '@vue-monorepo-template/base';
18+
19+
export default defineComponent({
20+
components: {
21+
VBase
22+
}
23+
});
24+
</script>
25+
```

0 commit comments

Comments
 (0)