@containerbase/semantic-release-pnpm 1.3.35 → 1.4.1

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.
Files changed (2) hide show
  1. package/lib/index.js +70 -33
  2. package/package.json +1 -1
package/lib/index.js CHANGED
@@ -16,7 +16,9 @@ import SemanticReleaseError from "@semantic-release/error";
16
16
  // src/definitions/errors.ts
17
17
  var errors_exports = {};
18
18
  __export(errors_exports, {
19
- EINVALIDNPMAUTH: () => EINVALIDNPMAUTH
19
+ EINVALIDNPMAUTH: () => EINVALIDNPMAUTH,
20
+ ENOPKG: () => ENOPKG,
21
+ ENOPKGNAME: () => ENOPKGNAME
20
22
  });
21
23
  function EINVALIDNPMAUTH(_ctx) {
22
24
  return {
@@ -26,6 +28,22 @@ function EINVALIDNPMAUTH(_ctx) {
26
28
  Please verify your authentication configuration.`
27
29
  };
28
30
  }
31
+ function ENOPKGNAME(_ctx) {
32
+ return {
33
+ message: "Missing `name` property in `package.json`.",
34
+ details: `The \`package.json\`'s [name](https://docs.npmjs.com/files/package.json#name) property is required in order to publish a package to the npm registry.
35
+
36
+ Please make sure to add a valid \`name\` for your package in your \`package.json\`.`
37
+ };
38
+ }
39
+ function ENOPKG(_ctx) {
40
+ return {
41
+ message: "Missing `package.json` file.",
42
+ details: `A [package.json file](https://docs.npmjs.com/files/package.json) at the root of your project is required to release on npm.
43
+
44
+ Please follow the [npm guideline](https://docs.npmjs.com/getting-started/creating-node-modules) to create a valid \`package.json\` file.`
45
+ };
46
+ }
29
47
 
30
48
  // src/get-error.ts
31
49
  var get_error_default = (code, ctx = {}) => {
@@ -75,40 +93,59 @@ async function prepare(_pluginConfig, {
75
93
  nextRelease: { version }
76
94
  }) {
77
95
  logger.log("Write version %s to package.json in %s", version, cwd);
78
- await execa(
79
- "pnpm",
80
- [
81
- "pnpm",
82
- "version",
83
- version,
84
- "--no-git-tag-version",
85
- "--allow-same-version"
86
- ],
87
- {
88
- cwd,
89
- env,
90
- stdout,
91
- stderr
96
+ const errors = [];
97
+ try {
98
+ await execa(
99
+ "npm",
100
+ [
101
+ "version",
102
+ version,
103
+ "--no-git-tag-version",
104
+ "--allow-same-version",
105
+ "--ignore-scripts"
106
+ ],
107
+ {
108
+ cwd,
109
+ env,
110
+ stdout,
111
+ stderr
112
+ }
113
+ );
114
+ } catch (err) {
115
+ if (err instanceof AggregateError) {
116
+ errors.push(...err.errors);
92
117
  }
93
- );
94
- await execa(
95
- "pnpm",
96
- [
97
- "-r",
98
- "exec",
118
+ errors.push(err);
119
+ }
120
+ if (errors.length > 0) {
121
+ throw new AggregateError(errors);
122
+ }
123
+ try {
124
+ await execa(
99
125
  "pnpm",
100
- "version",
101
- version,
102
- "--no-git-tag-version",
103
- "--allow-same-version"
104
- ],
105
- {
106
- cwd,
107
- env,
108
- stdout,
109
- stderr
110
- }
111
- );
126
+ [
127
+ "-r",
128
+ "exec",
129
+ "npm",
130
+ "version",
131
+ version,
132
+ "--no-git-tag-version",
133
+ "--allow-same-version",
134
+ "--ignore-scripts"
135
+ ],
136
+ {
137
+ cwd,
138
+ env,
139
+ stdout,
140
+ stderr
141
+ }
142
+ );
143
+ } catch (err) {
144
+ errors.push(err);
145
+ }
146
+ if (errors.length > 0) {
147
+ throw new AggregateError(errors);
148
+ }
112
149
  }
113
150
  async function publish(_pluginConfig, {
114
151
  cwd = ".",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@containerbase/semantic-release-pnpm",
3
- "version": "1.3.35",
3
+ "version": "1.4.1",
4
4
  "description": "A pnpm plugin for semantic-release",
5
5
  "keywords": [
6
6
  "semantic-release",