fix(build): add package.json and README to the build:release output. (#1308)

This commit is contained in:
Hans
2016-09-22 14:21:27 -07:00
committed by Kara
parent 1a824d2a0b
commit bbe347572c
2 changed files with 19 additions and 6 deletions
+15 -4
View File
@@ -19,7 +19,16 @@ const resolveBin = require('resolve-bin');
/** If the string passed in is a glob, returns it, otherwise append '**\/*' to it. */
function _globify(maybeGlob: string, suffix = '**/*') {
return maybeGlob.indexOf('*') != -1 ? maybeGlob : path.join(maybeGlob, suffix);
if (maybeGlob.indexOf('*') != -1) {
return maybeGlob;
}
try {
const stat = fs.statSync(maybeGlob);
if (stat.isFile()) {
return maybeGlob;
}
} catch (e) {}
return path.join(maybeGlob, suffix);
}
@@ -133,9 +142,11 @@ export function execNodeTask(packageName: string, executable: string | string[],
/** Copy files from a glob to a destination. */
export function copyTask(srcGlobOrDir: string, outRoot: string) {
return () => {
return gulp.src(_globify(srcGlobOrDir)).pipe(gulp.dest(outRoot));
export function copyTask(srcGlobOrDir: string | string[], outRoot: string) {
if (typeof srcGlobOrDir === 'string') {
return () => gulp.src(_globify(srcGlobOrDir)).pipe(gulp.dest(outRoot));
} else {
return () => gulp.src(srcGlobOrDir.map(name => _globify(name))).pipe(gulp.dest(outRoot));
}
}
+4 -2
View File
@@ -28,8 +28,10 @@ task(':watch:components:spec', () => {
task(':build:components:ts', tsBuildTask(componentsDir));
task(':build:components:spec', tsBuildTask(path.join(componentsDir, 'tsconfig-spec.json')));
task(':build:components:assets',
copyTask(path.join(componentsDir, '*/**/*.!(ts|spec.ts)'), DIST_COMPONENTS_ROOT));
task(':build:components:assets', copyTask([
path.join(componentsDir, '**/*.!(ts|spec.ts)'),
path.join(PROJECT_ROOT, 'README.md'),
], DIST_COMPONENTS_ROOT));
task(':build:components:scss', sassBuildTask(
DIST_COMPONENTS_ROOT, componentsDir, [path.join(componentsDir, 'core/style')]
));