Skip to content

Commit c3033f1

Browse files
committed
feat: initial commit
0 parents  commit c3033f1

33 files changed

+8432
-0
lines changed

.eslintignore

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
node_modules
2+
scripts/dev/*.js
3+
*.html
4+
**/libs/*.js

.eslintrc.js

+66
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
/*
2+
* @Author: tackchen
3+
* @Date: 2022-07-25 08:31:19
4+
* @Description: Coding something
5+
*/
6+
module.exports = {
7+
parser: '@typescript-eslint/parser',
8+
plugins: ['@typescript-eslint'],
9+
'globals': {
10+
'globalThis': true,
11+
},
12+
env: {
13+
'browser': true,
14+
'es6': true,
15+
'node': true,
16+
'commonjs': true,
17+
},
18+
'parserOptions': {
19+
'sourceType': 'module' // ts 中使用 es 模块
20+
},
21+
'rules': {
22+
'no-var': 'error',
23+
// 优先使用 interface 而不是 type
24+
'@typescript-eslint/consistent-type-definitions': [
25+
'error',
26+
'interface'
27+
],
28+
'@typescript-eslint/no-unused-vars': 'error', // 使用 ts 未使用变量的规则 比如枚举类型在es中会报错
29+
'no-extend-native': 0,
30+
'no-new': 0,
31+
'no-useless-escape': 0,
32+
'no-useless-constructor': 0,
33+
'no-trailing-spaces': ['error', {'skipBlankLines': true}],
34+
'indent': ['error', 2, {
35+
'SwitchCase': 1
36+
}],
37+
'space-infix-ops': ['error', {'int32Hint': false}],
38+
'space-before-function-paren': ['error', {
39+
'anonymous': 'always',
40+
'named': 'always',
41+
'asyncArrow': 'always'
42+
}],
43+
'semi': ['error', 'always'],
44+
'comma-dangle': 0,
45+
'no-console': 0,
46+
'no-debugger': 0,
47+
'id-length': 0,
48+
'eol-last': 0,
49+
'object-curly-spacing': ['error', 'never'],
50+
'arrow-spacing': 'error',
51+
'no-multiple-empty-lines': 'error',
52+
'spaced-comment': 'error',
53+
'quotes': ['error', 'single', {'allowTemplateLiterals': true}],
54+
'no-unreachable': 'error',
55+
'keyword-spacing': 'error',
56+
'space-before-blocks': 'error',
57+
'semi-spacing': 'error',
58+
'comma-spacing': 'error',
59+
'key-spacing': 'error',
60+
'no-undef': 'error',
61+
'prefer-const': ['error', {
62+
'destructuring': 'any',
63+
'ignoreReadBeforeAssign': false
64+
}]
65+
}
66+
};

.github/release-drafter.yml

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name-template: 'v$RESOLVED_VERSION'
2+
tag-template: 'v$RESOLVED_VERSION'
3+
template: |
4+
# What's Changed
5+
6+
### [Version Log](todo: add version log)
7+
8+
**Full Changelog**: https://github.com/$OWNER/$REPOSITORY/compare/$PREVIOUS_TAG...v$RESOLVED_VERSION
9+
10+
categories:
11+
- title: 'Breaking'
12+
label: 'type: breaking'
13+
- title: 'New'
14+
label: 'type: feature'
15+
- title: 'Bug Fixes'
16+
label: 'type: bug'
17+
- title: 'Maintenance'
18+
label: 'type: maintenance'
19+
- title: 'Documentation'
20+
label: 'type: docs'
21+
- title: 'Other changes'
22+
- title: 'Dependency Updates'
23+
label: 'type: dependencies'
24+
collapse-after: 5
25+
26+
version-resolver:
27+
major:
28+
labels:
29+
- 'type: breaking'
30+
minor:
31+
labels:
32+
- 'type: feature'
33+
patch:
34+
labels:
35+
- 'type: bug'
36+
- 'type: maintenance'
37+
- 'type: docs'
38+
- 'type: dependencies'
39+
- 'type: security'
40+
41+
exclude-labels:
42+
- 'skip-changelog'

.github/workflows/eb-docs.yml

