Skip to content

Commit 97ac76b

Browse files
committed
build: use genrule to generate example module
Since we no longer use NGC for generating the package output of the examples, we can start using the genrule for the `ExampleModule` again. This means that we can fully remove the example module tasks from gulp. Additionally renames the `material-examples` package to `examples` and removes the `module.ts` workaround for the examples since we do not need a flat module index file with ngtsc.
1 parent ffe47a7 commit 97ac76b

File tree

823 files changed

+391
-549
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

823 files changed

+391
-549
lines changed

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ jobs:
356356

357357
# TODO(devversion): Ideally the "build_release_packages" job should build all packages with
358358
# Bazel, but for now we mix up the Gulp and bazel setup, so we need to build the package here.
359-
- run: bazel build src/material-examples:npm_package --config=release
359+
- run: bazel build src/examples:npm_package --config=release
360360

361361
- run: ./scripts/circleci/publish-snapshots.sh
362362

.github/CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@
121121

122122
# Docs examples & guides
123123
/guides/** @jelbourn
124-
/src/material-examples/** @jelbourn
124+
/src/examples/** @jelbourn
125125

126126
# Accessibility demos
127127
/src/a11y-demo/**/* @jelbourn

.gitignore

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,6 @@
66
/deploy
77
/bazel-out
88

9-
# Example module file will be auto-generated.
10-
# TODO(devversion): re-add the example-module once angular#30259 is fixed.
11-
# /src/material-examples/example-module.ts
12-
139
# dependencies
1410
node_modules
1511
/bower_components

