Skip to content

Commit

Permalink
兼容Rax环境中可以调用js-api
Browse files Browse the repository at this point in the history
  • Loading branch information
icepy committed May 4, 2017
1 parent ee28eea commit 869edcb
Show file tree
Hide file tree
Showing 45 changed files with 1,022 additions and 29 deletions.
1 change: 1 addition & 0 deletions .flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

.*/build/.*
.*/dist/.*
.*/package/.*

[libs]
flow
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
logs
*.log
npm-debug.log*

# Runtime data
pids
*.pid
Expand Down
2 changes: 1 addition & 1 deletion dist/weex-dingtalk-min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/weex-dingtalk-min.js.map

Large diffs are not rendered by default.

65 changes: 57 additions & 8 deletions dist/weex-dingtalk.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/weex-dingtalk.js.map

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions flow/global-vars.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
declare var weex:Object;
declare type GLOBALWINDOW = Object;
declare var __weex_require__:Function;
declare var __weex_options__:Object;
declare var callNative:Function;
34 changes: 18 additions & 16 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"name": "weex-dingtalk",
"version": "0.0.7",
"version": "0.0.8",
"description": "Dingtalk Weex Js Api SDK",
"main": "dist/weex-dingtalk-min.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"es5": "node ./build/build.js build",
"flow": "flow check",
"dev": "node ./build/build.js dev --watch",
"build": "npm run flow && npm run es5 && node ./build/build.js dev"
"test": "echo \"Error: no test specified\" && exit 1",
"es5": "node ./build/build.js build",
"flow": "flow check",
"dev": "node ./build/build.js dev --watch",
"build": "npm run flow && npm run es5 && node ./build/build.js dev"
},
"repository": {
"type": "git",
Expand All @@ -17,17 +17,19 @@
"author": "icepy",
"license": "MIT",
"devDependencies": {
"babel-plugin-transform-flow-strip-types": "^6.22.0",
"babel-preset-es2015-rollup": "^3.0.0",
"flow-bin": "^0.42.0",
"rollup": "^0.41.6",
"rollup-plugin-alias": "^1.2.1",
"rollup-plugin-babel": "^2.7.1",
"rollup-plugin-node-resolve": "^2.0.0",
"rollup-plugin-uglify": "^1.0.1",
"rollup-watch": "^3.2.2"
"babel-plugin-transform-flow-strip-types": "^6.22.0",
"babel-preset-es2015-rollup": "^3.0.0",
"flow-bin": "^0.42.0",
"rollup": "^0.41.6",
"rollup-plugin-alias": "^1.2.1",
"rollup-plugin-babel": "^2.7.1",
"rollup-plugin-commonjs": "^8.0.2",
"rollup-plugin-node-resolve": "^2.0.0",
"rollup-plugin-uglify": "^1.0.1",
"rollup-watch": "^3.2.2"
},
"dependencies": {
"weex-dingtalk-require": "^0.0.4"
"weex-dingtalk-polyfills": "0.0.5",
"weex-dingtalk-require": "^0.0.8"
}
}
5 changes: 5 additions & 0 deletions package/weex-dingtalk-exec/.babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"presets": [[
"es2015", { "modules": false }]],
"plugins": ["transform-flow-strip-types"]
}
2 changes: 2 additions & 0 deletions package/weex-dingtalk-exec/.flowconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[libs]
flow
37 changes: 37 additions & 0 deletions package/weex-dingtalk-exec/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Logs
logs
*.log
npm-debug.log*
dist
# Runtime data
pids
*.pid
*.seed

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# nyc test coverage
.nyc_output

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# node-waf configuration
.lock-wscript

# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules
jspm_packages

# Optional npm cache directory
.npm

# Optional REPL history
.node_repl_history
20 changes: 20 additions & 0 deletions package/weex-dingtalk-exec/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# weex-dingtalk-exec

> Dingtalk Weex Js Api SDK 通信通道
## Build Setup

```bash
# install devDependencies
npm install

# 启动构建exec
npm run es5

# 类型检查
npm run flow

# 最终构建,会经过类型检查完成之后构建成es5代码
npm run build

```
15 changes: 15 additions & 0 deletions package/weex-dingtalk-exec/build/build.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
var rollup = require("rollup");
var babel = require("rollup-plugin-babel");
var commonjs = require("rollup-plugin-commonjs");
var resolve = require("rollup-plugin-node-resolve");

rollup.rollup({
entry: './src/index.js',
plugins: [ resolve(),commonjs(),babel() ]
}).then(function(bundle){
bundle.write({
dest:'./dist/weex-dingtalk-exec.js',
format: 'cjs',
sourceMap: true
});
});
4 changes: 4 additions & 0 deletions package/weex-dingtalk-exec/flow/global-vars.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
declare var weex: Object;
declare var __weex_require__:Function;
declare var __weex_options__:Object;
declare var callNative:Function;
30 changes: 30 additions & 0 deletions package/weex-dingtalk-exec/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"name": "weex-dingtalk-exec",
"version": "0.0.7",
"description": "Dingtalk Weex Js Api SDK 通信通道",
"main": "src/index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"es5": "node ./build/build.js",
"flow": "flow check",
"build": "npm run flow & npm run es5"
},
"repository": {
"type": "git",
"url": "[email protected]:icepy/weex-dingtalk.git"
},
"author": "icepy",
"license": "MIT",
"devDependencies": {
"babel-plugin-transform-flow-strip-types": "^6.22.0",
"babel-preset-es2015-rollup": "^3.0.0",
"flow-bin": "^0.42.0",
"rollup": "^0.41.6",
"rollup-plugin-babel": "^2.7.1",
"rollup-plugin-commonjs": "^8.0.2",
"rollup-plugin-node-resolve": "^3.0.0"
},
"dependencies": {
"weex-dingtalk-polyfills": "0.0.5"
}
}
Loading

0 comments on commit 869edcb

Please sign in to comment.