Skip to content

Commit 7c145d7

Browse files
committed
feat(package): added schematics support #69
1 parent d180485 commit 7c145d7

File tree

10 files changed

+683
-7
lines changed

10 files changed

+683
-7
lines changed

gulpfile.js

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,17 @@ gulp.task('build', ['clean'], (cb) => {
271271
runSequence('compile', 'test', 'npm-package', 'rollup-bundle', cb);
272272
});
273273

274+
gulp.task('build:schematics', () => {
275+
// return execDemoCmd(`build --preserve-symlinks --prod --aot --build-optimizer`, {cwd: `${config.demoDir}`});
276+
return execCmd('tsc', '-p src/schematics/tsconfig.json').then(exitCode => {
277+
if (exitCode === 0) {
278+
return execCmd('webpack', '--config src/schematics/webpack.config.js --progress --colors');
279+
} else {
280+
Promise.reject(1);
281+
}
282+
});
283+
});
284+
274285
// Same as 'build' but without cleaning temp folders (to avoid breaking demo app, if currently being served)
275286
gulp.task('build-watch', (cb) => {
276287
runSequence('compile', 'test', 'npm-package', 'rollup-bundle', cb);
@@ -297,7 +308,7 @@ gulp.task('build:watch-fast', ['build-watch-no-tests'], () => {
297308
/////////////////////////////////////////////////////////////////////////////
298309

299310
// Prepare 'dist' folder for publication to NPM
300-
gulp.task('npm-package', (cb) => {
311+
gulp.task('npm-package', ['build:schematics'], (cb) => {
301312
let pkgJson = JSON.parse(fs.readFileSync('./package.json', 'utf8'));
302313
let targetPkgJson = {};
303314
let fieldsToCopy = ['version', 'description', 'keywords', 'author', 'repository', 'license', 'bugs', 'homepage'];
@@ -491,8 +502,7 @@ gulp.task('serve:doc', ['clean:doc'], (cb) => {
491502
const execDemoCmd = (args, opts) => {
492503
if (fs.existsSync(`${config.demoDir}/node_modules`)) {
493504
return execCmd('ng', args, opts, `/${config.demoDir}`);
494-
}
495-
else {
505+
} else {
496506
fancyLog(acolors.yellow(`No 'node_modules' found in '${config.demoDir}'. Installing dependencies for you...`));
497507
return helpers.installDependencies({cwd: `${config.demoDir}`})
498508
.then(exitCode => exitCode === 0 ? execCmd('ng', args, opts, `/${config.demoDir}`) : Promise.reject())
@@ -661,8 +671,7 @@ gulp.task('release', (cb) => {
661671
if (!readyToRelease()) {
662672
fancyLog(acolors.red('# Pre-Release Checks have failed. Please fix them and try again. Aborting...'));
663673
cb();
664-
}
665-
else {
674+
} else {
666675
fancyLog(acolors.green('# Pre-Release Checks have succeeded. Continuing...'));
667676
runSequence(
668677
'bump-version',

0 commit comments

Comments
 (0)