Skip to content

Commit

Permalink
build: update all @Material packages to canary (#22241)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
crisbeto authored Mar 16, 2021
1 parent 55845ba commit 5da3d24
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -644,7 +644,7 @@ jobs:
- *yarn_install

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

# Setup the components repository to use the MDC snapshot builds.
# Run project tests with the MDC canary builds.
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@
"@types/youtube": "^0.0.40",
"@webcomponents/custom-elements": "^1.1.0",
"core-js-bundle": "^3.8.2",
"material-components-web": "11.0.0-canary.f8579b7ea.0",
"rxjs": "^6.5.3",
"rxjs-tslint-rules": "^4.33.1",
"systemjs": "0.19.43",
Expand Down Expand Up @@ -190,6 +189,7 @@
"karma-sourcemap-loader": "^0.3.7",
"madge": "^4.0.0",
"marked": "^2.0.0",
"material-components-web": "11.0.0-canary.f8579b7ea.0",
"merge2": "^1.2.3",
"minimatch": "^3.0.4",
"minimist": "^1.2.0",
Expand Down
17 changes: 17 additions & 0 deletions scripts/circleci/setup-mdc-canary.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
const {join} = require('path');
const {spawn} = require('child_process');
const packageJson = require(join(__dirname, '../../package.json'));
const pattern = /^material-components-web$|^@material\//;
const params = Object.keys(packageJson.devDependencies)
.filter(dependency => pattern.test(dependency))
.reduce((mdcDependencies, dependency) => [...mdcDependencies, `${dependency}@canary`], []);

if (!params.length) {
throw Error(`Could not find MDC dependencies in package.json`);
}

console.log('Updating all MDC dependencies to latest canary version');
const childProcess = spawn('yarn', ['add', ...params, '-D'], {shell: true});
childProcess.stdout.on('data', data => console.log(data + ''));
childProcess.stderr.on('data', data => console.error(data + ''));
childProcess.on('exit', code => process.exit(code));

0 comments on commit 5da3d24

Please sign in to comment.