Skip to content

Commit 9a688d7

Browse files
authored
chore: 发布 0.8.3 版本
2 parents 8d3db24 + 74f0fe1 commit 9a688d7

File tree

270 files changed

+4464
-2938
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

270 files changed

+4464
-2938
lines changed

.eslintignore

Lines changed: 0 additions & 5 deletions
This file was deleted.

.eslintrc

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
{
2+
"extends": [
3+
"eslint:recommended",
4+
"plugin:import/errors",
5+
"plugin:import/warnings",
6+
"plugin:promise/recommended"
7+
],
8+
"plugins": [
9+
"import",
10+
"promise"
11+
],
12+
"env": {
13+
"node": true,
14+
"es2017": true,
15+
"browser": true,
16+
"commonjs": true
17+
},
18+
"parserOptions": {
19+
"ecmaVersion": 2018,
20+
"sourceType": "module"
21+
},
22+
"globals": {
23+
"Component": true,
24+
"Page": true,
25+
"wx": true,
26+
"App": true
27+
},
28+
"ignorePatterns": [
29+
"dist/*",
30+
"examples/dist/*",
31+
"src/common/async-validator/*",
32+
"examples/pages/filter/components/wemark"
33+
],
34+
"rules": {
35+
// 函数大括号前不允许加空格(已关闭)
36+
"space-before-function-paren": "off",
37+
// 缩进 2 个空格
38+
"indent": ["error", 2],
39+
// 必须使用单引号
40+
"quotes": [
41+
"error", "single", {
42+
"allowTemplateLiterals": false
43+
}
44+
],
45+
// 行尾必须添加分号
46+
"semi": ["error"],
47+
// 不允许使用 console.log()
48+
"no-console": [
49+
"warn", {
50+
"allow": ["info", "warn", "error"]
51+
}
52+
],
53+
// 禁止使用未声明的变量
54+
"no-undef": "error",
55+
// 禁止不必要的转义使用(已关闭)
56+
"no-useless-escape": "off",
57+
// 必须使用严格等于
58+
"eqeqeq": ["error", "always"],
59+
// promise 中必须要 return 语句(已关闭)
60+
"promise/always-return": "off"
61+
}
62+
}

.eslintrc.json

Lines changed: 0 additions & 37 deletions
This file was deleted.

.github/workflows/npm-publish.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
2+
# For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages
3+
# 在创建 release 后自动发布 npm 包
4+
5+
6+
name: Node.js Package
7+
8+
on:
9+
release:
10+
types: [created]
11+
12+
jobs:
13+
build:
14+
name: 编译文件
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v2
18+
- uses: actions/setup-node@v1
19+
with:
20+
node-version: 12
21+
- run: npm i
22+
- run: npm lint
23+
- run: npm run build
24+
- run: npm run dev
25+
26+
publish-npm:
27+
name: 发布到 npm
28+
needs: build
29+
runs-on: ubuntu-latest
30+
steps:
31+
- uses: actions/checkout@v2
32+
- uses: actions/setup-node@v1
33+
with:
34+
node-version: 12
35+
registry-url: https://registry.npmjs.org/
36+
- run: npm publish
37+
env:
38+
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
39+
40+
publish-gpr:
41+
name: 发布到 github pkg
42+
needs: build
43+
runs-on: ubuntu-latest
44+
steps:
45+
- uses: actions/checkout@v2
46+
- uses: actions/setup-node@v1
47+
with:
48+
node-version: 12
49+
registry-url: https://npm.pkg.github.com/
50+
- run: npm publish
51+
env:
52+
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}

.huskyrc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"hooks": {
3+
"pre-commit": "npm run lint && git restore -W -S dist examples/dist",
4+
"commit-msg": "commitlint -e $GIT_PARAMS"
5+
}
6+
}

.travis.yml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,16 @@
11
# 指定运行环境
22
language: node_js
3+
34
node_js:
45
- lts/*
56

6-
# 仅监控 master 分支
7-
branches:
8-
except:
9-
- master
10-
117
jobs:
128
include:
139
- name: "Push Compile"
1410
if: type = push AND branch = develop
1511
install: yarn install
1612
before_script:
13+
- export TZ='Asia/Shanghai'
1714
- rm -rf dist
1815
- rm -rf examples/dist
1916
script:
@@ -26,7 +23,8 @@ jobs:
2623
- "git commit -m 'build: Travis CI automatic compilation'"
2724
- git push "https://juzi214032:${GITHUB_TOKEN}@github.com/TaleLin/lin-ui" HEAD:develop
2825
- name: "Check Compile"
29-
if: type = pull_request
26+
if: type = pull_request OR (type = push AND branch = master)
27+
before_install: export TZ='Asia/Shanghai'
3028
install: yarn install
3129
script:
3230
- yarn dev

build/index.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const path = require('path');
1717

1818
const componentData = require('./until');
1919
const result = `{common/*,behaviors,utils,${componentData()}}`;
20-
const isCustom = (result !== `{common/*,behaviors,utils,}`);
20+
const isCustom = (result !== '{common/*,behaviors,utils,}');
2121

2222
const distPath = path.resolve(__dirname, '../dist');
2323
const examplePath = path.resolve(__dirname, '../examples/dist');
@@ -74,11 +74,11 @@ module.exports = {
7474
),
7575
watch: parallel(
7676
() => {
77-
watch("../src/**/*.less", buildWxss(`${srcDevPath}/*.less`, `!${srcDevPath}/_*.less`, examplePath));
78-
watch("../src/**/*.wxml", copy(srcDevPath, examplePath, 'wxml'));
79-
watch("../src/**/*.wxs", copy(srcDevPath, examplePath, 'wxs'));
80-
watch("../src/**/*.json", copy(srcDevPath, examplePath, 'json'));
81-
watch("../src/**/*.js", copy(srcDevPath, examplePath, 'js'));
77+
watch('../src/**/*.less', buildWxss(`${srcDevPath}/*.less`, `!${srcDevPath}/_*.less`, examplePath));
78+
watch('../src/**/*.wxml', copy(srcDevPath, examplePath, 'wxml'));
79+
watch('../src/**/*.wxs', copy(srcDevPath, examplePath, 'wxs'));
80+
watch('../src/**/*.json', copy(srcDevPath, examplePath, 'json'));
81+
watch('../src/**/*.js', copy(srcDevPath, examplePath, 'js'));
8282
}
8383
)
8484
};

build/task.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ const copyStatic = (srcPath, distPath, env = 'build') => {
6464
copy(srcPath, distPath, 'png')
6565
);
6666
}
67-
}
67+
};
6868

6969
const clean = (cleanPath) => () =>
7070
del([cleanPath], {

build/until.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ const fs = require('fs');
22
let componentArr = [];
33

44
function componentData() {
5-
let data = fs.readFileSync(`../config/component.json`, 'utf-8');
5+
let data = fs.readFileSync('../config/component.json', 'utf-8');
66
let params = JSON.parse(data).components;
77
componentArr.push(...params);
88
forParams(params);

commitlint.config.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ module.exports = {
1212
'EsLint',
1313
'VuePress',
1414
'package.json',
15+
'TravisCI',
16+
'Husky',
1517
'README',
1618
'util',
1719
'.editorconfig',
@@ -62,7 +64,8 @@ module.exports = {
6264
'Counter',
6365
'SearchBar',
6466
'IndexList',
65-
'Behavior'
67+
'Behavior',
68+
'CapsuleBar'
6669
]
6770
]
6871
}

0 commit comments

Comments
 (0)