Merge pull request #10 from QingWei-Li/master

Use cooking@1.0.0-rc.2
This commit is contained in:
baiyaaaaa 2016-09-06 16:33:06 +08:00 committed by GitHub
commit 8c3b57afdc
46 changed files with 111 additions and 177 deletions

View File

@ -1,5 +1,5 @@
{
"presets": ["es2015-loose"],
"presets": [["es2015", { "loose": true }]],
"plugins": ["transform-vue-jsx"],
"comments": false
}

View File

@ -5,15 +5,12 @@ default: help
build-theme: build-theme-default
build-theme-default:
packages/theme-default/node_modules/.bin/gulp build --gulpfile packages/theme-default/gulpfile.js
cp -rf packages/theme-default/lib lib/theme-default
npm run build:theme
install:
npm i --registry=http://registry.npm.taobao.org --ignore-scripts --loglevel=error
./node_modules/.bin/lerna bootstrap
dev: install
node bin/iconInit.js
dev:
npm run dev
new:
@ -21,11 +18,9 @@ new:
dist:
npm run dist
make build-theme
dist-all:
node bin/build-all.js
make build-theme
npm run dist:all
deploy: install
@npm run deploy
@ -38,8 +33,8 @@ gh-docs:
pub:
./node_modules/.bin/kp $(filter-out $@,$(MAKECMDGOALS))
pub-all: dist-all
./node_modules/.bin/lerna publish
pub-all:
npm run pub:all
help:
@echo " \033[35mmake\033[0m \033[1m命令使用说明\033[0m"

View File

