mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2025-04-21 17:36:27 +08:00
chore(): modify dist paths (#1213)
* chore(): modify dist paths * fixes
This commit is contained in:
parent
fdffb055be
commit
edf4c75bbd
@ -40,7 +40,7 @@
|
|||||||
"build": "npm run clean && npm run lint && npm run build:core && npm run build:modules",
|
"build": "npm run clean && npm run lint && npm run build:core && npm run build:modules",
|
||||||
"build:core": "ngc -p scripts/build/tsconfig-core.json",
|
"build:core": "ngc -p scripts/build/tsconfig-core.json",
|
||||||
"build:modules": "node scripts/build/build.js",
|
"build:modules": "node scripts/build/build.js",
|
||||||
"clean": "rimraf dist",
|
"clean": "rimraf dist .tmp",
|
||||||
"shipit": "npm run build && gulp readmes && npm run npmpub",
|
"shipit": "npm run build && gulp readmes && npm run npmpub",
|
||||||
"npmpub": "node scripts/build/publish.js",
|
"npmpub": "node scripts/build/publish.js",
|
||||||
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s -r 0"
|
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s -r 0"
|
||||||
|
@ -12,8 +12,7 @@ const ROOT = path.resolve(path.join(__dirname, '../../')), // root ionic-native
|
|||||||
PLUGIN_PACKAGE_JSON = require(path.resolve(__dirname, 'plugin-package.json')), // plugin package.json template
|
PLUGIN_PACKAGE_JSON = require(path.resolve(__dirname, 'plugin-package.json')), // plugin package.json template
|
||||||
PLUGIN_TS_CONFIG = require(path.resolve(__dirname, 'tsconfig-plugin.json')), // plugin tsconfig template
|
PLUGIN_TS_CONFIG = require(path.resolve(__dirname, 'tsconfig-plugin.json')), // plugin tsconfig template
|
||||||
BUILD_TMP = path.resolve(ROOT, '.tmp'), // tmp directory path
|
BUILD_TMP = path.resolve(ROOT, '.tmp'), // tmp directory path
|
||||||
BUILD_DIST_ROOT = path.resolve(ROOT, 'dist/packages-dist/@ionic-native'), // dist directory root path
|
BUILD_DIST_ROOT = path.resolve(ROOT, 'dist/@ionic-native'), // dist directory root path
|
||||||
BUILD_PLUGINS_DIST = path.resolve(BUILD_DIST_ROOT, 'plugins'), // plugins dist directory path
|
|
||||||
BUILD_CORE_DIST = path.resolve(BUILD_DIST_ROOT, 'core'); // core dist directory path
|
BUILD_CORE_DIST = path.resolve(BUILD_DIST_ROOT, 'core'); // core dist directory path
|
||||||
|
|
||||||
|
|
||||||
@ -37,13 +36,6 @@ const PLUGIN_PEER_DEPS = {
|
|||||||
// set peer dependencies for all plugins
|
// set peer dependencies for all plugins
|
||||||
PLUGIN_PACKAGE_JSON.peerDependencies = PLUGIN_PEER_DEPS;
|
PLUGIN_PACKAGE_JSON.peerDependencies = PLUGIN_PEER_DEPS;
|
||||||
|
|
||||||
|
|
||||||
// Delete dist directory and any temporary files
|
|
||||||
console.log('Removing old TMP directory');
|
|
||||||
fs.removeSync(BUILD_TMP);
|
|
||||||
fs.removeSync(BUILD_PLUGINS_DIST);
|
|
||||||
|
|
||||||
|
|
||||||
// Create tmp/dist directories
|
// Create tmp/dist directories
|
||||||
console.log('Making new TMP directory');
|
console.log('Making new TMP directory');
|
||||||
fs.mkdirpSync(BUILD_TMP);
|
fs.mkdirpSync(BUILD_TMP);
|
||||||
@ -79,7 +71,7 @@ const addPluginToQueue = pluginName => {
|
|||||||
let tsConfigPath;
|
let tsConfigPath;
|
||||||
|
|
||||||
fs.mkdirpAsync(PLUGIN_BUILD_DIR) // create tmp build dir
|
fs.mkdirpAsync(PLUGIN_BUILD_DIR) // create tmp build dir
|
||||||
.then(() => fs.mkdirpAsync(path.resolve(BUILD_PLUGINS_DIST, pluginName))) // create dist dir
|
.then(() => fs.mkdirpAsync(path.resolve(BUILD_DIST_ROOT, pluginName))) // create dist dir
|
||||||
.then(() => {
|
.then(() => {
|
||||||
|
|
||||||
// Write tsconfig.json
|
// Write tsconfig.json
|
||||||
@ -98,7 +90,7 @@ const addPluginToQueue = pluginName => {
|
|||||||
packageJson.name = `@ionic-native/${pluginName}`;
|
packageJson.name = `@ionic-native/${pluginName}`;
|
||||||
packageJson.version = IONIC_NATIVE_VERSION;
|
packageJson.version = IONIC_NATIVE_VERSION;
|
||||||
|
|
||||||
return fs.writeJsonAsync(path.resolve(BUILD_PLUGINS_DIST, pluginName, 'package.json'), packageJson);
|
return fs.writeJsonAsync(path.resolve(BUILD_DIST_ROOT, pluginName, 'package.json'), packageJson);
|
||||||
})
|
})
|
||||||
.then(() => {
|
.then(() => {
|
||||||
|
|
||||||
|
@ -7,30 +7,24 @@ const fs = require('fs-extra-promise').useFs(require('fs-extra')),
|
|||||||
|
|
||||||
|
|
||||||
const ROOT = path.resolve(path.join(__dirname, '../../')),
|
const ROOT = path.resolve(path.join(__dirname, '../../')),
|
||||||
DIST = path.resolve(ROOT, 'dist', 'packages-dist', '@ionic-native'),
|
DIST = path.resolve(ROOT, 'dist', '@ionic-native');
|
||||||
PLUGINS_ROOT = path.resolve(DIST, 'plugins'),
|
|
||||||
CORE = path.resolve(DIST, 'core');
|
|
||||||
|
|
||||||
const FLAGS = '--access public'; // add any flags here if you want... (example: --tag alpha)
|
const FLAGS = '--access public'; // add any flags here if you want... (example: --tag alpha)
|
||||||
|
|
||||||
console.log('Publishing @ionic-native/core');
|
const PACKAGES = fs.readdirSync(DIST);
|
||||||
exec(`npm publish ${CORE} ${FLAGS}`)
|
|
||||||
.then(() => {
|
|
||||||
|
|
||||||
const PLUGINS = fs.readdirSync(PLUGINS_ROOT);
|
|
||||||
|
|
||||||
const QUEUE = queue({
|
const QUEUE = queue({
|
||||||
concurrency: 10
|
concurrency: 10
|
||||||
});
|
});
|
||||||
|
|
||||||
PLUGINS.forEach(pluginName => {
|
PACKAGES.forEach(packageName => {
|
||||||
|
|
||||||
QUEUE.push(done => {
|
QUEUE.push(done => {
|
||||||
|
|
||||||
console.log(`Publishing plugin ${pluginName}`);
|
console.log(`Publishing @ionic-native/${packageName}`);
|
||||||
const pluginPath = path.resolve(PLUGINS_ROOT, pluginName);
|
const packagePath = path.resolve(DIST, packageName);
|
||||||
|
exec(`npm publish ${packagePath} ${FLAGS}`)
|
||||||
exec(`npm publish ${pluginPath} ${FLAGS}`)
|
|
||||||
.then(() => done())
|
.then(() => done())
|
||||||
.catch(done);
|
.catch(done);
|
||||||
|
|
||||||
@ -48,10 +42,3 @@ exec(`npm publish ${CORE} ${FLAGS}`)
|
|||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
})
|
|
||||||
.catch(e => {
|
|
||||||
|
|
||||||
console.log('Publish failed');
|
|
||||||
console.log(e);
|
|
||||||
|
|
||||||
});
|
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
"emitDecoratorMetadata": true,
|
"emitDecoratorMetadata": true,
|
||||||
"module": "es2015",
|
"module": "es2015",
|
||||||
"moduleResolution": "node",
|
"moduleResolution": "node",
|
||||||
"outDir": "../../dist/packages-dist/",
|
"outDir": "../../dist/",
|
||||||
"rootDir": "../../src/",
|
"rootDir": "../../src/",
|
||||||
"target": "es5",
|
"target": "es5",
|
||||||
"skipLibCheck": true,
|
"skipLibCheck": true,
|
||||||
|
@ -7,16 +7,14 @@
|
|||||||
"emitDecoratorMetadata": true,
|
"emitDecoratorMetadata": true,
|
||||||
"module": "es2015",
|
"module": "es2015",
|
||||||
"moduleResolution": "node",
|
"moduleResolution": "node",
|
||||||
"outDir": "../../../dist/packages-dist/",
|
"outDir": "../../../dist/@ionic-native/",
|
||||||
"paths": {
|
"paths": {
|
||||||
"@ionic-native/core": ["../../../dist/packages-dist/@ionic-native/core"]
|
"@ionic-native/core": ["../../../dist/@ionic-native/core"]
|
||||||
},
|
},
|
||||||
"rootDir": "../../../src/",
|
"rootDir": "../../../src/@ionic-native/plugins/",
|
||||||
"target": "es5",
|
"target": "es5",
|
||||||
"skipLibCheck": true,
|
"skipLibCheck": true,
|
||||||
"lib": ["es2015", "dom"]
|
"lib": ["es2015", "dom"]
|
||||||
},
|
},
|
||||||
"files": [
|
"files": []
|
||||||
"../../../src/@ionic-native/plugins/{{PLUGIN}}/index.ts"
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
|
@ -2,5 +2,5 @@
|
|||||||
"sitePath": "../ionic-site",
|
"sitePath": "../ionic-site",
|
||||||
"v2DocsDir": "docs/v2/native",
|
"v2DocsDir": "docs/v2/native",
|
||||||
"docsDest": "../ionic-site/content/docs/v2/native",
|
"docsDest": "../ionic-site/content/docs/v2/native",
|
||||||
"pluginDir": "dist/packages-dist/@ionic-native/plugins"
|
"pluginDir": "dist/@ionic-native"
|
||||||
}
|
}
|
||||||
|
@ -101,6 +101,7 @@ module.exports = function(currentVersion) {
|
|||||||
docTypes: ['class'],
|
docTypes: ['class'],
|
||||||
getOutputPath: function(doc) {
|
getOutputPath: function(doc) {
|
||||||
return doc.originalModule.replace(config.pluginDir + '/', '')
|
return doc.originalModule.replace(config.pluginDir + '/', '')
|
||||||
|
.replace('/plugins', '')
|
||||||
.replace('/index', '') + '/README.md';
|
.replace('/index', '') + '/README.md';
|
||||||
}
|
}
|
||||||
}];
|
}];
|
||||||
@ -141,7 +142,7 @@ module.exports = function(currentVersion) {
|
|||||||
|
|
||||||
// Configure file writing
|
// Configure file writing
|
||||||
.config(function(writeFilesProcessor) {
|
.config(function(writeFilesProcessor) {
|
||||||
writeFilesProcessor.outputFolder = './dist/packages-dist/';
|
writeFilesProcessor.outputFolder = './dist/';
|
||||||
})
|
})
|
||||||
|
|
||||||
// Configure rendering
|
// Configure rendering
|
||||||
|
@ -1,5 +1,8 @@
|
|||||||
var config = require('../config.json');
|
var config = require('../config.json');
|
||||||
var projectPackage = require('../../package.json');
|
var projectPackage = require('../../package.json');
|
||||||
|
var path = require('path');
|
||||||
|
var fs = require('fs-extra-promise').useFs(require('fs-extra'));
|
||||||
|
|
||||||
module.exports = function(gulp) {
|
module.exports = function(gulp) {
|
||||||
gulp.task('docs', [], function() {
|
gulp.task('docs', [], function() {
|
||||||
var Dgeni = require('dgeni');
|
var Dgeni = require('dgeni');
|
||||||
@ -18,6 +21,9 @@ module.exports = function(gulp) {
|
|||||||
gulp.task('readmes', [], function() {
|
gulp.task('readmes', [], function() {
|
||||||
var Dgeni = require('dgeni');
|
var Dgeni = require('dgeni');
|
||||||
var semver = require('semver');
|
var semver = require('semver');
|
||||||
|
|
||||||
|
fs.copySync(path.resolve(__dirname, '..', '..', 'README.md'), path.resolve(__dirname, '..', '..', config.pluginDir, 'core', 'README.md'));
|
||||||
|
|
||||||
try {
|
try {
|
||||||
var ionicPackage = require('./dgeni-readmes-config')(projectPackage.version);
|
var ionicPackage = require('./dgeni-readmes-config')(projectPackage.version);
|
||||||
var dgeni = new Dgeni([ionicPackage]);
|
var dgeni = new Dgeni([ionicPackage]);
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
"module": "es2015",
|
"module": "es2015",
|
||||||
"moduleResolution": "node",
|
"moduleResolution": "node",
|
||||||
"paths": {
|
"paths": {
|
||||||
"@ionic-native/core": ["./dist/packages-dist/@ionic-native/core"]
|
"@ionic-native/core": ["./dist/@ionic-native/core"]
|
||||||
},
|
},
|
||||||
"rootDir": ".",
|
"rootDir": ".",
|
||||||
"target": "es5",
|
"target": "es5",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user