fix AoT support and add publish script

This commit is contained in:
Ibby
2017-02-16 22:00:06 -05:00
parent 1b1a0e99e8
commit 87b5327a42
5 changed files with 72 additions and 19 deletions
+7 -4
View File
@@ -9,11 +9,12 @@
"dist"
],
"devDependencies": {
"@angular/compiler": "^2.4.7",
"@angular/compiler-cli": "^2.4.7",
"@angular/core": "^2.4.6",
"@angular/compiler": "2.2.1",
"@angular/compiler-cli": "2.2.1",
"@angular/core": "2.2.1",
"browserify": "^13.3.0",
"canonical-path": "0.0.2",
"child-process-promise": "^2.2.0",
"conventional-changelog-cli": "^1.2.0",
"conventional-github-releaser": "^1.1.3",
"cpr": "^2.0.2",
@@ -41,12 +42,14 @@
"q": "1.4.1",
"queue": "^4.2.1",
"rimraf": "^2.5.4",
"rxjs": "5.0.0-beta.12",
"semver": "^5.3.0",
"tsify": "~3.0.0",
"tslint": "^3.15.1",
"tslint-ionic-rules": "0.0.7",
"typescript": "~2.0.10",
"watchify": "~3.7.0"
"watchify": "~3.7.0",
"zone.js": "0.6.26"
},
"scripts": {
"test": "karma start",
+58
View File
@@ -0,0 +1,58 @@
// Node module dependencies
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', 'packages-dist', '@ionic-native'),
PLUGINS_ROOT = path.resolve(DIST, 'plugins'),
CORE = path.resolve(DIST, 'core'),
UTILS = path.resolve(DIST, 'utils');
const FLAGS = '--access public --tag alpha'; // add any flags here if you want... (example: --tag alpha)
console.log('Publishing @ionic-native/core');
exec(`npm publish ${CORE} ${FLAGS}`)
.then(() => exec(`npm publish ${UTILS} ${FLAGS}`))
.then(() => {
const PLUGINS = fs.readdirSync(PLUGINS_ROOT);
const QUEUE = queue({
concurrency: 10
});
PLUGINS.forEach(pluginName => {
QUEUE.push(done => {
console.log(`Publishing plugin ${pluginName}`);
const pluginPath = path.resolve(PLUGINS_ROOT, pluginName);
exec(`npm publish ${pluginPath} ${FLAGS}`)
.then(() => done())
.catch(done);
});
});
QUEUE.start((err) => {
if (err) {
console.log('Error publishing ionic-native. ', err);
} else {
console.log('Done publishing ionic-native!');
}
});
})
.catch(e => {
console.log('Publish failed');
console.log(e);
});
+3 -3
View File
@@ -5,14 +5,14 @@ UTILS="./dist/packages-dist/@ionic-native/utils/"
BUILD_PLUGINS_DIST='dist/packages-dist/@ionic-native/plugins'
echo "Publishing @ionic-native/core"
npm publish "$CORE" --access public
npm publish "$CORE" --access public --tag alpha
echo "Publishing @ionic-native/utils"
npm publish "$UTILS" --access public
npm publish "$UTILS" --access public --tag alpha
# For each plugin, replace the values in tsconfig w/ the appropriate ones for this plugin
for d in $PLUGINS ; do
BASE=`basename $d`
echo "Publishing @ionic-native/$BASE"
npm publish "$BUILD_PLUGINS_DIST/$BASE/" --access public
npm publish "$BUILD_PLUGINS_DIST/$BASE/" --access public --tag alpha
done
+2 -6
View File
@@ -4,20 +4,16 @@
"declaration": true,
"stripInternal": true,
"experimentalDecorators": true,
"emitDecoratorMetadata": true,
"module": "es2015",
"moduleResolution": "node",
"outDir": "../../dist/packages-dist/",
"rootDir": "../../src/",
"sourceMap": true,
"inlineSources": true,
"target": "es5",
"skipLibCheck": true,
"lib": ["es2015", "dom"]
},
"files": [
"../../src/@ionic-native/core/index.ts"
],
"angularCompilerOptions": {
"genDir": "aot"
}
]
}
+2 -6
View File
@@ -4,6 +4,7 @@
"declaration": true,
"stripInternal": true,
"experimentalDecorators": true,
"emitDecoratorMetadata": true,
"module": "es2015",
"moduleResolution": "node",
"outDir": "../../../dist/packages-dist/",
@@ -11,16 +12,11 @@
"@ionic-native/core": ["../../../dist/packages-dist/@ionic-native/core"]
},
"rootDir": "../../../src/",
"sourceMap": true,
"inlineSources": true,
"target": "es5",
"skipLibCheck": true,
"lib": ["es2015", "dom"]
},
"files": [
"../../../src/@ionic-native/plugins/{{PLUGIN}}/index.ts"
],
"angularCompilerOptions": {
"genDir": "aot"
}
]
}