diff --git a/.babelrc b/.babelrc
new file mode 100644
index 000000000..e6e1f2fe2
--- /dev/null
+++ b/.babelrc
@@ -0,0 +1,8 @@
+{
+ "presets": [
+ "es2015"
+ ],
+ "plugins": [
+ "transform-vue-jsx"
+ ]
+}
\ No newline at end of file
diff --git a/.gitignore b/.gitignore
index 5306c013b..4c1cab8de 100644
--- a/.gitignore
+++ b/.gitignore
@@ -9,3 +9,4 @@ lib/*
!lib/style.css
node_modules
example/dist
+dist
diff --git a/Makefile b/Makefile
index bf8f2f463..ab0038d6a 100644
--- a/Makefile
+++ b/Makefile
@@ -11,4 +11,4 @@ init:
node build/bin/init.js $(filter-out $@,$(MAKECMDGOALS))
dev:
- npm run docs
+ npm run dev
diff --git a/README.md b/README.md
index e69de29bb..cb6383067 100644
--- a/README.md
+++ b/README.md
@@ -0,0 +1,35 @@
+## 下载项目
+```bash
+git@gitlab.qima-inc.com:fe/oxygen.git
+cd oxygen
+```
+
+## 安装组件依赖库
+```bash
+ynpm i
+```
+
+## 新建组件(以waterfall为例)
+新建一个Vue组件,比如 waterfall
+```bash
+make init waterfall
+```
+就可以在 packages目录 里面看到waterfall初始化的组件代码了。记得更新package.json和README.md里的组件描述信息
+
+## 示例预览(以waterfall为例)
+在 docs/nav.config.json 文件里合适的地方写入组件声明,根据组件类型(JS组件,CSS组件,Form等)进行区分
+在 docs/examples 目录里新建 同名的md文件,如 waterfall.md
+在项目的根目录下执行以下命令,启动server
+```
+make dev
+```
+浏览器访问 http://localhost:8080/#/ 就可以看到所有组件的示例了
+
+
+
+
+
+
+
+
+
diff --git a/build/bin/build-all.js b/build/bin/build-all.js
index e1014ed74..97927ee70 100644
--- a/build/bin/build-all.js
+++ b/build/bin/build-all.js
@@ -10,15 +10,15 @@ let componentPaths = [];
delete components.font;
Object.keys(components).forEach(key => {
- const filePath = path.join(__dirname, `../../packages/${key}/cooking.conf.js`);
+ const filePath = path.join(__dirname, `../../packages/${key}/webpack.conf.js`);
if (existsSync(filePath)) {
- componentPaths.push(`packages/${key}/cooking.conf.js`);
+ componentPaths.push(`packages/${key}/webpack.conf.js`);
}
});
const paths = componentPaths.join(',');
-const cli = `node_modules/.bin/cooking build -c ${paths} -p`;
+const cli = `node_modules/.bin/webpack build -c ${paths} -p`;
execSync(cli, {
stdio: 'inherit'
diff --git a/build/bin/build-entry.js b/build/bin/build-entry.js
index fffd532e8..a3a9a1a35 100644
--- a/build/bin/build-entry.js
+++ b/build/bin/build-entry.js
@@ -8,8 +8,6 @@ var OUTPUT_PATH = path.join(__dirname, '../../src/index.js');
var IMPORT_TEMPLATE = 'import {{name}} from \'../packages/{{package}}/index.js\';';
var ISNTALL_COMPONENT_TEMPLATE = ' Vue.component({{name}}.name, {{name}});';
var MAIN_TEMPLATE = `{{include}}
-// zanui
-import '../packages/zanui-css/src/index.pcss';
const install = function(Vue) {
if (install.installed) return;
diff --git a/build/release.sh b/build/release.sh
new file mode 100644
index 000000000..a738c9f18
--- /dev/null
+++ b/build/release.sh
@@ -0,0 +1,38 @@
+git checkout master
+git merge dev
+
+#!/usr/bin/env sh
+set -e
+echo "Enter release version: "
+read VERSION
+
+read -p "Releasing $VERSION - are you sure? (y/n)" -n 1 -r
+echo # (optional) move to a new line
+if [[ $REPLY =~ ^[Yy]$ ]]
+then
+ echo "Releasing $VERSION ..."
+
+ # build
+ VERSION=$VERSION npm run dist
+
+ # publish zanui-css
+ echo "Releasing zanui-css $VERSION ..."
+ cd packages/zanui-css
+ npm version $VERSION --message "[release] $VERSION"
+ npm publish
+ cd ../..
+
+ # commit
+ git add -A
+ git commit -m "[build] $VERSION"
+ npm version $VERSION --message "[release] $VERSION"
+
+ # publish
+ git push origin master
+ git push origin refs/tags/v$VERSION
+ git checkout dev
+ git rebase master
+ git push origin dev
+
+ npm publish
+fi
diff --git a/build/webpack.build.js b/build/webpack.build.js
index 4222eae61..7963aad45 100644
--- a/build/webpack.build.js
+++ b/build/webpack.build.js
@@ -1,13 +1,19 @@
-var config = require('./webpack.config.js')
+var config = require('./webpack.config.js');
config.entry = {
- 'oxygen': './src/index.js'
-}
+ 'zanui': './src/index.js'
+};
config.output = {
- filename: './dist/[name].js',
- library: 'Oxygen',
+ filename: './lib/[name].js',
+ library: 'zanui',
libraryTarget: 'umd'
-}
+};
-module.exports = config
+config.externals = {
+ vue: 'Vue'
+};
+
+delete config.devtool;
+
+module.exports = config;
diff --git a/build/webpack.build.min.js b/build/webpack.build.min.js
index d8a978bc0..be17f3f93 100644
--- a/build/webpack.build.min.js
+++ b/build/webpack.build.min.js
@@ -1,19 +1,20 @@
-var config = require('./webpack.build.js')
-var webpack = require('webpack')
+var config = require('./webpack.build.js');
+var webpack = require('webpack');
-
-config.output.filename = config.output.filename.replace(/\.js$/, '.min.js')
-
-delete config.devtool
+config.output.filename = config.output.filename.replace(/\.js$/, '.min.js');
config.plugins = [
+ new webpack.LoaderOptionsPlugin({
+ minimize: true,
+ debug: false
+ }),
new webpack.optimize.UglifyJsPlugin({
- sourceMap: false,
- drop_console: true,
+ comments: false,
compress: {
+ drop_console: true,
warnings: false
}
})
-]
+];
-module.exports = config
+module.exports = config;
diff --git a/build/webpack.config.js b/build/webpack.config.js
index 5d28befbf..111fe99b4 100644
--- a/build/webpack.config.js
+++ b/build/webpack.config.js
@@ -24,7 +24,8 @@ function wrap(render) {
module.exports = {
entry: {
- 'build-docs': './docs/index.js'
+ 'zanui-docs': './docs/index.js',
+ 'zanui-examples': './docs/examples.js'
},
output: {
path: './docs/build',
@@ -39,7 +40,7 @@ module.exports = {
extensions: ['.js', '.vue', '.pcss'],
alias: {
'vue$': 'vue/dist/vue.runtime.common.js',
- 'oxygen': path.join(__dirname, '..'),
+ 'zanui': path.join(__dirname, '..'),
'src': path.join(__dirname, '../src'),
'packages': path.join(__dirname, '../packages')
}
@@ -57,10 +58,6 @@ module.exports = {
},
{
test: /\.css$/,
- loader: 'style-loader!css-loader?root=./docs/'
- },
- {
- test: /\.pcss$/,
loader: 'style-loader!css-loader!postcss-loader'
},
{
@@ -91,8 +88,12 @@ if (process.env.NODE_ENV === 'production') {
}),
new ExtractTextPlugin(`yzvue_base_${version}_min.css`),
new webpack.optimize.UglifyJsPlugin({
- compress: {warnings: false},
- output: {comments: false},
+ compress: {
+ warnings: false
+ },
+ output: {
+ comments: false
+ },
sourceMap: false
}),
new webpack.LoaderOptionsPlugin({
diff --git a/components.json b/components.json
index bd59720a9..3b1dc2789 100644
--- a/components.json
+++ b/components.json
@@ -10,5 +10,8 @@
"dialog": "./packages/dialog/index.js",
"picker": "./packages/picker/index.js",
"radio-group": "./packages/radio-group/index.js",
- "waterfall": "./packages/waterfall/index.js"
+ "waterfall": "./packages/waterfall/index.js",
+ "loading": "./packages/loading/index.js",
+ "panel": "./packages/panel/index.js",
+ "card": "./packages/card/index.js"
}
diff --git a/packages/switch/CHANGELOG.md b/docs/ExamplesApp.vue
similarity index 100%
rename from packages/switch/CHANGELOG.md
rename to docs/ExamplesApp.vue
diff --git a/docs/App.vue b/docs/ExamplesDocsApp.vue
similarity index 98%
rename from docs/App.vue
rename to docs/ExamplesDocsApp.vue
index c0b8380c3..648a9b356 100644
--- a/docs/App.vue
+++ b/docs/ExamplesDocsApp.vue
@@ -21,6 +21,8 @@ export default {
+
+## Panel 面板
+
+面板只是一个容器,里面可以放入自定义的内容。
+
+### 基础用法
+
+:::demo
+```html
+商品名称是什么,两行显示状态如效果图,多余多余多余两行显示状态如效果图,多余多余多余两行显示状态如效果图,多余多余多余两行显示状态如效果图,多余多余多余两行显示状态如效果图,多余多余多余
+ ¥ 2.00
+ 商品sku
+ x 2
+ 商品名称是什么,两行显示状态如效果图,多余多余多余两行显示状态如效果图,多余多余多余两行显示状态如效果图,多余多余多余两行显示状态如效果图,多余多余多余两行显示状态如效果图,多余多余多余
+ ¥ 2.00
+ 商品sku
+ x 2
+