@wpelevator/wp-release 0.11.0 → 0.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -7
- package/dist/index.d.ts +0 -2
- package/dist/index.js +0 -1
- package/package.json +1 -1
- package/dist/github.d.ts +0 -24
- package/dist/github.js +0 -30
package/README.md
CHANGED
|
@@ -132,14 +132,13 @@ Add release notes in a feature PR with `npx wp-release changeset-add --package @
|
|
|
132
132
|
|
|
133
133
|
On the release branch, preview with `changeset-version --dry-run`, then run `changeset-version` to update version targets and changelogs. By default, new Markdown entries go before the first version heading; `changelogInsertAfter` sets a literal insertion marker for `CHANGELOG.md` and, with `readmeChangelog`, the plugin readme. Put the marker in both files; a missing marker is an error. Without a marker, plugin readmes use the `== Changelog ==` heading. Failed updates are rolled back for safe retries.
|
|
134
134
|
|
|
135
|
-
Configure `changelogEntry( { package, changeset, commit } )` to format the changelog entry of each changeset, where `commit` is the `{ hash, shortHash, subject }` of the commit that added the changeset file, if it's committed. The formatted entries go into `CHANGELOG.md`, the `changelog` of each release in the `changeset-version` result, and so the release notes; plugin readmes keep the plain summaries.
|
|
135
|
+
Configure `changelogEntry( { package, changeset, commit } )` to format the changelog entry of each changeset, where `commit` is the `{ hash, shortHash, subject }` of the commit that added the changeset file, if it's committed. The formatted entries go into `CHANGELOG.md`, the `changelog` of each release in the `changeset-version` result, and so the release notes; plugin readmes keep the plain summaries. Without the callback, entries are the plain summaries. For example, to link each entry to its commit:
|
|
136
136
|
|
|
137
137
|
```js
|
|
138
|
-
changelogEntry:
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
},
|
|
138
|
+
changelogEntry: ( { changeset, commit } ) =>
|
|
139
|
+
commit
|
|
140
|
+
? `${ changeset.summary } ([\`${ commit.shortHash }\`](https://github.com/me/repo/commit/${ commit.hash }))`
|
|
141
|
+
: changeset.summary,
|
|
143
142
|
```
|
|
144
143
|
|
|
145
144
|
Configure `dependents` to re-release packages that bundle a package when it releases. The dependents come from what the packages declare: a package is a dependent of a source when the spec that it declares in its npm `dependencies` or `optionalDependencies` (or the sections that the policy adds) resolves the current version of the source or points at the workspace, and it re-releases when the next version of the source falls outside the declared range, or always with `when: 'always'`. A pin to an older version selects a registry release instead and `changeset-status` warns about the drift until the pin resolves the package again. Versioning a dependent rewrites its declared specs of the source to the released version, keeping their range prefixes, so an exact pin matches the released workspace again and the built bundle matches the changelog. Wildcards and unpinned ranges accept the release without one, like the `devDependencies` of a package. The derived dependents appear in `changeset-status`, `changeset-version` and `changeset-tag` like any other release, and a dependent that releases for its own reasons keeps its own bump and appends the bundle note:
|
|
@@ -651,7 +650,6 @@ The changeset release modules, from the entry point down:
|
|
|
651
650
|
| `release-tags.ts` | Choosing the version and previous tag of a release, and building its release notes. |
|
|
652
651
|
| `tag-format.ts` | Formatting tag names from the tag format. |
|
|
653
652
|
| `release-repository.ts` | `ReleaseRepository`, the git commands of a release: tags, commits and changed files. |
|
|
654
|
-
| `github.ts` | Finding the pull request of a commit with the GitHub CLI, for changelog formatters. |
|
|
655
653
|
| `file-journal.ts` | `FileJournal`, which restores every file a failed `changeset-version` run changed. |
|
|
656
654
|
| `versions.ts` | Version checks and SemVer precedence. |
|
|
657
655
|
|
package/dist/index.d.ts
CHANGED
|
@@ -47,8 +47,6 @@ export type { WpReleaseConfig, ChangesetPackageGroup, PackageVersionConfig, Pack
|
|
|
47
47
|
export type { SvnCheckoutInput, SvnCommandInput, SvnCommandOutput, SvnCommitInput, SvnCopyInput, SvnDepth, SvnOptions, SvnPathsInput, SvnPropsetInput, SvnRunner, SvnStatusEntry, SvnStatusType, SvnUpdateInput, } from './svn.ts';
|
|
48
48
|
export type { SyncDirectoryInput, SyncResult } from './sync.ts';
|
|
49
49
|
export type { SummaryContext } from './summary.ts';
|
|
50
|
-
export { getGitHubPullRequest } from './github.ts';
|
|
51
|
-
export type { GitHubPullRequest, GetGitHubPullRequestInput } from './github.ts';
|
|
52
50
|
export type { CheckoutPath, DeployResult } from './svn-deploy.ts';
|
|
53
51
|
export type { GitCommandInput, GitCommandOutput, GitRunner } from './git.ts';
|
|
54
52
|
export type { GitDeployInput, GitDeployOptions, GitDeployResult, } from './git-deploy.ts';
|
package/dist/index.js
CHANGED
|
@@ -23,4 +23,3 @@ export { ASSET_MIME_TYPES, SvnDeploy } from "./svn-deploy.js";
|
|
|
23
23
|
export { GitError, createGitRunner, redactUrls } from "./git.js";
|
|
24
24
|
export { GitDeploy, isValidRefName, resolveGitDeployOptions, } from "./git-deploy.js";
|
|
25
25
|
export { getGitDeployInputFromArgs } from "./commands/deploy-git.js";
|
|
26
|
-
export { getGitHubPullRequest } from "./github.js";
|
package/package.json
CHANGED
package/dist/github.d.ts
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* A GitHub pull request of a commit.
|
|
3
|
-
*/
|
|
4
|
-
export interface GitHubPullRequest {
|
|
5
|
-
number: number;
|
|
6
|
-
url: string;
|
|
7
|
-
/** GitHub handle of the pull request author, without the @. */
|
|
8
|
-
author: string;
|
|
9
|
-
}
|
|
10
|
-
export interface GetGitHubPullRequestInput {
|
|
11
|
-
/** Directory of the repository, whose GitHub remote `gh` uses. */
|
|
12
|
-
cwd: string;
|
|
13
|
-
/** Commit hash. */
|
|
14
|
-
commit: string;
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* Find the pull request that merged a commit, with the authenticated `gh`
|
|
18
|
-
* command line client.
|
|
19
|
-
*
|
|
20
|
-
* @param input Repository directory and commit.
|
|
21
|
-
* @return The first pull request of the commit, or undefined without one.
|
|
22
|
-
* @throws {ValidationError} If `gh` fails, like without authentication.
|
|
23
|
-
*/
|
|
24
|
-
export declare function getGitHubPullRequest(input: GetGitHubPullRequestInput): Promise<GitHubPullRequest | undefined>;
|
package/dist/github.js
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { execFile } from 'node:child_process';
|
|
2
|
-
import { promisify } from 'node:util';
|
|
3
|
-
import { ValidationError } from "./errors.js";
|
|
4
|
-
const execFileAsync = promisify(execFile);
|
|
5
|
-
/**
|
|
6
|
-
* Find the pull request that merged a commit, with the authenticated `gh`
|
|
7
|
-
* command line client.
|
|
8
|
-
*
|
|
9
|
-
* @param input Repository directory and commit.
|
|
10
|
-
* @return The first pull request of the commit, or undefined without one.
|
|
11
|
-
* @throws {ValidationError} If `gh` fails, like without authentication.
|
|
12
|
-
*/
|
|
13
|
-
export async function getGitHubPullRequest(input) {
|
|
14
|
-
let stdout;
|
|
15
|
-
try {
|
|
16
|
-
({ stdout } = await execFileAsync('gh', ['api', `repos/{owner}/{repo}/commits/${input.commit}/pulls`], { cwd: input.cwd }));
|
|
17
|
-
}
|
|
18
|
-
catch (error) {
|
|
19
|
-
const message = error instanceof Error ? error.message : String(error);
|
|
20
|
-
throw new ValidationError(`Could not find the pull request of commit ${input.commit}: ${message}`);
|
|
21
|
-
}
|
|
22
|
-
const [pullRequest] = JSON.parse(stdout);
|
|
23
|
-
return pullRequest
|
|
24
|
-
? {
|
|
25
|
-
number: pullRequest.number,
|
|
26
|
-
url: pullRequest.html_url,
|
|
27
|
-
author: pullRequest.user?.login ?? '',
|
|
28
|
-
}
|
|
29
|
-
: undefined;
|
|
30
|
-
}
|