Skip to content

Commit 73395ea

Browse files
author
lifeifan
committed
v2.0.0-beta.2
2 parents d43099a + 8f3f7c0 commit 73395ea

29 files changed

+1097
-692
lines changed

.coveralls.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
service_name: travis-ci
2+
repo_token: bOzghLfr6hi9xqh8LDKUPB07Q56vdl1YG

.travis.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@ sudo: required
22
language: node_js
33
node_js:
44
- '8'
5+
cache: npm
56
script:
6-
- 'npm run test'
7-
before_script:
8-
- 'sudo chown root /opt/google/chrome/chrome-sandbox'
9-
- 'sudo chmod 4755 /opt/google/chrome/chrome-sandbox'
7+
- npm test
8+
- npm run coveralls

README.md

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# NutUI 2
2-
![npm version](https://img.shields.io/npm/v/@nutui/nutui.svg) [![Build Status](https://api.travis-ci.org/jdf2e/nutui.svg?branch=v2)](https://github.com/jdf2e/nutui/)
2+
![npm version](https://img.shields.io/npm/v/@nutui/nutui.svg) [![Build Status](https://api.travis-ci.org/jdf2e/nutui.svg?branch=v2)](https://github.com/jdf2e/nutui/) [![Coverage Status](https://coveralls.io/repos/github/jdf2e/nutui/badge.svg?branch=v2)](https://coveralls.io/github/jdf2e/nutui?branch=v2) ![license](https://img.shields.io/npm/l/@nutui/nutui.svg)
33

44
一套移动端轻量级Vue组件库
55

@@ -17,9 +17,9 @@
1717
* 支持多语言(国际化)
1818
* 支持 TypeScript
1919
* 支持服务端渲染(Vue SSR)
20-
* 配套有基于Webpack的构建工具,可快速创建已内置本组件库的Vue工程
20+
* 配套有基于Webpack的构建工具,可快速创建已内置本组件库的Vue工程
2121

22-
> 如需使用 1.x 版本,请指定版本号,如: `npm i @nutui/[email protected] -S`
22+
> 如需使用 1.x 版本,安装时请指定版本号,如: `npm i @nutui/[email protected] -S`
2323
2424
## 支持环境
2525

@@ -33,9 +33,17 @@
3333

3434
> 你还可以订阅: https://github.com/jdf2e/nutui/releases.atom 来获得稳定版发布的通知。
3535
36+
## 示例
37+
38+
![npm version](http://img13.360buyimg.com/uba/s300x300_jfs/t1/14144/37/3433/5890/5c26d976E7cd98b80/94583409233081cc.jpg)
39+
3640
## 安装使用
3741

38-
具体安装使用方法请参考 NutUI 官网 http://nutui.jd.com
42+
具体安装使用方法请参考 NutUI 官网
43+
44+
http://nutui.jd.com
45+
46+
文档:[2.X](http://nutui.jd.com/default.html#/start) | [1.X](http://nutui.jd.com/1x/index.html#/intro)
3947

4048
## 链接
4149
* [意见反馈](https://github.com/jdf2e/nutui/issues)

build/webpack.demo.build.conf.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
const webpack = require('webpack');
22
const baseConf = require('./webpack.demo.base.conf.js');
33
const merge = require('webpack-merge');
4+
const path = require('path');
5+
const CopyWebpackPlugin = require('copy-webpack-plugin');
46
const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
57
const OptimizeCSSAssetsPlugin = require('optimize-css-assets-webpack-plugin');
68
const rimraf = require('rimraf');
@@ -21,7 +23,10 @@ module.exports = merge(baseConf, {
2123
'process.env': {
2224
NODE_ENV: '"production"'
2325
}
24-
})
26+
}),
27+
new CopyWebpackPlugin([
28+
{ from: path.join(__dirname, "../sites/demo/asset/img/favicon.ico"), to: path.join(__dirname, "../dist/sites/")}
29+
]),
2530
],
2631
optimization: {
2732
minimizer: [

build/webpack.disperse.conf.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
const webpack = require('webpack');
2-
const config = require('../package.json');
32
const cptConf = require('../src/config.json');
43
const webpackBaseConf = require('./webpack.base.conf.js');
54
const path = require('path');

package.json

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@nutui/nutui",
3-
"version": "2.0.0-beta.1",
4-
"description": "一套移动端轻量级Vue组件库",
3+
"version": "2.0.0-beta.2",
4+
"description": "一套轻量级移动端Vue组件库",
55
"typings": "dist/types/index.d.ts",
66
"main": "dist/nutui.js",
77
"files": [
@@ -24,8 +24,8 @@
2424
"build": "npm run build:prod && npm run build:prodmin && npm run build:disp",
2525
"eslint": "eslint src/packages/**/*.{js,vue}",
2626
"add": "node scripts/createCptTpl.js",
27-
"test": "cross-env NODE_ENV=test mocha-webpack --webpack-config build/webpack.test.conf.js --require test/setup.js src/packages/*/__test__/**.spec.js",
28-
"cover": "cross-env NODE_ENV=test nyc --reporter=lcov --reporter=text npm run test",
27+
"test": "cross-env NODE_ENV=test nyc --reporter=lcov --reporter=text mocha-webpack --webpack-config build/webpack.test.conf.js --require test/setup.js src/packages/*/__test__/**.spec.js",
28+
"coveralls": "cat ./coverage/lcov.info | coveralls",
2929
"test:watch": "npm run test --watch"
3030
},
3131
"repository": {
@@ -63,6 +63,7 @@
6363
"@babel/core": "7.1.2",
6464
"@babel/plugin-syntax-dynamic-import": "7.0.0",
6565
"@babel/plugin-transform-runtime": "7.1.0",
66+
"istanbul-instrumenter-loader": "^3.0.1",
6667
"@babel/preset-env": "7.1.0",
6768
"@nutui/carefree": "^0.4.0",
6869
"@tweenjs/tween.js": "17.2.0",
@@ -82,6 +83,7 @@
8283
"chalk": "2.4.1",
8384
"copy": "0.3.2",
8485
"copy-webpack-plugin": "4.5.4",
86+
"coveralls": "^3.0.2",
8587
"cross-env": "5.2.0",
8688
"css-loader": "1.0.0",
8789
"eslint": "4.19.1",

scripts/md-to-other.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,12 @@ function createdFile(output, sorce,ishasCode) {
9898
<div v-html="content"></div>
9999
</div>`+ res + '</div></template>' + jsroot;
100100
var buf = new Buffer(bufs);
101-
fs.writeSync(fd, buf, 0, buf.length, 0);
101+
if( typeof fd == 'number'){
102+
fs.writeSync(fd, buf, 0, buf.length, 0);
103+
}else{
104+
console.log(pathSrc,' typeof fd != number 请改正文件')
105+
}
106+
102107
})
103108
}
104109
function fileDisplay(filePath,outPath,nohead) {

sites/demo/app.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import "core-js/modules/es6.array.iterator";
44
import Vue from 'vue';
55
import App from './App.vue';
66
import router from './router';
7-
import Conf from '../../src/config.json';
87
import NutUI from '../../src/nutui';
98
// import en from '../../src/locales/lang/en-US';
109
// import demoEN from './lang/en-US';
@@ -50,7 +49,7 @@ const app = new Vue({
5049
template: '<App/>'
5150
})
5251

53-
Vue.prototype.NUTCONF = Conf;
52+
//Vue.prototype.NUTCONF = Conf;
5453

5554

5655
let pageLoading = app.$toast.loading();

sites/demo/asset/img/favicon.ico

4.19 KB
Binary file not shown.

sites/demo/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
<head>
55
<meta charset="utf-8" />
66
<meta content="telephone=no" name="format-detection" />
7+
<link rel="shortcut icon" href="/favicon.ico">
78
<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport" />
89
<title>NutUI - 移动端Vue组件库</title>
910
<script src="//misc.360buyimg.com/felibs/vue/2.5.16/vue.min.js"></script>

sites/demo/router.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import Vue from 'vue';
22
import VueRouter from 'vue-router';
3-
import Conf from '../../src/config.json';
3+
import { packages } from '../../src/config.json';
44
import vueg from 'vueg';
55
import 'vueg/css/transition-min.css';
66

@@ -30,7 +30,7 @@ const routes = [
3030
];
3131

3232
//组件示例页面
33-
Conf.packages.map(item => {
33+
packages.map(item => {
3434
if (item.showDemo === false) return;
3535
const pkgName = item.name.toLowerCase();
3636
routes.push({

sites/demo/view/index.vue

Lines changed: 12 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,17 @@
44
<div class="version">NutUI 2.0</div>
55
<p>NutUI 是一套轻量级移动端Vue组件库。</p>
66
<div
7-
:class="['demo-list-box',{'unfold':foldStatus[sortIdx]}]"
8-
v-for="(sortName,sortIdx) in sorts"
9-
:key="sortIdx"
7+
:class="['demo-list-box',{'unfold':foldStatus[item]}]"
8+
v-for="item in sorts"
9+
:key="item"
1010
>
11-
<h4 @click="toggleFold(sortIdx)">
12-
{{sortName}}
11+
<h4 @click="toggleFold(item)">
12+
{{oriSorts[item]}}
1313
<i></i>
1414
</h4>
1515
<ul>
1616
<template v-for="cpt in packages">
17-
<li v-if="cpt.showDemo !== false && cpt.sort == sortIdx" :key="cpt.name">
17+
<li v-if="cpt.showDemo !== false && cpt.sort == item" :key="cpt.name">
1818
<a :href="'./demo.html#/'+cpt.name">
1919
{{cpt.name}}
2020
<span>{{cpt.chnName}}</span>
@@ -27,17 +27,17 @@
2727
</template>
2828

2929
<script>
30-
import Conf from "../../../src/config.json";
30+
import { packages,sorts } from "../../../src/config.json";
3131
export default {
3232
name: "index",
3333
data() {
3434
return {
3535
path: "",
3636
packages: {},
3737
sortedPackages: [],
38-
sorts: [],
39-
foldStatus: [],
40-
version: ""
38+
oriSorts:[],
39+
sorts: [1,2,0,3,4,5],
40+
foldStatus: []
4141
};
4242
},
4343
methods: {
@@ -47,18 +47,8 @@ export default {
4747
}
4848
},
4949
created() {
50-
this.packages = Conf.packages;
51-
this.version = Conf.version;
52-
//this.sorts = Conf.sorts;
53-
54-
this.sorts = [
55-
"数据录入",
56-
"操作反馈",
57-
"数据展示",
58-
"导航组件",
59-
"布局组件",
60-
"基础组件"
61-
];
50+
this.packages = packages;
51+
this.oriSorts = sorts;
6252
6353
this.foldStatus = Array(this.sorts.length)
6454
.join(",")

sites/doc/app.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ import 'highlight.js/styles/github.css';
2121
//import prettify from 'google-code-prettify/src/prettify';
2222
//import 'google-code-prettify/src/prettify.css';
2323
//import 'google-code-prettify/styles/sunburst.css';
24-
import Conf from '../../src/config.json';
2524
//import qrcode from './qrcode/index.js';
2625
import codes from 'qrcode';
2726
//import NutUI from '../../src/nutui.js';
@@ -37,6 +36,7 @@ new Vue({
3736
router,
3837
components: { App },
3938
template: '<App/>'
40-
})
41-
Vue.prototype.NUTCONF = Conf;
39+
});
40+
41+
//Vue.prototype.NUTCONF = Conf;
4242

0 commit comments

Comments
 (0)