Skip to content

Commit

Permalink
re-organize src file structure (#590)
Browse files Browse the repository at this point in the history
* + [jsfm] add update finish

* * [jsfm] patch version

* + [jsfm] add changelos

* + [jsfm] add level for log

* * [jsfm] fixed fireEvent params

* + [html5] image component support attr 'resize'

* * [html5] fix height of root component

* * [html5] wrap iframe with div for web component

* * [html5] support embed config to fix a embed weex instance's default height

* + [html5] loading-indicator support 'color' style

* * [html5] add webkit vendor

* * [html5] correct function name & clear unnecessary code

* + [html5] embed component supports attribute loader and jsonp-callback

* * [html5] update ver and add relase note

* + [jsfm] update console polyfill

* * [html5] fix lazyload of slider images & default value of autoPlay

* * [html5] fix removing & inserting before fixed child

* * [html5] fix removing & inserting before fixed child in list & scroller

* + [jsfm] add log && update test

* * [jsfm] add track-by test

* * [jsfm] update changelog

* * [jsfm] fix #323

* + [jsfm] add document.URL

* + [jsfm] add build tag

* + [jsfm] add document.ULR expect test

* * [jsfm] update url

* + [html5] add fetch API for stream module

* + [html5] add logger

* + [html5] support 'debug' flag in url

* * [html5] fix lint

* * [html5] add lint for src folder

* * [html5] fix height of downgraded scrollable root

* * [html5] add warnings for scrollable roots

* * [jsfm] fix promise polyfill && apply native component

* + [html5] add promise polyfill

* * [html5] rewrite logger

* * [html5] udpate jscs scripts

* * [html5] fix default interval time for slider

* * [html5] add vlist and hlist

* * [html5] rm reduplicated code

* * [html5] add env.deviceWidth for getConfig

* * [html5] fix index for move elements inside the same parent

* * [html5] removed duplicated root component register

* + [jsfm] added style, attr, event test case for dom.js

* + [jsfm] added test case for input-binding

* * [jsfm] typo

* + [jsfm] updated new data observer

* + [jsfm] supported components options

* + [jsfm] added a test case for component options and fixed bugs

* * [jsfm] fix 'console' in jscore

* + [jsfm] updated changelog

* * [html5] fix merge conflicts

* + [jsfm] updated CHANGELOG for components option

* * [jsfm] add comment

* * [html5] enhancement of value filters for auto-adding px to strings

* * [html5] return -1 for native error

* * [html5] fix <a> component

* * [html5] stop default behavior for click event and stop event propagation

* * [html5] stop propagation of clicking events for <a>

* * [html5] fix bubbling and <a> component

* * [html5] add demo for event bubbling

* - [jsfm] removed unnecessary old perf APIs

* * [jsfm] moved framework.js to runtime/index.js

* + [jsfm] supported 3rd-party framework extension

* + [jsfm] added framework helper

* * [jsfm] used export default for main js framework

* + [html5] add direction support for scroller and loadmore event

* * [html5] fix html height

* * [jsfm] removed all ".js" suffix of import path

* - [jsfm] removed destroyDocument(id) in dom.js, use doc.destroy() instead.

* * [jsfm] put event manager and dom listener into dom's dependencies

* * [jsfm] separated dom and app from callTasks

* * [jsfm] moved all dom files to lib/dom/

* + [jsfm] added Document.prototype.fireEvent(el, type, e, domChanges)

* * [html5] fix default border style of image

* * [html5] don't give warning for div root

* * [html5] fix scrollTo in scroller and direction of appear events

* * [html5] fix lint

* + [html5] add ability to call APIs through messages

* * [html5] rm irrelevant code

* * [html5] beautify code

* + [jsfm] virtual-DOM new implementations

* + [html5] add building date info

* * [jsfm] removed sinon.stub(console, log) in test

* * [html5] refactor code & update version

* * [jsfm] fixed more new v-dom bugs

* * [jsfm] passed all test case for new virtual-DOM APIs

* * [jsfm] fixed dom actions test case

* - [jsfm] removed Node.prototype.parentRef instead of parentNode

* - [jsfm] removed next() and prev() in dom instead of nextSibling and previousSibling

* * [html5] fix embed udpate url & root warning

* * [html5] udpate release version and fix list's scroll direction

* * [html5] fix embed's update src

* * [jsfm] update polyfill

* + [jsfm] freeze 0.13.10 for pre-publish, and open 0.13.11 for feature && bugfix

* + [html5] add e2e test

* * [html5] fix lint

* * [html5] add test to ci

* * [html5] add transform before test

* * [html5] build before running test

* + [html5] add animation spec

* * [html5] add test files to lint

* * [html5] fix text's word-wrap

* * [html5] fix indicator's initial item-color

* * [html5] add transform and build to main ci

* * [all] file structure adjustment

* * [all] marked legacy files

* * [all] fixed ci error

* * [all] supported serve, clean and copy

* * [all] fixed all npm scripts except create and removed watch script from ./start

* * [all] scripts typo

* * [all] build html5 renderer and js framework together

* + [all] added weex-html5 package to dist

* * [all] used eslint first

* * [all] fixed no-undef and no-unused-vars in eslint

* * [all] fixed padded-blocks and wrap-iife

* + [all] added eslint into npm scripts

* * [all] fixed no-var in eslint

* * [all] reverted watching examples in ./start

* + [html5] add direction to gestures

* * [html5] implement timer with raf to optimize slider's performance

* * [all] updated default framework exports

* * [html5] fix scrollToElement's offset

* * [all] vdom updated

* * [all] fixed callJS bug in default JS Framework

* * [html5] fix bugs of scroll, appear and kountdown

* * [html5] fix lint

* * [all] adapted default js-framework

* + [html5] scaffold e2e testing with nightwatch

* * [html5] fix code style

* * [html5] fix lint

* * [html5] fix ci

* * [html5] fix ci 2

* * [html5] fix ci 3

* * [html5] change server port to 8088

* * [html5] fix ci 4

* * [all] fixed e2e test

* * [all] fixed console problem

* + [jsfm] added custom downgrade feature

* * [html5] merge with legacy code

* * [html5] fix lint

* * [jsfm] update downgrade error message

* * [html5] fix conflicts & fix timer

* * [html5] fix promise

* * [html5] fix typo

* + [jsfm] added JS Bundle format version config

* * [html5] add default bgcolor for loading & refresh & fix scroll bouncing

* * [all] supported create body with children

* * [all] upgraded npm scripts and deps

* - [all] removed old website and some legacy files

* * [all] moved weex-components into npm deps
  • Loading branch information
Jinjiang authored and luics committed Jun 27, 2016
1 parent e74c8d4 commit 74c982e
Show file tree
Hide file tree
Showing 358 changed files with 11,545 additions and 35,340 deletions.
File renamed without changes.
141 changes: 141 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
{
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "module"
},

"env": {
"es6": true,
"node": true,
"mocha": true
},

"globals": {
"document": false,
"navigator": false,
"window": false,
"location": false,
"callNative": false,
"callJS": false
},

"rules": {
"accessor-pairs": 2,
"arrow-spacing": [2, { "before": true, "after": true }],
"block-spacing": [2, "always"],
"brace-style": [2, "stroustrup", { "allowSingleLine": true }],
"camelcase": [2, { "properties": "never" }],
"comma-dangle": [2, "never"],
"comma-spacing": [2, { "before": false, "after": true }],
"comma-style": [2, "last"],
"constructor-super": 2,
"curly": [2, "multi-line"],
"dot-location": [2, "property"],
"eol-last": 2,
"eqeqeq": [2, "allow-null"],
"generator-star-spacing": [2, { "before": true, "after": true }],
"handle-callback-err": [2, "^(err|error)$" ],
"indent": [2, 2, { "SwitchCase": 1 }],
"key-spacing": [2, { "beforeColon": false, "afterColon": true }],
"keyword-spacing": [2, { "before": true, "after": true }],
"new-cap": [2, { "newIsCap": true, "capIsNew": false }],
"new-parens": 2,
"no-array-constructor": 2,
"no-caller": 2,
"no-class-assign": 2,
"no-cond-assign": 2,
"no-const-assign": 2,
"no-control-regex": 2,
"no-debugger": 2,
"no-delete-var": 2,
"no-dupe-args": 2,
"no-dupe-class-members": 2,
"no-dupe-keys": 2,
"no-duplicate-case": 2,
"no-empty-character-class": 2,
"no-empty-pattern": 2,
"no-eval": 2,
"no-ex-assign": 2,
"no-extend-native": 2,
"no-extra-bind": 2,
"no-extra-boolean-cast": 2,
"no-extra-parens": [2, "functions"],
"no-fallthrough": 2,
"no-floating-decimal": 2,
"no-func-assign": 2,
"no-implied-eval": 2,
"no-inner-declarations": [2, "functions"],
"no-invalid-regexp": 2,
"no-irregular-whitespace": 2,
"no-iterator": 2,
"no-label-var": 2,
"no-labels": [2, { "allowLoop": false, "allowSwitch": false }],
"no-lone-blocks": 2,
"no-mixed-spaces-and-tabs": 2,
"no-multi-spaces": 2,
"no-multi-str": 2,
"no-multiple-empty-lines": [2, { "max": 1 }],
"no-native-reassign": 2,
"no-negated-in-lhs": 2,
"no-new-object": 2,
"no-new-require": 2,
"no-new-symbol": 2,
"no-new-wrappers": 2,
"no-obj-calls": 2,
"no-octal": 2,
"no-octal-escape": 2,
"no-path-concat": 2,
"no-proto": 2,
"no-redeclare": 2,
"no-regex-spaces": 2,
"no-return-assign": [2, "except-parens"],
"no-self-assign": 2,
"no-self-compare": 2,
"no-sequences": 2,
"no-shadow-restricted-names": 2,
"no-spaced-func": 2,
"no-sparse-arrays": 2,
"no-this-before-super": 2,
"no-throw-literal": 2,
"no-trailing-spaces": 2,
"no-undef": 2,
"no-undef-init": 2,
"no-unexpected-multiline": 2,
"no-unmodified-loop-condition": 2,
"no-unneeded-ternary": [2, { "defaultAssignment": false }],
"no-unreachable": 2,
"no-unsafe-finally": 2,
"no-unused-vars": [2, { "vars": "all", "args": "none" }],
"no-useless-call": 2,
"no-useless-computed-key": 2,
"no-useless-constructor": 2,
"no-useless-escape": 2,
"no-whitespace-before-property": 2,
"no-with": 2,
"one-var": [2, { "initialized": "never" }],
// "operator-linebreak": [2, "after", { "overrides": { "?": "before", ":": "before" } }],
"padded-blocks": [2, "never"],
"quotes": [2, "single", {"avoidEscape": true, "allowTemplateLiterals": true}],
"semi": [2, "never"],
"semi-spacing": [2, { "before": false, "after": true }],
"space-before-blocks": [2, "always"],
"space-before-function-paren": [2, "always"],
"space-in-parens": [2, "never"],
"space-infix-ops": 2,
"space-unary-ops": [2, { "words": true, "nonwords": false }],
"spaced-comment": [2, "always", { "markers": ["global", "globals", "eslint", "eslint-disable", "*package", "!", ","] }],
"template-curly-spacing": [2, "never"],
"use-isnan": 2,
"valid-typeof": 2,
"wrap-iife": [2, "any"],
"yield-star-spacing": [2, "both"],
"yoda": [2, "never"],

"no-var": 2,
"prefer-const": 2,
"object-curly-spacing": [2, "always", {
objectsInObjects: false
}],
"array-bracket-spacing": [2, "never"]
}
}
12 changes: 9 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
examples/build
test/build
weex_tmp
coverage
dist

