Skip to content

Commit

Permalink
Merge pull request #176 from GeekyAnts/develop
Browse files Browse the repository at this point in the history
Release tag 0.1.0
  • Loading branch information
gauravprwl14 authored Aug 2, 2019
2 parents 7e95962 + 23042f6 commit b72b8ca
Show file tree
Hide file tree
Showing 100 changed files with 6,560 additions and 29,915 deletions.
16 changes: 9 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,16 @@ $ vue-native init <projectName>
## NOTE:

```
'AlertIOS',
'AsyncStorage',
'ImageStore',
'ListView',
'MaskedViewIOS',
'NetInfo',
'AsyncStorage',
'AlertIOS',
'WebView',
'ViewPagerAndroid',
'ListView',
'SwipeableListView',
'Slider'
'Slider',
'SwipeableListView',
'ViewPagerAndroid',
'WebView',
```
The above modules are set to be removed from future core react-native.
Hence these modules can no longer be imported from vue-native.
Expand Down
8 changes: 6 additions & 2 deletions build/.eslintrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@

{
"env": {
"es6": true,
},
"rules": {
"camelcase": 0
}
"camelcase": 0,
},
}
44 changes: 21 additions & 23 deletions build/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,6 @@ if (process.argv[2]) {
builds = builds.filter(b => {
return filters.some(f => b.dest.indexOf(f) > -1)
})
} else {
// filter out weex builds by default
builds = builds.filter(b => {
return b.dest.indexOf('weex') === -1
})
}

