Skip to content

Commit f65e6e4

Browse files
committed
feat(package): added support of angular schematics
1 parent c08eff7 commit f65e6e4

11 files changed

+874
-10
lines changed

gulpfile.js

+16-6
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,18 @@ gulp.task('build', ['clean'], (cb) => {
271271
runSequence('compile', 'test', 'npm-package', 'rollup-bundle', cb);
272272
});
273273

274+
// Build the schematics in dist
275+
gulp.task('build:schematics', () => {
276+
// return execDemoCmd(`build --preserve-symlinks --prod --aot --build-optimizer`, {cwd: `${config.demoDir}`});
277+
return execCmd('tsc', '-p src/schematics/tsconfig.json').then(exitCode => {
278+
if (exitCode === 0) {
279+
return execCmd('webpack', '--config src/schematics/webpack.config.js --progress --colors');
280+
} else {
281+
Promise.reject(1);
282+
}
283+
});
284+
});
285+
274286
// Same as 'build' but without cleaning temp folders (to avoid breaking demo app, if currently being served)
275287
gulp.task('build-watch', (cb) => {
276288
runSequence('compile', 'test', 'npm-package', 'rollup-bundle', cb);
@@ -300,7 +312,7 @@ gulp.task('build:watch-fast', ['build-watch-no-tests'], () => {
300312
gulp.task('npm-package', (cb) => {
301313
let pkgJson = JSON.parse(fs.readFileSync('./package.json', 'utf8'));
302314
let targetPkgJson = {};
303-
let fieldsToCopy = ['version', 'description', 'keywords', 'author', 'repository', 'license', 'bugs', 'homepage'];
315+
let fieldsToCopy = ['version', 'description', 'keywords', 'author', 'repository', 'license', 'bugs', 'homepage', 'schematics'];
304316

305317
targetPkgJson['name'] = config.libraryName;
306318

@@ -491,8 +503,7 @@ gulp.task('serve:doc', ['clean:doc'], (cb) => {
491503
const execDemoCmd = (args, opts) => {
492504
if (fs.existsSync(`${config.demoDir}/node_modules`)) {
493505
return execCmd('ng', args, opts, `/${config.demoDir}`);
494-
}
495-
else {
506+
} else {
496507
gulpUtil.log(gulpUtil.colors.yellow(`No 'node_modules' found in '${config.demoDir}'. Installing dependencies for you...`));
497508
return helpers.installDependencies({cwd: `${config.demoDir}`})
498509
.then(exitCode => exitCode === 0 ? execCmd('ng', args, opts, `/${config.demoDir}`) : Promise.reject())
@@ -657,7 +668,7 @@ gulp.task('create-new-tag', (cb) => {
657668
});
658669

659670
// Build and then Publish 'dist' folder to NPM
660-
gulp.task('npm-publish', ['build'], () => {
671+
gulp.task('npm-publish', ['build', 'build:schematics'], () => {
661672
return execExternalCmd('npm', `publish ${config.outputDir} --access public`)
662673
});
663674

@@ -672,8 +683,7 @@ gulp.task('release', (cb) => {
672683
if (!readyToRelease()) {
673684
gulpUtil.log(gulpUtil.colors.red('# Pre-Release Checks have failed. Please fix them and try again. Aborting...'));
674685
cb();
675-
}
676-
else {
686+
} else {
677687
gulpUtil.log(gulpUtil.colors.green('# Pre-Release Checks have succeeded. Continuing...'));
678688
runSequence(
679689
'bump-version',

0 commit comments

Comments
 (0)