+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Docs
2+
on:
3+
push:
4+
tags:
5+
- d*.*.*
6+
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout
12+
uses: actions/checkout@v3
13+
with:
14+
fetch-depth: 0
15+
16+
- name: Setup Node
17+
uses: actions/setup-node@v3
18+
with:
19+
node-version: '16'
20+
registry-url: https://registry.npmjs.org
21+
22+
- name: Determine npm cache directory
23+
id: npm-cache
24+
run: |
25+
echo "::set-output name=dir::$(npm config get cache)"
26+
27+
- name: Restore npm cache
28+
uses: actions/cache@v3
29+
with:
30+
path: ${{ steps.npm-cache.outputs.dir }}
31+
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
32+
restore-keys: |
33+
${{ runner.os }}-node-
34+
35+
- name: Npm Install
36+
run: npm install
37+
38+
- name: Version
39+
id: version
40+
run: |
41+
tag=${GITHUB_REF/refs\/tags\//}
42+
version=${tag#d}
43+
echo "::set-output name=version::${version}"
44+
45+
- name: Build docs # build npm
46+
run: npm run eb:docs -- ${{ steps.version.outputs.version }}
47+
48+
- name: Pages # github pages
49+
uses: JamesIves/github-pages-deploy-action@v4.3.0
50+
with:
51+
branch: gh-pages
52+
folder: docs
53+
54+
- name: Purge # purge cdn # 此处只需要purge docs即可
55+
run: npm run eb:purge -- ${{ steps.version.outputs.version }}

.github/workflows/eb-release.yml

+71
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
name: Release
2+
on:
3+
push:
4+
tags:
5+
- v*.*.*
6+
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout
12+
uses: actions/checkout@v3
13+
with:
14+
fetch-depth: 0
15+
16+
- name: Setup Node
17+
uses: actions/setup-node@v3
18+
with:
19+
node-version: '16'
20+
registry-url: https://registry.npmjs.org
21+
22+
- name: Determine npm cache directory
23+
id: npm-cache
24+
run: |
25+
echo "::set-output name=dir::$(npm config get cache)"
26+
27+
- name: Restore npm cache
28+
uses: actions/cache@v3
29+
with:
30+
path: ${{ steps.npm-cache.outputs.dir }}
31+
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
32+
restore-keys: |
33+
${{ runner.os }}-node-
34+
35+
- name: Npm Install
36+
run: npm install
37+
38+
- name: Version
39+
id: version
40+
run: |
41+
tag=${GITHUB_REF/refs\/tags\//}
42+
version=${tag#v}
43+
echo "::set-output name=version::${version}"
44+
45+
- name: Build # build npm
46+
run: npm run eb:build -- ${{ steps.version.outputs.version }}
47+
48+
- name: Build Docs
49+
run: npm run eb:docs -- ${{ steps.version.outputs.version }}
50+
51+
- name: Pages # github pages
52+
uses: JamesIves/github-pages-deploy-action@v4.3.0
53+
with:
54+
branch: gh-pages
55+
folder: docs
56+
57+
- name: Release # release
58+
uses: release-drafter/release-drafter@v5
59+
with:
60+
version: ${{ steps.version.outputs.version }}
61+
publish: true
62+
env:
63+
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }}
64+
65+
- name: Publish # npm publish
66+
env:
67+
NODE_AUTH_TOKEN: ${{ secrets.NPMJS_TOKEN }}
68+
run: npm run eb:publish -- ${{ steps.version.outputs.version }}
69+
70+
- name: Purge # purge cdn
71+
run: npm run eb:purge -- ${{ steps.version.outputs.version }}

.gitignore

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
node_modules
2+
dist
3+
cdn
4+
.pnpm-debug.log

.npmrc

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
strict-peer-dependencies=false
2+
registry=https://registry.npmjs.org/

.vscode/settings.json

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"editor.tabSize": 2,
3+
"editor.formatOnSave": false, // 每次保存的时候将代码按eslint格式进行修复
4+
"eslint.validate": [
5+
//开启对.vue文件中错误的检查
6+
"javascript",
7+
"javascriptreact",
8+
"html",
9+
"vue",
10+
"typescript",
11+
"html",
12+
"vue",
13+
],
14+
"search.exclude": {
15+
"**/node_modules": true
16+
},
17+
"typescript.validate.enable": true,
18+
"editor.codeActionsOnSave": {
19+
"source.fixAll.eslint": true
20+
}
21+
}
22+

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2019 - present
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
13+
all 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
21+
THE SOFTWARE.

README.md

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<!--
2+
* @Author: tackchen
3+
* @Date: 2022-08-03 21:24:33
4+
* @Description: Coding something
5+
-->
6+
## ebuild-template-rollup
7+
8+
[ebuild-cli](https://github.com/theajack/ebuild-template-rollup)
9+
10+
## quickstart
11+
12+
```
13+
npm i -g pnpm lerna
14+
```
15+
16+
```
17+
pnpm i
18+
19+
pnpm run dev
20+
21+
pnpm run publish -- x.x.x
22+
```

babel.config.js

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
module.exports = {
2+
presets: [
3+
[
4+
'@babel/preset-env',
5+
{
6+
useBuiltIns: 'entry',
7+
targets: {
8+
esmodules: true,
9+
ie: 11,
10+
},
11+
},
12+
],
13+
'@babel/preset-typescript',
14+
],
15+
};
16+

npm/LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2019 - present
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
13+
all 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
21+
THE SOFTWARE.

npm/README.md

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<!--
2+
* @Author: tackchen
3+
* @Date: 2022-08-03 21:22:27
4+
* @Description: Coding something
5+
-->
6+
## quickstart
7+
8+
```
9+
npm i -g pnpm
10+
```
11+
12+
```
13+
pnpm i
14+
15+
pnpm run dev
16+
17+
pnpm run build
18+
```

npm/ebuild-demo.min.d.ts

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
declare const _default: "Hello Ebuild!";
2+
3+
export { _default as default };

npm/ebuild-demo.min.js

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)