# Node
logs
Expand All @@ -19,6 +21,10 @@ pids
*.pid
*.seed

# Compiled binary addons (http://nodejs.org/api/addons.html)
build
release
# e2e test
html5/test/e2e/reports
html5/test/e2e/screenshots
html5/test/e2e/logs

# legacy
src
62 changes: 14 additions & 48 deletions SCRIPTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,51 +2,17 @@

There are several scripts for end-user and developer.

## For end-user

**clean `*.js` in `examples/build` and `test/build` folders**
```shell
npm run clean
```

**create `.we` file(run `npm run create -- -h` for help)**
```shell
npm run create -- [name] -o [directory]
```

**transform `*.we` in `examples` and `test` folders**
```shell
npm run transform
```

**npm run clean && npm run transform**
```shell
npm run dev
```

**run a file server at `12580` port**
```shell
npm run serve
```

**run a watcher for `*.we` changed**
```shell
npm run watch
```

## For SDK Developer

**build js-framework and h5-render**
```shell
npm run build
```

**run test under js-framework and h5-render**
```shell
npm run ci
```

**copy the built files to `playground`**
```shell
npm run copy
```
**For end users you can only know `npm run build` and `npm run serve` to start and `npm run dev:examples` to write or modify a demo.**

* `npm run build:browser`: build HTML5 renderer to `dist/browser.js`.
* `npm run build:native`: build JS framework for native renderer to `dist/native.js`.
* `npm run build:examples`: build all js bundles from `examples/` to `examples/build/`.
* `npm run build:test`: build all js bundles from `test/` to `test/build/`.
* `npm run build`: build all above.
* `npm run dev:browser`, `npm run dev:native`, `npm run dev:examples`, `npm run dev:test` are the watcher mode for all build scripts, any file changes will automatically be built.
* `npm run serve`: run a http server so you can access all examples in browser through `http://localhost:12580/`. **note: you must run `npm run build` first to prepare all the built files.**
* `npm run clean:examples`: clean `examples/build/`.
* `npm run clean:test`: clean `test/build/`.
* `npm run clean`: clean both `examples/build/` and `test/build/`.
* `npm run copy`: copy JS framework and examples into Android project.
* `npm run lint`, `npm run test`, `npm run cover` and `npm run ci` are something quality assurance.
5 changes: 0 additions & 5 deletions bin/install-components.sh

