Skip to content

Commit 9eab516

Browse files
committed
Copy package and readme
1 parent f45f61e commit 9eab516

File tree

6 files changed

+35
-58
lines changed

6 files changed

+35
-58
lines changed

src/lib/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Angular Material
2+
=======
3+
4+
The sources for this package are in the main [Angular Material](https://github.com/angular/material2) repo. Please file issues and pull requests against that repo.
5+
6+
License: MIT

src/lib/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@
33
"version": "2.0.0-beta.2",
44
"description": "Angular Material",
55
"main": "./bundles/material.umd.js",
6-
"module": "./index.js",
7-
"typings": "./index.d.ts",
6+
"module": "./@angular/material.es5.js",
7+
"es2015": "./@angular/material.js",
8+
"typings": "./material.d.ts",
89
"repository": {
910
"type": "git",
1011
"url": "https://github.com/angular/material2.git"

tools/gulp/gulpfile.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,4 @@ import './tasks/unit-test';
1111
import './tasks/aot';
1212
import './tasks/payload';
1313
import './tasks/coverage';
14-
import './tasks/library';
15-
16-
import './tasks/packaging';
14+
import './tasks/library';

tools/gulp/tasks/library.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import {createRollupBundle} from '../util/rollup-helper';
77
import {transpileFile} from '../util/ts-compiler';
88
import {ScriptTarget, ModuleKind} from 'typescript';
99
import {writeFileSync} from 'fs';
10-
import {green} from 'chalk';
1110

1211
// There are no type definitions available for these imports.
1312
const inlineResources = require('../../../scripts/release/inline-resources');
@@ -93,8 +92,6 @@ async function buildModuleEntry(entryFile: string, entryName = '') {
9392

9493
// Output a minified version of the UMD bundle
9594
writeFileSync(umdMinFile, uglify.minify(umdFile, UGLIFYJS_OPTIONS).code);
96-
97-
console.log(green(`Built module ${moduleName} successfully.`));
9895
}
9996

10097
/**

tools/gulp/tasks/packaging.ts

Lines changed: 0 additions & 23 deletions
This file was deleted.

tools/gulp/tasks/release.ts

Lines changed: 25 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -2,54 +2,55 @@ import {spawn} from 'child_process';
22
import {existsSync, statSync, copySync} from 'fs-extra';
33
import {join} from 'path';
44
import {task, src, dest} from 'gulp';
5-
import {execTask} from '../util/task_helpers';
6-
import {DIST_RELEASE, DIST_BUNDLES, DIST_MATERIAL} from '../constants';
7-
8-
// There are no type definitions available for these imports.
9-
import gulpRunSequence = require('run-sequence');
10-
import minimist = require('minimist');
5+
import {execTask, sequenceTask} from '../util/task_helpers';
6+
import {DIST_RELEASE, DIST_BUNDLES, DIST_MATERIAL, COMPONENTS_DIR} from '../constants';
7+
import * as minimist from 'minimist';
118

9+
/** Parse command-line arguments for release task. */
1210
const argv = minimist(process.argv.slice(3));
1311

14-
// Capture all d.ts files output by typescript compilation except for the special files
15-
// generated by ngc.
12+
// Capture all d.ts files output by typescript compilation except for the
13+
// special files generated by ngc.
1614
const typingsGlob = [
1715
join(DIST_MATERIAL, '**', '*.d.ts'),
1816
`!${join(DIST_MATERIAL, 'index.d.ts')}`,
1917
`!${join(DIST_MATERIAL, 'public_api.d.ts')}`,
2018
];
2119

20+
const assetsGlob = join(COMPONENTS_DIR, '+(package.json|README.md)');
21+
2222
// Capture all UMD bundles.
2323
const umdGlob = join(DIST_BUNDLES, '*.umd.*');
2424

2525
// Capture all flat ESM bunldes (e.g., "material.js" and "material.es5.js")
26-
const fesmGlob = [join(DIST_BUNDLES, "*.js"), `!${umdGlob}`];
27-
28-
task('build:release', function(done: () => void) {
29-
gulpRunSequence(
30-
'library:build',
31-
':package:release',
32-
done
33-
);
34-
});
26+
const fesmGlob = [join(DIST_BUNDLES, '*.js'), `!${umdGlob}`];
27+
28+
task('build:release', sequenceTask(
29+
'library:build',
30+
':package:release',
31+
));
3532

3633
/** Task that combines intermediate build artifacts into the release package structure. */
3734
task(':package:release', [
3835
':package:metadata',
3936
':package:typings',
4037
':package:umd',
4138
':package:fesm',
39+
':package:assets'
4240
]);
4341

42+
4443
/** Copy metatadata.json and associated d.ts files to the root of the package structure. */
4544
task(':package:metadata', () => {
46-
// https://github.com/angular/angular/blob/master/build.sh#L293-L294
45+
// See: https://github.com/angular/angular/blob/master/build.sh#L293-L294
4746
copySync(join(DIST_MATERIAL, 'public_api.d.ts'), join(DIST_RELEASE, 'public_api.d.ts'));
4847
copySync(join(DIST_MATERIAL, 'index.d.ts'), join(DIST_RELEASE, 'material.d.ts'));
4948
copySync(join(DIST_MATERIAL, 'index.metadata.json'),
5049
join(DIST_RELEASE, 'material.metadata.json'));
5150
});
5251

52+
task(':package:assets', () => src(assetsGlob).pipe(dest(DIST_RELEASE)));
53+
5354
/** Copy all d.ts except the special flat typings from ngc to typings/ in the release package. */
5455
task(':package:typings', () => src(typingsGlob).pipe(dest(join(DIST_RELEASE, 'typings'))));
5556

@@ -131,12 +132,9 @@ task(':publish', function(done: (err?: any) => void) {
131132
.then(() => process.chdir(currentDir));
132133
});
133134

134-
task('publish', function(done: () => void) {
135-
gulpRunSequence(
136-
':publish:whoami',
137-
'build:release',
138-
':publish',
139-
':publish:logout',
140-
done
141-
);
142-
});
135+
task('publish', sequenceTask(
136+
':publish:whoami',
137+
'build:release',
138+
':publish',
139+
':publish:logout',
140+
));

0 commit comments

Comments
 (0)