build(builds)
Expand All @@ -42,24 +37,27 @@ function build (builds) {

function buildEntry (config) {
const isProd = /min\.js$/.test(config.dest)
return rollup.rollup(config).then(bundle => {
const code = bundle.generate(config).code
if (isProd) {
var minified = (config.banner ? config.banner + '\n' : '') + uglify.minify(code, {
fromString: true,
output: {
screw_ie8: true,
ascii_only: true
},
compress: {
pure_funcs: ['makeMap']
}
}).code
return write(config.dest, minified, true)
} else {
return write(config.dest, code)
}
})
const output = config.output
const { file, banner } = output
return rollup.rollup(config)
.then(bundle => bundle.generate(output))
.then(({ output: [{ code }] }) => {
if (isProd) {
const minified = (banner ? banner + '\n' : '') + uglify.minify(code, {
fromString: true,
output: {
screw_ie8: true,
ascii_only: true
},
compress: {
pure_funcs: ['makeMap']
}
}).code
return write(file, minified, true)
} else {
return write(file, code)
}
})
}

function write (dest, code, zip) {
Expand Down
164 changes: 26 additions & 138 deletions build/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@ const buble = require("rollup-plugin-buble");
const alias = require("rollup-plugin-alias");
const replace = require("rollup-plugin-replace");
const flow = require("rollup-plugin-flow-no-whitespace");
const version = process.env.VERSION || require("../package.json").version;
const weexVersion =
process.env.WEEX_VERSION ||
require("../packages/weex-vue-framework/package.json").version;
const version =
process.env.VERSION
|| require("../packages/vue-native-core/package.json").version;

const banner =
"/*!\n" +
Expand All @@ -19,15 +18,6 @@ const banner =
" * Released under the MIT License.\n" +
" */";

const weexFactoryPlugin = {
intro() {
return "module.exports = function weexFactory (exports, renderer) {";
},
outro() {
return "}";
}
};

const aliases = require("./alias");
const resolve = p => {
const base = p.split("/")[0];
Expand All @@ -43,154 +33,52 @@ const builds = {
entry: resolve("vue-native/index.js"),
dest: resolve("packages/vue-native-core/build.js"),
format: "cjs",
external: ["react"]
external: ["react"],
},
"vue-native-helper": {
entry: resolve("vue-native/runtime/helpers.js"),
dest: resolve("packages/vue-native-helper/build.js"),
format: "cjs",
external: ["react", "change-case", "he", "de-indent"]
},
"vue-native-scripts": {
entry: resolve("vue-native/scripts/index.js"),
dest: resolve("packages/vue-native-scripts/build.js"),
format: "cjs",
external: []
.concat(Object.keys(require("../packages/vue-native-scripts/package.json").dependencies))
.concat(Object.keys(require("../packages/vue-native-scripts/package.json").peerDependencies)),
},
"vue-native-template-compiler": {
entry: resolve("vue-native/compiler.js"),
dest: resolve("packages/vue-native-template-compiler/build.js"),
format: "cjs",
external: ["change-case", "he", "de-indent"]
external: ["change-case", "he", "de-indent"],
}
// Runtime only (CommonJS). Used by bundlers e.g. Webpack & Browserify
// 'web-runtime-cjs': {
// entry: resolve('web/runtime.js'),
// dest: resolve('dist/vue.runtime.common.js'),
// format: 'cjs',
// banner
// },
// // Runtime+compiler CommonJS build (CommonJS)
// 'web-full-cjs': {
// entry: resolve('web/runtime-with-compiler.js'),
// dest: resolve('dist/vue.common.js'),
// format: 'cjs',
// alias: { he: './entity-decoder' },
// banner
// },
// // Runtime only (ES Modules). Used by bundlers that support ES Modules,
// // e.g. Rollup & Webpack 2
// 'web-runtime-esm': {
// entry: resolve('web/runtime.js'),
// dest: resolve('dist/vue.runtime.esm.js'),
// format: 'es',
// banner
// },
// // Runtime+compiler CommonJS build (ES Modules)
// 'web-full-esm': {
// entry: resolve('web/runtime-with-compiler.js'),
// dest: resolve('dist/vue.esm.js'),
// format: 'es',
// alias: { he: './entity-decoder' },
// banner
// },
// // runtime-only build (Browser)
// 'web-runtime-dev': {
// entry: resolve('web/runtime.js'),
// dest: resolve('dist/vue.runtime.js'),
// format: 'umd',
// env: 'development',
// banner
// },
// // runtime-only production build (Browser)
// 'web-runtime-prod': {
// entry: resolve('web/runtime.js'),
// dest: resolve('dist/vue.runtime.min.js'),
// format: 'umd',
// env: 'production',
// banner
// },
// // Runtime+compiler development build (Browser)
// 'web-full-dev': {
// entry: resolve('web/runtime-with-compiler.js'),
// dest: resolve('dist/vue.js'),
// format: 'umd',
// env: 'development',
// alias: { he: './entity-decoder' },
// banner
// },
// // Runtime+compiler production build (Browser)
// 'web-full-prod': {
// entry: resolve('web/runtime-with-compiler.js'),
// dest: resolve('dist/vue.min.js'),
// format: 'umd',
// env: 'production',
// alias: { he: './entity-decoder' },
// banner
// },
// // Web compiler (CommonJS).
// 'web-compiler': {
// entry: resolve('web/compiler.js'),
// dest: resolve('packages/vue-template-compiler/build.js'),
// format: 'cjs',
// external: Object.keys(require('../packages/vue-template-compiler/package.json').dependencies)
// },
// // Web server renderer (CommonJS).
// 'web-server-renderer': {
// entry: resolve('web/server-renderer.js'),
// dest: resolve('packages/vue-server-renderer/build.js'),
// format: 'cjs',
// external: Object.keys(require('../packages/vue-server-renderer/package.json').dependencies)
// },
// 'web-server-renderer-webpack-server-plugin': {
// entry: resolve('server/webpack-plugin/server.js'),
// dest: resolve('packages/vue-server-renderer/server-plugin.js'),
// format: 'cjs',
// external: Object.keys(require('../packages/vue-server-renderer/package.json').dependencies)
// },
// 'web-server-renderer-webpack-client-plugin': {
// entry: resolve('server/webpack-plugin/client.js'),
// dest: resolve('packages/vue-server-renderer/client-plugin.js'),
// format: 'cjs',
// external: Object.keys(require('../packages/vue-server-renderer/package.json').dependencies)
// },
// // Weex runtime factory
// 'weex-factory': {
// weex: true,
// entry: resolve('weex/runtime-factory.js'),
// dest: resolve('packages/weex-vue-framework/factory.js'),
// format: 'cjs',
// plugins: [weexFactoryPlugin]
// },
// // Weex runtime framework (CommonJS).
// 'weex-framework': {
// weex: true,
// entry: resolve('weex/framework.js'),
// dest: resolve('packages/weex-vue-framework/index.js'),
// format: 'cjs'
// },
// // Weex compiler (CommonJS). Used by Weex's Webpack loader.
// 'weex-compiler': {
// weex: true,
// entry: resolve('weex/compiler.js'),
// dest: resolve('packages/weex-template-compiler/build.js'),
// format: 'cjs',
// external: Object.keys(require('../packages/weex-template-compiler/package.json').dependencies)
// }
};

function genConfig(opts) {
const config = {
entry: opts.entry,
dest: opts.dest,
input: opts.entry,
output: {
file: opts.dest,
format: opts.format,
banner: opts.banner,
name: "Vue",
},
external: opts.external,
format: opts.format,
banner: opts.banner,
moduleName: "Vue",
plugins: [
replace({
__WEEX__: !!opts.weex,
__WEEX_VERSION__: weexVersion,
__VERSION__: version
}),
flow(),
buble(),
alias(Object.assign({}, aliases, opts.alias))
].concat(opts.plugins || [])
].concat(opts.plugins || []),
onwarn: (msg, warn) => {
if (!/Circular/.test(msg)) {
warn(msg)
}
},
};

if (opts.env) {
Expand Down
37 changes: 0 additions & 37 deletions build/release-weex.sh

This file was deleted.

Loading

0 comments on commit b72b8ca

Please sign in to comment.