@wpelevator/wp-release 0.6.1 → 0.7.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 +71 -7
- package/dist/changeset-config.d.ts +22 -0
- package/dist/changeset-config.js +4 -0
- package/dist/changeset-release.d.ts +17 -1
- package/dist/changeset-release.js +266 -18
- package/dist/changesets.d.ts +7 -0
- package/dist/changesets.js +13 -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 +9 -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/index.d.ts +8 -3
- package/dist/index.js +5 -2
- package/dist/summary.d.ts +51 -0
- package/dist/summary.js +78 -0
- package/package.json +1 -1
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