@ -31,8 +31,8 @@ import {
// ...
} from 'element-ui'
Vue.component(Select.name, ElSelect)
Vue.component(Button.name, ElButton)
Vue.component(Select.name, Select)
Vue.component(Button.name, Button)
```
(roughly) to
@ -50,8 +50,8 @@ import Select from 'element-ui/lib/theme-default/select.css';
import Button from 'element-ui/lib/button';
import Button from 'element-ui/lib/theme-default/button.css';
Vue.component(Select.name, ElSelect)
Vue.component(Button.name, ElButton)
Vue.component(Select.name, Select)
Vue.component(Button.name, Button)
```
## babel-plugin-component
@ -70,20 +70,16 @@ Vue.component(Button.name, ElButton)
## development
### Building Tool Installation
```shell
# development => install packages -> build icon etc. -> run webpack
$ npm run dev
Element UI is built with [cooking](http://cookingjs.github.io/). So before running it you'll need to install [cooking](http://cookingjs.github.io/) globally.
# Recommended use `npminstall` to install packages, it is so fast
$ npm i npminstall -g
$ npminstall
```bash
$ npm install cooking -g
```
### Commands
```bash
$ make install --- install dependencies
$ make dev --- develop mode
$ make dist --- compile the project
$ make dist-all --- compile each component individually
# build => build all component
$ npm run dist
```
## Changelog

View File

@ -41,9 +41,7 @@ cooking.set({
template: false,
format: 'umd',
moduleName: 'El${ComponentName}',
extractCSS: 'style.css',
extends: ['vue', 'saladcss']
extends: ['vue2']
});
cooking.add('resolve.alias', {

View File

@ -8,11 +8,15 @@
"src"
],
"scripts": {
"dev": "node bin/build-entry.js && cooking watch -c scripts/cooking.demo.js",
"dist": "rm -rf lib && cooking build -c scripts/cooking.conf.js -p && cooking build -c scripts/cooking.component.js -p",
"dev": "npm i && (node bin/iconInit.js & node bin/build-entry.js) && cooking watch -c scripts/cooking.demo.js",
"dist": "rm -rf lib && cooking build -c scripts/cooking.conf.js -p && cooking build -c scripts/cooking.component.js -p && npm run build:theme",
"dist:all": "node bin/build-all.js && npm run build:theme",
"build:theme": "gulp build --gulpfile packages/theme-default/gulpfile.js && cp -rf packages/theme-default/lib lib/theme-default",
"deploy": "cooking build -c scripts/cooking.demo.js -p",
"gh-docs": "cooking build -c scripts/cooking.demo.js -p && gh-pages -d examples/element-ui --remote origin",
"prepublish": "make dist"
"postinstall": "lerna bootstrap",
"pub": "npm run dist && kp",
"pub:all": "npm run dist:all && lerna publish"
},
"repository": {
"type": "git",
@ -27,27 +31,42 @@
"url": "https://github.com/eleme/element-ui/issues"
},
"devDependencies": {
"theaterjs": "^3.0.0",
"object-assign": "^4.1.0",
"babel-core": "^6.14.0",
"babel-helper-vue-jsx-merge-props": "^1.0.1",
"babel-loader": "^6.2.5",
"babel-plugin-syntax-jsx": "^6.8.0",
"babel-plugin-transform-vue-jsx": "^3.1.0",
"babel-preset-es2015-loose": "^7.0.0",
"babel-preset-es2015": "^6.14.0",
"cheerio": "^0.18.0",
"cooking": "^1.0.0-rc.2",
"cooking-lint": "^0.1.2",
"cooking-vue2": "^0.1.4",
"css-loader": "^0.24.0",
"extract-text-webpack-plugin": "^1.0.1",
"file-loader": "^0.9.0",
"file-save": "^0.2.0",
"gh-pages": "^0.11.0",
"highlight.js": "^9.3.0",
"html-loader": "^0.4.3",
"html-webpack-plugin": "^2.22.0",
"json-loader": "^0.5.4",
"json-templater": "^1.0.4",
"lerna": "2.0.0-beta.18",
"markdown-it-container": "^2.0.0",
"markdown-it-toc-and-anchor": "^4.1.1",
"oui-dom-events": "^0.2.1",
"postcss": "^5.0.21",
"cheerio": "^0.18.0",
"object-assign": "^4.1.0",
"postcss": "^5.1.2",
"postcss-loader": "^0.11.1",
"postcss-salad": "^1.0.5",
"style-loader": "^0.13.1",
"theaterjs": "^3.0.0",
"uppercamelcase": "^1.1.0",
"url-loader": "^0.5.7",
"vue": "^2.0.0-rc.3",
"vue-loader": "^9.4.0",
"vue-markdown-loader": "^0.4.0",
"vue-popup": "^0.2.3",
"vue-router": "^2.0.0-beta.2"
"vue-router": "^2.0.0-beta.2",
"webpack": "^1.13.2",
"webpack-dev-server": "^1.15.1"
}
}

View File

@ -9,9 +9,7 @@ cooking.set({
template: false,
format: 'umd',
moduleName: 'ElAlert',
extractCSS: 'style.css',
extends: ['vue', 'saladcss']
extends: ['vue2']
});
cooking.add('resolve.alias', {

View File

@ -9,9 +9,7 @@ cooking.set({
template: false,
format: 'umd',
moduleName: 'ElAutocomplete',
extractCSS: 'style.css',
extends: ['vue', 'saladcss']
extends: ['vue2']
});
cooking.add('resolve.alias', {

View File

@ -9,9 +9,7 @@ cooking.set({
template: false,
format: 'umd',
moduleName: 'ElBadge',
extractCSS: 'style.css',
extends: ['vue', 'saladcss']
extends: ['vue2']
});
cooking.add('resolve.alias', {

View File

@ -9,9 +9,7 @@ cooking.set({
template: false,
format: 'umd',
moduleName: 'ElBreadcrumb',
extractCSS: 'style.css',
extends: ['vue', 'saladcss']
extends: ['vue2']
});
cooking.add('resolve.alias', {

View File

@ -9,9 +9,7 @@ cooking.set({
template: false,
format: 'umd',
moduleName: 'ElButton',
extractCSS: 'style.css',
extends: ['vue', 'saladcss']
extends: ['vue2']
});
cooking.add('resolve.alias', {

View File

@ -9,9 +9,7 @@ cooking.set({
template: false,
format: 'umd',
moduleName: 'ElCard',
extractCSS: 'style.css',
extends: ['vue', 'saladcss']
extends: ['vue2']
});
cooking.add('resolve.alias', {

View File

@ -9,9 +9,7 @@ cooking.set({
template: false,
format: 'umd',
moduleName: 'ElCascader',
extractCSS: 'style.css',
extends: ['vue', 'saladcss']
extends: ['vue2']
});
cooking.add('resolve.alias', {

View File

@ -9,9 +9,7 @@ cooking.set({
template: false,
format: 'umd',
moduleName: 'ElCheckbox',
extractCSS: 'style.css',
extends: ['vue', 'saladcss']
extends: ['vue2']
});
cooking.add('resolve.alias', {

View File

@ -9,9 +9,7 @@ cooking.set({
template: false,
format: 'umd',
moduleName: 'ElCol',
extractCSS: 'style.css',
extends: ['vue', 'saladcss']
extends: ['vue2']
});
cooking.add('resolve.alias', {

View File

@ -3,15 +3,13 @@ var path = require('path');
cooking.set({
entry: {
index: path.join(__dirname, '_index.js')
index: path.join(__dirname, 'index.js')
},
dist: path.join(__dirname, 'lib'),
template: false,
format: 'umd',
moduleName: 'ElDatePicker',
extractCSS: 'style.css',
extends: ['vue', 'saladcss']
extends: ['vue2']
});
cooking.add('resolve.alias', {

View File

@ -9,9 +9,7 @@ cooking.set({
template: false,
format: 'umd',
moduleName: 'ElDialog',
extractCSS: 'style.css',
extends: ['vue', 'saladcss']
extends: ['vue2']
});
cooking.add('resolve.alias', {

View File

@ -9,9 +9,7 @@ cooking.set({
template: false,
format: 'umd',
moduleName: 'ElDropdown',
extractCSS: 'style.css',
extends: ['vue', 'saladcss']
extends: ['vue2']
});
cooking.add('resolve.alias', {

View File

@ -9,9 +9,7 @@ cooking.set({
template: false,
format: 'umd',
moduleName: 'ElForm',
extractCSS: 'style.css',
extends: ['vue', 'saladcss']
extends: ['vue2']
});
cooking.add('resolve.alias', {

View File

@ -9,9 +9,7 @@ cooking.set({
template: false,
format: 'umd',
moduleName: 'ElInputNumber',
extractCSS: 'style.css',
extends: ['vue', 'saladcss']
extends: ['vue2']
});
cooking.add('resolve.alias', {

View File

@ -9,9 +9,7 @@ cooking.set({
template: false,
format: 'umd',
moduleName: 'ElInput',
extractCSS: 'style.css',
extends: ['vue', 'saladcss']
extends: ['vue2']
});
cooking.add('resolve.alias', {

View File

@ -9,9 +9,7 @@ cooking.set({
template: false,
format: 'umd',
moduleName: 'ElLoading',
extractCSS: 'style.css',
extends: ['vue', 'saladcss']
extends: ['vue2']
});
cooking.add('resolve.alias', {

View File

@ -9,9 +9,7 @@ cooking.set({
template: false,
format: 'umd',
moduleName: 'ElMenu',
extractCSS: 'style.css',
extends: ['vue', 'saladcss']
extends: ['vue2']
});
cooking.add('resolve.alias', {

View File

@ -9,9 +9,7 @@ cooking.set({
template: false,
format: 'umd',
moduleName: 'ElMessageBox',
extractCSS: 'style.css',
extends: ['vue', 'saladcss']
extends: ['vue2']
});
cooking.add('resolve.alias', {

View File

@ -9,9 +9,7 @@ cooking.set({
template: false,
format: 'umd',
moduleName: 'ElMessage',
extractCSS: 'style.css',
extends: ['vue', 'saladcss']
extends: ['vue2']
});
cooking.add('resolve.alias', {

View File

@ -9,9 +9,7 @@ cooking.set({
template: false,
format: 'umd',
moduleName: 'ElNotification',
extractCSS: 'style.css',
extends: ['vue', 'saladcss']
extends: ['vue2']
});
cooking.add('resolve.alias', {

View File

@ -9,9 +9,7 @@ cooking.set({
template: false,
format: 'umd',
moduleName: 'ElPagination',
extractCSS: 'style.css',
extends: ['vue', 'saladcss']
extends: ['vue2']
});
cooking.add('resolve.alias', {

View File

@ -9,9 +9,7 @@ cooking.set({
template: false,
format: 'umd',
moduleName: 'ElPopover',
extractCSS: 'style.css',
extends: ['vue', 'saladcss']
extends: ['vue2']
});
cooking.add('resolve.alias', {

View File

@ -9,9 +9,7 @@ cooking.set({
template: false,
format: 'umd',
moduleName: 'ElProgress',
extractCSS: 'style.css',
extends: ['vue', 'saladcss']
extends: ['vue2']
});
cooking.add('resolve.alias', {

View File

@ -9,9 +9,7 @@ cooking.set({
template: false,
format: 'umd',
moduleName: 'ElCascader',
extractCSS: 'style.css',
extends: ['vue', 'saladcss']
extends: ['vue2']
});
cooking.add('resolve.alias', {

View File

@ -9,9 +9,7 @@ cooking.set({
template: false,
format: 'umd',
moduleName: 'ElRate',
extractCSS: 'style.css',
extends: ['vue', 'saladcss']
extends: ['vue2']
});
cooking.add('resolve.alias', {

View File

@ -9,9 +9,7 @@ cooking.set({
template: false,
format: 'umd',
moduleName: 'ElRow',
extractCSS: 'style.css',
extends: ['vue', 'saladcss']
extends: ['vue2']
});
cooking.add('resolve.alias', {

View File

@ -9,9 +9,7 @@ cooking.set({
template: false,
format: 'umd',
moduleName: 'ElSelectMenu',
extractCSS: 'style.css',
extends: ['vue', 'saladcss']
extends: ['vue2']
});
cooking.add('resolve.alias', {

View File

@ -9,9 +9,7 @@ cooking.set({
template: false,
format: 'umd',
moduleName: 'ElSelect',
extractCSS: 'style.css',
extends: ['vue', 'saladcss']
extends: ['vue2']
});
cooking.add('resolve.alias', {

View File

@ -9,9 +9,7 @@ cooking.set({
template: false,
format: 'umd',
moduleName: 'ElSlider',
extractCSS: 'style.css',
extends: ['vue', 'saladcss']
extends: ['vue2']
});
cooking.add('resolve.alias', {

View File

@ -9,9 +9,7 @@ cooking.set({
template: false,
format: 'umd',
moduleName: 'ElSpinner',
extractCSS: 'style.css',
extends: ['vue', 'saladcss']
extends: ['vue2']
});
cooking.add('resolve.alias', {

View File

@ -9,9 +9,7 @@ cooking.set({
template: false,
format: 'umd',
moduleName: 'ElSteps',
extractCSS: 'style.css',
extends: ['vue', 'saladcss']
extends: ['vue2']
});
cooking.add('resolve.alias', {

View File

@ -9,9 +9,7 @@ cooking.set({
template: false,
format: 'umd',
moduleName: 'ElCascader',
extractCSS: 'style.css',
extends: ['vue', 'saladcss']
extends: ['vue2']
});
cooking.add('resolve.alias', {

View File

@ -9,9 +9,7 @@ cooking.set({
template: false,
format: 'umd',
moduleName: 'ElTable',
extractCSS: 'style.css',
extends: ['vue', 'saladcss']
extends: ['vue2']
});
cooking.add('resolve.alias', {

View File

@ -9,9 +9,7 @@ cooking.set({
template: false,
format: 'umd',
moduleName: 'ElTabs',
extractCSS: 'style.css',
extends: ['vue', 'saladcss']
extends: ['vue2']
});
cooking.add('resolve.alias', {

View File

@ -9,9 +9,7 @@ cooking.set({
template: false,
format: 'umd',
moduleName: 'ElTag',
extractCSS: 'style.css',
extends: ['vue', 'saladcss']
extends: ['vue2']
});
cooking.add('resolve.alias', {

View File

@ -9,9 +9,7 @@ cooking.set({
template: false,
format: 'umd',
moduleName: 'ElTooltip',
extractCSS: 'style.css',
extends: ['vue', 'saladcss']
extends: ['vue2']
});
cooking.add('resolve.alias', {

View File

@ -9,9 +9,7 @@ cooking.set({
template: false,
format: 'umd',
moduleName: 'ElTree',
extractCSS: 'style.css',
extends: ['vue', 'saladcss']
extends: ['vue2']
});
cooking.add('resolve.alias', {

View File

@ -9,9 +9,7 @@ cooking.set({
template: false,
format: 'umd',
moduleName: 'ElUpload',
extractCSS: 'style.css',
extends: ['vue', 'saladcss']
extends: ['vue2']
});
cooking.add('resolve.alias', {

View File

@ -14,10 +14,9 @@ cooking.set({
entry: entries,
dist: './lib',
clean: false,
template: false,
format: 'cjs',
extractCSS: '[name]/style.css',
extends: ['vue']
extends: ['vue2']
});
cooking.add('output.filename', '[name]/index.js');

View File

@ -5,11 +5,10 @@ cooking.set({
entry: './src/index.js',
dist: './lib',
clean: false,
template: false,
format: 'umd',
moduleName: 'ELEMENT',
extractCSS: 'style.css',
extends: ['vue']
extends: ['vue2']
});
cooking.add('output.filename', 'index.js');

View File

@ -18,7 +18,6 @@ cooking.set({
},
dist: './examples/element-ui/',
template: './examples/index.template.html',
publicPath: '/element-ui/',
hash: true,
devServer: {
@ -26,27 +25,32 @@ cooking.set({
log: false,
publicPath: '/'
},
minimize: true,
chunk: 'vendor',
extractCSS: true,
extends: {
vue: true,
lint: true,
saladcss: {
browser: ['ie > 8', 'last 2 version'],
features: {
'bem': {
'shortcuts': {
'component': 'b',
'modifier': 'm',
'descendent': 'e'
extends: ['vue2', 'lint'],
postcss: function(webapck) {
return [
require('postcss-salad')({
browser: ['ie > 8', 'last 2 version'],
features: {
'partialImport': {
addDependencyTo: webapck
},
'separators': {
'descendent': '__',
'modifier': '--'
'bem': {
'shortcuts': {
'component': 'b',
'modifier': 'm',
'descendent': 'e'
},
'separators': {
'descendent': '__',
'modifier': '--'
}
}
}
}
}
})
]
}
});