Revert "chore(package): bump dependencies and lint rules"

This reverts commit 21ad4734fa.
This commit is contained in:
Daniel
2018-03-17 00:13:08 +01:00
parent 21ad4734fa
commit 6c938bfdb7
178 changed files with 4221 additions and 10592 deletions
+40 -36
View File
@@ -1,6 +1,6 @@
'use strict';
"use strict";
// Node module dependencies
const fs = require('fs-extra'),
const fs = require('fs-extra-promise').useFs(require('fs-extra')),
queue = require('queue'),
path = require('path'),
exec = require('child_process').exec;
@@ -15,6 +15,7 @@ const ROOT = path.resolve(path.join(__dirname, '../../')), // root ionic-native
BUILD_DIST_ROOT = path.resolve(ROOT, 'dist/@ionic-native'), // dist directory root path
BUILD_CORE_DIST = path.resolve(BUILD_DIST_ROOT, 'core'); // core dist directory path
// dependency versions
const ANGULAR_VERSION = '*',
RXJS_VERSION = '^5.0.1',
@@ -23,13 +24,13 @@ const ANGULAR_VERSION = '*',
// package dependencies
const CORE_PEER_DEPS = {
rxjs: RXJS_VERSION
'rxjs': RXJS_VERSION
};
const PLUGIN_PEER_DEPS = {
'@ionic-native/core': MIN_CORE_VERSION,
'@angular/core': ANGULAR_VERSION,
rxjs: RXJS_VERSION
'rxjs': RXJS_VERSION
};
// set peer dependencies for all plugins
@@ -43,10 +44,8 @@ fs.mkdirpSync(BUILD_TMP);
console.log('Preparing core module package.json');
CORE_PACKAGE_JSON.version = IONIC_NATIVE_VERSION;
CORE_PACKAGE_JSON.peerDependencies = CORE_PEER_DEPS;
fs.writeJsonSync(
path.resolve(BUILD_CORE_DIST, 'package.json'),
CORE_PACKAGE_JSON
);
fs.writeJsonSync(path.resolve(BUILD_CORE_DIST, 'package.json'), CORE_PACKAGE_JSON);
// Fetch a list of the plugins
const PLUGINS = fs.readdirSync(PLUGINS_PATH);
@@ -60,9 +59,7 @@ const index = pluginsToBuild.indexOf('ignore-errors');
if (index > -1) {
ignoreErrors = true;
pluginsToBuild.splice(index, 1);
console.log(
'Build will continue even if errors were thrown. Errors will be printed when build finishes.'
);
console.log('Build will continue even if errors were thrown. Errors will be printed when build finishes.');
}
if (!pluginsToBuild.length) {
@@ -74,9 +71,12 @@ const QUEUE = queue({
concurrency: require('os').cpus().length
});
// Function to process a single plugin
const addPluginToQueue = pluginName => {
QUEUE.push(callback => {
QUEUE.push((callback) => {
console.log(`Building plugin: ${pluginName}`);
const PLUGIN_BUILD_DIR = path.resolve(BUILD_TMP, 'plugins', pluginName),
@@ -84,10 +84,10 @@ const addPluginToQueue = pluginName => {
let tsConfigPath;
fs
.mkdirs(PLUGIN_BUILD_DIR) // create tmp build dir
.then(() => fs.mkdirs(path.resolve(BUILD_DIST_ROOT, pluginName))) // create dist dir
fs.mkdirpAsync(PLUGIN_BUILD_DIR) // create tmp build dir
.then(() => fs.mkdirpAsync(path.resolve(BUILD_DIST_ROOT, pluginName))) // create dist dir
.then(() => {
// Write tsconfig.json
const tsConfig = JSON.parse(JSON.stringify(PLUGIN_TS_CONFIG));
tsConfig.files = [PLUGIN_SRC_PATH];
@@ -95,7 +95,7 @@ const addPluginToQueue = pluginName => {
tsConfigPath = path.resolve(PLUGIN_BUILD_DIR, 'tsconfig.json');
return fs.writeJson(tsConfigPath, tsConfig);
return fs.writeJsonAsync(tsConfigPath, tsConfig);
})
.then(() => {
// clone package.json
@@ -104,39 +104,42 @@ const addPluginToQueue = pluginName => {
packageJson.name = `@ionic-native/${pluginName}`;
packageJson.version = IONIC_NATIVE_VERSION;
return fs.writeJson(
path.resolve(BUILD_DIST_ROOT, pluginName, 'package.json'),
packageJson
);
return fs.writeJsonAsync(path.resolve(BUILD_DIST_ROOT, pluginName, 'package.json'), packageJson);
})
.then(() => {
// compile the plugin
exec(
`${ROOT}/node_modules/.bin/ngc -p ${tsConfigPath}`,
(err, stdout, stderr) => {
if (err) {
if (!ignoreErrors) {
// oops! something went wrong.
console.log(err);
callback(`\n\nBuilding ${pluginName} failed.`);
return;
} else {
errors.push(err);
}
exec(`${ROOT}/node_modules/.bin/ngc -p ${tsConfigPath}`, (err, stdout, stderr) => {
if (err) {
if (!ignoreErrors) {
// oops! something went wrong.
console.log(err);
callback(`\n\nBuilding ${pluginName} failed.`);
return;
} else {
errors.push(err);
}
// we're done with this plugin!
callback();
}
);
// we're done with this plugin!
callback();
});
})
.catch(callback);
}); // QUEUE.push end
};
pluginsToBuild.forEach(addPluginToQueue);
QUEUE.start(err => {
QUEUE.start((err) => {
if (err) {
console.log('Error building plugins.');
console.log(err);
@@ -152,4 +155,5 @@ QUEUE.start(err => {
} else {
console.log('Done processing plugins!');
}
});
+15 -8
View File
@@ -1,10 +1,11 @@
'use strict';
"use strict";
// Node module dependencies
const fs = require('fs-extra'),
const fs = require('fs-extra-promise').useFs(require('fs-extra')),
queue = require('queue'),
path = require('path'),
exec = require('child-process-promise').exec;
const ROOT = path.resolve(path.join(__dirname, '../../')),
DIST = path.resolve(ROOT, 'dist', '@ionic-native');
@@ -19,16 +20,15 @@ const QUEUE = queue({
});
PACKAGES.forEach(packageName => {
QUEUE.push(done => {
console.log(`Publishing @ionic-native/${packageName}`);
const packagePath = path.resolve(DIST, packageName);
exec(`npm publish ${packagePath} ${FLAGS}`)
.then(() => done())
.catch(e => {
if (
e.stderr &&
e.stderr.indexOf('previously published version') === -1
) {
.catch((e) => {
if (e.stderr && e.stderr.indexOf('previously published version') === -1) {
failedPackages.push({
cmd: e.cmd,
stderr: e.stderr
@@ -36,10 +36,13 @@ PACKAGES.forEach(packageName => {
}
done();
});
});
});
QUEUE.start(err => {
QUEUE.start((err) => {
if (err) {
console.log('Error publishing ionic-native. ', err);
} else if (failedPackages.length > 0) {
@@ -48,4 +51,8 @@ QUEUE.start(err => {
} else {
console.log('Done publishing ionic-native!');
}
});
+14 -15
View File
@@ -1,40 +1,39 @@
'use strict';
"use strict";
const config = require('../config.json'),
projectPackage = require('../../package.json'),
path = require('path'),
fs = require('fs-extra'),
fs = require('fs-extra-promise').useFs(require('fs-extra')),
Dgeni = require('dgeni');
module.exports = gulp => {
gulp.task('docs', [], () => {
try {
const ionicPackage = require('./dgeni-config')(projectPackage.version),
dgeni = new Dgeni([ionicPackage]);
return dgeni
.generate()
.then(docs => console.log(docs.length + ' docs generated'));
return dgeni.generate().then(docs => console.log(docs.length + ' docs generated'));
} catch (err) {
console.log(err.stack);
}
});
gulp.task('readmes', [], function() {
fs.copySync(
path.resolve(__dirname, '..', '..', 'README.md'),
path.resolve(__dirname, '..', '..', config.pluginDir, 'core', 'README.md')
);
fs.copySync(path.resolve(__dirname, '..', '..', 'README.md'), path.resolve(__dirname, '..', '..', config.pluginDir, 'core', 'README.md'));
try {
const ionicPackage = require('./dgeni-readmes-config')(
projectPackage.version
),
const ionicPackage = require('./dgeni-readmes-config')(projectPackage.version),
dgeni = new Dgeni([ionicPackage]);
return dgeni
.generate()
.then(docs => console.log(docs.length + ' README files generated'));
return dgeni.generate().then(docs => console.log(docs.length + ' README files generated'));
} catch (err) {
console.log(err.stack);
}
});
};