chore(): update angular build scripts

This commit is contained in:
Adam Bradley
2018-03-26 16:31:40 -05:00
parent dddaee1719
commit a1eabecc61
14 changed files with 4178 additions and 1268 deletions

View File

@ -1,3 +1,15 @@
# Local @ionic/angular test app development
1. `npm install` at the root of `angular`
2. `npm run build` to build local `@ionic/angular`
3. `npm link` to locally link `@ionic/angular`
4. `cd` to the test app, such as `angular/test/nav`
5. `npm install` in the test app directory
6. `npm link @ionic/angular` in the test app directory
7. `ng serve` in the test app directory
8. [http://localhost:4200/](http://localhost:4200/)
# npm link local development
`npm link` doesn't work as expected due to the `devDependency` on `@angular/core`. This is the work around...
@ -5,12 +17,3 @@
npm run build.link ../ionic-conference-app
When the command above is ran from the `angular` directory, it will build `@ionic/angular` and copy the `dist` directory to the correct location of another local project. In the example above, the end result is that it copies the `dist` directory to `../ionic-conference-app/node_modules/@ionic/angular/dist`. The path given should be relative to the root of this mono repo.
# Deploy
1. `npm run prepare.deploy`
2. Review/update changelog
3. Commit updates using the package name and version number as the commit message.
4. `npm run deploy`
5. :tada:

View File

@ -2,23 +2,12 @@ const path = require('path');
const cwd = process.cwd();
const glob = require('glob');
const rimRaf = require('rimraf');
const fs = require('fs-extra');
const distDir = path.join(cwd, 'dist');
const distDir = path.join(__dirname, '../dist');
const distGeneratedNodeModules = path.join(distDir, 'node_modules');
function rimRafAsync(dir) {
return new Promise((resolve, reject) => {
rimRaf(dir, {}, err => {
if (err) {
return reject(err);
}
resolve();
})
});
}
function doGlob(globString) {
return new Promise((resolve, reject) => {
glob(globString, (err, matches) => {
@ -40,15 +29,14 @@ function getCodegenedFilesToDelete() {
const deleteFilePromises = [];
listOfGlobResults.forEach(fileMatches => {
fileMatches.forEach(filePath => {
deleteFilePromises.push(rimRafAsync(filePath));
deleteFilePromises.push(fs.remove(filePath));
})
})
return Promise.all(deleteFilePromises);
});
}
const taskPromises = [];
taskPromises.push(getCodegenedFilesToDelete());
taskPromises.push(rimRafAsync(distGeneratedNodeModules));
return Promise.all(taskPromises);
Promise.all([
getCodegenedFilesToDelete(),
fs.remove(distGeneratedNodeModules)
]);