actbase-cli
Advanced tools
Comparing version 0.1.0 to 0.1.2
@@ -109,3 +109,3 @@ "use strict"; | ||
let response = JSON.stringify(files, null, 2); | ||
response = 'export default ' + response.replace(/\"@([^\"]*)"/g, "require('$1')").replace(/"/g, "'"); | ||
response = 'export default ' + response.replace(/\"@([^\"]*)"/g, "require('./$1')").replace(/"/g, "'"); | ||
yield (0, _utils.writeFile)((_config5 = _config) === null || _config5 === void 0 ? void 0 : _config5.output, response); | ||
@@ -112,0 +112,0 @@ console.log('Write a file! '); |
@@ -22,4 +22,62 @@ "use strict"; | ||
var _ref = _asyncToGenerator(function* (pkgs, forceReset) { | ||
const file = yield (0, _utils.getPackageJson)(); | ||
console.log(file); | ||
let pkgv = null; | ||
const file = yield (0, _utils.getPackageJson)(pk => { | ||
pkgv = pk.version; | ||
}); | ||
if (!file.bugsnag) return; | ||
file.version++; | ||
const text = JSON.stringify(file, null, 2); | ||
yield (0, _utils.writeFile)('./actbase.json', text); | ||
if (file.bugsnag) { | ||
try { | ||
yield (0, _utils.execute)(`rm -rf build_ios && mkdir build_ios`); | ||
const cmd1 = ` | ||
npx react-native bundle | ||
--platform ios | ||
--dev false | ||
--entry-file index.js | ||
--bundle-output build_ios/release.bundle | ||
--sourcemap-output build_ios/release.bundle.map | ||
`; | ||
yield (0, _utils.execute)(cmd1); | ||
const cmd2 = `npx bugsnag-sourcemaps upload --api-key ${file.bugsnag} | ||
--source-map build_ios/release.bundle.map | ||
--minified-file build_ios/release.bundle | ||
--minified-url main.jsbundle | ||
--upload-sources | ||
--add-wildcard-prefix | ||
--code-bundle-id ${pkgv}-${file.version}`; | ||
yield (0, _utils.execute)(cmd2); | ||
} catch (e) { | ||
console.log(e); | ||
} | ||
yield (0, _utils.execute)(`rm -rf build_ios`); | ||
try { | ||
yield (0, _utils.execute)(`rm -rf build_and && mkdir build_and`); | ||
const cmd1 = ` | ||
npx react-native bundle | ||
--platform android | ||
--dev false | ||
--entry-file index.js | ||
--bundle-output build_and/release.bundle | ||
--sourcemap-output build_and/release.bundle.map | ||
`; | ||
yield (0, _utils.execute)(cmd1); | ||
const cmd2 = `npx bugsnag-sourcemaps upload --api-key ${file.bugsnag} | ||
--source-map build_and/release.bundle.map | ||
--minified-file build_and/release.bundle | ||
--minified-url index.android.bundle | ||
--upload-sources | ||
--add-wildcard-prefix | ||
--code-bundle-id ${pkgv}-${file.version}`; | ||
yield (0, _utils.execute)(cmd2); | ||
} catch (e) { | ||
console.log(e); | ||
} | ||
yield (0, _utils.execute)(`rm -rf build_and`); | ||
} | ||
}); | ||
@@ -26,0 +84,0 @@ |
@@ -274,2 +274,3 @@ "use strict"; | ||
let pkgVer = null; | ||
const file = yield (0, _utils.getPackageJson)( | ||
@@ -279,2 +280,4 @@ /*#__PURE__*/ | ||
var _ref8 = _asyncToGenerator(function* (pkg) { | ||
pkgVer = pkg.version; | ||
if (Object.keys(pkg.dependencies).indexOf('react-native-code-push') < 0) { | ||
@@ -400,3 +403,3 @@ console.log('install to codepush...'); | ||
--add-wildcard-prefix | ||
--code-bundle-id ${file.version}`; | ||
--code-bundle-id ${pkgVer}-${file.version}`; | ||
yield (0, _utils.execute)(cmd); | ||
@@ -427,3 +430,3 @@ } | ||
--add-wildcard-prefix | ||
--code-bundle-id ${file.version}`; | ||
--code-bundle-id ${pkgVer}-${file.version}`; | ||
yield (0, _utils.execute)(cmd); | ||
@@ -430,0 +433,0 @@ } |
@@ -23,3 +23,3 @@ "use strict"; | ||
return new Promise((resolve, reject) => { | ||
exec(cmd, (err, stdout, stderr) => { | ||
exec(cmd === null || cmd === void 0 ? void 0 : cmd.replace(/\n/g, ' '), (err, stdout, stderr) => { | ||
if (err) { | ||
@@ -91,6 +91,7 @@ console.log(err); | ||
var _ref2 = _asyncToGenerator(function* (fn) { | ||
const pfile = JSON.parse((yield readFile('./package.json'))); | ||
yield fn === null || fn === void 0 ? void 0 : fn(pfile); | ||
let cfile = {}; | ||
if (!fs.existsSync('./actbase.json')) { | ||
const pfile = JSON.parse((yield readFile('./package.json'))); | ||
const keys = Object.keys(pfile === null || pfile === void 0 ? void 0 : pfile.dependencies); | ||
@@ -111,3 +112,2 @@ let preset = 'react'; | ||
yield writeFile('./actbase.json', text); | ||
yield fn === null || fn === void 0 ? void 0 : fn(pfile); | ||
cfile.preset = preset; | ||
@@ -114,0 +114,0 @@ } else { |
{ | ||
"name": "actbase-cli", | ||
"version": "0.1.0", | ||
"version": "0.1.2", | ||
"description": "Actbase Command Line Interface", | ||
@@ -5,0 +5,0 @@ "author": "Trabricks LLC", |
39210
858