@mlaursen/release-script 0.0.3 → 0.0.5
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 +15 -1
- package/dist/release.d.ts +12 -0
- package/dist/release.js +1 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -49,7 +49,7 @@ await release({
|
|
|
49
49
|
// If there is a custom build command for releases. `build` is the default
|
|
50
50
|
// buildCommand: "build",
|
|
51
51
|
|
|
52
|
-
// An optional flag if the build step should be skipped. `
|
|
52
|
+
// An optional flag if the build step should be skipped. `!buildCommand` by default
|
|
53
53
|
// skipBuild: process.argv.includes("--skip-build"),
|
|
54
54
|
|
|
55
55
|
// This is useful for monorepos where only a single Github release needs to
|
|
@@ -98,3 +98,17 @@ Finally, run the release script whenever a new release should go out:
|
|
|
98
98
|
```sh
|
|
99
99
|
pnpm release
|
|
100
100
|
```
|
|
101
|
+
|
|
102
|
+
## Alpha Releases
|
|
103
|
+
|
|
104
|
+
Use the changesets api to enter the pre-release flow:
|
|
105
|
+
|
|
106
|
+
```sh
|
|
107
|
+
pnpm changeset enter pre
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
Once ready to do a real release:
|
|
111
|
+
|
|
112
|
+
```sh
|
|
113
|
+
pnpm changeset exit pre
|
|
114
|
+
```
|
package/dist/release.d.ts
CHANGED
|
@@ -1,9 +1,21 @@
|
|
|
1
1
|
import { ConfigurableCreateReleaseOptions } from "./createRelease.js";
|
|
2
2
|
export interface ReleaseOptions extends ConfigurableCreateReleaseOptions {
|
|
3
|
+
/**
|
|
4
|
+
* @defaultValue `!buildCommand`
|
|
5
|
+
*/
|
|
3
6
|
skipBuild?: boolean;
|
|
7
|
+
/**
|
|
8
|
+
* @defaultValue `"clean"`
|
|
9
|
+
*/
|
|
4
10
|
cleanCommand?: string;
|
|
11
|
+
/**
|
|
12
|
+
* @defaultValue `"build"`
|
|
13
|
+
*/
|
|
5
14
|
buildCommand?: string;
|
|
6
15
|
mainPackage?: string;
|
|
16
|
+
/**
|
|
17
|
+
* @defaultValue `"build(version): version package"`
|
|
18
|
+
*/
|
|
7
19
|
versionMessage?: string;
|
|
8
20
|
getTagName?: () => Promise<string>;
|
|
9
21
|
}
|
package/dist/release.js
CHANGED
|
@@ -9,7 +9,7 @@ const exec = (command, opts) => {
|
|
|
9
9
|
execSync(command, opts);
|
|
10
10
|
};
|
|
11
11
|
export async function release(options) {
|
|
12
|
-
const { owner, repo, envPath,
|
|
12
|
+
const { owner, repo, envPath, cleanCommand = "clean", buildCommand = "build", skipBuild = !buildCommand, mainPackage, getTagName = createGetTagName(mainPackage), versionMessage = "build(version): version package", } = options;
|
|
13
13
|
const pkgManager = await getPackageManager();
|
|
14
14
|
if (!skipBuild) {
|
|
15
15
|
exec(`${pkgManager} ${cleanCommand}`);
|
|
@@ -21,8 +21,6 @@ export async function release(options) {
|
|
|
21
21
|
exec("git add .changeset");
|
|
22
22
|
const changeset = await getCurrentChangeset();
|
|
23
23
|
exec("pnpm changeset version", { stdio: "inherit" });
|
|
24
|
-
// handle the first release
|
|
25
|
-
exec("git add CHANGELOG.md");
|
|
26
24
|
exec("git add -u");
|
|
27
25
|
await continueRelease();
|
|
28
26
|
exec(`git commit -m "${versionMessage}"`);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mlaursen/release-script",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.5",
|
|
5
5
|
"description": "The release script I normally use for packages I publish to npm",
|
|
6
6
|
"repository": "https://github.com/mlaursen/release-script.git",
|
|
7
7
|
"author": "Mikkel Laursen <mlaursen03@gmail.com>",
|