Permalink
Browse files

* [html5] merge form jsfm-feature-0.17

  • Loading branch information...
2 parents 2b1d6a1 + ea33aac commit 217596f48363d47a382319776d1eb6a064667932 @Hanks10100 Hanks10100 committed Oct 19, 2016
Showing 386 changed files with 7,394 additions and 1,967 deletions.
View
@@ -0,0 +1,3 @@
+# do not lint test case source files
+html5/test/case/*/*.source.js
+html5/test/case/*/*.output.js
View
@@ -22,9 +22,6 @@ pids
*.pid
*.seed
-# build framework options by script
-html5/runtime/config.js
-
# e2e test
html5/test/e2e/reports
html5/test/e2e/screenshots
View
@@ -1,13 +1,13 @@
# Weex
Android[![Download](https://api.bintray.com/packages/alibabaweex/maven/weex_sdk/images/download.svg)](https://bintray.com/alibabaweex/maven/weex_sdk/_latestVersion)
-iOS[![Pod version](https://badge.fury.io/co/WeexSDK.svg)](https://cocoapods.org/pods/WeexSDK)
+iOS[![Pod version](https://badge.fury.io/co/WeexSDK.svg)](https://cocoapods.org/pods/WeexSDK)
HTML5[![npm version](https://badge.fury.io/js/weex-html5.svg)](https://www.npmjs.com/package/weex-html5)
> A framework for building Mobile cross-platform UI.
[![CircleCI](https://circleci.com/gh/alibaba/weex/tree/dev.svg?style=svg&circle-token=b83b047a3a01f6ec26458a455530a5ddc261925f)](https://circleci.com/gh/alibaba/weex/tree/dev) [![Gitter](https://img.shields.io/gitter/room/weexteam/cn.svg?maxAge=2592000)](https://gitter.im/weexteam) <sub>(English Gitter)</sub> [![Gitter](https://img.shields.io/gitter/room/weexteam/cn.svg?maxAge=2592000)](https://gitter.im/weexteam/cn) <sub>(Chinese 中文聊天室)</sub>
-Support Android 4.1 (API 16) and iOS 7.0+. See [Weex website](https://alibaba.github.io/weex/) for more information.
+Support Android 4.1 (API 16) and iOS 7.0+. See [Weex website](https://alibaba.github.io/weex/) for more information.
## For Windows
@@ -26,12 +26,12 @@ Please ***INSTALL [Git for Windows](https://git-scm.com/download/win)*** and run
* [Tutorial](https://alibaba.github.io/weex/doc/tutorial.html)
* Doc: [English](https://alibaba.github.io/weex/doc/), [中文](https://github.com/weexteam/article/wiki/Weex%E4%B8%AD%E6%96%87%E6%96%87%E6%A1%A3)
-### Android
+### Android
0. Prerequisites
0. Install [Node.js](http://nodejs.org/) 4.0+
- 0. Under project root
- 0. `npm install`, install project
+ 0. Under project root
+ 0. `npm install`, install project
0. `./start`
0. Install [Android Environment](http://developer.android.com/training/basics/firstapp/index.html)
0. Run playground, In Android Studio
@@ -49,8 +49,8 @@ On Android Platform , Weex code is executed in [weex_v8core](https://github.com/
0. Prerequisites
0. Install [Node.js](http://nodejs.org/) 4.0+
- 0. Under project root
- 0. `npm install`, install project
+ 0. Under project root
+ 0. `npm install`, install project
0. `./start`
0. Install [iOS Environment](https://developer.apple.com/library/ios/documentation/IDEs/Conceptual/AppStoreDistributionTutorial/Setup/Setup.html)
0. Install [CocoaPods](https://guides.cocoapods.org/using/getting-started.html)
@@ -78,7 +78,7 @@ Weex team have developed a [DevTool](https://github.com/weexteam/weex-devtool) t
See [FAQ](https://alibaba.github.io/weex/doc/faq.html) for more information.
-### Community based Weex knowledge site
+### Community based Weex knowledge site
* [weex article](https://github.com/weexteam/article/wiki) : article collection about Weex(文章集合)
* [weex.help](http://weex.help/) : 3rd forum about Weex(第三方Weex中文技术论坛)
@@ -87,4 +87,3 @@ See [FAQ](https://alibaba.github.io/weex/doc/faq.html) for more information.
## Contributing
See [Weex Contributing Guide](./CONTRIBUTING.md) for more information.
-
@@ -15,7 +15,7 @@ rm -Rf src
mkdir src
cp ../../.babelrc .
cp -Rf ../../html5/* src/
-rm -Rf src/browser
+rm -Rf src/render/browser
rm -Rf src/test
if [ $# -gt 0 ]; then
@@ -1,51 +0,0 @@
-// read all files framework-*.js
-// filter by args
-// generate frameworks.js
-
-var select
-if (process.argv[2]) {
- select = process.argv[2].toLowerCase().split(',')
-}
-
-var path = require('path')
-var fs = require('fs')
-
-var dirPath = path.resolve(__dirname, '..', 'html5', 'runtime')
-
-function getAllFrameworkNames () {
- var files = fs.readdirSync(dirPath)
- return files.filter(function (name) {
- return name.match(/^framework-/)
- }).map(function (filename) {
- return filename.replace(/^framework-(.+)\.js$/, '$1')
- }).filter(function (name) {
- return !select || select.indexOf(name) >= 0
- }).map(function (name) {
- var filePath = path.join(dirPath, 'framework-' + name + '.js')
- return {
- name: name.charAt(0).toUpperCase() + name.slice(1),
- content: fs.readFileSync(filePath, { encoding: 'utf8' })
- }
- })
-}
-
-function generateContent () {
- var frameworks = getAllFrameworkNames()
- var content = []
- var names = []
- frameworks.forEach(function (framework) {
- content.push(framework.content.trim())
- names.push(' ' + framework.name)
- })
- return '// built by npm run build:config\n\n' +
- content.join('\n') + '\n\n' +
- 'export default {\n' + names.join(',\n') + '\n}\n'
-}
-
-function writeContent() {
- var content = generateContent()
- var filePath = path.join(dirPath, 'config.js')
- fs.writeFileSync(filePath, content)
-}
-
-writeContent()
@@ -0,0 +1,35 @@
+import { rollup } from 'rollup'
+import postcss from 'rollup-plugin-postcss'
+import json from 'rollup-plugin-json'
+import eslint from 'rollup-plugin-eslint'
+import nodeResolve from 'rollup-plugin-node-resolve'
+import commonjs from 'rollup-plugin-commonjs'
+import buble from 'rollup-plugin-buble'
+
+const pkg = require('../package.json')
+const version = pkg.subversion.browser
+const date = new Date().toISOString().split('T')[0].replace(/\-/g, '')
+const banner = `\
+console.log('START WEEX HTML5: ${version} Build ${date}');
+`
+
+export default {
+ entry: './html5/render/browser/index.js',
+ dest: './dist/browser.common.js',
+ banner,
+ format: 'cjs',
+ plugins: [
+ postcss(),
+ json(),
+ eslint({
+ exclude: ['./package.json', '**/*.css']
+ }),
+ nodeResolve({
+ jsnext: true,
+ main: true,
+ browser: true
+ }),
+ commonjs(),
+ buble()
+ ]
+}
@@ -0,0 +1,38 @@
+import { rollup } from 'rollup'
+import postcss from 'rollup-plugin-postcss'
+import json from 'rollup-plugin-json'
+import eslint from 'rollup-plugin-eslint'
+import nodeResolve from 'rollup-plugin-node-resolve'
+import commonjs from 'rollup-plugin-commonjs'
+import buble from 'rollup-plugin-buble'
+
+const pkg = require('../package.json')
+const version = pkg.subversion.browser
+const date = new Date().toISOString().split('T')[0].replace(/\-/g, '')
+const banner = `\
+(this.nativeLog || function(s) {console.log(s)})('START WEEX HTML5: ${version} Build ${date}');
+var global = this, process = { env: {}};
+`
+
+export default {
+ entry: './html5/render/browser/index.js',
+ dest: './dist/browser.js',
+ banner,
+ format: 'umd',
+ moduleName: 'weex',
+ sourceMap: 'inline',
+ plugins: [
+ postcss(),
+ json(),
+ eslint({
+ exclude: ['./package.json', '**/*.css']
+ }),
+ nodeResolve({
+ jsnext: true,
+ main: true,
+ browser: true
+ }),
+ commonjs(),
+ buble()
+ ]
+}
@@ -0,0 +1,34 @@
+import { rollup } from 'rollup'
+import json from 'rollup-plugin-json'
+import eslint from 'rollup-plugin-eslint'
+import nodeResolve from 'rollup-plugin-node-resolve'
+import commonjs from 'rollup-plugin-commonjs'
+import buble from 'rollup-plugin-buble'
+
+const pkg = require('../package.json')
+const version = pkg.subversion.framework
+const date = new Date().toISOString().split('T')[0].replace(/\-/g, '')
+const banner = `\
+(this.nativeLog || function(s) {console.log(s)})('START JS FRAMEWORK: ${version} Build ${date}');
+var global = this, process = { env: {}};
+`
+
+export default {
+ entry: './html5/render/native/index.js',
+ dest: './dist/native.js',
+ banner,
+ format: 'umd',
+ sourceMap: 'inline',
+ plugins: [
+ json(),
+ eslint({
+ exclude: './package.json'
+ }),
+ nodeResolve({
+ jsnext: true,
+ main: true
+ }),
+ commonjs(),
+ buble()
+ ]
+}
@@ -1,43 +0,0 @@
-var path = require('path')
-var fs = require('fs')
-
-var dirPath = path.resolve(__dirname, '..', 'html5', 'runtime')
-var filePath = path.join(dirPath, 'config.js')
-if (!fs.existsSync(filePath)) {
- var programName = require('os').platform() === 'win32' ? 'npm.cmd' : 'npm'
- require('child_process').spawnSync(programName, ['run', 'build:config'])
-}
-
-var webpack = require('webpack')
-
-var pkg = require('../package.json')
-
-var sourceMapPlugin = new webpack.SourceMapDevToolPlugin({
- test: /\.js$/
-})
-
-var version = pkg.subversion.browser
-
-var date = new Date().toISOString().split('T')[0].replace(/\-/g, '')
-var banner = `(this.nativeLog || function(s) {console.log(s)})` +
- `('START WEEX HTML5: ${version} Build ${date}');`;
-
-var bannerPlugin = new webpack.BannerPlugin(banner, {
- raw: true
-})
-
-module.exports = {
- entry: './html5/browser',
- output: {
- path: './dist',
- filename: 'browser.js',
- },
- module: {
- loaders: [
- { test: /\.js$/, loader: 'babel' },
- { test: /\.json$/, loader: 'json'},
- { test: /\.css$/, loader: 'style-loader!css-loader' }
- ]
- },
- plugins: [bannerPlugin, sourceMapPlugin]
-}
@@ -1,50 +0,0 @@
-var path = require('path')
-var fs = require('fs')
-
-var dirPath = path.resolve(__dirname, '..', 'html5', 'runtime')
-var filePath = path.join(dirPath, 'config.js')
-if (!fs.existsSync(filePath)) {
- var programName = require('os').platform() === 'win32' ? 'npm.cmd' : 'npm'
- require('child_process').spawnSync(programName, ['run', 'build:config'])
-}
-
-var webpack = require('webpack')
-
-var pkg = require('../package.json')
-
-var sourceMapPlugin = new webpack.SourceMapDevToolPlugin({
- test: /\.js$/
-})
-
-var version = pkg.subversion.browser
-
-var date = new Date().toISOString().split('T')[0].replace(/\-/g, '')
-var banner = `(function(s) {console.log(s)})` +
- `('START WEEX HTML5: ${version} Build ${date}');`;
-
-var bannerPlugin = new webpack.BannerPlugin(banner, {
- raw: true
-})
-
-module.exports = {
- entry: './html5/browser',
- output: {
- path: './dist',
- filename: 'browser.common.js',
- },
- node: {
- global: false
- },
- module: {
- loaders: [
- {
- test: /\.js$/,
- exclude: /node_modules/,
- loaders: ['babel']
- },
- { test: /\.json$/, loader: 'json'},
- { test: /\.css$/, loader: 'style-loader!css-loader' }
- ]
- },
- plugins: [bannerPlugin, sourceMapPlugin]
-}
@@ -0,0 +1,48 @@
+var path = require('path');
+var fs = require('fs');
+var webpack = require('webpack');
+
+var entry = {};
+
+function walk(dir) {
+ dir = dir || '.'
+ var directory = path.join(__dirname, '../examples', dir);
+ fs.readdirSync(directory)
+ .forEach(function(file) {
+ var fullpath = path.join(directory, file);
+ var stat = fs.statSync(fullpath);
+ var extname = path.extname(fullpath);
+ if (stat.isFile() && extname === '.vue') {
+ var name = path.join('examples', 'build', dir, path.basename(file, extname));
+ entry[name] = fullpath + '?entry=true';
+ } else if (stat.isDirectory() && file !== 'build' && file !== 'include') {
+ var subdir = path.join(dir, file);
+ walk(subdir);
+ }
+ });
+}
+
+walk();
+
+var banner = '// { "framework": "Vue" }\n'
+
+var bannerPlugin = new webpack.BannerPlugin(banner, {
+ raw: true
+})
+
+module.exports = {
+ entry: entry,
+ output : {
+ path: '.',
+ filename: '[name].js'
+ },
+ module: {
+ loaders: [
+ {
+ test: /\.vue(\?[^?]+)?$/,
+ loader: 'weex-vue-loader'
+ }
+ ]
+ },
+ plugins: [bannerPlugin]
+}
Oops, something went wrong.

0 comments on commit 217596f

Please sign in to comment.