Skip to content

Commit

Permalink
chore: 发布 0.8.3 版本
Browse files Browse the repository at this point in the history
  • Loading branch information
juzi214032 authored Jun 10, 2020
2 parents 8d3db24 + 74f0fe1 commit 9a688d7
Show file tree
Hide file tree
Showing 270 changed files with 4,464 additions and 2,938 deletions.
5 changes: 0 additions & 5 deletions .eslintignore

This file was deleted.

62 changes: 62 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{
"extends": [
"eslint:recommended",
"plugin:import/errors",
"plugin:import/warnings",
"plugin:promise/recommended"
],
"plugins": [
"import",
"promise"
],
"env": {
"node": true,
"es2017": true,
"browser": true,
"commonjs": true
},
"parserOptions": {
"ecmaVersion": 2018,
"sourceType": "module"
},
"globals": {
"Component": true,
"Page": true,
"wx": true,
"App": true
},
"ignorePatterns": [
"dist/*",
"examples/dist/*",
"src/common/async-validator/*",
"examples/pages/filter/components/wemark"
],
"rules": {
// 函数大括号前不允许加空格(已关闭)
"space-before-function-paren": "off",
// 缩进 2 个空格
"indent": ["error", 2],
// 必须使用单引号
"quotes": [
"error", "single", {
"allowTemplateLiterals": false
}
],
// 行尾必须添加分号
"semi": ["error"],
// 不允许使用 console.log()
"no-console": [
"warn", {
"allow": ["info", "warn", "error"]
}
],
// 禁止使用未声明的变量
"no-undef": "error",
// 禁止不必要的转义使用(已关闭)
"no-useless-escape": "off",
// 必须使用严格等于
"eqeqeq": ["error", "always"],
// promise 中必须要 return 语句(已关闭)
"promise/always-return": "off"
}
}
37 changes: 0 additions & 37 deletions .eslintrc.json

This file was deleted.

52 changes: 52 additions & 0 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
# For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages
# 在创建 release 后自动发布 npm 包


name: Node.js Package

on:
release:
types: [created]

jobs:
build:
name: 编译文件
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 12
- run: npm i
- run: npm lint
- run: npm run build
- run: npm run dev

publish-npm:
name: 发布到 npm
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 12
registry-url: https://registry.npmjs.org/
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}

publish-gpr:
name: 发布到 github pkg
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 12
registry-url: https://npm.pkg.github.com/
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
6 changes: 6 additions & 0 deletions .huskyrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"hooks": {
"pre-commit": "npm run lint && git restore -W -S dist examples/dist",
"commit-msg": "commitlint -e $GIT_PARAMS"
}
}
10 changes: 4 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
# 指定运行环境
language: node_js

node_js:
- lts/*

# 仅监控 master 分支
branches:
except:
- master

jobs:
include:
- name: "Push Compile"
if: type = push AND branch = develop
install: yarn install
before_script:
- export TZ='Asia/Shanghai'
- rm -rf dist
- rm -rf examples/dist
script:
Expand All @@ -26,7 +23,8 @@ jobs:
- "git commit -m 'build: Travis CI automatic compilation'"
- git push "https://juzi214032:${GITHUB_TOKEN}@github.com/TaleLin/lin-ui" HEAD:develop
- name: "Check Compile"
if: type = pull_request
if: type = pull_request OR (type = push AND branch = master)
before_install: export TZ='Asia/Shanghai'
install: yarn install
script:
- yarn dev
Expand Down
12 changes: 6 additions & 6 deletions build/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const path = require('path');

const componentData = require('./until');
const result = `{common/*,behaviors,utils,${componentData()}}`;
const isCustom = (result !== `{common/*,behaviors,utils,}`);
const isCustom = (result !== '{common/*,behaviors,utils,}');

const distPath = path.resolve(__dirname, '../dist');
const examplePath = path.resolve(__dirname, '../examples/dist');
Expand Down Expand Up @@ -74,11 +74,11 @@ module.exports = {
),
watch: parallel(
() => {
watch("../src/**/*.less", buildWxss(`${srcDevPath}/*.less`, `!${srcDevPath}/_*.less`, examplePath));
watch("../src/**/*.wxml", copy(srcDevPath, examplePath, 'wxml'));
watch("../src/**/*.wxs", copy(srcDevPath, examplePath, 'wxs'));
watch("../src/**/*.json", copy(srcDevPath, examplePath, 'json'));
watch("../src/**/*.js", copy(srcDevPath, examplePath, 'js'));
watch('../src/**/*.less', buildWxss(`${srcDevPath}/*.less`, `!${srcDevPath}/_*.less`, examplePath));
watch('../src/**/*.wxml', copy(srcDevPath, examplePath, 'wxml'));
watch('../src/**/*.wxs', copy(srcDevPath, examplePath, 'wxs'));
watch('../src/**/*.json', copy(srcDevPath, examplePath, 'json'));
watch('../src/**/*.js', copy(srcDevPath, examplePath, 'js'));
}
)
};
2 changes: 1 addition & 1 deletion build/task.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ const copyStatic = (srcPath, distPath, env = 'build') => {
copy(srcPath, distPath, 'png')
);
}
}
};

