Skip to content

Commit 5da3d24

Browse files
authored
build: update all @Material packages to canary (#22241)
Currently the job that checks the MDC canary version only updates `material-components-web`. These changes add a script that will update all `@material/*` packages for consistency.
1 parent 55845ba commit 5da3d24

File tree

3 files changed

+19
-2
lines changed

3 files changed

+19
-2
lines changed

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -644,7 +644,7 @@ jobs:
644644
- *yarn_install
645645

646646
# Install the latest canary version of the "material-components-web".
647-
- run: yarn add material-components-web@canary
647+
- run: node ./scripts/circleci/setup-mdc-canary.js
648648

649649
# Setup the components repository to use the MDC snapshot builds.
650650
# Run project tests with the MDC canary builds.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@
6363
"@types/youtube": "^0.0.40",
6464
"@webcomponents/custom-elements": "^1.1.0",
6565
"core-js-bundle": "^3.8.2",
66-
"material-components-web": "11.0.0-canary.f8579b7ea.0",
6766
"rxjs": "^6.5.3",
6867
"rxjs-tslint-rules": "^4.33.1",
6968
"systemjs": "0.19.43",
@@ -190,6 +189,7 @@
190189
"karma-sourcemap-loader": "^0.3.7",
191190
"madge": "^4.0.0",
192191
"marked": "^2.0.0",
192+
"material-components-web": "11.0.0-canary.f8579b7ea.0",
193193
"merge2": "^1.2.3",
194194
"minimatch": "^3.0.4",
195195
"minimist": "^1.2.0",

scripts/circleci/setup-mdc-canary.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
const {join} = require('path');
2+
const {spawn} = require('child_process');
3+
const packageJson = require(join(__dirname, '../../package.json'));
4+
const pattern = /^material-components-web$|^@material\//;
5+
const params = Object.keys(packageJson.devDependencies)
6+
.filter(dependency => pattern.test(dependency))
7+
.reduce((mdcDependencies, dependency) => [...mdcDependencies, `${dependency}@canary`], []);
8+
9+
if (!params.length) {
10+
throw Error(`Could not find MDC dependencies in package.json`);
11+
}
12+
13+
console.log('Updating all MDC dependencies to latest canary version');
14+
const childProcess = spawn('yarn', ['add', ...params, '-D'], {shell: true});
15+
childProcess.stdout.on('data', data => console.log(data + ''));
16+
childProcess.stderr.on('data', data => console.error(data + ''));
17+
childProcess.on('exit', code => process.exit(code));

0 commit comments

Comments
 (0)