-
-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(core): add set-semver-ranges command
- Loading branch information
1 parent
103e6f6
commit 4d206b9
Showing
9 changed files
with
267 additions
and
68 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,21 @@ | ||
#!/usr/bin/env node | ||
|
||
import chalk from 'chalk'; | ||
import * as program from 'commander'; | ||
import * as _ from 'lodash'; | ||
import { relative } from 'path'; | ||
import { DEFAULT_PATTERN, DEFAULT_SEMVER_RANGE, OPTION_PACKAGES, OPTION_SEMVER_RANGE } from './constants'; | ||
import { setVersionRange } from './manifests'; | ||
|
||
program | ||
.option(OPTION_PACKAGES.spec, OPTION_PACKAGES.description) | ||
.option(OPTION_SEMVER_RANGE.spec, OPTION_SEMVER_RANGE.description) | ||
.parse(process.argv); | ||
|
||
const { packages = DEFAULT_PATTERN, semverRange = DEFAULT_SEMVER_RANGE } = program; | ||
|
||
setVersionRange(semverRange, packages).then((descriptors) => { | ||
_.each(descriptors, (descriptor) => { | ||
console.log(chalk.blue(`./${relative('.', descriptor.path)}`)); | ||
}); | ||
}); |
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 |
---|---|---|
@@ -1,13 +1,14 @@ | ||
#!/usr/bin/env node | ||
|
||
import * as program from 'commander'; | ||
import { FIX_MISMATCHES, FORMAT, LIST, LIST_MISMATCHES, VERSION } from './constants'; | ||
import { FIX_MISMATCHES, FORMAT, LIST, LIST_MISMATCHES, SET_SEMVER_RANGES, VERSION } from './constants'; | ||
|
||
program | ||
.version(VERSION) | ||
.command(FIX_MISMATCHES.name, FIX_MISMATCHES.description) | ||
.command(FORMAT.name, FORMAT.description) | ||
.command(LIST.name, LIST.description, { isDefault: true }) | ||
.command(LIST_MISMATCHES.name, LIST_MISMATCHES.description); | ||
.command(LIST_MISMATCHES.name, LIST_MISMATCHES.description) | ||
.command(SET_SEMVER_RANGES.name, SET_SEMVER_RANGES.description); | ||
|
||
program.parse(process.argv); |
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
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
Oops, something went wrong.