@wpelevator/wp-release 0.6.1 → 0.8.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 +81 -7
- package/dist/changeset-config.d.ts +31 -0
- package/dist/changeset-config.js +8 -0
- package/dist/changeset-release.d.ts +25 -5
- package/dist/changeset-release.js +335 -21
- package/dist/changesets.d.ts +19 -0
- package/dist/changesets.js +21 -0
- package/dist/cli.js +2 -0
- package/dist/commands/changeset-args.d.ts +14 -0
- package/dist/commands/changeset-args.js +19 -0
- package/dist/commands/changeset-tag.d.ts +7 -0
- package/dist/commands/changeset-tag.js +22 -5
- package/dist/commands/changeset-version.d.ts +7 -0
- package/dist/commands/changeset-version.js +8 -2
- package/dist/commands/deploy-git.d.ts +45 -0
- package/dist/commands/deploy-git.js +81 -0
- package/dist/git-deploy.d.ts +218 -0
- package/dist/git-deploy.js +420 -0
- package/dist/git.d.ts +49 -0
- package/dist/git.js +65 -0
- package/dist/github.d.ts +24 -0
- package/dist/github.js +30 -0
- package/dist/index.d.ts +12 -5
- package/dist/index.js +6 -2
- package/dist/summary.d.ts +51 -0
- package/dist/summary.js +78 -0
- package/package.json +1 -1
package/dist/summary.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type { ChecksumsResult } from './commands/checksums.ts';
|
|
2
2
|
import type { SignResult } from './commands/sign.ts';
|
|
3
3
|
import type { ZipResult } from './commands/zip.ts';
|
|
4
|
+
import type { ChangesetTagResult } from './changeset-release.ts';
|
|
5
|
+
import type { PackageRelease } from './changesets.ts';
|
|
4
6
|
import type { DeployOptions } from './deploy-options.ts';
|
|
5
7
|
import type { SvnStatusEntry } from './svn.ts';
|
|
6
8
|
import type { Problem } from './errors.ts';
|
|
@@ -105,6 +107,28 @@ export declare function getVerifySummary(context: SummaryContext, result: {
|
|
|
105
107
|
checksumsPath: string;
|
|
106
108
|
matched: number;
|
|
107
109
|
}): string;
|
|
110
|
+
/**
|
|
111
|
+
* Get the summary of applied or, in a dry run, pending package releases.
|
|
112
|
+
*
|
|
113
|
+
* @param releases Package releases.
|
|
114
|
+
* @param dryRun Whether the versions were only planned.
|
|
115
|
+
* @return Markdown summary.
|
|
116
|
+
*/
|
|
117
|
+
export declare function getChangesetVersionSummary(releases: PackageRelease[], dryRun: boolean): string;
|
|
118
|
+
/**
|
|
119
|
+
* Get the status of a release tag.
|
|
120
|
+
*
|
|
121
|
+
* @param item Tag of the changeset-tag result.
|
|
122
|
+
* @return Created, Exists or, in a dry run, Would create.
|
|
123
|
+
*/
|
|
124
|
+
export declare function getTagStatus(item: ChangesetTagResult['tags'][number]): string;
|
|
125
|
+
/**
|
|
126
|
+
* Get the summary of release tags with their release notes.
|
|
127
|
+
*
|
|
128
|
+
* @param result Result of changeset-tag.
|
|
129
|
+
* @return Markdown summary.
|
|
130
|
+
*/
|
|
131
|
+
export declare function getChangesetTagSummary(result: ChangesetTagResult): string;
|
|
108
132
|
/**
|
|
109
133
|
* Get the summary of a version check without mismatches.
|
|
110
134
|
*
|
|
@@ -139,3 +163,30 @@ export declare function getErrorSummary(title: string, message: string): string;
|
|
|
139
163
|
* @return Markdown summary.
|
|
140
164
|
*/
|
|
141
165
|
export declare function getDeploySummary(input: DeploySummaryInput): string;
|
|
166
|
+
export interface GitDeploySummaryInput {
|
|
167
|
+
/** Repository URL, shown without credentials. */
|
|
168
|
+
gitUrl: string;
|
|
169
|
+
/** Release commit. */
|
|
170
|
+
revision: string;
|
|
171
|
+
/** Previous release. */
|
|
172
|
+
previous: string | null;
|
|
173
|
+
/** Whether a new release commit was created. */
|
|
174
|
+
created: boolean;
|
|
175
|
+
/** Whether the branch already has newer source history and isn't moved. */
|
|
176
|
+
outdated: boolean;
|
|
177
|
+
/** Refs to write, pushed unless it's a dry run. */
|
|
178
|
+
planned: string[];
|
|
179
|
+
/** Number of released files. */
|
|
180
|
+
files: number;
|
|
181
|
+
/** Whether the push was skipped. */
|
|
182
|
+
dryRun: boolean;
|
|
183
|
+
}
|
|
184
|
+
/**
|
|
185
|
+
* Get the summary of a Git deploy, with the release commit and the pushed
|
|
186
|
+
* refs.
|
|
187
|
+
*
|
|
188
|
+
* @param context Workspace directory.
|
|
189
|
+
* @param input Git deploy result.
|
|
190
|
+
* @return Markdown summary.
|
|
191
|
+
*/
|
|
192
|
+
export declare function getGitDeploySummary(context: SummaryContext, input: GitDeploySummaryInput): string;
|
package/dist/summary.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { isAbsolute, relative, resolve, sep } from 'node:path';
|
|
2
2
|
import { normalizeTag } from "./deploy-options.js";
|
|
3
|
+
import { redactUrls } from "./git.js";
|
|
3
4
|
/**
|
|
4
5
|
* SVN host of the WordPress.org plugin repositories.
|
|
5
6
|
*/
|
|
@@ -163,6 +164,56 @@ export function getVerifySummary(context, result) {
|
|
|
163
164
|
`All ${result.matched} files match ${formatFile(context, result.checksumsPath)}.`,
|
|
164
165
|
]);
|
|
165
166
|
}
|
|
167
|
+
/**
|
|
168
|
+
* Get the summary of applied or, in a dry run, pending package releases.
|
|
169
|
+
*
|
|
170
|
+
* @param releases Package releases.
|
|
171
|
+
* @param dryRun Whether the versions were only planned.
|
|
172
|
+
* @return Markdown summary.
|
|
173
|
+
*/
|
|
174
|
+
export function getChangesetVersionSummary(releases, dryRun) {
|
|
175
|
+
return joinBlocks([
|
|
176
|
+
dryRun ? '### Package releases (dry run)' : '### Package releases',
|
|
177
|
+
releases.length
|
|
178
|
+
? formatTable(['Package', 'Version', 'Bump'], releases.map((release) => [
|
|
179
|
+
formatCode(release.package.name),
|
|
180
|
+
`${release.currentVersion} → ${release.nextVersion}`,
|
|
181
|
+
release.bump,
|
|
182
|
+
]))
|
|
183
|
+
: 'No pending package releases.',
|
|
184
|
+
]);
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* Get the status of a release tag.
|
|
188
|
+
*
|
|
189
|
+
* @param item Tag of the changeset-tag result.
|
|
190
|
+
* @return Created, Exists or, in a dry run, Would create.
|
|
191
|
+
*/
|
|
192
|
+
export function getTagStatus(item) {
|
|
193
|
+
if (item.created) {
|
|
194
|
+
return 'Created';
|
|
195
|
+
}
|
|
196
|
+
return item.exists ? 'Exists' : 'Would create';
|
|
197
|
+
}
|
|
198
|
+
/**
|
|
199
|
+
* Get the summary of release tags with their release notes.
|
|
200
|
+
*
|
|
201
|
+
* @param result Result of changeset-tag.
|
|
202
|
+
* @return Markdown summary.
|
|
203
|
+
*/
|
|
204
|
+
export function getChangesetTagSummary(result) {
|
|
205
|
+
return joinBlocks([
|
|
206
|
+
'### Release tags',
|
|
207
|
+
result.tags.length
|
|
208
|
+
? formatTable(['Tag', 'Previous tag', 'Status'], result.tags.map((item) => [
|
|
209
|
+
formatCode(item.tag),
|
|
210
|
+
item.previousTag ? formatCode(item.previousTag) : '—',
|
|
211
|
+
getTagStatus(item),
|
|
212
|
+
]))
|
|
213
|
+
: 'No packages to tag.',
|
|
214
|
+
...result.tags.map((item) => formatDetails(`Release notes of ${formatCode(item.tag)}`, item.notes || 'No release notes.')),
|
|
215
|
+
]);
|
|
216
|
+
}
|
|
166
217
|
/**
|
|
167
218
|
* Get the summary of a version check without mismatches.
|
|
168
219
|
*
|
|
@@ -285,3 +336,30 @@ export function getDeploySummary(input) {
|
|
|
285
336
|
: '')),
|
|
286
337
|
]);
|
|
287
338
|
}
|
|
339
|
+
/**
|
|
340
|
+
* Get the summary of a Git deploy, with the release commit and the pushed
|
|
341
|
+
* refs.
|
|
342
|
+
*
|
|
343
|
+
* @param context Workspace directory.
|
|
344
|
+
* @param input Git deploy result.
|
|
345
|
+
* @return Markdown summary.
|
|
346
|
+
*/
|
|
347
|
+
export function getGitDeploySummary(context, input) {
|
|
348
|
+
const { revision, created, outdated, planned, files, dryRun } = input;
|
|
349
|
+
const refs = planned.map(formatCode).join(', ');
|
|
350
|
+
const pushedText = dryRun ? `Dry run, skipped pushing ${refs}.` : refs;
|
|
351
|
+
const reused = outdated
|
|
352
|
+
? 'the previous release'
|
|
353
|
+
: 'the same files as the previous release';
|
|
354
|
+
return joinBlocks([
|
|
355
|
+
'### Deploy to Git',
|
|
356
|
+
formatList([
|
|
357
|
+
`**Repository:** ${formatCode(redactUrls(input.gitUrl))}`,
|
|
358
|
+
`**Release:** ${formatCode(revision)}, ${created ? `${files} files` : reused}`,
|
|
359
|
+
`**Pushed:** ${planned.length ? pushedText : 'nothing, no changes'}`,
|
|
360
|
+
outdated
|
|
361
|
+
? '**Branch:** not moved, the previous release has newer source history'
|
|
362
|
+
: '',
|
|
363
|
+
].filter(Boolean)),
|
|
364
|
+
]);
|
|
365
|
+
}
|
package/package.json
CHANGED