Skip to content

Commit

Permalink
feat:发布0.5.9
Browse files Browse the repository at this point in the history
- 修复按需加载某些情况下缺少common文件的bug (#364)
- 修复评分事件名问题,以及actionsheet遮罩错误 (#368)
  • Loading branch information
7insummer authored Jul 24, 2019
2 parents 36b9b88 + d05c62c commit 83ae045
Show file tree
Hide file tree
Showing 221 changed files with 86 additions and 6,930 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<div align="center">

![](https://img.shields.io/badge/build-passing-00d508.svg)
![](https://img.shields.io/badge/version-0.5.8-3963bc.svg)
![](https://img.shields.io/badge/version-0.5.9-3963bc.svg)
![](https://img.shields.io/badge/license-MIT-3963bc.svg)

</div>
Expand All @@ -39,7 +39,7 @@ Lin UI 是基于 **微信小程序原生语法** 实现的组件库。遵循简

## 最新版本

核心库:0.5.8
核心库:0.5.9

示例工程:0.0.1-alpha.2

Expand Down
48 changes: 24 additions & 24 deletions build/build-dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,48 +4,48 @@ const cssmin = require('gulp-clean-css');
const rename = require('gulp-rename');

gulp.task('dispose-wxs', () => {
return gulp.src(['../src/**/*.wxs'])
.pipe(gulp.dest('../examples/dist/'));
return gulp.src(['../src/**/*.wxs'])
.pipe(gulp.dest('../examples/dist/'));
});

gulp.task('dispose-css', () => {
return gulp.src(['../src/**/*.less', '!../src/**/_*.less'])
.pipe(less())
.pipe(cssmin())
.pipe(rename((path) => {
path.extname = '.wxss';
}))
.pipe(gulp.dest('../examples/dist/'));
return gulp.src(['../src/**/*.less', '!../src/**/_*.less'])
.pipe(less())
.pipe(cssmin())
.pipe(rename((path) => {
path.extname = '.wxss';
}))
.pipe(gulp.dest('../examples/dist/'));
});

gulp.task('dispose-js', () => {
return gulp.src(['../src/**/*.js'])
.pipe(gulp.dest('../examples/dist/'));
return gulp.src(['../src/**/*.js'])
.pipe(gulp.dest('../examples/dist/'));
});

gulp.task('dispose-json', () => {
return gulp.src(['../src/**/*.json'])
.pipe(gulp.dest('../examples/dist/'));
return gulp.src(['../src/**/*.json'])
.pipe(gulp.dest('../examples/dist/'));
});

gulp.task('dispose-wxml', () => {
return gulp.src(['../src/**/*.wxml'])
.pipe(gulp.dest('../examples/dist/'));
return gulp.src(['../src/**/*.wxml'])
.pipe(gulp.dest('../examples/dist/'));
});

// copy
gulp.task('copy', () => {
return gulp.src('../src/**/image/**')
.pipe(gulp.dest('../examples/dist/'))
});
return gulp.src('../src/**/image/**')
.pipe(gulp.dest('../examples/dist/'));
});

gulp.task('watch', () => {
gulp.watch('../src/**/*.less', gulp.series('dispose-css'));
gulp.watch('../src/**/*.js', gulp.series('dispose-js'));
gulp.watch('../src/**/*.wxs', gulp.series('dispose-wxs'));
gulp.watch('../src/**/*.json', gulp.series('dispose-json'));
gulp.watch('../src/**/*.wxml', gulp.series('dispose-wxml'));
gulp.watch('../src/**/image/*', gulp.series('copy'));
gulp.watch('../src/**/*.less', gulp.series('dispose-css'));
gulp.watch('../src/**/*.js', gulp.series('dispose-js'));
gulp.watch('../src/**/*.wxs', gulp.series('dispose-wxs'));
gulp.watch('../src/**/*.json', gulp.series('dispose-json'));
gulp.watch('../src/**/*.wxml', gulp.series('dispose-wxml'));
gulp.watch('../src/**/image/*', gulp.series('copy'));
});

gulp.task('default',gulp.series('dispose-css', 'dispose-js', 'dispose-wxs','dispose-json', 'dispose-wxml', 'copy', 'watch'));
64 changes: 32 additions & 32 deletions build/build-prod.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,61 +3,61 @@ const less = require('gulp-less');
const cssmin = require('gulp-clean-css');
const rename = require('gulp-rename');
const componentData = require('./build-tool');
const result = componentData();
const result = `{common,behaviors,${componentData()}}`;

// js => js
gulp.task('dispose-js', () => {
const path = result ? `../src/{${ result }}/*.js` : '../src/**/*.js'
return gulp.src(path)
.pipe(gulp.dest('../dist/'));
const path = result ? `../src/${result}/*.js` : '../src/**/*.js';
return gulp.src(path)
.pipe(gulp.dest('../dist/'));
});


gulp.task('dispose-wxss', () => {
const path = result ? `../src/{${ result }}/*.less` : '../src/**/*.less',
remainPath = result ? `!../src/{${ result }}/_*.less` : '!../src/**/_*.less';
return gulp.src([path, remainPath])
.pipe(less())
.pipe(cssmin())
.pipe(rename((path) => {
path.extname = '.wxss';
}))
.pipe(gulp.dest('../dist/'));
const path = result ? `../src/${result}/*.less` : '../src/**/*.less',
remainPath = result ? `!../src/${result}/_*.less` : '!../src/**/_*.less';
return gulp.src([path, remainPath])
.pipe(less())
.pipe(cssmin())
.pipe(rename((path) => {
path.extname = '.wxss';
}))
.pipe(gulp.dest('../dist/'));
});

// wxs => wxs
gulp.task('dispose-wxs', () => {
const path = result ? `../src/{${ result }}/*.wxs` : '../src/**/*.wxs'
return gulp.src(path)
.pipe(gulp.dest('../dist/'));
const path = result ? `../src/${result}/*.wxs` : '../src/**/*.wxs';
return gulp.src(path)
.pipe(gulp.dest('../dist/'));
});

// json => json
gulp.task('dispose-json', () => {
const path = result ? `../src/{${ result }}/*.json` : '../src/**/*.json'
return gulp.src(path)
.pipe(gulp.dest('../dist/'));
const path = result ? `../src/${result}/*.json` : '../src/**/*.json';
return gulp.src(path)
.pipe(gulp.dest('../dist/'));
});

// wxml => wxml
gulp.task('dispose-wxml', () => {
const path = result ? `../src/{${ result }}/*.wxml` : '../src/**/*.wxml'
return gulp.src(path)
.pipe(gulp.dest('../dist/'));
const path = result ? `../src/${result}/*.wxml` : '../src/**/*.wxml';
return gulp.src(path)
.pipe(gulp.dest('../dist/'));
});

// copy
gulp.task('dispose-copy', () => {
const path = result ? `../src/{${ result }}/image/**` : '../src/**/image/**'
return gulp.src(path)
.pipe(gulp.dest('../dist/'))
const path = result ? `../src/${result}/image/**` : '../src/**/image/**';
return gulp.src(path)
.pipe(gulp.dest('../dist/'));
});

gulp.task('default', gulp.series(
'dispose-js',
'dispose-wxss',
'dispose-wxml',
'dispose-wxs',
'dispose-copy',
'dispose-json'
gulp.task('default', gulp.series(
'dispose-js',
'dispose-wxss',
'dispose-wxml',
'dispose-wxs',
'dispose-copy',
'dispose-json'
));
46 changes: 23 additions & 23 deletions build/build-tool.js
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
const fs = require('fs')
let componentArr = []
const fs = require('fs');
let componentArr = [];

function componentData () {
let data = fs.readFileSync(`../config/component.json`, 'utf-8')
let params = JSON.parse(data).components
componentArr.push(...params)
forParams(params)
let result = [...new Set(componentArr)].join()
return result
};
function componentData() {
let data = fs.readFileSync(`../config/component.json`, 'utf-8');
let params = JSON.parse(data).components;
componentArr.push(...params);
forParams(params);
let result = [...new Set(componentArr)].join();
return result;
}

const forParams = (arr) => {
let finishArr = []
let finishArr = [];
arr.map(item => {
let data = fs.readFileSync(`../src/${item}/index.json`, 'utf-8')
const params = JSON.parse(data)
const { usingComponents } = params
let data = fs.readFileSync(`../src/${item}/index.json`, 'utf-8');
const params = JSON.parse(data);
const { usingComponents } = params;
if (usingComponents && !isEmptyObj(usingComponents)) {
for (let key in usingComponents) {
let keyComponent = key.substring(2, key.length)
finishArr.push(keyComponent)
let keyComponent = key.substring(2, key.length);
finishArr.push(keyComponent);
}
componentArr.push(...finishArr)
forParams(finishArr)
componentArr.push(...finishArr);
forParams(finishArr);
}
})
}
});
};

const isEmptyObj = (obj) => {
let result = (JSON.stringify(obj) === "{}");
return result
}
let result = (JSON.stringify(obj) === '{}');
return result;
};

module.exports = componentData;
125 changes: 0 additions & 125 deletions dist/action-sheet/index.js

This file was deleted.

8 changes: 0 additions & 8 deletions dist/action-sheet/index.json

This file was deleted.

Loading

0 comments on commit 83ae045

Please sign in to comment.