-
Notifications
You must be signed in to change notification settings - Fork 6.8k
build: serve dev-app with bazel #16829
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
Merged
Merged
Changes from all commits
Commits
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 hidden or 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 hidden or 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 |
---|---|---|
|
@@ -17,12 +17,12 @@ | |
"build": "gulp build-release-packages", | ||
"bazel:buildifier": "find . -type f \\( -name \"*.bzl\" -or -name WORKSPACE -or -name BUILD -or -name BUILD.bazel \\) ! -path \"*/node_modules/*\" | xargs buildifier -v --warnings=attr-cfg,attr-license,attr-non-empty,attr-output-default,attr-single-file,constant-glob,ctx-args,depset-iteration,depset-union,dict-concatenation,duplicated-name,filetype,git-repository,http-archive,integer-division,load,load-on-top,native-build,native-package,output-group,package-name,package-on-top,redefined-variable,repository-name,same-origin-load,string-iteration,unused-variable", | ||
"bazel:format-lint": "yarn -s bazel:buildifier --lint=warn --mode=check", | ||
"dev-app": "gulp serve:devapp", | ||
"dev-app": "bazel run //src/dev-app:devserver", | ||
"test": "bazel test //src/... --test_tag_filters=-e2e,-browser:firefox-local --build_tag_filters=-browser:firefox-local --build_tests_only", | ||
"test-firefox": "bazel test //src/... --test_tag_filters=-e2e,-browser:chromium-local --build_tag_filters=-browser:chromium-local --build_tests_only", | ||
"lint": "gulp lint && yarn -s bazel:format-lint", | ||
"e2e": "bazel test //src/... --test_tag_filters=e2e", | ||
"deploy": "gulp deploy:devapp", | ||
"deploy": "echo 'Not supported yet. Tracked with COMP-230'", | ||
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. I moved this to the queue since I want to keep this deploy functional; we'll likely want to do some amount of IE and mobile testing with the MDC components as we progress |
||
"webdriver-manager": "webdriver-manager", | ||
"breaking-changes": "gulp breaking-changes", | ||
"gulp": "gulp", | ||
|
@@ -75,7 +75,6 @@ | |
"@firebase/app-types": "^0.3.2", | ||
"@octokit/rest": "^16.28.7", | ||
"@schematics/angular": "^8.2.1", | ||
"@types/browser-sync": "^0.0.42", | ||
"@types/chalk": "^0.4.31", | ||
"@types/fs-extra": "^4.0.3", | ||
"@types/glob": "^5.0.33", | ||
|
@@ -93,7 +92,6 @@ | |
"@types/run-sequence": "^0.0.29", | ||
"autoprefixer": "^6.7.6", | ||
"axe-webdriverjs": "^1.1.1", | ||
"browser-sync": "^2.26.3", | ||
"chalk": "^1.1.3", | ||
"clang-format": "^1.2.4", | ||
"codelyzer": "^5.1.0", | ||
|
@@ -114,7 +112,6 @@ | |
"gulp-util": "^3.0.8", | ||
"hammerjs": "^2.0.8", | ||
"highlight.js": "^9.11.0", | ||
"http-rewrite-middleware": "^0.1.6", | ||
"husky": "^1.3.1", | ||
"inquirer": "^6.2.0", | ||
"jasmine-core": "^3.3.0", | ||
|
This file contains hidden or 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 hidden or 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 was deleted.
Oops, something went wrong.
This file contains hidden or 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 hidden or 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,175 @@ | ||
/** | ||
* @license | ||
* Copyright Google LLC All Rights Reserved. | ||
* | ||
* Use of this source code is governed by an MIT-style license that can be | ||
* found in the LICENSE file at https://angular.io/license | ||
*/ | ||
|
||
const CDK_PACKAGES = [ | ||
'a11y', | ||
'accordion', | ||
'bidi', | ||
'coercion', | ||
'collections', | ||
'drag-drop', | ||
'keycodes', | ||
'layout', | ||
'observers', | ||
'overlay', | ||
'platform', | ||
'portal', | ||
'scrolling', | ||
'stepper', | ||
'table', | ||
'text-field', | ||
'tree', | ||
]; | ||
|
||
const CDK_EXPERIMENTAL_PACKAGES = [ | ||
'dialog', | ||
'popover-edit', | ||
'scrolling', | ||
]; | ||
|
||
const MATERIAL_PACKAGES = [ | ||
'autocomplete', 'badge', | ||
'bottom-sheet', 'button', | ||
'button-toggle', 'card', | ||
'checkbox', 'chips', | ||
'core', 'datepicker', | ||
'dialog', 'divider', | ||
'expansion', 'form-field', | ||
'grid-list', 'icon', | ||
'input', 'list', | ||
'menu', 'paginator', | ||
'progress-bar', 'progress-spinner', | ||
'radio', 'select', | ||
'sidenav', 'slide-toggle', | ||
'slider', 'snack-bar', | ||
'sort', 'stepper', | ||
'table', 'tabs', | ||
'toolbar', 'tooltip', | ||
'tree', | ||
]; | ||
|
||
const GOOGLE_MAPS_PACKAGES = [ | ||
'google-map', | ||
]; | ||
|
||
const MATERIAL_EXPERIMENTAL_PACKAGES = [ | ||
'mdc-button', | ||
'mdc-card', | ||
'mdc-checkbox', | ||
'mdc-chips', | ||
'mdc-tabs', | ||
'mdc-helpers', | ||
'mdc-menu', | ||
'mdc-radio', | ||
'mdc-slide-toggle', | ||
'popover-edit', | ||
]; | ||
|
||
/** Bazel runfile path referring to the "src/" folder of the project. */ | ||
const srcRunfilePath = 'angular_material/src'; | ||
|
||
/** Path mappings that will be registered in SystemJS. */ | ||
const pathMapping = {}; | ||
|
||
/** Package configurations that will be used in SystemJS. */ | ||
const packagesConfig = {}; | ||
|
||
// Configure all primary entry-points. | ||
configureEntryPoint('cdk'); | ||
configureEntryPoint('cdk-experimental'); | ||
configureEntryPoint('material'); | ||
configureEntryPoint('material-experimental'); | ||
configureEntryPoint('material-examples'); | ||
configureEntryPoint('material-moment-adapter'); | ||
|
||
// Configure all secondary entry-points. | ||
CDK_PACKAGES.forEach(pkgName => configureEntryPoint('cdk', pkgName)); | ||
CDK_EXPERIMENTAL_PACKAGES.forEach(pkgName => configureEntryPoint('cdk-experimental', pkgName)); | ||
MATERIAL_EXPERIMENTAL_PACKAGES.forEach( | ||
pkgName => configureEntryPoint('material-experimental', pkgName)); | ||
MATERIAL_PACKAGES.forEach(pkgName => configureEntryPoint('material', pkgName)); | ||
GOOGLE_MAPS_PACKAGES.forEach(pkgName => configureEntryPoint('google-maps', pkgName)); | ||
|
||
/** Configures the specified package and its entry-point. */ | ||
function configureEntryPoint(pkgName, entryPoint) { | ||
if (entryPoint === undefined) { | ||
pathMapping[`@angular/${pkgName}`] = `${srcRunfilePath}/${pkgName}`; | ||
packagesConfig[`${srcRunfilePath}/${pkgName}`] = {main: 'index.js'}; | ||
} else { | ||
pathMapping[`@angular/${pkgName}/${entryPoint}`] = `${srcRunfilePath}/${pkgName}/${entryPoint}`; | ||
packagesConfig[`${srcRunfilePath}/${pkgName}/${entryPoint}`] = {main: 'index.js'}; | ||
} | ||
} | ||
|
||
// Configure the base path and map the different node packages. | ||
System.config({ | ||
map: { | ||
'main': 'main.js', | ||
'tslib': 'tslib/tslib.js', | ||
'moment': 'moment/min/moment-with-locales.min.js', | ||
|
||
'rxjs': 'rxjs/bundles/rxjs.umd.min.js', | ||
'rxjs/operators': 'system-rxjs-operators.js', | ||
|
||
// MDC Web | ||
'@material/animation': '@material/animation/dist/mdc.animation.js', | ||
'@material/auto-init': '@material/auto-init/dist/mdc.autoInit.js', | ||
'@material/base': '@material/base/dist/mdc.base.js', | ||
'@material/checkbox': '@material/checkbox/dist/mdc.checkbox.js', | ||
'@material/chips': '@material/chips/dist/mdc.chips.js', | ||
'@material/dialog': '@material/dialog/dist/mdc.dialog.js', | ||
'@material/dom': '@material/dom/dist/mdc.dom.js', | ||
'@material/drawer': '@material/drawer/dist/mdc.drawer.js', | ||
'@material/floating-label': '@material/floating-label/dist/mdc.floatingLabel.js', | ||
'@material/form-field': '@material/form-field/dist/mdc.formField.js', | ||
'@material/grid-list': '@material/grid-list/dist/mdc.gridList.js', | ||
'@material/icon-button': '@material/icon-button/dist/mdc.iconButton.js', | ||
'@material/line-ripple': '@material/line-ripple/dist/mdc.lineRipple.js', | ||
'@material/linear-progress': '@material/linear-progress/dist/mdc.linearProgress.js', | ||
'@material/list': '@material/list/dist/mdc.list.js', | ||
'@material/menu': '@material/menu/dist/mdc.menu.js', | ||
'@material/menu-surface': '@material/menu-surface/dist/mdc.menuSurface.js', | ||
'@material/notched-outline': '@material/notched-outline/dist/mdc.notchedOutline.js', | ||
'@material/radio': '@material/radio/dist/mdc.radio.js', | ||
'@material/ripple': '@material/ripple/dist/mdc.ripple.js', | ||
'@material/select': '@material/select/dist/mdc.select.js', | ||
'@material/slider': '@material/slider/dist/mdc.slider.js', | ||
'@material/snackbar': '@material/snackbar/dist/mdc.snackbar.js', | ||
'@material/switch': '@material/switch/dist/mdc.switch.js', | ||
'@material/tab': '@material/tab/dist/mdc.tab.js', | ||
'@material/tab-bar': '@material/tab-bar/dist/mdc.tabBar.js', | ||
'@material/tab-indicator': '@material/tab-indicator/dist/mdc.tabIndicator.js', | ||
'@material/tab-scroller': '@material/tab-scroller/dist/mdc.tabScroller.js', | ||
'@material/text-field': '@material/textfield/dist/mdc.textfield.js', | ||
'@material/top-app-bar': '@material/top-app-bar/dist/mdc.topAppBar.js', | ||
|
||
...pathMapping, | ||
}, | ||
packages: { | ||
// Set the default extension for the root package, because otherwise the dev-app can't | ||
// be built within the production mode. Due to missing file extensions. | ||
'.': {defaultExtension: 'js'}, | ||
|
||
// Angular specific mappings. | ||
'@angular/core': {main: 'bundles/core.umd.js'}, | ||
'@angular/common': {main: 'bundles/common.umd.js'}, | ||
'@angular/common/http': {main: '../bundles/common-http.umd.js'}, | ||
'@angular/compiler': {main: 'bundles/compiler.umd.js'}, | ||
'@angular/forms': {main: 'bundles/forms.umd.js'}, | ||
'@angular/animations': {main: 'bundles/animations.umd.js'}, | ||
'@angular/elements': {main: 'bundles/elements.umd.js'}, | ||
'@angular/router': {main: 'bundles/router.umd.js'}, | ||
'@angular/animations/browser': {main: '../bundles/animations-browser.umd.js'}, | ||
'@angular/platform-browser/animations': {main: '../bundles/platform-browser-animations.umd'}, | ||
'@angular/platform-browser': {main: 'bundles/platform-browser.umd.js'}, | ||
'@angular/platform-browser-dynamic': {main: 'bundles/platform-browser-dynamic.umd.js'}, | ||
|
||
// Project specific configurations. | ||
...packagesConfig, | ||
} | ||
}); |
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.
Should we still build the devapp as a test?
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.
It will be built as part of the bazel build job.