1
0
mirror of https://gitcode.com/gh_mirrors/re/react-native-pushy.git synced 2025-10-31 21:33:12 +08:00
Code Issues Packages Projects Releases Wiki Activity GitHub Gitee
This commit is contained in:
tdzl2003
2016-02-23 00:36:23 +08:00
parent 8bc608581c
commit 56495062c4
16 changed files with 254 additions and 63 deletions

View File

@@ -0,0 +1,6 @@
{
"plugins": [
"transform-es2015-modules-commonjs",
"transform-strict-mode"
]
}

View File

@@ -0,0 +1,7 @@
/.idea
/src
/.babelrc
/.npmignore
/.eslintrc
/.nvmrc
/.travis.yml

View File

@@ -4,10 +4,11 @@
"description": "Command tools for javaScript updater with `pushy` service for react native apps.",
"main": "index.js",
"bin": {
"pushy": "cli.js"
"pushy": "lib/cli.js"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"test": "echo \"Error: no test specified\" && exit 1",
"prepublish": "node_modules/.bin/babel src --out-dir lib"
},
"repository": {
"type": "git",
@@ -25,7 +26,9 @@
"url": "https://github.com/reactnativecn/react-native-pushy/issues"
},
"homepage": "https://github.com/reactnativecn/react-native-pushy/tree/master/react-native-pushy-cli",
"dependencies": {
"babel-register": "^6.5.2"
"devDependencies": {
"babel-cli": "^6.5.1",
"babel-plugin-transform-es2015-modules-commonjs": "^6.5.2",
"babel-plugin-transform-strict-mode": "^6.5.2"
}
}

View File

@@ -3,11 +3,10 @@
* Created by tdzl2003 on 2/13/16.
*/
var path = require('path');
var fs = require('fs');
import * as path from 'path';
import * as fs from 'fs-promise';
var CLI_MODULE_PATH = function() {
const CLI_MODULE_PATH = function() {
return path.resolve(
process.cwd(),
'node_modules',
@@ -16,7 +15,7 @@ var CLI_MODULE_PATH = function() {
);
};
var PACKAGE_JSON_PATH = function() {
const PACKAGE_JSON_PATH = function() {
return path.resolve(
process.cwd(),
'node_modules',
@@ -27,18 +26,8 @@ var PACKAGE_JSON_PATH = function() {
checkForVersionCommand();
require('babel-register')({
'plugins': [
'transform-async-to-generator',
'transform-strict-mode',
'transform-object-rest-spread',
'transform-es2015-parameters',
'transform-es2015-destructuring',
],
});
var cli;
var cliPath = CLI_MODULE_PATH();
let cli;
const cliPath = CLI_MODULE_PATH();
if (fs.existsSync(cliPath)) {
cli = require(cliPath);
}
@@ -53,7 +42,7 @@ if (cli) {
function checkForVersionCommand() {
if (process.argv.indexOf('-v') >= 0 || process.argv[2] === 'version') {
console.log('react-native-pushy-cli: ' + require('./package.json').version);
console.log('react-native-pushy-cli: ' + require('../package.json').version);
try {
console.log('react-native-pushy: ' + require(PACKAGE_JSON_PATH()).version);
} catch (e) {