rollup-globals.bzl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,13 +105,13 @@ create_globals(
105105
# Rollup globals the examples package. Since individual examples are
106106
# grouped by package and component, the primary entry-point imports
107107
# from entry-points which should be treated as external imports.
108-
create_globals("material-examples/cdk", CDK_ENTRYPOINTS)
109-
create_globals("material-examples/cdk-experimental", CDK_EXPERIMENTAL_ENTRYPOINTS)
108+
create_globals("examples/cdk", CDK_ENTRYPOINTS)
109+
create_globals("examples/cdk-experimental", CDK_EXPERIMENTAL_ENTRYPOINTS)
110110
create_globals(
111-
"material-examples/material",
111+
"examples/material",
112112
MATERIAL_ENTRYPOINTS + MATERIAL_TESTING_ENTRYPOINTS,
113113
)
114114
create_globals(
115-
"material-examples/material-experimental",
115+
"examples/material-experimental",
116116
MATERIAL_EXPERIMENTAL_ENTRYPOINTS + MATERIAL_EXPERIMENTAL_TESTING_ENTRYPOINTS,
117117
)

scripts/deploy/publish-docs-content.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ docsDistPath="${projectPath}/dist/docs"
2323
# Path to the cloned docs-content repository.
2424
docsContentPath="${projectPath}/tmp/material2-docs-content"
2525

26-
# Path to the release output of the Bazel "@angular/material-examples" NPM package.
27-
examplesPackagePath="$(bazel info bazel-bin)/src/material-examples/npm_package"
26+
# Path to the release output of the Bazel "@angular/examples" NPM package.
27+
examplesPackagePath="$(bazel info bazel-bin)/src/examples/npm_package"
2828

2929
# Git clone URL for the material2-docs-content repository.
3030
docsContentRepoUrl="https://github.com/angular/material2-docs-content"

src/dev-app/example/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ ng_module(
77
srcs = glob(["**/*.ts"]),
88
deps = [
99
"//src/cdk/coercion",
10-
"//src/material-examples:examples",
10+
"//src/examples",
1111
"//src/material/expansion",
1212
"@npm//@angular/elements",
1313
],

src/dev-app/example/example-list.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*/
88

99
import {Component, Input} from '@angular/core';
10-
import {EXAMPLE_COMPONENTS} from '@angular/material-examples';
10+
import {EXAMPLE_COMPONENTS} from '@angular/examples';
1111
import {coerceBooleanProperty} from '@angular/cdk/coercion';
1212

1313
/** Displays a set of material examples in a mat-accordion. */

src/dev-app/example/example-module.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@
99
import {CommonModule} from '@angular/common';
1010
import {NgModule} from '@angular/core';
1111
import {MatExpansionModule} from '@angular/material/expansion';
12-
import {ExampleModule as ExampleDataModule} from '@angular/material-examples';
12+
import {ExampleModule as DocsExampleModule} from '@angular/examples';
1313
import {Example} from './example';
1414

1515

1616
import {ExampleList} from './example-list';
1717

1818
@NgModule({
19-
imports: [CommonModule, ExampleDataModule, MatExpansionModule],
19+
imports: [CommonModule, MatExpansionModule, DocsExampleModule],
2020
declarations: [Example, ExampleList],
2121
exports: [Example, ExampleList]
2222
})

src/dev-app/example/example.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
import {coerceBooleanProperty} from '@angular/cdk/coercion';
1010
import {Component, ElementRef, Injector, Input, OnInit} from '@angular/core';
11-
import {EXAMPLE_COMPONENTS} from '@angular/material-examples';
11+
import {EXAMPLE_COMPONENTS} from '@angular/examples';
1212
import {createCustomElement} from '@angular/elements';
1313

1414
@Component({

src/dev-app/examples-page/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ ng_module(
77
srcs = glob(["**/*.ts"]),
88
deps = [
99
"//src/dev-app/example",
10-
"//src/material-examples:examples",
10+
"//src/examples",
1111
"@npm//@angular/router",
1212
],
1313
)

src/dev-app/examples-page/examples-page.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*/
88

99
import {Component} from '@angular/core';
10-
import {EXAMPLE_COMPONENTS} from '@angular/material-examples';
10+
import {EXAMPLE_COMPONENTS} from '@angular/examples';
1111

1212
/** Renders all material examples listed in the generated EXAMPLE_COMPONENTS. */
1313
@Component({

src/dev-app/popover-edit/BUILD.bazel

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ ng_module(
77
srcs = glob(["**/*.ts"]),
88
deps = [
99
"//src/dev-app/example",
10-
"//src/material-examples/cdk-experimental/popover-edit",
11-
"//src/material-examples/material-experimental/popover-edit",
10+
"//src/examples/cdk-experimental/popover-edit",
11+
"//src/examples/material-experimental/popover-edit",
1212
"@npm//@angular/forms",
1313
"@npm//@angular/router",
1414
],

src/dev-app/popover-edit/popover-edit-demo-module.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,9 @@
77
*/
88

99
import {NgModule} from '@angular/core';
10+
import {CdkPopoverEditExamplesModule} from '@angular/examples/cdk-experimental/popover-edit';
11+
import {PopoverEditExamplesModule} from '@angular/examples/material-experimental/popover-edit';
1012
import {FormsModule} from '@angular/forms';
11-
import {
12-
CdkPopoverEditExamplesModule
13-
} from '@angular/material-examples/cdk-experimental/popover-edit/module';
14-
import {
15-
PopoverEditExamplesModule
16-
} from '@angular/material-examples/material-experimental/popover-edit/module';
1713
import {RouterModule} from '@angular/router';
1814
import {PopoverEditDemo} from './popover-edit-demo';
1915

src/dev-app/ripple/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ ng_module(
1111
],
1212
deps = [
1313
"//src/dev-app/example",
14-
"//src/material-examples/material/core",
14+
"//src/examples/material/core",
1515
"//src/material/button",
1616
"//src/material/checkbox",
1717
"//src/material/icon",

src/dev-app/ripple/ripple-demo-module.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
*/
88

99
import {NgModule} from '@angular/core';
10+
import {CoreExamplesModule} from '@angular/examples/material/core';
1011
import {FormsModule} from '@angular/forms';
11-
import {CoreExamplesModule} from '@angular/material-examples/material/core/module';
1212
import {MatButtonModule} from '@angular/material/button';
1313
import {MatCheckboxModule} from '@angular/material/checkbox';
1414
import {MatIconModule} from '@angular/material/icon';

src/dev-app/system-config-tmpl.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ var packagesConfig = {};
3232
// Configure all primary entry-points.
3333
configureEntryPoint('cdk');
3434
configureEntryPoint('cdk-experimental');
35+
configureEntryPoint('examples');
3536
configureEntryPoint('material');
3637
configureEntryPoint('material-experimental');
37-
configureEntryPoint('material-examples');
3838
configureEntryPoint('material-moment-adapter');
3939

4040
// Configure all secondary entry-points.
@@ -56,7 +56,7 @@ configureEntryPoint('youtube-player');
5656
/** Configures the specified package, its entry-point and its examples. */
5757
function configureEntryPoint(pkgName, entryPoint) {
5858
var name = entryPoint ? pkgName + '/' + entryPoint : pkgName;
59-
var examplesName = 'material-examples/' + name;
59+
var examplesName = 'examples/' + name;
6060

6161
pathMapping['@angular/' + name] = srcRunfilePath + '/' + name;
6262
pathMapping['@angular/' + examplesName] = srcRunfilePath + '/' + examplesName;

src/dev-app/table/BUILD.bazel

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ ng_module(
88
assets = ["table-demo.html"],
99
deps = [
1010
"//src/dev-app/example",
11-
"//src/material-examples/cdk/table",
12-
"//src/material-examples/material/table",
11+
"//src/examples/cdk/table",
12+
"//src/examples/material/table",
1313
"@npm//@angular/router",
1414
],
1515
)

src/dev-app/table/table-demo-module.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
*/
88

99
import {NgModule} from '@angular/core';
10+
import {CdkTableExamplesModule} from '@angular/examples/cdk/table';
11+
import {TableExamplesModule} from '@angular/examples/material/table';
1012
import {RouterModule} from '@angular/router';
11-
import {CdkTableExamplesModule} from '@angular/material-examples/cdk/table/module';
12-
import {TableExamplesModule} from '@angular/material-examples/material/table/module';
1313
import {TableDemo} from './table-demo';
1414

1515
@NgModule({

src/dev-app/tabs/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ ng_module(
88
assets = ["tabs-demo.html"],
99
deps = [
1010
"//src/dev-app/example",
11-
"//src/material-examples/material/tabs",
11+
"//src/examples/material/tabs",
1212
"//src/material/tabs",
1313
"@npm//@angular/router",
1414
],

src/dev-app/tabs/tabs-demo-module.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
*/
88

99
import {NgModule} from '@angular/core';
10+
import {TabGroupExamplesModule} from '@angular/examples/material/tabs';
1011
import {MatTabsModule} from '@angular/material/tabs';
1112
import {RouterModule} from '@angular/router';
12-
import {TabGroupExamplesModule} from '@angular/material-examples/material/tabs/module';
1313
import {TabsDemo} from './tabs-demo';
1414

1515
@NgModule({

src/dev-app/tooltip/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ ng_module(
88
assets = ["tooltip-demo.html"],
99
deps = [
1010
"//src/dev-app/example",
11-
"//src/material-examples/material/tooltip",
11+
"//src/examples/material/tooltip",
1212
"@npm//@angular/router",
1313
],
1414
)

src/dev-app/tooltip/tooltip-demo-module.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
*/
88

99
import {NgModule} from '@angular/core';
10+
import {TooltipExamplesModule} from '@angular/examples/material/tooltip';
1011
import {RouterModule} from '@angular/router';
11-
import {TooltipExamplesModule} from '@angular/material-examples/material/tooltip/module';
1212
import {TooltipDemo} from './tooltip-demo';
1313

1414
@NgModule({

src/dev-app/tree/BUILD.bazel

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ ng_module(
1616
],
1717
deps = [
1818
"//src/cdk/tree",
19-
"//src/material-examples/cdk/tree",
20-
"//src/material-examples/material/tree",
19+
"//src/examples/cdk/tree",
20+
"//src/examples/material/tree",
2121
"//src/material/button",
2222
"//src/material/checkbox",
2323
"//src/material/expansion",

src/dev-app/tree/tree-demo-module.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
import {CdkTreeModule} from '@angular/cdk/tree';
99
import {CommonModule} from '@angular/common';
1010
import {NgModule} from '@angular/core';
11+
import {CdkTreeExamplesModule} from '@angular/examples/cdk/tree';
12+
import {TreeExamplesModule} from '@angular/examples/material/tree';
1113
import {FormsModule} from '@angular/forms';
1214
import {MatButtonModule} from '@angular/material/button';
1315
import {MatCheckboxModule} from '@angular/material/checkbox';
@@ -18,8 +20,6 @@ import {MatInputModule} from '@angular/material/input';
1820
import {MatProgressBarModule} from '@angular/material/progress-bar';
1921
import {MatTreeModule} from '@angular/material/tree';
2022
import {RouterModule} from '@angular/router';
21-
import {CdkTreeExamplesModule} from '@angular/material-examples/cdk/tree/module';
22-
import {TreeExamplesModule} from '@angular/material-examples/material/tree/module';
2323

2424
import {ChecklistNestedTreeDemo} from './checklist-tree-demo/checklist-nested-tree-demo';
2525
import {ChecklistTreeDemo} from './checklist-tree-demo/checklist-tree-demo';

src/dev-app/tsconfig.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
"@angular/cdk-experimental": ["../cdk-experimental"],
1616
"@angular/material-moment-adapter": ["../material-moment-adapter/public-api.ts"],
1717
"@angular/google-maps": ["../google-maps"],
18-
"@angular/material-examples": ["../material-examples"],
19-
"@angular/material-examples/*": ["../material-examples/*"]
18+
"@angular/examples": ["../examples"],
19+
"@angular/examples/*": ["../examples/*"]
2020
}
2121
},
2222
"include": ["./**/*.ts"]

src/e2e-app/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ ng_module(
3131
"//src/cdk/overlay",
3232
"//src/cdk/scrolling",
3333
"//src/cdk/testing/tests:test_components",
34-
"//src/material-examples:examples",
34+
"//src/examples",
3535
"//src/material-experimental/mdc-button",
3636
"//src/material-experimental/mdc-card",
3737
"//src/material-experimental/mdc-checkbox",

src/e2e-app/example-viewer/example-list-viewer.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
import {Component, Input} from '@angular/core';
1010

11-
/** Loads an example component from `@angular/material-examples`. */
11+
/** Loads an example component from `@angular/examples`. */
1212
@Component({
1313
selector: 'example-list-viewer',
1414
template: `

src/e2e-app/example-viewer/example-viewer-module.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
import {CommonModule} from '@angular/common';
1010
import {NgModule} from '@angular/core';
11-
import {ExampleModule as ExampleDataModule} from '@angular/material-examples';
11+
import {ExampleModule as ExampleDataModule} from '@angular/examples';
1212
import {ExampleListViewer} from './example-list-viewer.component';
1313
import {ExampleViewer} from './example-viewer';
1414

src/e2e-app/example-viewer/example-viewer.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88

99
import {Component, ElementRef, Injector, Input, OnInit} from '@angular/core';
1010
import {createCustomElement} from '@angular/elements';
11-
import {EXAMPLE_COMPONENTS} from '@angular/material-examples';
11+
import {EXAMPLE_COMPONENTS} from '@angular/examples';
1212

13-
/** Loads an example component from `@angular/material-examples` */
13+
/** Loads an example component from `@angular/examples` */
1414
@Component({
1515
selector: 'example-viewer',
1616
template: `

src/e2e-app/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"@angular/cdk-experimental/*": ["../cdk-experimental/*"],
1313
"@angular/cdk-experimental": ["../cdk-experimental/"],
1414
"@angular/material-moment-adapter": ["../material-moment-adapter/"],
15-
"@angular/material-examples": ["../material-examples/"]
15+
"@angular/examples": ["../examples/"]
1616
}
1717
},
1818
"include": ["./**/*.ts"]

0 commit comments

Comments
 (0)