This file was deleted.

56 changes: 56 additions & 0 deletions build/nightwatch.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
// http://nightwatchjs.org/guide#settings-file
module.exports = {
'src_folders': ['html5/test/e2e/specs'],
'output_folder': 'html5/test/e2e/reports',

'selenium': {
'start_process': true,
'server_path': 'node_modules/selenium-server/lib/runner/selenium-server-standalone-2.53.0.jar',
'log_path': 'html5/test/e2e/logs',
'host': '127.0.0.1',
'port': 4444,
'cli_args': {
'webdriver.chrome.driver': require('chromedriver').path
}
},

'test_settings': {

'default': {
'selenium_port': 4444,
'selenium_host': 'localhost',
'launch_url': 'http://localhost',
'silent': true,
'screenshots': {
'enabled': true,
'on_failure': true,
'on_error': false,
'path': 'html5/test/e2e/screenshots'
}
},

'chrome': {
'desiredCapabilities': {
'browserName': 'chrome',
'javascriptEnabled': true,
'acceptSslCerts': true
}
},

'firefox': {
'desiredCapabilities': {
'browserName': 'firefox',
'javascriptEnabled': true,
'acceptSslCerts': true
}
},

'phantomjs': {
'desiredCapabilities': {
'browserName': 'phantomjs',
'javascriptEnabled': true,
'acceptSslCerts': true
}
}
}
}
31 changes: 31 additions & 0 deletions build/webpack.browser.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
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]
}
30 changes: 10 additions & 20 deletions webpack.config.js → build/webpack.examples.config.js
Original file line number Diff line number Diff line change
@@ -1,42 +1,32 @@
var path = require('path');
var fs = require('fs');
var webpack = require('webpack');
var loader = require('weex-loader');
var scripter = require('weex-scripter');
var styler = require('weex-styler');
var templater = require('weex-templater');

loader.useScripter(scripter);
loader.useStyler(styler);
loader.useTemplater(templater);

var entry = {};

function walk(dir, root) {
var directory = path.join(__dirname, root, dir);
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 === '.we' || extname === '.js')) {
var name = path.join(root, 'build', dir, path.basename(file, extname));
if (stat.isFile() && extname === '.we') {
var name = path.join('examples', 'build', dir, path.basename(file, extname));
entry[name] = fullpath + '?entry=true';
} else if (stat.isDirectory() &&
file !== 'build') {
} else if (stat.isDirectory() && file !== 'build' && file !== 'include') {
var subdir = path.join(dir, file);
walk(subdir, root);
walk(subdir);
}
});
}
walk('./', 'examples');
walk('./', 'test');

walk();

module.exports = {
entry: entry,
output : {
path: __dirname,
path: '.',
filename: '[name].js'
},
module: {
Expand Down
Loading

0 comments on commit 74c982e

Please sign in to comment.