-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2741 from semantic-release/beta
upgraded to next major version of the npm plugin
- Loading branch information
Showing
38 changed files
with
11,927 additions
and
6,818 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# style: prettier (#2670) | ||
b06c9bbe4c6be121c5561b356d8c465c1cadffba |
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 |
---|---|---|
@@ -1,18 +1,18 @@ | ||
import {isString, mapValues, omit, remove, template} from 'lodash-es'; | ||
import micromatch from 'micromatch'; | ||
import {getBranches} from '../git.js'; | ||
import { isString, mapValues, omit, remove, template } from "lodash-es"; | ||
import micromatch from "micromatch"; | ||
import { getBranches } from "../git.js"; | ||
|
||
export default async (repositoryUrl, {cwd}, branches) => { | ||
const gitBranches = await getBranches(repositoryUrl, {cwd}); | ||
export default async (repositoryUrl, { cwd }, branches) => { | ||
const gitBranches = await getBranches(repositoryUrl, { cwd }); | ||
|
||
return branches.reduce( | ||
(branches, branch) => [ | ||
...branches, | ||
...remove(gitBranches, (name) => micromatch(gitBranches, branch.name).includes(name)).map((name) => ({ | ||
name, | ||
...mapValues(omit(branch, 'name'), (value) => (isString(value) ? template(value)({name}) : value)), | ||
...mapValues(omit(branch, "name"), (value) => (isString(value) ? template(value)({ name }) : value)), | ||
})), | ||
], | ||
[] | ||
); | ||
} | ||
}; |
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,36 +1,35 @@ | ||
import {escapeRegExp, template} from 'lodash-es'; | ||
import semver from 'semver'; | ||
import pReduce from 'p-reduce'; | ||
import debugTags from 'debug'; | ||
import {getNote, getTags} from '../../lib/git.js'; | ||
import { escapeRegExp, template } from "lodash-es"; | ||
import semver from "semver"; | ||
import pReduce from "p-reduce"; | ||
import debugTags from "debug"; | ||
import { getNote, getTags } from "../../lib/git.js"; | ||
|
||
const debug = debugTags('semantic-release:get-tags'); | ||
const debug = debugTags("semantic-release:get-tags"); | ||
|
||
|
||
export default async ({cwd, env, options: {tagFormat}}, branches) => { | ||
export default async ({ cwd, env, options: { tagFormat } }, branches) => { | ||
// Generate a regex to parse tags formatted with `tagFormat` | ||
// by replacing the `version` variable in the template by `(.+)`. | ||
// The `tagFormat` is compiled with space as the `version` as it's an invalid tag character, | ||
// so it's guaranteed to no be present in the `tagFormat`. | ||
const tagRegexp = `^${escapeRegExp(template(tagFormat)({version: ' '})).replace(' ', '(.+)')}`; | ||
const tagRegexp = `^${escapeRegExp(template(tagFormat)({ version: " " })).replace(" ", "(.+)")}`; | ||
|
||
return pReduce( | ||
branches, | ||
async (branches, branch) => { | ||
const branchTags = await pReduce( | ||
await getTags(branch.name, {cwd, env}), | ||
await getTags(branch.name, { cwd, env }), | ||
async (branchTags, tag) => { | ||
const [, version] = tag.match(tagRegexp) || []; | ||
return version && semver.valid(semver.clean(version)) | ||
? [...branchTags, {gitTag: tag, version, channels: (await getNote(tag, {cwd, env})).channels || [null]}] | ||
? [...branchTags, { gitTag: tag, version, channels: (await getNote(tag, { cwd, env })).channels || [null] }] | ||
: branchTags; | ||
}, | ||
[] | ||
); | ||
|
||
debug('found tags for branch %s: %o', branch.name, branchTags); | ||
return [...branches, {...branch, tags: branchTags}]; | ||
debug("found tags for branch %s: %o", branch.name, branchTags); | ||
return [...branches, { ...branch, tags: branchTags }]; | ||
}, | ||
[] | ||
); | ||
} | ||
}; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,17 @@ | ||
export const RELEASE_TYPE = ['patch', 'minor', 'major']; | ||
export const RELEASE_TYPE = ["patch", "minor", "major"]; | ||
|
||
export const FIRST_RELEASE = '1.0.0'; | ||
export const FIRST_RELEASE = "1.0.0"; | ||
|
||
export const FIRSTPRERELEASE = '1'; | ||
export const FIRSTPRERELEASE = "1"; | ||
|
||
export const COMMIT_NAME = 'semantic-release-bot'; | ||
export const COMMIT_NAME = "semantic-release-bot"; | ||
|
||
export const COMMIT_EMAIL = '[email protected]'; | ||
export const COMMIT_EMAIL = "[email protected]"; | ||
|
||
export const RELEASE_NOTES_SEPARATOR = '\n\n'; | ||
export const RELEASE_NOTES_SEPARATOR = "\n\n"; | ||
|
||
export const SECRET_REPLACEMENT = '[secure]'; | ||
export const SECRET_REPLACEMENT = "[secure]"; | ||
|
||
export const SECRET_MIN_SIZE = 5; | ||
|
||
export const GIT_NOTE_REF = 'semantic-release'; | ||
export const GIT_NOTE_REF = "semantic-release"; |
Oops, something went wrong.