@release-change/shared 0.1.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/LICENSE +21 -0
- package/README.md +15 -0
- package/dist/agree-in-number.d.ts +8 -0
- package/dist/agree-in-number.d.ts.map +1 -0
- package/dist/agree-in-number.js +12 -0
- package/dist/agree-in-number.js.map +1 -0
- package/dist/constants.d.ts +54 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/constants.js +5 -0
- package/dist/constants.js.map +1 -0
- package/dist/format-detailed-error.d.ts +8 -0
- package/dist/format-detailed-error.d.ts.map +1 -0
- package/dist/format-detailed-error.js +12 -0
- package/dist/format-detailed-error.js.map +1 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +7 -0
- package/dist/index.js.map +1 -0
- package/dist/parse-pathname.d.ts +8 -0
- package/dist/parse-pathname.d.ts.map +1 -0
- package/dist/parse-pathname.js +24 -0
- package/dist/parse-pathname.js.map +1 -0
- package/dist/run-command-sync.d.ts +11 -0
- package/dist/run-command-sync.d.ts.map +1 -0
- package/dist/run-command-sync.js +32 -0
- package/dist/run-command-sync.js.map +1 -0
- package/dist/run-command.d.ts +11 -0
- package/dist/run-command.d.ts.map +1 -0
- package/dist/run-command.js +44 -0
- package/dist/run-command.js.map +1 -0
- package/dist/shared.types.d.ts +127 -0
- package/dist/shared.types.d.ts.map +1 -0
- package/dist/shared.types.js +2 -0
- package/dist/shared.types.js.map +1 -0
- package/package.json +33 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025-present Victor Brito
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# @release-change/shared
|
|
2
|
+
|
|
3
|
+
Some shared functions and types all over release-change
|
|
4
|
+
|
|
5
|
+

