@wpelevator/wp-release 0.13.0 → 0.14.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 +67 -20
- package/dist/changeset-config.d.ts +8 -6
- package/dist/changeset-config.js +7 -5
- package/dist/changeset-packages.d.ts +12 -2
- package/dist/changeset-packages.js +13 -1
- package/dist/changeset-release.d.ts +5 -2
- package/dist/changeset-release.js +12 -6
- package/dist/cli.js +33 -9
- package/dist/commands/args.d.ts +0 -21
- package/dist/commands/args.js +1 -35
- package/dist/commands/changeset-add.d.ts +1 -1
- package/dist/commands/changeset-add.js +3 -2
- package/dist/commands/changeset-status.d.ts +1 -1
- package/dist/commands/changeset-status.js +2 -1
- package/dist/commands/changeset-tag.d.ts +1 -1
- package/dist/commands/changeset-tag.js +4 -2
- package/dist/commands/changeset-version.d.ts +1 -1
- package/dist/commands/changeset-version.js +2 -1
- package/dist/commands/checksums.js +2 -2
- package/dist/commands/command.d.ts +2 -0
- package/dist/commands/deploy-git.d.ts +1 -1
- package/dist/commands/deploy-git.js +2 -1
- package/dist/commands/deploy-svn.d.ts +1 -1
- package/dist/commands/deploy-svn.js +2 -1
- package/dist/commands/keygen.d.ts +3 -0
- package/dist/commands/keygen.js +6 -1
- package/dist/commands/package-deploys.d.ts +8 -0
- package/dist/commands/package-deploys.js +5 -0
- package/dist/commands/sign.d.ts +19 -1
- package/dist/commands/sign.js +47 -12
- package/dist/commands/verify.d.ts +3 -0
- package/dist/commands/verify.js +43 -24
- package/dist/commands/zip.d.ts +12 -8
- package/dist/commands/zip.js +135 -78
- package/dist/ed25519.d.ts +25 -0
- package/dist/ed25519.js +44 -0
- package/dist/file-selection.d.ts +21 -0
- package/dist/file-selection.js +35 -0
- package/dist/git.d.ts +17 -0
- package/dist/git.js +23 -0
- package/dist/index.d.ts +9 -4
- package/dist/index.js +6 -3
- package/dist/minisign.d.ts +41 -0
- package/dist/minisign.js +128 -0
- package/dist/package-deploy.d.ts +28 -0
- package/dist/package-deploy.js +41 -6
- package/dist/package-zip.d.ts +52 -0
- package/dist/package-zip.js +78 -0
- package/dist/release-repository.d.ts +4 -3
- package/dist/release-repository.js +5 -4
- package/dist/signing.d.ts +64 -9
- package/dist/signing.js +113 -40
- package/dist/ssh-signature.d.ts +43 -0
- package/dist/ssh-signature.js +156 -0
- package/dist/summary.d.ts +3 -3
- package/dist/summary.js +2 -2
- package/dist/tag-format.d.ts +21 -12
- package/dist/tag-format.js +25 -39
- package/dist/version-files.d.ts +6 -7
- package/dist/version-files.js +10 -11
- package/package.json +2 -2
package/dist/version-files.js
CHANGED
|
@@ -4,21 +4,20 @@ import { ValidationError } from "./errors.js";
|
|
|
4
4
|
import { readJson } from "./json-files.js";
|
|
5
5
|
import { findMainPluginFile } from "./package-meta.js";
|
|
6
6
|
import { escapeRegExp } from "./regexp.js";
|
|
7
|
-
import {
|
|
7
|
+
import { DEFAULT_TAG_FORMAT, formatTag } from "./tag-format.js";
|
|
8
8
|
import { findConstantValues } from "./version-check.js";
|
|
9
9
|
import { compareVersions, isPrerelease } from "./versions.js";
|
|
10
10
|
/**
|
|
11
11
|
* Read the current version of a package from its configured source.
|
|
12
12
|
*
|
|
13
|
-
* @param repository
|
|
14
|
-
* @param directory
|
|
15
|
-
* @param descriptor
|
|
16
|
-
* @param
|
|
17
|
-
* @param tagType Configured {type} of the package tags.
|
|
13
|
+
* @param repository Repository, for versions stored as git tags.
|
|
14
|
+
* @param directory Package directory.
|
|
15
|
+
* @param descriptor Version source.
|
|
16
|
+
* @param pkg Package name and path, for the tags of a git-tag source.
|
|
18
17
|
* @return Current version.
|
|
19
18
|
* @throws {ValidationError} If the version is missing.
|
|
20
19
|
*/
|
|
21
|
-
export async function readVersion(repository, directory, descriptor,
|
|
20
|
+
export async function readVersion(repository, directory, descriptor, pkg) {
|
|
22
21
|
if ('package-json' === descriptor.kind ||
|
|
23
22
|
'composer-json' === descriptor.kind) {
|
|
24
23
|
const manifest = await readJson(path.join(directory, descriptor.file));
|
|
@@ -29,8 +28,8 @@ export async function readVersion(repository, directory, descriptor, relativePat
|
|
|
29
28
|
throw new ValidationError(`Missing ${descriptor.file}#${descriptor.field} in ${directory}.`);
|
|
30
29
|
}
|
|
31
30
|
if ('git-tag' === descriptor.kind) {
|
|
32
|
-
const pattern = descriptor.pattern ??
|
|
33
|
-
const tags = await repository.listTags(
|
|
31
|
+
const pattern = descriptor.pattern ?? DEFAULT_TAG_FORMAT;
|
|
32
|
+
const tags = await repository.listTags(formatTag(pattern, pkg, ''));
|
|
34
33
|
const versions = tags
|
|
35
34
|
.map((tag) => tag.match(/(?:^|\/|v)(\d+(?:\.\d+){1,3})$/)?.[1])
|
|
36
35
|
.filter((item) => Boolean(item));
|
|
@@ -38,7 +37,7 @@ export async function readVersion(repository, directory, descriptor, relativePat
|
|
|
38
37
|
if (versions[0]) {
|
|
39
38
|
return versions[0];
|
|
40
39
|
}
|
|
41
|
-
throw new ValidationError(`No git tag matches ${pattern} for ${
|
|
40
|
+
throw new ValidationError(`No git tag matches ${pattern} for ${pkg.path}.`);
|
|
42
41
|
}
|
|
43
42
|
if ('php-constant' === descriptor.kind) {
|
|
44
43
|
const file = path.join(directory, descriptor.file);
|
|
@@ -142,7 +141,7 @@ export async function verifyVersionTargets(repository, pkg, expected) {
|
|
|
142
141
|
actual = undefined;
|
|
143
142
|
}
|
|
144
143
|
else {
|
|
145
|
-
actual = await readVersion(repository, pkg.directory, target, pkg
|
|
144
|
+
actual = await readVersion(repository, pkg.directory, target, pkg);
|
|
146
145
|
}
|
|
147
146
|
if (undefined !== actual && actual !== expected) {
|
|
148
147
|
throw new ValidationError(`Version mismatch for ${pkg.name}: expected ${expected}, found ${actual}.`);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wpelevator/wp-release",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.14.0",
|
|
4
4
|
"description": "Package, checksum, sign, verify and version-check WordPress plugins and themes, and deploy plugins to WordPress.org SVN",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"build": "tsc -p tsconfig.build.json",
|
|
59
59
|
"prepack": "npm run build",
|
|
60
60
|
"lint": "npm-run-all lint:*",
|
|
61
|
-
"lint:js": "wp-scripts lint-js
|
|
61
|
+
"lint:js": "wp-scripts lint-js",
|
|
62
62
|
"lint:types": "tsc -p tsconfig.json",
|
|
63
63
|
"format": "wp-scripts format src",
|
|
64
64
|
"test": "node --test --conditions=wpelevator-source"
|