Skip to content

Commit 96c83de

Browse files
committed
feat(project): added schematics support #145
1 parent e50521f commit 96c83de

File tree

10 files changed

+631
-9
lines changed

10 files changed

+631
-9
lines changed

gulpfile.js

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,17 @@ gulp.task('build', ['clean'], (cb) => {
285285
runSequence('compile', 'test', 'npm-package', 'rollup-bundle', cb);
286286
});
287287

288+
gulp.task('build:schematics', () => {
289+
// return execDemoCmd(`build --preserve-symlinks --prod --aot --build-optimizer`, {cwd: `${config.demoDir}`});
290+
return execCmd('tsc', '-p src/schematics/tsconfig.json').then(exitCode => {
291+
if (exitCode === 0) {
292+
return execCmd('webpack', '--config src/schematics/webpack.config.js --progress --colors');
293+
} else {
294+
Promise.reject(1);
295+
}
296+
});
297+
});
298+
288299
// Same as 'build' but without cleaning temp folders (to avoid breaking demo app, if currently being served)
289300
gulp.task('build-watch', (cb) => {
290301
runSequence('compile', 'test', 'npm-package', 'rollup-bundle', cb);
@@ -311,10 +322,10 @@ gulp.task('build:watch-fast', ['build-watch-no-tests'], () => {
311322
/////////////////////////////////////////////////////////////////////////////
312323

313324
// Prepare 'dist' folder for publication to NPM
314-
gulp.task('npm-package', (cb) => {
325+
gulp.task('npm-package', ['build:schematics'], (cb) => {
315326
let pkgJson = JSON.parse(fs.readFileSync('./package.json', 'utf8'));
316327
let targetPkgJson = {};
317-
let fieldsToCopy = ['version', 'description', 'keywords', 'author', 'repository', 'license', 'bugs', 'homepage'];
328+
let fieldsToCopy = ['version', 'description', 'keywords', 'author', 'repository', 'license', 'bugs', 'homepage', 'schematics'];
318329

319330
targetPkgJson['name'] = config.libraryName;
320331

@@ -505,8 +516,7 @@ gulp.task('serve:doc', ['clean:doc'], (cb) => {
505516
const execDemoCmd = (args, opts) => {
506517
if (fs.existsSync(`${config.demoDir}/node_modules`)) {
507518
return execCmd('ng', args, opts, `/${config.demoDir}`);
508-
}
509-
else {
519+
} else {
510520
gulpUtil.log(gulpUtil.colors.yellow(`No 'node_modules' found in '${config.demoDir}'. Installing dependencies for you...`));
511521
return helpers.installDependencies({cwd: `${config.demoDir}`})
512522
.then(exitCode => exitCode === 0 ? execCmd('ng', args, opts, `/${config.demoDir}`) : Promise.reject())
@@ -710,8 +720,7 @@ gulp.task('release', (cb) => {
710720
if (!readyToRelease()) {
711721
gulpUtil.log(gulpUtil.colors.red('# Pre-Release Checks have failed. Please fix them and try again. Aborting...'));
712722
cb();
713-
}
714-
else {
723+
} else {
715724
gulpUtil.log(gulpUtil.colors.green('# Pre-Release Checks have succeeded. Continuing...'));
716725
runSequence(
717726
'bump-version',

0 commit comments

Comments
 (0)