|
|
6
|
+
[](https://nodejs.org/api/esm.html)
|
|
7
|
+
[](https://conventionalcommits.org)
|
|
8
|
+
[](https://biomejs.dev/)
|
|
9
|
+

|
|
10
|
+

|
|
11
|
+

|
|
12
|
+
|
|
13
|
+
## Copyright & licence
|
|
14
|
+
|
|
15
|
+
© 2025-present Victor Brito — Released under the [MIT licence](./LICENSE).
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns the singular or plural form of a word depending on the number of occurrences.
|
|
3
|
+
* @param occurrences - The number of occurrences.
|
|
4
|
+
* @param wordForms - The singular and plural forms of the word.
|
|
5
|
+
* @return The singular or plural form of the word.
|
|
6
|
+
*/
|
|
7
|
+
export declare const agreeInNumber: (occurrences: number, wordForms: [string, string]) => string;
|
|
8
|
+
//# sourceMappingURL=agree-in-number.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agree-in-number.d.ts","sourceRoot":"","sources":["../src/agree-in-number.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,eAAO,MAAM,aAAa,GAAI,aAAa,MAAM,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,WAI7E,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns the singular or plural form of a word depending on the number of occurrences.
|
|
3
|
+
* @param occurrences - The number of occurrences.
|
|
4
|
+
* @param wordForms - The singular and plural forms of the word.
|
|
5
|
+
* @return The singular or plural form of the word.
|
|
6
|
+
*/
|
|
7
|
+
export const agreeInNumber = (occurrences, wordForms) => {
|
|
8
|
+
const pluralRule = new Intl.PluralRules("en-GB", { type: "cardinal" });
|
|
9
|
+
const [wordInSingular, wordInPlural] = wordForms;
|
|
10
|
+
return pluralRule.select(occurrences) === "one" ? wordInSingular : wordInPlural;
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=agree-in-number.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agree-in-number.js","sourceRoot":"","sources":["../src/agree-in-number.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,WAAmB,EAAE,SAA2B,EAAE,EAAE;IAChF,MAAM,UAAU,GAAG,IAAI,IAAI,CAAC,WAAW,CAAC,OAAO,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC,CAAC;IACvE,MAAM,CAAC,cAAc,EAAE,YAAY,CAAC,GAAG,SAAS,CAAC;IACjD,OAAO,UAAU,CAAC,MAAM,CAAC,WAAW,CAAC,KAAK,KAAK,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,YAAY,CAAC;AAClF,CAAC,CAAC"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
export declare const ROOT_PACKAGE_MANIFEST: {
|
|
2
|
+
name: string;
|
|
3
|
+
version: string;
|
|
4
|
+
private: boolean;
|
|
5
|
+
description: string;
|
|
6
|
+
keywords: string[];
|
|
7
|
+
homepage: string;
|
|
8
|
+
bugs: {
|
|
9
|
+
url: string;
|
|
10
|
+
};
|
|
11
|
+
author: string;
|
|
12
|
+
repository: {
|
|
13
|
+
type: string;
|
|
14
|
+
url: string;
|
|
15
|
+
};
|
|
16
|
+
type: string;
|
|
17
|
+
license: string;
|
|
18
|
+
workspaces: string[];
|
|
19
|
+
engines: {
|
|
20
|
+
node: string;
|
|
21
|
+
npm: string;
|
|
22
|
+
pnpm: string;
|
|
23
|
+
};
|
|
24
|
+
scripts: {
|
|
25
|
+
biome: string;
|
|
26
|
+
"biome:check": string;
|
|
27
|
+
"biome:format": string;
|
|
28
|
+
"biome:format:check": string;
|
|
29
|
+
"biome:lint": string;
|
|
30
|
+
"biome:lint:check": string;
|
|
31
|
+
build: string;
|
|
32
|
+
dev: string;
|
|
33
|
+
prepare: string;
|
|
34
|
+
"release-change": string;
|
|
35
|
+
test: string;
|
|
36
|
+
"test:watch": string;
|
|
37
|
+
"tsc:watch": string;
|
|
38
|
+
};
|
|
39
|
+
devDependencies: {
|
|
40
|
+
"@biomejs/biome": string;
|
|
41
|
+
"@commitlint/cli": string;
|
|
42
|
+
"@commitlint/config-conventional": string;
|
|
43
|
+
"@types/node": string;
|
|
44
|
+
husky: string;
|
|
45
|
+
typescript: string;
|
|
46
|
+
vitest: string;
|
|
47
|
+
};
|
|
48
|
+
pnpm: {
|
|
49
|
+
onlyBuiltDependencies: string[];
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
export declare const WORKSPACE_NAME: string;
|
|
53
|
+
export declare const WORKSPACE_VERSION: string;
|
|
54
|
+
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAAsB,CAAC;AACzD,eAAO,MAAM,cAAc,QAA6B,CAAC;AACzD,eAAO,MAAM,iBAAiB,QAAgC,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import rootPackageManifest from "../../../package.json" with { type: "json" };
|
|
2
|
+
export const ROOT_PACKAGE_MANIFEST = rootPackageManifest;
|
|
3
|
+
export const WORKSPACE_NAME = ROOT_PACKAGE_MANIFEST.name;
|
|
4
|
+
export const WORKSPACE_VERSION = ROOT_PACKAGE_MANIFEST.version;
|
|
5
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,OAAO,mBAAmB,MAAM,uBAAuB,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AAE9E,MAAM,CAAC,MAAM,qBAAqB,GAAG,mBAAmB,CAAC;AACzD,MAAM,CAAC,MAAM,cAAc,GAAG,qBAAqB,CAAC,IAAI,CAAC;AACzD,MAAM,CAAC,MAAM,iBAAiB,GAAG,qBAAqB,CAAC,OAAO,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { DetailedError } from "./index.js";
|
|
2
|
+
/**
|
|
3
|
+
* Formats a detailed error with a title, a message and details.
|
|
4
|
+
* @param detailedError - The detailed error to format.
|
|
5
|
+
* @return An `Error` object.
|
|
6
|
+
*/
|
|
7
|
+
export declare const formatDetailedError: (detailedError: DetailedError) => Error;
|
|
8
|
+
//# sourceMappingURL=format-detailed-error.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format-detailed-error.d.ts","sourceRoot":"","sources":["../src/format-detailed-error.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAEhD;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,GAAI,eAAe,aAAa,KAAG,KAKlE,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Formats a detailed error with a title, a message and details.
|
|
3
|
+
* @param detailedError - The detailed error to format.
|
|
4
|
+
* @return An `Error` object.
|
|
5
|
+
*/
|
|
6
|
+
export const formatDetailedError = (detailedError) => {
|
|
7
|
+
const { title, message, details } = detailedError;
|
|
8
|
+
return new Error(`${title}: ${message}`, {
|
|
9
|
+
cause: { title, message, details }
|
|
10
|
+
});
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=format-detailed-error.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format-detailed-error.js","sourceRoot":"","sources":["../src/format-detailed-error.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,aAA4B,EAAS,EAAE;IACzE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,aAAa,CAAC;IAClD,OAAO,IAAI,KAAK,CAAC,GAAG,KAAK,KAAK,OAAO,EAAE,EAAE;QACvC,KAAK,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE;KACnC,CAAC,CAAC;AACL,CAAC,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export type { AuthToken, BranchConfig, CiConfig, CliOptions, CommandResult, Commit, Config, Context, ContextBase, DependencyUpdateMethod, DetailedError, LastRelease, NextRelease, Package, PackageLastRelease, PackageNextRelease, ParsedCliOptions, Reference, ReleaseInfo, ReleaseInfoGithub, ReleaseInfoNpm, ReleaseType } from "./shared.types.js";
|
|
2
|
+
export { agreeInNumber } from "./agree-in-number.js";
|
|
3
|
+
export { formatDetailedError } from "./format-detailed-error.js";
|
|
4
|
+
export { parsePathname } from "./parse-pathname.js";
|
|
5
|
+
export { runCommand } from "./run-command.js";
|
|
6
|
+
export { runCommandSync } from "./run-command-sync.js";
|
|
7
|
+
export { ROOT_PACKAGE_MANIFEST, WORKSPACE_NAME, WORKSPACE_VERSION } from "./constants.js";
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,SAAS,EACT,YAAY,EACZ,QAAQ,EACR,UAAU,EACV,aAAa,EACb,MAAM,EACN,MAAM,EACN,OAAO,EACP,WAAW,EACX,sBAAsB,EACtB,aAAa,EACb,WAAW,EACX,WAAW,EACX,OAAO,EACP,kBAAkB,EAClB,kBAAkB,EAClB,gBAAgB,EAChB,SAAS,EACT,WAAW,EACX,iBAAiB,EACjB,cAAc,EACd,WAAW,EACZ,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAEvD,OAAO,EAAE,qBAAqB,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { agreeInNumber } from "./agree-in-number.js";
|
|
2
|
+
export { formatDetailedError } from "./format-detailed-error.js";
|
|
3
|
+
export { parsePathname } from "./parse-pathname.js";
|
|
4
|
+
export { runCommand } from "./run-command.js";
|
|
5
|
+
export { runCommandSync } from "./run-command-sync.js";
|
|
6
|
+
export { ROOT_PACKAGE_MANIFEST, WORKSPACE_NAME, WORKSPACE_VERSION } from "./constants.js";
|
|
7
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAyBA,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAEvD,OAAO,EAAE,qBAAqB,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { PathnameGroups } from "./shared.types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Parses the path name.
|
|
4
|
+
* @param pathname - The path name to parse.
|
|
5
|
+
* @return An object with `owner` and `repository` properties if the repository owner and the repository name are parsed successfully, `null` otherwise.
|
|
6
|
+
*/
|
|
7
|
+
export declare const parsePathname: (pathname: string) => PathnameGroups | null;
|
|
8
|
+
//# sourceMappingURL=parse-pathname.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parse-pathname.d.ts","sourceRoot":"","sources":["../src/parse-pathname.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAExD;;;;GAIG;AACH,eAAO,MAAM,aAAa,GAAI,UAAU,MAAM,KAAG,cAAc,GAAG,IAiBjE,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Parses the path name.
|
|
3
|
+
* @param pathname - The path name to parse.
|
|
4
|
+
* @return An object with `owner` and `repository` properties if the repository owner and the repository name are parsed successfully, `null` otherwise.
|
|
5
|
+
*/
|
|
6
|
+
export const parsePathname = (pathname) => {
|
|
7
|
+
const groupsMatch = /^\/(?<owner>[^/]+)\/(?<repository>.+)\.git$/.exec(pathname);
|
|
8
|
+
if (groupsMatch) {
|
|
9
|
+
const { groups } = groupsMatch;
|
|
10
|
+
if (groups) {
|
|
11
|
+
const { owner, repository } = groups;
|
|
12
|
+
if (owner && repository) {
|
|
13
|
+
return {
|
|
14
|
+
owner,
|
|
15
|
+
repository
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
return null;
|
|
19
|
+
}
|
|
20
|
+
return null;
|
|
21
|
+
}
|
|
22
|
+
return null;
|
|
23
|
+
};
|
|
24
|
+
//# sourceMappingURL=parse-pathname.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parse-pathname.js","sourceRoot":"","sources":["../src/parse-pathname.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,QAAgB,EAAyB,EAAE;IACvE,MAAM,WAAW,GAAG,6CAA6C,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACjF,IAAI,WAAW,EAAE,CAAC;QAChB,MAAM,EAAE,MAAM,EAAE,GAAG,WAAW,CAAC;QAC/B,IAAI,MAAM,EAAE,CAAC;YACX,MAAM,EAAE,KAAK,EAAE,UAAU,EAAE,GAAG,MAAM,CAAC;YACrC,IAAI,KAAK,IAAI,UAAU,EAAE,CAAC;gBACxB,OAAO;oBACL,KAAK;oBACL,UAAU;iBACX,CAAC;YACJ,CAAC;YACD,OAAO,IAAI,CAAC;QACd,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { SpawnSyncOptions } from "node:child_process";
|
|
2
|
+
import type { CommandResult } from "./shared.types.js";
|
|
3
|
+
/**
|
|
4
|
+
* Runs a command synchronously.
|
|
5
|
+
* @param command - The command to run.
|
|
6
|
+
* @param args - The command arguments.
|
|
7
|
+
* @param [options] - The options for the synchronous command.
|
|
8
|
+
* @return The command result with the exit code, the standard output and the standard error.
|
|
9
|
+
*/
|
|
10
|
+
export declare const runCommandSync: (command: string, args: readonly string[], options?: SpawnSyncOptions) => CommandResult;
|
|
11
|
+
//# sourceMappingURL=run-command-sync.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run-command-sync.d.ts","sourceRoot":"","sources":["../src/run-command-sync.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAMvD;;;;;;GAMG;AACH,eAAO,MAAM,cAAc,GACzB,SAAS,MAAM,EACf,MAAM,SAAS,MAAM,EAAE,EACvB,UAAU,gBAAgB,KACzB,aAqBF,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { spawnSync } from "node:child_process";
|
|
2
|
+
import { formatDetailedError } from "./index.js";
|
|
3
|
+
/**
|
|
4
|
+
* Runs a command synchronously.
|
|
5
|
+
* @param command - The command to run.
|
|
6
|
+
* @param args - The command arguments.
|
|
7
|
+
* @param [options] - The options for the synchronous command.
|
|
8
|
+
* @return The command result with the exit code, the standard output and the standard error.
|
|
9
|
+
*/
|
|
10
|
+
export const runCommandSync = (command, args, options) => {
|
|
11
|
+
const childProcess = spawnSync(command, args, options);
|
|
12
|
+
const { status, stdout, stderr } = childProcess;
|
|
13
|
+
const stdoutString = stdout.toString();
|
|
14
|
+
const stderrString = stderr.toString();
|
|
15
|
+
if (status) {
|
|
16
|
+
process.exitCode = status;
|
|
17
|
+
throw formatDetailedError({
|
|
18
|
+
title: `Failed to run the \`${command}\` command`,
|
|
19
|
+
message: `The command failed with status ${status}.`,
|
|
20
|
+
details: {
|
|
21
|
+
output: stderrString || stdoutString || `Command failed with status ${status}.`,
|
|
22
|
+
command: `${command} ${args.join(" ")}`
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
return {
|
|
27
|
+
status,
|
|
28
|
+
stdout: stdoutString,
|
|
29
|
+
stderr: stderrString
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
//# sourceMappingURL=run-command-sync.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run-command-sync.js","sourceRoot":"","sources":["../src/run-command-sync.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAE/C,OAAO,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAEjD;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,CAC5B,OAAe,EACf,IAAuB,EACvB,OAA0B,EACX,EAAE;IACjB,MAAM,YAAY,GAAG,SAAS,CAAC,OAAO,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;IACvD,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,YAAY,CAAC;IAChD,MAAM,YAAY,GAAG,MAAM,CAAC,QAAQ,EAAE,CAAC;IACvC,MAAM,YAAY,GAAG,MAAM,CAAC,QAAQ,EAAE,CAAC;IACvC,IAAI,MAAM,EAAE,CAAC;QACX,OAAO,CAAC,QAAQ,GAAG,MAAM,CAAC;QAC1B,MAAM,mBAAmB,CAAC;YACxB,KAAK,EAAE,uBAAuB,OAAO,YAAY;YACjD,OAAO,EAAE,kCAAkC,MAAM,GAAG;YACpD,OAAO,EAAE;gBACP,MAAM,EAAE,YAAY,IAAI,YAAY,IAAI,8BAA8B,MAAM,GAAG;gBAC/E,OAAO,EAAE,GAAG,OAAO,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE;aACxC;SACF,CAAC,CAAC;IACL,CAAC;IACD,OAAO;QACL,MAAM;QACN,MAAM,EAAE,YAAY;QACpB,MAAM,EAAE,YAAY;KACrB,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { SpawnOptionsWithoutStdio } from "node:child_process";
|
|
2
|
+
import type { CommandResult } from "./shared.types.js";
|
|
3
|
+
/**
|
|
4
|
+
* Runs a command asynchronously.
|
|
5
|
+
* @param command - The command to run.
|
|
6
|
+
* @param args - The command arguments.
|
|
7
|
+
* @param [options] - The options for the asynchronous command.
|
|
8
|
+
* @return The command result with the exit code, the standard output and the standard error.
|
|
9
|
+
*/
|
|
10
|
+
export declare const runCommand: (command: string, args: readonly string[], options?: SpawnOptionsWithoutStdio) => Promise<CommandResult>;
|
|
11
|
+
//# sourceMappingURL=run-command.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run-command.d.ts","sourceRoot":"","sources":["../src/run-command.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AACnE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAMvD;;;;;;GAMG;AACH,eAAO,MAAM,UAAU,GACrB,SAAS,MAAM,EACf,MAAM,SAAS,MAAM,EAAE,EACvB,UAAU,wBAAwB,KACjC,OAAO,CAAC,aAAa,CAmCvB,CAAC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { spawn } from "node:child_process";
|
|
2
|
+
import { formatDetailedError } from "./format-detailed-error.js";
|
|
3
|
+
/**
|
|
4
|
+
* Runs a command asynchronously.
|
|
5
|
+
* @param command - The command to run.
|
|
6
|
+
* @param args - The command arguments.
|
|
7
|
+
* @param [options] - The options for the asynchronous command.
|
|
8
|
+
* @return The command result with the exit code, the standard output and the standard error.
|
|
9
|
+
*/
|
|
10
|
+
export const runCommand = async (command, args, options) => {
|
|
11
|
+
return new Promise((resolve, reject) => {
|
|
12
|
+
const commandResult = {
|
|
13
|
+
status: null,
|
|
14
|
+
stdout: "",
|
|
15
|
+
stderr: ""
|
|
16
|
+
};
|
|
17
|
+
const childProcess = spawn(command, args, options);
|
|
18
|
+
childProcess.stdout.on("data", data => {
|
|
19
|
+
commandResult.stdout += data.toString();
|
|
20
|
+
});
|
|
21
|
+
childProcess.stderr.on("data", data => {
|
|
22
|
+
commandResult.stderr += data.toString();
|
|
23
|
+
});
|
|
24
|
+
childProcess.on("close", code => {
|
|
25
|
+
commandResult.status = code;
|
|
26
|
+
process.exitCode = Number(code);
|
|
27
|
+
resolve(commandResult);
|
|
28
|
+
});
|
|
29
|
+
childProcess.on("error", error => {
|
|
30
|
+
const { exitCode } = childProcess;
|
|
31
|
+
const { message } = error;
|
|
32
|
+
process.exitCode = Number(exitCode);
|
|
33
|
+
reject(formatDetailedError({
|
|
34
|
+
title: `Failed to run the \`${command}\` command`,
|
|
35
|
+
message: `The command failed with status ${exitCode}.`,
|
|
36
|
+
details: {
|
|
37
|
+
output: message || `Command failed with status ${exitCode}.`,
|
|
38
|
+
command: `${command} ${args.join(" ")}`
|
|
39
|
+
}
|
|
40
|
+
}));
|
|
41
|
+
});
|
|
42
|
+
});
|
|
43
|
+
};
|
|
44
|
+
//# sourceMappingURL=run-command.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run-command.js","sourceRoot":"","sources":["../src/run-command.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAE3C,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAEjE;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,KAAK,EAC7B,OAAe,EACf,IAAuB,EACvB,OAAkC,EACV,EAAE;IAC1B,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACrC,MAAM,aAAa,GAAkB;YACnC,MAAM,EAAE,IAAI;YACZ,MAAM,EAAE,EAAE;YACV,MAAM,EAAE,EAAE;SACX,CAAC;QACF,MAAM,YAAY,GAAG,K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
|
+
status: number | null;
|
|
3
|
+
stdout: string;
|
|
4
|
+
stderr: string;
|
|
5
|
+
};
|
|
6
|
+
export type ParsedCliOptions = {
|
|
7
|
+
branches?: string[];
|
|
8
|
+
repositoryUrl?: string;
|
|
9
|
+
remoteName?: string;
|
|
10
|
+
debug?: true;
|
|
11
|
+
dryRun?: true;
|
|
12
|
+
version?: true;
|
|
13
|
+
help?: true;
|
|
14
|
+
};
|
|
15
|
+
export type CliOptions = Omit<ParsedCliOptions, "help" | "version">;
|
|
16
|
+
export type DetailedError = {
|
|
17
|
+
title: string;
|
|
18
|
+
message: string;
|
|
19
|
+
details: {
|
|
20
|
+
output: string;
|
|
21
|
+
command?: string;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
export type BranchConfig = {
|
|
25
|
+
channel?: string;
|
|
26
|
+
prerelease?: true;
|
|
27
|
+
prereleaseIdentifier?: string;
|
|
28
|
+
};
|
|
29
|
+
export type DependencyUpdateMethod = "pin" | "workspace" | "caret-range" | "tilde-range" | null;
|
|
30
|
+
export type Config = {
|
|
31
|
+
branches: string[];
|
|
32
|
+
releaseType: Record<string, BranchConfig>;
|
|
33
|
+
isMonorepo: boolean;
|
|
34
|
+
dependencyUpdateMethod?: DependencyUpdateMethod;
|
|
35
|
+
debug: boolean;
|
|
36
|
+
dryRun: boolean;
|
|
37
|
+
repositoryUrl: string;
|
|
38
|
+
remoteName: string;
|
|
39
|
+
npmPublish?: false;
|
|
40
|
+
};
|
|
41
|
+
export type CiConfig = {
|
|
42
|
+
isCi: boolean;
|
|
43
|
+
isPullRequest: boolean;
|
|
44
|
+
};
|
|
45
|
+
export type Package = {
|
|
46
|
+
name: string;
|
|
47
|
+
pathname: string;
|
|
48
|
+
};
|
|
49
|
+
export type PackageLastRelease = {
|
|
50
|
+
name: string;
|
|
51
|
+
pathname: string;
|
|
52
|
+
gitTag: string | null;
|
|
53
|
+
version: string;
|
|
54
|
+
};
|
|
55
|
+
export type PackageNextRelease = {
|
|
56
|
+
name: string;
|
|
57
|
+
pathname: string;
|
|
58
|
+
gitTag: string;
|
|
59
|
+
version: string;
|
|
60
|
+
npmTag?: string;
|
|
61
|
+
};
|
|
62
|
+
export type LastRelease = {
|
|
63
|
+
ref: string | null;
|
|
64
|
+
packages: PackageLastRelease[];
|
|
65
|
+
};
|
|
66
|
+
export type NextRelease = PackageNextRelease[];
|
|
67
|
+
export type ReleaseType = "major" | "minor" | "patch" | null;
|
|
68
|
+
export type Commit = {
|
|
69
|
+
isMergeCommit: boolean;
|
|
70
|
+
sha: string | null;
|
|
71
|
+
message: string;
|
|
72
|
+
body: string[];
|
|
73
|
+
footer: string[];
|
|
74
|
+
releaseType: ReleaseType;
|
|
75
|
+
modifiedFiles?: string[];
|
|
76
|
+
};
|
|
77
|
+
export type Reference = {
|
|
78
|
+
number: number;
|
|
79
|
+
isPullRequest: boolean;
|
|
80
|
+
gitTags: string[];
|
|
81
|
+
};
|
|
82
|
+
export type ReleaseInfoGithub = {
|
|
83
|
+
type: "github";
|
|
84
|
+
name: "GitHub release";
|
|
85
|
+
url: string;
|
|
86
|
+
};
|
|
87
|
+
export type ReleaseInfoNpm = {
|
|
88
|
+
type: "npm";
|
|
89
|
+
name: `NPM ${string} distribution tag)`;
|
|
90
|
+
url: string;
|
|
91
|
+
};
|
|
92
|
+
export type ReleaseInfo = ReleaseInfoGithub | ReleaseInfoNpm;
|
|
93
|
+
type FileExists = {
|
|
94
|
+
fileExists: true;
|
|
95
|
+
authTokenExists: boolean;
|
|
96
|
+
};
|
|
97
|
+
type FileNotExists = {
|
|
98
|
+
fileExists: false;
|
|
99
|
+
authTokenExists: false;
|
|
100
|
+
};
|
|
101
|
+
export type AuthToken = FileExists | FileNotExists;
|
|
102
|
+
export interface ContextBase {
|
|
103
|
+
cwd: string;
|
|
104
|
+
env: NodeJS.ProcessEnv;
|
|
105
|
+
config: {
|
|
106
|
+
debug: boolean;
|
|
107
|
+
};
|
|
108
|
+
errors: DetailedError[];
|
|
109
|
+
}
|
|
110
|
+
export interface Context extends ContextBase {
|
|
111
|
+
config: Config;
|
|
112
|
+
branch: string | undefined;
|
|
113
|
+
ci: CiConfig;
|
|
114
|
+
packages: Package[];
|
|
115
|
+
releaseInfos: ReleaseInfo[];
|
|
116
|
+
lastRelease?: LastRelease;
|
|
117
|
+
nextRelease?: NextRelease;
|
|
118
|
+
commits?: Commit[];
|
|
119
|
+
references?: Reference[];
|
|
120
|
+
authToken?: AuthToken;
|
|
121
|
+
}
|
|
122
|
+
export type PathnameGroups = {
|
|
123
|
+
owner: string;
|
|
124
|
+
repository: string;
|
|
125
|
+
};
|
|
126
|
+
export {};
|
|
127
|
+
//# sourceMappingURL=shared.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shared.types.d.ts","sourceRoot":"","sources":["../src/shared.types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,aAAa,GAAG;IAC1B,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AACF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,IAAI,CAAC;IACb,MAAM,CAAC,EAAE,IAAI,CAAC;IACd,OAAO,CAAC,EAAE,IAAI,CAAC;IACf,IAAI,CAAC,EAAE,IAAI,CAAC;CACb,CAAC;AACF,MAAM,MAAM,UAAU,GAAG,IAAI,CAAC,gBAAgB,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;AACpE,MAAM,MAAM,aAAa,GAAG;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE;QACP,MAAM,EAAE,MAAM,CAAC;QACf,OAAO,CAAC,EAAE,MAAM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AAG,aAAa,CAAC;AACnD,MAAM,WAAW,WAAW;IAC1B,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC,UAAU,CAAC;IACvB,MAAM,EAAE;QACN,KAAK,EAAE,OAAO,CAAC;KAChB,CAAC;IACF,MAAM,EAAE,aAAa,EAAE,CAAC;CACzB;AACD,MAAM,WAAW,OAAQ,SAAQ,WAAW;IAC1C,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,EAAE,EAAE,QAAQ,CAAC;IACb,QAAQ,EAAE,OAAO,EAAE,CAAC;IACpB,YAAY,EAAE,WAAW,EAAE,CAAC;IAC5B,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,UAAU,CAAC,EAAE,SAAS,EAAE,CAAC;IACzB,SAAS,CAAC,EAAE,SAAS,CAAC;CACvB;AACD,MAAM,MAAM,cAAc,GAAG;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shared.types.js","sourceRoot":"","sources":["../src/shared.types.ts"],"names":[],"mappings":""}
|
package/package.json
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@release-change/shared",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Some shared functions and types all over release-change",
|
|
5
|
+
"keywords": [],
|
|
6
|
+
"homepage": "https://github.com/release-change/release-change",
|
|
7
|
+
"bugs": {
|
|
8
|
+
"url": "https://github.com/release-change/release-change/issues"
|
|
9
|
+
},
|
|
10
|
+
"author": "Victor Brito (https://victor-brito.dev)",
|
|
11
|
+
"repository": {
|
|
12
|
+
"type": "git",
|
|
13
|
+
"url": "git+https://github.com/release-change/release-change.git"
|
|
14
|
+
},
|
|
15
|
+
"type": "module",
|
|
16
|
+
"license": "MIT",
|
|
17
|
+
"files": [
|
|
18
|
+
"dist"
|
|
19
|
+
],
|
|
20
|
+
"exports": {
|
|
21
|
+
"import": "./dist/index.js",
|
|
22
|
+
"types": "./dist/index.d.ts"
|
|
23
|
+
},
|
|
24
|
+
"engines": {
|
|
25
|
+
"node": "^20.18.3 || ^22.12.0 || ^24.0.0",
|
|
26
|
+
"npm": ">=10.8.2",
|
|
27
|
+
"pnpm": ">=10.28.0"
|
|
28
|
+
},
|
|
29
|
+
"scripts": {
|
|
30
|
+
"build": "tsc",
|
|
31
|
+
"dev": "tsc --watch --preserveWatchOutput & vitest"
|
|
32
|
+
}
|
|
33
|
+
}
|