-
Notifications
You must be signed in to change notification settings - Fork 6.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
build: create example package #4046
Merged
Merged
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
2 changes: 2 additions & 0 deletions
2
src/examples/autocomplete-overview/autocomplete-overview-example.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
{ | ||
"name": "@angular/material-examples", | ||
"version": "2.0.0-beta.3", | ||
"description": "Angular Material", | ||
"main": "./bundles/examples.umd.js", | ||
"module": "./@angular/examples.es5.js", | ||
"es2015": "./@angular/examples.js", | ||
"typings": "./examples.d.ts", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/angular/material2.git" | ||
}, | ||
"keywords": [ | ||
"angular", | ||
"material", | ||
"material design", | ||
"components" | ||
], | ||
"license": "MIT", | ||
"bugs": { | ||
"url": "https://github.com/angular/material2/issues" | ||
}, | ||
"homepage": "https://github.com/angular/material2#readme", | ||
"peerDependencies": { | ||
"@angular/core": "^4.0.0", | ||
"@angular/common": "^4.0.0", | ||
"@angular/http": "^4.0.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export * from './example-data'; | ||
export * from './example-module'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// TypeScript config file that is used to compile the examples. Target environment needs to be | ||
// ES2015 since the build process will create FESM bundles using rollup. | ||
{ | ||
"compilerOptions": { | ||
"baseUrl": ".", | ||
"declaration": true, | ||
"stripInternal": false, | ||
"experimentalDecorators": true, | ||
"module": "es2015", | ||
"moduleResolution": "node", | ||
"outDir": "../../dist/packages/examples", | ||
"paths": { | ||
"@angular/material": [ | ||
"../../dist/packages/material" | ||
] | ||
}, | ||
"rootDir": ".", | ||
"sourceMap": true, | ||
"inlineSources": true, | ||
"target": "es2015", | ||
"lib": ["es2015", "dom"], | ||
"skipLibCheck": true, | ||
"types": [] | ||
}, | ||
"files": [ | ||
"public_api.ts" | ||
], | ||
"angularCompilerOptions": { | ||
"annotateForClosureCompiler": true, | ||
"strictMetadataEmit": true, | ||
"flatModuleOutFile": "index.js", | ||
"skipTemplateCodegen": true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
import {task, watch} from 'gulp'; | ||
import {join} from 'path'; | ||
import {main as tsc} from '@angular/tsc-wrapped'; | ||
import {SOURCE_ROOT, DIST_BUNDLES, DIST_EXAMPLES} from '../constants'; | ||
import {sequenceTask, sassBuildTask, copyTask, triggerLivereload} from '../util/task_helpers'; | ||
import {createRollupBundle} from '../util/rollup-helper'; | ||
import {transpileFile} from '../util/ts-compiler'; | ||
import {buildModuleEntry, composeRelease} from '../util/package-build'; | ||
import {ScriptTarget, ModuleKind} from 'typescript'; | ||
import {writeFileSync} from 'fs'; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looks like a lot of unused imports in this file (and library.ts / release.ts) now |
||
|
||
// There are no type definitions available for these imports. | ||
const inlineResources = require('../../../scripts/release/inline-resources'); | ||
const uglify = require('uglify-js'); | ||
|
||
const examplesRoot = join(SOURCE_ROOT, 'examples'); | ||
const tsconfigPath = join(examplesRoot, 'tsconfig-build.json'); | ||
|
||
// Paths to the different output directories. | ||
const examplesOut = DIST_EXAMPLES; | ||
const bundlesDir = DIST_BUNDLES; | ||
|
||
const examplesMain = join(examplesOut, 'public_api.js'); | ||
|
||
task('examples:clean-build', sequenceTask('clean', 'examples:build')); | ||
|
||
task('examples:build', sequenceTask( | ||
// The examples depend on the library. Build the library first. | ||
'library:build', | ||
// Build ESM and copy HTML assets to the dist. | ||
['examples:build:esm', 'examples:assets:html'], | ||
// Inline assets into ESM output. | ||
'examples:assets:inline', | ||
// Build bundles on top of inlined ESM output. | ||
'examples:build:bundles', | ||
)); | ||
|
||
task('examples:release', ['examples:clean-build'], () => composeRelease('examples')); | ||
|
||
/** | ||
* TypeScript compilation tasks. Tasks are creating ESM, FESM, UMD bundles for releases. | ||
**/ | ||
|
||
task('examples:build:esm', () => tsc(tsconfigPath, {basePath: examplesRoot})); | ||
task('examples:build:bundles', () => buildModuleEntry(examplesMain, 'examples')); | ||
|
||
/** | ||
* Asset tasks. Copying and inlining CSS, HTML files into the ESM output. | ||
**/ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Only one |
||
|
||
task('examples:assets:html', copyTask(join(examplesRoot, '**/*.+(html|css)'), examplesOut)); | ||
task('examples:assets:inline', () => inlineResources(examplesOut)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's make this
angular-material-examples
since it's not something we should ever publish under@angular