const clean = (cleanPath) => () =>
del([cleanPath], {
Expand Down
2 changes: 1 addition & 1 deletion build/until.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const fs = require('fs');
let componentArr = [];

function componentData() {
let data = fs.readFileSync(`../config/component.json`, 'utf-8');
let data = fs.readFileSync('../config/component.json', 'utf-8');
let params = JSON.parse(data).components;
componentArr.push(...params);
forParams(params);
Expand Down
5 changes: 4 additions & 1 deletion commitlint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ module.exports = {
'EsLint',
'VuePress',
'package.json',
'TravisCI',
'Husky',
'README',
'util',
'.editorconfig',
Expand Down Expand Up @@ -62,7 +64,8 @@ module.exports = {
'Counter',
'SearchBar',
'IndexList',
'Behavior'
'Behavior',
'CapsuleBar'
]
]
}
Expand Down
2 changes: 1 addition & 1 deletion dist/arc-popup/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 7 additions & 2 deletions dist/arc-popup/index.wxml
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
<l-popup show="{{show}}" direction="{{direction}}" transition="{{transition}}" opacity="{{opacity}}" locked="{{locked}}" z-index="{{zIndex}}" l-class="l-class" l-bg-class="l-bg-class" bind:lintap="onArcPopupTap">
<scroll-view scroll-y="true" class="content-arc-popup l-panel-class" style="{{arcStyle}}">
<slot></slot>
<scroll-view scroll-y="true" class="arc-popup l-panel-class" style="{{arcStyle}}">
<view class="header-popup {{headerFixed ? 'fixed' : ''}} l-header-class">
<slot name="header"/>
</view>
<view class="content-arc-popup">
<slot/>
</view>
</scroll-view>
</l-popup>
2 changes: 1 addition & 1 deletion dist/arc-popup/index.wxss
Original file line number Diff line number Diff line change
@@ -1 +1 @@
.container-arc-popup{width:100%}.content-arc-popup{width:100%;background:#fff;padding:20rpx;box-sizing:border-box}
.container-arc-popup{width:100%}.arc-popup{overflow:hidden;width:100%;background:#fff}.content-arc-popup{padding:30rpx;box-sizing:border-box}.header-popup{width:100%;z-index:999}.header-popup.fixed{position:sticky;top:0;background-color:#fff}
2 changes: 1 addition & 1 deletion dist/behaviors/scrollCenter.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added dist/capsule-bar/icons/capsule-left-black.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added dist/capsule-bar/icons/capsule-left-white.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added dist/capsule-bar/icons/capsule-right-black.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added dist/capsule-bar/icons/capsule-right-white.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions dist/capsule-bar/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions dist/capsule-bar/index.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"component":true}
35 changes: 35 additions & 0 deletions dist/capsule-bar/index.wxml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@


<view class="container" style="padding-top: {{hasPadding?titleBarHeight+statusBarHeight:'0'}}rpx">

<cover-view class="capsule-bar" style="background-color: {{bgColor}};">


<cover-view class="status-bar" style="height: {{statusBarHeight+4}}rpx;background-color: {{statusBarColor}};"></cover-view>


<cover-view class="title-bar" style="height: {{titleBarHeight}}rpx;background-color: {{titleBarColor}};">
<cover-view class="title l-title-class" style="color: {{titleColor}};">{{title}}</cover-view>
</cover-view>


<cover-view wx:if="{{!hiddenCapsule}}" class="capsule-button" style="border-color: rgba({{capsuleColor==='black'?'0,0,0,0.1':'255,255,255,0.25'}});background-color: rgba({{capsuleColor==='black'?'255,255,255,0.6':'0,0,0,0.15'}});width: {{capsuleButtonInfo.width}}px;height: {{capsuleButtonInfo.height}}px;left: {{capsuleButtonInfo.left}}px;top: {{capsuleButtonInfo.top}}px;">

<cover-view catch:tap="onTapLeftButton" catch:longpress="onLongPressLeftButton" hover-class="icon-wrapper-hover-{{capsuleColor}}" class="icon-wrapper" style="width: {{capsuleButtonInfo.width/2}}px;height: {{capsuleButtonInfo.height}}px;">
<cover-image class="icon-left" src="icons/capsule-left-{{capsuleColor}}.png"></cover-image>
</cover-view>


<cover-view class="line"></cover-view>


<cover-view catch:tap="onTapRightButton" catch:longpress="onLongPressRightButton" hover-class="icon-wrapper-hover-{{capsuleColor}}" class="icon-wrapper" style="width: {{capsuleButtonInfo.width/2}}px;height: {{capsuleButtonInfo.height}}px;">
<cover-image class="icon-right" src="icons/capsule-right-{{capsuleColor}}.png"></cover-image>
</cover-view>
</cover-view>
</cover-view>

<view class="content-container">
<slot></slot>
</view>
</view>
1 change: 1 addition & 0 deletions dist/capsule-bar/index.wxss
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.container{position:relative}.container .capsule-bar{width:100%;position:fixed;display:flex;flex-direction:column;top:0;left:0;z-index:999}.container .capsule-bar .status-bar{width:100%}.container .capsule-bar .title-bar{width:100%;display:flex;align-items:center;justify-content:center;margin-top:-4rpx;padding-top:4rpx;box-sizing:border-box}.container .capsule-bar .title-bar .title{font-size:36rpx;font-weight:700}.container .capsule-bar .capsule-button{border-radius:99999px;display:flex;align-items:center;border:1px solid rgba(0,0,0,.1);position:fixed}.container .capsule-bar .capsule-button .icon-wrapper-hover-black{background-color:rgba(0,0,0,.36)}.container .capsule-bar .capsule-button .icon-wrapper-hover-white{background-color:rgba(255,255,255,.339)}.container .capsule-bar .capsule-button .icon-wrapper{display:flex;justify-content:center;align-items:center}.container .capsule-bar .capsule-button .icon-wrapper .icon-left{display:block;width:20rpx;height:34rpx}.container .capsule-bar .capsule-button .icon-wrapper .icon-right{display:block;width:38rpx;height:34rpx}.container .capsule-bar .capsule-button .line{height:18px;width:1px;line-height:1;background-color:rgba(255,255,255,.25)}.container .content-container{width:100%;position:absolute;left:0}
Loading

0 comments on commit 9a688d7

Please sign in to comment.