-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
Showing
3 changed files
with
19 additions
and
2 deletions.
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
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,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)); |