@anolilab/semantic-release-pnpm 1.0.0-alpha.8 → 1.0.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/CHANGELOG.md +4 -66
- package/{LICENSE → LICENSE.md} +1 -1
- package/README.md +227 -2
- package/dist/index.d.ts +3 -3
- package/dist/index.js +15 -18
- package/dist/index.js.map +1 -1
- package/package.json +142 -146
package/CHANGELOG.md
CHANGED
|
@@ -1,74 +1,12 @@
|
|
|
1
|
-
##
|
|
1
|
+
## @anolilab/semantic-release-pnpm 1.0.0 (2024-05-22)
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
### Features
|
|
5
5
|
|
|
6
|
-
*
|
|
6
|
+
* adding semantic-release-pnpm ([#25](https://github.com/anolilab/semantic-release/issues/25)) ([c8a8d47](https://github.com/anolilab/semantic-release/commit/c8a8d4738ee4909dbdab4f6ea39ef0600af1a5d4))
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
### Bug Fixes
|
|
10
9
|
|
|
11
|
-
|
|
10
|
+
### Dependencies
|
|
12
11
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
### Bug Fixes
|
|
17
|
-
|
|
18
|
-
* remove hack fix for npm 8.5 ([591bf1d](https://github.com/anolilab/semantic-release-pnpm/commit/591bf1d0971c74f25153ec927c3c9072c7ccc99b))
|
|
19
|
-
|
|
20
|
-
## [1.0.0-alpha.6](https://github.com/anolilab/semantic-release-pnpm/compare/v1.0.0-alpha.5...v1.0.0-alpha.6) (2024-05-16)
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
### Features
|
|
24
|
-
|
|
25
|
-
* more tests ([d969442](https://github.com/anolilab/semantic-release-pnpm/commit/d969442b4109723c1e5491a7dcefc5477c1518d0))
|
|
26
|
-
* replaced rc with custom version, ported more tests ([22368ff](https://github.com/anolilab/semantic-release-pnpm/commit/22368ffce0bddc647676e46f21604748d570eb76))
|
|
27
|
-
|
|
28
|
-
## [1.0.0-alpha.5](https://github.com/anolilab/semantic-release-pnpm/compare/v1.0.0-alpha.4...v1.0.0-alpha.5) (2024-05-16)
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
### Bug Fixes
|
|
32
|
-
|
|
33
|
-
* changed wrong arg ([4464484](https://github.com/anolilab/semantic-release-pnpm/commit/4464484654ca25abf5896a6c7dca322bae3c4352))
|
|
34
|
-
|
|
35
|
-
## [1.0.0-alpha.4](https://github.com/anolilab/semantic-release-pnpm/compare/v1.0.0-alpha.3...v1.0.0-alpha.4) (2024-05-16)
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
### Bug Fixes
|
|
39
|
-
|
|
40
|
-
* changed wrong arg ([90658c9](https://github.com/anolilab/semantic-release-pnpm/commit/90658c9fc5353e7290c84dab404b468df6ad311e))
|
|
41
|
-
|
|
42
|
-
## [1.0.0-alpha.3](https://github.com/anolilab/semantic-release-pnpm/compare/v1.0.0-alpha.2...v1.0.0-alpha.3) (2024-05-16)
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
### Features
|
|
46
|
-
|
|
47
|
-
* added option for disableScripts ([2d739cf](https://github.com/anolilab/semantic-release-pnpm/commit/2d739cf36d01599264e3a70eb24e5ca4bc09e590))
|
|
48
|
-
|
|
49
|
-
## [1.0.0-alpha.2](https://github.com/anolilab/semantic-release-pnpm/compare/v1.0.0-alpha.1...v1.0.0-alpha.2) (2024-05-16)
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
### Bug Fixes
|
|
53
|
-
|
|
54
|
-
* use no-git-checks for publish ([7b9762f](https://github.com/anolilab/semantic-release-pnpm/commit/7b9762f93adbc412e08bd84f6b7738c1e07fd4eb))
|
|
55
|
-
|
|
56
|
-
## 1.0.0-alpha.1 (2024-05-16)
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
### Features
|
|
60
|
-
|
|
61
|
-
* first version of semantic-release-pnpm ([ae2a519](https://github.com/anolilab/semantic-release-pnpm/commit/ae2a5191e61444d22178a082f91fa8271e6a8683))
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
### Bug Fixes
|
|
65
|
-
|
|
66
|
-
* better error handling ([ff5c3b9](https://github.com/anolilab/semantic-release-pnpm/commit/ff5c3b93443b9cc5ea4f021d6471a48099f830c6))
|
|
67
|
-
* better error handling ([faa8047](https://github.com/anolilab/semantic-release-pnpm/commit/faa8047a454eda31eef63b97e6e2714852ad6476))
|
|
68
|
-
* better get-registry ([3097ab0](https://github.com/anolilab/semantic-release-pnpm/commit/3097ab09a5ae5642562d7d781c5797ed2be9947f))
|
|
69
|
-
* debug ([c9f52fb](https://github.com/anolilab/semantic-release-pnpm/commit/c9f52fbd474930614bf18198fe2458cd370d0a7a))
|
|
70
|
-
* debug ([9fd60c3](https://github.com/anolilab/semantic-release-pnpm/commit/9fd60c32d6251672f6b4f0fb9962aaa32aa37131))
|
|
71
|
-
* fixed audit issue ([06e6154](https://github.com/anolilab/semantic-release-pnpm/commit/06e61542762c41de7f6022f93c0167919615604c))
|
|
72
|
-
* fixed error ([0e14896](https://github.com/anolilab/semantic-release-pnpm/commit/0e148962d8e463b0ccdb24d722ec1393c4adfb5d))
|
|
73
|
-
* fixed pnpm version check ([0d3c084](https://github.com/anolilab/semantic-release-pnpm/commit/0d3c084ee9003f66c8ae7b06cd5d9fe8748e8fe1))
|
|
74
|
-
* moved some deps ([204a5c1](https://github.com/anolilab/semantic-release-pnpm/commit/204a5c158404442d08e3e47d37c9c13d5c91019b))
|
|
12
|
+
* **@anolilab/rc:** upgraded to 1.0.0
|
package/{LICENSE → LICENSE.md}
RENAMED
package/README.md
CHANGED
|
@@ -1,3 +1,228 @@
|
|
|
1
|
-
|
|
1
|
+
<div align="center">
|
|
2
|
+
<h3>anolilab semantic-release-pnpm</h3>
|
|
3
|
+
<p>
|
|
4
|
+
Semantic-release plugin to publish a npm package with pnpm.
|
|
5
|
+
</p>
|
|
6
|
+
</div>
|
|
2
7
|
|
|
3
|
-
|
|
8
|
+
<br />
|
|
9
|
+
|
|
10
|
+
<div align="center">
|
|
11
|
+
|
|
12
|
+
[![typescript-image]][typescript-url] [![npm-image]][npm-url] [![license-image]][license-url]
|
|
13
|
+
|
|
14
|
+
</div>
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
<div align="center">
|
|
19
|
+
<p>
|
|
20
|
+
<sup>
|
|
21
|
+
Daniel Bannert's open source work is supported by the community on <a href="https://github.com/sponsors/prisis">GitHub Sponsors</a>
|
|
22
|
+
</sup>
|
|
23
|
+
</p>
|
|
24
|
+
</div>
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
## Install
|
|
29
|
+
|
|
30
|
+
```sh
|
|
31
|
+
npm install @anolilab/semantic-release-pnpm
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
```sh
|
|
35
|
+
yarn add @anolilab/semantic-release-pnpm
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
```sh
|
|
39
|
+
pnpm add @anolilab/semantic-release-pnpm
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Usage
|
|
43
|
+
|
|
44
|
+
The plugin can be configured in the [**semantic-release** configuration file](https://github.com/semantic-release/semantic-release/blob/master/docs/usage/configuration.md#configuration):
|
|
45
|
+
|
|
46
|
+
```json
|
|
47
|
+
{
|
|
48
|
+
"plugins": ["@semantic-release/commit-analyzer", "@semantic-release/release-notes-generator", "@anolilab/semantic-release-pnpm"]
|
|
49
|
+
}
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## Steps that are used
|
|
53
|
+
|
|
54
|
+
| Step | Description |
|
|
55
|
+
| ------------------ | -------------------------------------------------------------------------------------------------------------------------------- |
|
|
56
|
+
| `verifyConditions` | Verify the presence of the `NPM_TOKEN` environment variable, or an `.npmrc` file, and verify the authentication method is valid. |
|
|
57
|
+
| `prepare` | Update the `package.json` version and [create](https://docs.npmjs.com/cli/pack) the npm package tarball. |
|
|
58
|
+
| `addChannel` | [Add a release to a dist-tag](https://docs.npmjs.com/cli/dist-tag). |
|
|
59
|
+
| `publish` | [Publish the npm package](https://docs.npmjs.com/cli/publish) to the registry. |
|
|
60
|
+
|
|
61
|
+
## Configuration
|
|
62
|
+
|
|
63
|
+
### npm registry authentication
|
|
64
|
+
|
|
65
|
+
The npm [token](https://docs.npmjs.com/about-access-tokens) authentication configuration is **required** and can be set via [environment variables](#environment-variables).
|
|
66
|
+
|
|
67
|
+
Automation tokens are recommended since they can be used for an automated workflow, even when your account is configured to use the [`auth-and-writes` level of 2FA](https://docs.npmjs.com/about-two-factor-authentication#authorization-and-writes).
|
|
68
|
+
|
|
69
|
+
### npm provenance
|
|
70
|
+
|
|
71
|
+
If you are publishing to the official registry and your pipeline is on a [provider that is supported by npm for provenance](https://docs.npmjs.com/generating-provenance-statements#provenance-limitations), npm can be configured to [publish with provenance](https://docs.npmjs.com/generating-provenance-statements).
|
|
72
|
+
|
|
73
|
+
Since semantic-release wraps the npm publish command, configuring provenance is not exposed directly.
|
|
74
|
+
Instead, provenance can be configured through the [other configuration options exposed by npm](https://docs.npmjs.com/generating-provenance-statements#using-third-party-package-publishing-tools).
|
|
75
|
+
Provenance applies specifically to publishing, so our recommendation is to configure under `publishConfig` within the `package.json`.
|
|
76
|
+
|
|
77
|
+
#### npm provenance on GitHub Actions
|
|
78
|
+
|
|
79
|
+
For package provenance to be signed on the GitHub Actions CI the following permission is required
|
|
80
|
+
to be enabled on the job:
|
|
81
|
+
|
|
82
|
+
```yaml
|
|
83
|
+
permissions:
|
|
84
|
+
id-token: write # to enable use of OIDC for npm provenance
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
It's worth noting that if you are using semantic-release to its fullest with a GitHub release, GitHub comments,
|
|
88
|
+
and other features, then [more permissions are required](https://github.com/semantic-release/github#github-authentication) to be enabled on this job:
|
|
89
|
+
|
|
90
|
+
```yaml
|
|
91
|
+
permissions:
|
|
92
|
+
contents: write # to be able to publish a GitHub release
|
|
93
|
+
issues: write # to be able to comment on released issues
|
|
94
|
+
pull-requests: write # to be able to comment on released pull requests
|
|
95
|
+
id-token: write # to enable use of OIDC for npm provenance
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
Refer to the [GitHub Actions recipe for npm package provenance](https://semantic-release.gitbook.io/semantic-release/recipes/ci-configurations/github-actions#.github-workflows-release.yml-configuration-for-node-projects) for the full CI job's YAML code example.
|
|
99
|
+
|
|
100
|
+
### Environment variables
|
|
101
|
+
|
|
102
|
+
| Variable | Description |
|
|
103
|
+
| ----------- | ----------------------------------------------------------------------------------------------------------------------------- |
|
|
104
|
+
| `NPM_TOKEN` | Npm token created via [npm token create](https://docs.npmjs.com/getting-started/working_with_tokens#how-to-create-new-tokens) |
|
|
105
|
+
|
|
106
|
+
### Options
|
|
107
|
+
|
|
108
|
+
| Options | Description | Default |
|
|
109
|
+
| --------------- | ------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------- |
|
|
110
|
+
| `npmPublish` | Whether to publish the `npm` package to the registry. If `false` the `package.json` version will still be updated. | `false` if the `package.json` [private](https://docs.npmjs.com/files/package.json#private) property is `true`, `true` otherwise. |
|
|
111
|
+
| `pkgRoot` | Directory path to publish. | `.` |
|
|
112
|
+
| `tarballDir` | Directory path in which to write the package tarball. If `false` the tarball is not be kept on the file system. | `false` |
|
|
113
|
+
| `publishBranch` | The primary branch of the repository which is used for publishing the latest changes. | [master and main](https://pnpm.io/cli/publish#--publish-branch-branch) |
|
|
114
|
+
|
|
115
|
+
**Note**: The `pkgRoot` directory must contain a `package.json`. The version will be updated only in the `package.json` and `npm-shrinkwrap.json` within the `pkgRoot` directory.
|
|
116
|
+
|
|
117
|
+
**Note**: If you use a [shareable configuration](https://github.com/semantic-release/semantic-release/blob/master/docs/usage/shareable-configurations.md#shareable-configurations) that defines one of these options you can set it to `false` in your [**semantic-release** configuration](https://github.com/semantic-release/semantic-release/blob/master/docs/usage/configuration.md#configuration) in order to use the default value.
|
|
118
|
+
|
|
119
|
+
### npm configuration
|
|
120
|
+
|
|
121
|
+
The plugin uses the [`npm` CLI](https://github.com/npm/cli) which will read the configuration from [`.npmrc`](https://docs.npmjs.com/files/npmrc). See [`npm config`](https://docs.npmjs.com/misc/config) for the option list.
|
|
122
|
+
|
|
123
|
+
The [`registry`](https://docs.npmjs.com/misc/registry) can be configured via the npm environment variable `NPM_CONFIG_REGISTRY` and will take precedence over the configuration in `.npmrc`.
|
|
124
|
+
|
|
125
|
+
The [`registry`](https://docs.npmjs.com/misc/registry) and [`dist-tag`](https://docs.npmjs.com/cli/dist-tag) can be configured under `publishConfig` in the `package.json`:
|
|
126
|
+
|
|
127
|
+
```json
|
|
128
|
+
{
|
|
129
|
+
"publishConfig": {
|
|
130
|
+
"registry": "https://registry.npmjs.org/",
|
|
131
|
+
"tag": "latest"
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
**Notes**:
|
|
137
|
+
|
|
138
|
+
- The presence of an `.npmrc` file will override any specified environment variables.
|
|
139
|
+
- The presence of `registry` or `dist-tag` under `publishConfig` in the `package.json` will take precedence over the configuration in `.npmrc` and `NPM_CONFIG_REGISTRY`
|
|
140
|
+
|
|
141
|
+
### Examples
|
|
142
|
+
|
|
143
|
+
The `npmPublish` and `tarballDir` option can be used to skip the publishing to the `npm` registry and instead, release the package tarball with another plugin. For example with the [@semantic-release/github](https://github.com/semantic-release/github) plugin:
|
|
144
|
+
|
|
145
|
+
```json
|
|
146
|
+
{
|
|
147
|
+
"plugins": [
|
|
148
|
+
"@semantic-release/commit-analyzer",
|
|
149
|
+
"@semantic-release/release-notes-generator",
|
|
150
|
+
[
|
|
151
|
+
"@anolilab/semantic-release-pnpm",
|
|
152
|
+
{
|
|
153
|
+
"npmPublish": false,
|
|
154
|
+
"tarballDir": "dist"
|
|
155
|
+
}
|
|
156
|
+
],
|
|
157
|
+
[
|
|
158
|
+
"@semantic-release/github",
|
|
159
|
+
{
|
|
160
|
+
"assets": "dist/*.tgz"
|
|
161
|
+
}
|
|
162
|
+
]
|
|
163
|
+
]
|
|
164
|
+
}
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
When publishing from a sub-directory with the `pkgRoot` option, the `package.json` and `npm-shrinkwrap.json` updated with the new version can be moved to another directory with a `postversion`. For example with the [@semantic-release/git](https://github.com/semantic-release/git) plugin:
|
|
168
|
+
|
|
169
|
+
```json
|
|
170
|
+
{
|
|
171
|
+
"plugins": [
|
|
172
|
+
"@semantic-release/commit-analyzer",
|
|
173
|
+
"@semantic-release/release-notes-generator",
|
|
174
|
+
[
|
|
175
|
+
"@anolilab/semantic-release-pnpm",
|
|
176
|
+
{
|
|
177
|
+
"pkgRoot": "dist"
|
|
178
|
+
}
|
|
179
|
+
],
|
|
180
|
+
[
|
|
181
|
+
"@semantic-release/git",
|
|
182
|
+
{
|
|
183
|
+
"assets": ["package.json", "npm-shrinkwrap.json"]
|
|
184
|
+
}
|
|
185
|
+
]
|
|
186
|
+
]
|
|
187
|
+
}
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
```json
|
|
191
|
+
{
|
|
192
|
+
"scripts": {
|
|
193
|
+
"postversion": "cp -r package.json .. && cp -r npm-shrinkwrap.json .."
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
## Related
|
|
199
|
+
|
|
200
|
+
- [@semantic-release/npm](https://github.com/semantic-release/npm) - 🚢 semantic-release plugin to publish a npm package
|
|
201
|
+
- [semantic-release-yarn](https://github.com/hongaar/semantic-release-yarn) - 🧶 A semantic-release plugin to publish npm packages with Yarn. Comes with built-in support for monorepos.
|
|
202
|
+
|
|
203
|
+
## Supported Node.js Versions
|
|
204
|
+
|
|
205
|
+
Libraries in this ecosystem make the best effort to track [Node.js’ release schedule](https://github.com/nodejs/release#release-schedule).
|
|
206
|
+
Here’s [a post on why we think this is important](https://medium.com/the-node-js-collection/maintainers-should-consider-following-node-js-release-schedule-ab08ed4de71a).
|
|
207
|
+
|
|
208
|
+
## Contributing
|
|
209
|
+
|
|
210
|
+
If you would like to help take a look at the [list of issues](https://github.com/anolilab/semantic-release/issues) and check our [Contributing](.github/CONTRIBUTING.md) guidelines.
|
|
211
|
+
|
|
212
|
+
> **Note:** please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.
|
|
213
|
+
|
|
214
|
+
## Credits
|
|
215
|
+
|
|
216
|
+
- [Daniel Bannert](https://github.com/prisis)
|
|
217
|
+
- [All Contributors](https://github.com/anolilab/semantic-release/graphs/contributors)
|
|
218
|
+
|
|
219
|
+
## License
|
|
220
|
+
|
|
221
|
+
The anolilab semantic-release-pnpm is open-sourced software licensed under the [MIT][license-url]
|
|
222
|
+
|
|
223
|
+
[typescript-image]: https://img.shields.io/badge/Typescript-294E80.svg?style=for-the-badge&logo=typescript
|
|
224
|
+
[typescript-url]: "typescript"
|
|
225
|
+
[license-image]: https://img.shields.io/npm/l/@anolilab/semantic-release-pnpm?color=blueviolet&style=for-the-badge
|
|
226
|
+
[license-url]: LICENSE.md "license"
|
|
227
|
+
[npm-image]: https://img.shields.io/npm/v/@anolilab/semantic-release-pnpm/latest.svg?style=for-the-badge&logo=npm
|
|
228
|
+
[npm-url]: https://www.npmjs.com/package/@anolilab/semantic-release-pnpm/v/latest "npm"
|
package/dist/index.d.ts
CHANGED
|
@@ -21,17 +21,17 @@ type CommonContext2 = CommonContext & {
|
|
|
21
21
|
};
|
|
22
22
|
type AddChannelContext = CommonContext2 & {
|
|
23
23
|
commits: Commit[];
|
|
24
|
-
lastRelease: Release;
|
|
25
24
|
currentRelease: Release;
|
|
25
|
+
lastRelease: Release;
|
|
26
26
|
nextRelease: Release;
|
|
27
27
|
};
|
|
28
28
|
type CommonContext3 = CommonContext2 & {
|
|
29
|
-
lastRelease: Release;
|
|
30
29
|
commits: Commit[];
|
|
30
|
+
lastRelease: Release;
|
|
31
31
|
};
|
|
32
32
|
type CommonContext4 = CommonContext3 & {
|
|
33
|
-
nextRelease: Release;
|
|
34
33
|
commits: Commit[];
|
|
34
|
+
nextRelease: Release;
|
|
35
35
|
};
|
|
36
36
|
type PrepareContext = CommonContext4;
|
|
37
37
|
type PublishContext = CommonContext4;
|
package/dist/index.js
CHANGED
|
@@ -1,22 +1,19 @@
|
|
|
1
1
|
import { execa } from 'execa';
|
|
2
2
|
import { validRange, gte } from 'semver';
|
|
3
|
-
import { isAccessibleSync,
|
|
3
|
+
import { isAccessibleSync, ensureFileSync, writeFile } from '@visulima/fs';
|
|
4
4
|
import { findPackageJson, findCacheDirectorySync, getPackageManagerVersion } from '@visulima/package';
|
|
5
|
-
import { resolve
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
9
|
-
import { parseJson, stripJsonComments } from '@visulima/fs/utils';
|
|
10
|
-
import { parse, stringify } from 'ini';
|
|
11
|
-
import { merge } from 'ts-deepmerge';
|
|
12
|
-
import H from 'normalize-url';
|
|
5
|
+
import { resolve } from '@visulima/path';
|
|
6
|
+
import pe from '@semantic-release/error';
|
|
7
|
+
import { rc } from '@anolilab/rc';
|
|
8
|
+
import F from 'normalize-url';
|
|
13
9
|
import { moveFile } from 'move-file';
|
|
14
|
-
import
|
|
15
|
-
import
|
|
10
|
+
import W from 'aggregate-error';
|
|
11
|
+
import { stringify } from 'ini';
|
|
12
|
+
import Ae from 'registry-auth-token';
|
|
16
13
|
import { URL } from 'url';
|
|
17
14
|
|
|
18
|
-
var
|
|
19
|
-
Your configuration for the \`branches\` option is \`${e}\`.`,message:"Invalid `branches` option."}),EINVALIDNPMPUBLISH:({npmPublish:e})=>({details:`The [npmPublish option](${h("README.md#npmpublish")}) option, if defined, must be a \`Boolean\`.
|
|
15
|
+
var C=e=>e?validRange(e)?`release-${e}`:e:"latest";var G={name:"@anolilab/semantic-release-pnpm",version:"0.0.0",description:"Semantic-release plugin to publish a npm package with pnpm.",keywords:["anolilab","npm","pnpm","publish","monorepo","semantic-release","semantic-release-plugin","semantic-release-pnpm"],homepage:"https://github.com/anolilab/semantic-release/tree/main/packages/semantic-release-pnpm",bugs:{url:"https://github.com/anolilab/semantic-release/issues"},repository:{type:"git",url:"git+https://github.com/anolilab/semantic-release.git",directory:"packages/semantic-release-pnpm"},funding:[{type:"github",url:"https://github.com/sponsors/prisis"},{type:"consulting",url:"https://anolilab.com/support"}],license:"MIT",author:{name:"Daniel Bannert",email:"d.bannert@anolilab.de"},sideEffects:!1,type:"module",exports:"./dist/index.js",main:"dist/index.js",types:"dist/index.d.ts",files:["dist","README.md","CHANGELOG.md"],scripts:{build:"cross-env NODE_ENV=development tsup","build:prod":"cross-env NODE_ENV=production tsup",clean:"rimraf node_modules dist .eslintcache",dev:"pnpm run build --watch","lint:eslint":"eslint . --ext js,cjs,mjs,jsx,ts,tsx,json,yaml,yml,md,mdx --max-warnings=0 --config .eslintrc.cjs","lint:eslint:fix":"eslint . --ext js,cjs,mjs,jsx,ts,tsx,json,yaml,yml,md,mdx --max-warnings=0 --config .eslintrc.cjs --fix","lint:package-json":"publint --strict","lint:prettier":"prettier --config=.prettierrc.cjs --check .","lint:prettier:fix":"prettier --config=.prettierrc.cjs --write .","lint:types":"tsc --noEmit",test:"vitest run","test:coverage":"vitest run --coverage","test:ui":"vitest --ui --coverage.enabled=true","test:watch":"vitest"},dependencies:{"@anolilab/rc":"workspace:*","@semantic-release/error":"^4.0.0","@visulima/fs":"^2.1.1","@visulima/package":"1.8.1","@visulima/path":"^1.0.0","aggregate-error":"^5.0.0",execa:"^9.1.0",ini:"4.1.2","move-file":"^3.1.0","normalize-url":"^8.0.1","registry-auth-token":"^5.0.2",semver:"^7.6.2"},devDependencies:{"@anolilab/eslint-config":"^15.0.3","@anolilab/prettier-config":"^5.0.14","@anolilab/semantic-release-preset":"^8.0.3","@babel/core":"^7.24.3","@rushstack/eslint-plugin-security":"^0.8.1","@secretlint/secretlint-rule-preset-recommend":"^8.1.2","@semantic-release/changelog":"^6.0.3","@semantic-release/git":"^10.0.1","@semantic-release/github":"^10.0.4","@types/dockerode":"^3.3.29","@types/ini":"^4.1.0","@types/node":"18.18.14","@types/semantic-release__error":"3.0.3","@types/semver":"7.5.8","@types/stream-buffers":"^3.0.7","@vitest/coverage-v8":"^1.4.0","@vitest/ui":"^1.4.0","cross-env":"^7.0.3",dockerode:"4.0.2",eslint:"^8.57.0","eslint-plugin-deprecation":"^2.0.0","eslint-plugin-editorconfig":"^4.0.3","eslint-plugin-import":"npm:eslint-plugin-i@2.29.1","eslint-plugin-mdx":"^3.1.5","eslint-plugin-n":"^17.7.0","eslint-plugin-vitest":"^0.4.1","eslint-plugin-vitest-globals":"^1.5.0","eslint-plugin-you-dont-need-lodash-underscore":"^6.14.0","get-stream":"9.0.1",got:"^14.2.1","p-retry":"^6.2.0",prettier:"^3.2.5",rimraf:"^5.0.5",secretlint:"8.1.2","semantic-release":"^23.0.5","sort-package-json":"^2.8.0","stream-buffers":"^3.0.2",tempy:"^3.1.0",tsup:"^8.0.2",typescript:"^5.4.3",vitest:"^1.4.0"},engines:{node:">=18.* <=21.*"},publishConfig:{access:"public",provenance:!0},anolilab:{"eslint-config":{plugin:{etc:!1,tsdoc:!1},warn_on_unsupported_typescript_version:!1,info_on_disabling_jsx_react_rule:!1,info_on_disabling_prettier_conflict_rule:!1,info_on_disabling_jsonc_sort_keys_rule:!1,import_ignore_exports:["**/*.cjs"]}}};var h=e=>`${G.homepage}/blob/main/${e}`,J={EINVALIDBRANCHES:e=>({details:`The [branches option](${h("README.md#branches")}) option, if defined, must be an array of \`String\`.
|
|
16
|
+
Your configuration for the \`branches\` option is \`${e.join(",")}\`.`,message:"Invalid `branches` option."}),EINVALIDNPMPUBLISH:({npmPublish:e})=>({details:`The [npmPublish option](${h("README.md#npmpublish")}) option, if defined, must be a \`Boolean\`.
|
|
20
17
|
Your configuration for the \`npmPublish\` option is \`${e}\`.`,message:"Invalid `npmPublish` option."}),EINVALIDNPMTOKEN:({registry:e})=>({details:`The [npm token](${h("README.md#npm-registry-authentication")}) configured in the \`NPM_TOKEN\` environment variable must be a valid [token](https://docs.npmjs.com/getting-started/working_with_tokens) allowing to publish to the registry \`${e}\`.
|
|
21
18
|
If you are using Two Factor Authentication for your account, set its level to ["Authorization only"](https://docs.npmjs.com/getting-started/using-two-factor-authentication#levels-of-authentication) in your account settings. **semantic-release** cannot publish with the default "Authorization and writes" level.
|
|
22
19
|
Please make sure to set the \`NPM_TOKEN\` environment variable in your CI with the exact value of the npm token.`,message:"Invalid npm token."}),EINVALIDPKGROOT:({pkgRoot:e})=>({details:`The [pkgRoot option](${h("README.md#pkgroot")}) option, if defined, must be a \`String\`.
|
|
@@ -25,12 +22,12 @@ Your configuration for the \`pkgRoot\` option is \`${e}\`.`,message:"Invalid `pk
|
|
|
25
22
|
Your version of Pnpm is "${e}".`,message:"Incompatible Pnpm version detected."}),EINVALIDPUBLISHBRANCH:({publishBranch:e})=>({details:`The [publishBranch option](${h("README.md#publishBranch")}) option, if defined, must be a \`String\`.
|
|
26
23
|
Your configuration for the \`publishBranch\` option is \`${e}\`.`,message:"Invalid `publishBranch` option."}),EINVALIDTARBALLDIR:({tarballDir:e})=>({details:`The [tarballDir option](${h("README.md#tarballdir")}) option, if defined, must be a \`String\`.
|
|
27
24
|
Your configuration for the \`tarballDir\` option is \`${e}\`.`,message:"Invalid `tarballDir` option."}),ENONPMTOKEN:({registry:e})=>({details:`An [npm token](${h("README.md#npm-registry-authentication")}) must be created and set in the \`NPM_TOKEN\` environment variable on your CI environment.
|
|
28
|
-
Please make sure to create an [npm token](https://docs.npmjs.com/getting-started/working_with_tokens#how-to-create-new-tokens) and to set it in the \`NPM_TOKEN\` environment variable on your CI environment. The token must allow to publish to the registry \`${e}\`.`,message:"No npm token specified."}),ENOPKG:()=>({details:"A [package.json file](https://docs.npmjs.com/files/package.json) at the root of your project is required to release on npm.\nPlease follow the [npm guideline](https://docs.npmjs.com/getting-started/creating-node-modules) to create a valid `package.json` file.",message:"Missing `package.json` file."}),ENOPKGNAME:()=>({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.\nPlease make sure to add a valid `name` for your package in your `package.json`.",message:"Missing `name` property in `package.json`."}),ENOPNPM:()=>({details:"The Pnpm CLI could not be found in your PATH. Make sure Pnpm is installed and try again.",message:"Pnpm not found."}),ENOPNPMRC:()=>({details:"Didnt find a `.npmrc` file or it was not possible to create , in the root of your project.",message:"Missing `.npmrc` file."})};var
|
|
29
|
-
`).pop(),y=resolve(r,
|
|
25
|
+
Please make sure to create an [npm token](https://docs.npmjs.com/getting-started/working_with_tokens#how-to-create-new-tokens) and to set it in the \`NPM_TOKEN\` environment variable on your CI environment. The token must allow to publish to the registry \`${e}\`.`,message:"No npm token specified."}),ENOPKG:()=>({details:"A [package.json file](https://docs.npmjs.com/files/package.json) at the root of your project is required to release on npm.\nPlease follow the [npm guideline](https://docs.npmjs.com/getting-started/creating-node-modules) to create a valid `package.json` file.",message:"Missing `package.json` file."}),ENOPKGNAME:()=>({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.\nPlease make sure to add a valid `name` for your package in your `package.json`.",message:"Missing `name` property in `package.json`."}),ENOPNPM:()=>({details:"The Pnpm CLI could not be found in your PATH. Make sure Pnpm is installed and try again.",message:"Pnpm not found."}),ENOPNPMRC:()=>({details:"Didnt find a `.npmrc` file or it was not possible to create , in the root of your project.",message:"Missing `.npmrc` file."})};var c=(e,t={})=>{let{details:r,message:o}=J[e](t);return new pe(o,e,r)};var ce=(e,t)=>{let r,o=resolve(e,".npmrc");if(t.NPM_CONFIG_USERCONFIG&&isAccessibleSync(t.NPM_CONFIG_USERCONFIG))r=t.NPM_CONFIG_USERCONFIG;else if(isAccessibleSync(o))r=o;else {let i=findCacheDirectorySync("semantic-release-pnpm",{create:!0,cwd:e});i&&(ensureFileSync(i),r=i);}if(r===void 0)throw new AggregateError([c("ENOPNPMRC",{npmrc:o})]);return r},k=ce;var A="https://registry.npmjs.org/";var de=(e,t)=>{let r=A;if(t){let o=t[`${e}:registry`]??t.registry;o&&(r=o);}return r.endsWith("/")?r:`${r}/`},P=({name:e,publishConfig:{registry:t}={}},{cwd:r,env:o})=>t??o.NPM_CONFIG_REGISTRY??de(e.split("/")[0],rc("npm",{config:o.NPM_CONFIG_USERCONFIG??resolve(r,".npmrc"),cwd:r,defaults:{registry:"https://registry.npmjs.org/"}}).config);var I=({name:e},{env:{DEFAULT_NPM_REGISTRY:t="https://registry.npmjs.org/"},nextRelease:{version:r}},o,i)=>({channel:o,name:`pnpm package (@${o} dist-tag)`,url:F(i)===F(t)?`https://www.npmjs.com/package/${e}/v/${r}`:void 0});var N=(e,t)=>e.npmPublish===!1?"npmPublish plugin option is false":t.private===!0&&t.workspaces===void 0?"package is private and has no workspaces":null,b=(e,t)=>N(e,t)===null;var U=async(e,t,r)=>{let{cwd:o,env:i,logger:l,nextRelease:{channel:f,version:m},stderr:g,stdout:n}=r;if(b(e,t)){let p=P(t,r),d=C(f);l.log(`Adding version ${m} to npm registry on dist-tag ${d}`);let y=k(o,i),u=execa("pnpm",["dist-tag","add",`${t.name}@${m}`,d,"--userconfig",y,"--registry",p],{cwd:o,env:i,preferLocal:!0});return u.stdout.pipe(n,{end:!1}),u.stderr.pipe(g,{end:!1}),await u,l.log(`Added ${t.name}@${m} to dist-tag @${d} on ${p}`),I(t,r,d,p)}return l.log(`Skip adding to npm channel as ${N(e,t)}`),!1};var D=async({pkgRoot:e,tarballDir:t},{cwd:r,env:o,logger:i,nextRelease:{version:l},stderr:f,stdout:m})=>{let g=e?resolve(r,e):r;i.log("Write version %s to package.json in %s",l,g);let n=execa("pnpm",["version",l,"--no-git-tag-version","--allow-same-version"],{cwd:g,env:o,preferLocal:!0});if(n.stdout.pipe(m,{end:!1}),n.stderr.pipe(f,{end:!1}),await n,t){i.log("Creating npm package version %s",l);let p=execa("pnpm",["pack",g],{cwd:r,env:o,preferLocal:!0});p.stdout.pipe(m,{end:!1}),p.stderr.pipe(f,{end:!1});let d=(await p).stdout.split(`
|
|
26
|
+
`).pop(),y=resolve(r,d),u=resolve(r,t.trim(),d);y!==u&&await moveFile(y,u);}};var z=async(e,t,r)=>{let{cwd:o,env:i,logger:l,nextRelease:{channel:f,version:m},stderr:g,stdout:n}=r,{pkgRoot:p,publishBranch:d}=e;if(b(e,t)){let y=p?resolve(o,p):o,u=P(t,r),E=C(f),{stdout:S}=await execa("git",["rev-parse","--abbrev-ref","HEAD"],{cwd:o,env:i,preferLocal:!0}),L=typeof d=="string"&&d.split("|"),V=L&&L.includes(S)?S:"main";l.log(`Publishing version ${m} on branch ${V} to npm registry on dist-tag ${E}`);let B=["publish",y,"--publish-branch",V,"--tag",E,"--registry",u,"--no-git-checks"];e.disableScripts&&B.push("--ignore-scripts");let R=execa("pnpm",B,{cwd:o,env:i,preferLocal:!0});R.stdout.pipe(n,{end:!1}),R.stderr.pipe(g,{end:!1});try{await R;}catch($){throw l.log(`Failed to publish ${t.name}@${m} to dist-tag @${E} on ${u}: ${$.message??$}`),new W([$])}return l.log(`Published ${t.name}@${m} to dist-tag @${E} on ${u}`),I(t,r,E,u)}return l.log(`Skip publishing to npm registry as ${N(e,t)}`),!1};var v=async({pkgRoot:e},{cwd:t})=>{try{let{packageJson:r}=await findPackageJson(e?resolve(t,e):t);if(!r.name)throw new W([c("ENOPKGNAME")]);return r}catch(r){throw r.code==="ENOENT"?new W([c("ENOPKG")]):r}};var ve=e=>{let t=new URL(e),r=`${t.protocol}//${t.host}${t.pathname}`,o=new URL(".",r);return `//${o.host}${o.pathname}`},Q=ve;var X=async(e,t,{cwd:r,env:{NPM_CONFIG_USERCONFIG:o,NPM_EMAIL:i,NPM_PASSWORD:l,NPM_TOKEN:f,NPM_USERNAME:m},logger:g})=>{g.log("Verify authentication for registry %s",t);let{config:n,files:p}=rc("npm",{config:o??resolve(r,".npmrc"),cwd:r,defaults:{registry:A}});if(Array.isArray(p)&&g.log("Reading npm config from %s",p.join(", ")),Ae(t,{npmrc:n})){await writeFile(e,stringify(n));return}if(m&&l&&i)await writeFile(e,`${Object.keys(n).length>0?`${stringify(n)}
|
|
30
27
|
`:""}_auth = \${LEGACY_TOKEN}
|
|
31
|
-
email = \${NPM_EMAIL}`),
|
|
32
|
-
`:""}${
|
|
28
|
+
email = \${NPM_EMAIL}`),g.log(`Wrote NPM_USERNAME, NPM_PASSWORD, and NPM_EMAIL to ${e}`);else if(f)await writeFile(e,`${Object.keys(n).length>0?`${stringify(n)}
|
|
29
|
+
`:""}${Q(t)}:_authToken = \${NPM_TOKEN}`),g.log(`Wrote NPM_TOKEN to ${e}`);else throw new W([c("ENONPMTOKEN",{registry:t})])};var ee=async(e,t,r)=>{let{cwd:o,env:{DEFAULT_NPM_REGISTRY:i="https://registry.npmjs.org/",...l},logger:f,stderr:m,stdout:g}=r,n=P(t,r);if(await X(e,n,r),F(n)===F(i))try{f.log(`Running "pnpm whoami" to verify authentication on registry "${n}"`);let p=execa("pnpm",["whoami","--userconfig",e,"--registry",n],{cwd:o,env:l,preferLocal:!0});p.stdout.pipe(g,{end:!1}),p.stderr.pipe(m,{end:!1}),await p;}catch{throw new W([c("EINVALIDNPMTOKEN",{registry:n})])}else f.log(`Skipping authentication verification for non-default registry "${n}"`);};var Re=e=>typeof e=="string",$e=e=>e==null,T=e=>Re(e)?e.trim()!=="":!1,te={branches:Array.isArray,npmPublish:e=>typeof e=="boolean",pkgRoot:T,publishBranch:T,tarballDir:T},re=e=>Object.entries(e).reduce((t,[r,o])=>$e(o)||!(r in te)||te[r]?.(o)?t:[...t,c(`EINVALID${r.toUpperCase()}`,{[r]:o})],[]);var ie="8.0.0";async function j({logger:e}){e.log(`Verify pnpm version is >= ${ie}`);let t=getPackageManagerVersion("pnpm");if(t!=="pnpm")throw new W([new Error("pnpm is not installed")]);if(gte(ie,t))throw new W([c("EINVALIDPNPM",{version:String(t)})])}var _e=async(e,t)=>{let r=re(e);try{await j(t);}catch(o){let i=o;r=[...r,...i.errors??[o]];}try{let o=await v(e,t);if(b(e,o)){let i=k(t.cwd,t.env);await ee(i,o,t);}}catch(o){let i=o;r=[...r,...i.errors??[o]];}if(r.length>0)throw new W(r)},x=_e;var Te="semantic-release-pnpm",w,ne,Mr=async(e,t)=>{if(t.options.publish){let o=(Array.isArray(t.options.publish)?t.options.publish:[t.options.publish]).find(i=>i.path&&i.path===Te)||{};e.npmPublish=e.npmPublish??o.npmPublish,e.tarballDir=e.tarballDir??o.tarballDir,e.pkgRoot=e.pkgRoot??o.pkgRoot,e.disableScripts=e.disableScripts??o.disableScripts,e.branches=e.branches??o.branches;}await x(e,t),w=!0;},Dr=async(e,t)=>{w||await x(e,t),await D(e,t),ne=!0;},Or=async(e,t)=>{let r=await v(e,t);return w||await x(e,t),ne||await D(e,t),await z(e,r,t)},_r=async(e,t)=>{w||await x(e,t);let r=await v(e,t);return await U(e,r,t)};
|
|
33
30
|
|
|
34
|
-
export {
|
|
31
|
+
export { _r as addChannel, Dr as prepare, Or as publish, Mr as verifyConditions };
|
|
35
32
|
//# sourceMappingURL=out.js.map
|
|
36
33
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/add-channel.ts","../src/utils/get-channel.ts","../src/utils/get-npmrc.ts","../src/utils/get-error.ts","../package.json","../src/definitions/errors.ts","../src/utils/get-registry.ts","../src/definitions/constants.ts","../src/utils/rc.ts","../src/utils/is-json.ts","../src/utils/get-release-info.ts","../src/utils/should-publish.ts","../src/prepare.ts","../src/publish.ts","../src/utils/get-pkg.ts","../src/verify/index.ts","../src/verify/verify-auth.ts","../src/utils/set-npmrc-auth.ts","../src/utils/nerf-dart.ts","../src/verify/verify-config.ts","../src/verify/verify-pnpm.ts","../src/index.ts"],"names":["execa","validRange","get_channel_default","channel","ensureFile","isAccessibleSync","findCacheDirectorySync","resolve","SemanticReleaseError","package_default","linkify","file","errors","branches","npmPublish","registry","pkgRoot","version","publishBranch","tarballDir","get_error_default","code","context","details","message","getNpmrc","cwd","environment","npmrc","npmrcPath","temporaryNpmrcPath","get_npmrc_default","DEFAULT_NPM_REGISTRY","homedir","env","findUpSync","readFileSync","parseJson","stripJsonComments","join","parse","merge","isJson","value","is_json_default","getEnvironment","prefix","returnValue","l","k","keypath","emptyStringIndex","cursor","subkey","index","getConfigFiles","name","home","internalCwd","environmentConfig","optionConfig","configFiles","foundConfigFile","rc_default","options","configs","content","getRegistryUrl","scope","url","registryUrl","get_registry_default","normalizeUrl","getReleaseInfo","distributionTag","reasonToNotPublish","pluginConfig","package_","shouldPublish","add_channel_default","logger","stderr","stdout","result","moveFile","prepare_default","basePath","versionResult","packResult","tarball","tarballSource","tarballDestination","AggregateError","publish_default","publishBranchConfig","currentBranch","publishBranches","pnpmArguments","error","findPackageJson","get_pkg_default","packageJson","writeFile","stringify","getAuthToken","URL","nerfDart","parsed","from","real","nerf_dart_default","set_npmrc_auth_default","NPM_CONFIG_USERCONFIG","NPM_EMAIL","NPM_PASSWORD","NPM_TOKEN","NPM_USERNAME","config","files","verify_auth_default","whoamiResult","isString","isNil","isNonEmptyString","VALIDATORS","verify_config_default","option","getPackageManagerVersion","gte","MIN_PNPM_VERSION","verifyPnpm","verify","typedError","verify_default","PLUGIN_NAME","verified","prepared","verifyConditions","publishPlugin","prepare","publish","addChannel"],"mappings":"AACA,OAAS,SAAAA,OAAa,QCDtB,OAAS,cAAAC,OAAkB,SAE3B,IAAOC,EAASC,GAAgDA,EAAWF,GAAWE,CAAO,EAAI,WAAWA,CAAO,GAAKA,EAAW,SCFnI,OAAS,cAAAC,GAAY,oBAAAC,OAAwB,eAC7C,OAAS,0BAAAC,OAA8B,oBACvC,OAAS,WAAAC,OAAe,iBCFxB,OAAOC,OAA0B,0BCAjC,IAAAC,EAAA,CACI,KAAQ,kCACR,QAAW,gBACX,YAAe,8DACf,SAAY,CACR,WACA,MACA,UACA,mBACA,OACA,UACJ,EACA,SAAY,oDACZ,WAAc,CACV,KAAQ,MACR,IAAO,uDACX,EACA,QAAW,MACX,O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,EAAc,eAE3E9D,EAAa,SAAWA,EAAa,UAAY8D,EAAc,QACnE,CAEA,MAAML,EAAOzD,EAActD,CAAO,EAElCiH,EAAW,EACf,EAEaI,GAAU,MAAO/D,EAA4BtD,IAA2C,CAC5FiH,GACD,MAAMF,EAAOzD,EAActD,CAAO,EAGtC,MAAM+D,EAAWT,EAActD,CAAO,EAEtCkH,GAAW,EACf,EAEaI,GAAU,MAAOhE,EAA4BtD,IAA0D,CAChH,IAAM+E,EAAc,MAAMD,EAAWxB,EAActD,CAAO,EAE1D,OAAKiH,GACD,MAAMF,EAAOzD,EAActD,CAAO,EAGjCkH,IACD,MAAMnD,EAAWT,EAActD,CAAO,EAGnCuE,EAAWjB,EAAcyB,EAAa/E,CAAO,CACxD,EAEauH,GAAa,MAAOjE,EAA4BtD,IAA6D,CACjHiH,GACD,MAAMF,EAAOzD,EAActD,CAAO,EAGtC,IAAM+E,EAAc,MAAMD,EAAWxB,EAActD,CAAO,EAE1D,OAAOyD,EAAcH,EAAcyB,EAAa/E,CAAO,CAC3D","sourcesContent":["import type { PackageJson } from \"@visulima/package\";\nimport { execa } from \"execa\";\n\nimport type { AddChannelContext } from \"./definitions/context\";\nimport type { PluginConfig } from \"./definitions/plugin-config\";\nimport getChannel from \"./utils/get-channel\";\nimport getNpmrc from \"./utils/get-npmrc\";\nimport getRegistry from \"./utils/get-registry\";\nimport type { ReleaseInfo } from \"./utils/get-release-info\";\nimport { getReleaseInfo } from \"./utils/get-release-info\";\nimport { reasonToNotPublish, shouldPublish } from \"./utils/should-publish\";\n\nexport default async (pluginConfig: PluginConfig, package_: PackageJson, context: AddChannelContext): Promise<ReleaseInfo | false> => {\n const {\n cwd,\n env,\n logger,\n nextRelease: { channel, version },\n stderr,\n stdout,\n } = context;\n\n if (shouldPublish(pluginConfig, package_)) {\n const registry = getRegistry(package_, context);\n const distributionTag = getChannel(channel);\n\n logger.log(`Adding version ${version} to npm registry on dist-tag ${distributionTag}`);\n\n const npmrc = getNpmrc(cwd, env);\n\n const result = execa(\"pnpm\", [\"dist-tag\", \"add\", `${package_.name}@${version}`, distributionTag, \"--userconfig\", npmrc, \"--registry\", registry], {\n cwd,\n env,\n preferLocal: true,\n });\n\n result.stdout.pipe(stdout, { end: false });\n result.stderr.pipe(stderr, { end: false });\n\n await result;\n\n logger.log(`Added ${package_.name}@${version} to dist-tag @${distributionTag} on ${registry}`);\n\n return getReleaseInfo(package_, context, distributionTag, registry);\n }\n\n logger.log(`Skip adding to npm channel as ${reasonToNotPublish(pluginConfig, package_)}`);\n\n return false;\n};\n","import { validRange } from \"semver\";\n\nexport default (channel: string | null | undefined): string => (channel ? (validRange(channel) ? `release-${channel}` : channel) : \"latest\");\n","import { ensureFile, isAccessibleSync } from \"@visulima/fs\";\nimport { findCacheDirectorySync } from \"@visulima/package\";\nimport { resolve } from \"@visulima/path\";\n\nimport getError from \"./get-error\";\n\nconst getNpmrc = (cwd: string, environment: NodeJS.ProcessEnv): string => {\n let npmrc = environment.NPM_CONFIG_USERCONFIG;\n\n const npmrcPath = resolve(cwd, \".npmrc\");\n\n if (!npmrc && isAccessibleSync(npmrcPath)) {\n npmrc = npmrcPath;\n } else if (!npmrc) {\n const temporaryNpmrcPath = findCacheDirectorySync(\"semantic-release-pnpm\", { create: true, cwd });\n\n if (temporaryNpmrcPath) {\n ensureFile(temporaryNpmrcPath);\n\n npmrc = temporaryNpmrcPath;\n }\n }\n\n if (!npmrc) {\n // eslint-disable-next-line unicorn/error-message\n throw new AggregateError([\n getError(\"ENOPNPMRC\", {\n npmrc: npmrcPath,\n }),\n ]);\n }\n\n return npmrc;\n};\n\nexport default getNpmrc;\n","import SemanticReleaseError from \"@semantic-release/error\";\n\nimport type { ErrorContext, ErrorDefinition } from \"../definitions/errors\";\nimport { errors } from \"../definitions/errors\";\n\nexport default <T extends keyof typeof errors>(code: T, context: ErrorContext = {}): SemanticReleaseError => {\n const { details, message }: { details?: string; message: string } = (errors[code] as ErrorDefinition)(context);\n\n return new SemanticReleaseError(message, code, details);\n};\n","{\n \"name\": \"@anolilab/semantic-release-pnpm\",\n \"version\": \"1.0.0-alpha.7\",\n \"description\": \"Semantic-release plugin to publish a npm package with pnpm.\",\n \"keywords\": [\n \"anolilab\",\n \"npm\",\n \"publish\",\n \"semantic-release\",\n \"pnpm\",\n \"monorepo\"\n ],\n \"homepage\": \"https://github.com/anolilab/semantic-release-pnpm\",\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"https://github.com/anolilab/semantic-release-pnpm.git\"\n },\n \"license\": \"MIT\",\n \"author\": {\n \"name\": \"Daniel Bannert\",\n \"email\": \"d.bannert@anolilab.de\"\n },\n \"type\": \"module\",\n \"exports\": \"./dist/index.js\",\n \"main\": \"dist/index.js\",\n \"types\": \"dist/index.d.ts\",\n \"files\": [\n \"dist\",\n \"README.md\",\n \"CHANGELOG.md\"\n ],\n \"scripts\": {\n \"build\": \"cross-env NODE_ENV=development tsup\",\n \"build:prod\": \"cross-env NODE_ENV=production tsup\",\n \"lint:eslint\": \"eslint . --ext js,cjs,mjs,jsx,ts,tsx,json,yaml,yml,md,mdx --max-warnings=0 --config .eslintrc.cjs\",\n \"lint:eslint:fix\": \"pnpm run lint:eslint --fix\",\n \"lint:fix\": \"pnpm run lint:prettier:fix && pnpm run lint:eslint:fix\",\n \"lint:packagejson\": \"publint --strict\",\n \"lint:prettier\": \"prettier --config=.prettierrc.cjs --check .\",\n \"lint:prettier:fix\": \"prettier --config=.prettierrc.cjs --write .\",\n \"lint:secrets\": \"secretlint **/*\",\n \"lint:staged\": \"lint-staged --verbose --concurrent false --debug\",\n \"lint:text\": \"textlint ./.github/ ./README.md ./UPGRADE.md --parallel --experimental --cache --dry-run\",\n \"lint:text:fix\": \"textlint ./.github/ ./README.md ./UPGRADE.md --parallel --experimental --fix\",\n \"lint:types\": \"tsc --noEmit\",\n \"prepare\": \"is-ci || (node verify-node-version.cjs && pnpx only-allow pnpm && husky install)\",\n \"sort-package-json\": \"sort-package-json ./package.json\",\n \"test\": \"vitest run\",\n \"test:bench\": \"vitest bench\",\n \"test:coverage\": \"vitest run --coverage\",\n \"test:watch\": \"vitest\",\n \"update:deps\": \"taze\"\n },\n \"dependencies\": {\n \"@semantic-release/error\": \"^4.0.0\",\n \"@visulima/fs\": \"^2.1.1\",\n \"@visulima/package\": \"1.8.1\",\n \"@visulima/path\": \"^1.0.0\",\n \"aggregate-error\": \"^5.0.0\",\n \"execa\": \"^9.1.0\",\n \"ini\": \"4.1.2\",\n \"move-file\": \"^3.1.0\",\n \"normalize-url\": \"^8.0.1\",\n \"registry-auth-token\": \"^5.0.2\",\n \"semver\": \"^7.6.2\",\n \"ts-deepmerge\": \"^7.0.0\"\n },\n \"devDependencies\": {\n \"@anolilab/commitlint-config\": \"^5.0.3\",\n \"@anolilab/eslint-config\": \"^15.0.3\",\n \"@anolilab/lint-staged-config\": \"^2.1.7\",\n \"@anolilab/prettier-config\": \"^5.0.14\",\n \"@anolilab/textlint-config\": \"^8.0.16\",\n \"@babel/core\": \"^7.24.5\",\n \"@babel/eslint-parser\": \"7.24.5\",\n \"@commitlint/cli\": \"^19.3.0\",\n \"@commitlint/config-conventional\": \"^19.2.2\",\n \"@secretlint/secretlint-rule-preset-recommend\": \"^8.2.4\",\n \"@semantic-release/changelog\": \"^6.0.3\",\n \"@semantic-release/git\": \"^10.0.1\",\n \"@semantic-release/github\": \"^10.0.4\",\n \"@types/dockerode\": \"^3.3.29\",\n \"@types/ini\": \"^4.1.0\",\n \"@types/node\": \"^20.12.12\",\n \"@types/semantic-release__error\": \"3.0.3\",\n \"@types/semver\": \"7.5.8\",\n \"@types/stream-buffers\": \"^3.0.7\",\n \"@vitest/coverage-v8\": \"^1.6.0\",\n \"commitizen\": \"^4.3.0\",\n \"commitlint\": \"^19.3.0\",\n \"cross-env\": \"^7.0.3\",\n \"cz-conventional-changelog\": \"^3.3.0\",\n \"dockerode\": \"4.0.2\",\n \"eslint\": \"8.55.0\",\n \"eslint-plugin-deprecation\": \"^2.0.0\",\n \"eslint-plugin-editorconfig\": \"^4.0.3\",\n \"eslint-plugin-import\": \"npm:eslint-plugin-i@2.29.1\",\n \"eslint-plugin-mdx\": \"^3.1.5\",\n \"eslint-plugin-n\": \"^17.7.0\",\n \"eslint-plugin-vitest\": \"^0.4.1\",\n \"eslint-plugin-vitest-globals\": \"^1.5.0\",\n \"eslint-plugin-you-dont-need-lodash-underscore\": \"^6.14.0\",\n \"get-stream\": \"9.0.1\",\n \"got\": \"^14.2.1\",\n \"husky\": \"^9.0.11\",\n \"is-ci\": \"^3.0.1\",\n \"lint-staged\": \"^15.2.2\",\n \"p-retry\": \"^6.2.0\",\n \"prettier\": \"^3.2.5\",\n \"publint\": \"^0.2.7\",\n \"rimraf\": \"^5.0.7\",\n \"secretlint\": \"8.2.4\",\n \"semantic-release\": \"^23.1.1\",\n \"sort-package-json\": \"^2.10.0\",\n \"stream-buffers\": \"^3.0.2\",\n \"taze\": \"^0.13.8\",\n \"tempy\": \"^3.1.0\",\n \"textlint\": \"^14.0.4\",\n \"tsup\": \"^8.0.2\",\n \"typescript\": \"^5.4.5\",\n \"vitest\": \"^1.6.0\"\n },\n \"peerDependencies\": {\n \"semantic-release\": \"^20.0 || ^21.0 || >=22.0.3\"\n },\n \"packageManager\": \"pnpm@9.1.1\",\n \"engines\": {\n \"node\": \">=18 || >=20.6.1\"\n },\n \"publishConfig\": {\n \"access\": \"public\",\n \"provenance\": true\n },\n \"pnpm\": {\n \"overrides\": {\n \"chrono-node@<2.2.4\": \">=2.7.5\"\n }\n },\n \"anolilab\": {\n \"eslint-config\": {\n \"plugin\": {\n \"etc\": false,\n \"tsdoc\": false\n },\n \"warn_on_unsupported_typescript_version\": false,\n \"info_on_disabling_jsx_react_rule\": false,\n \"info_on_disabling_prettier_conflict_rule\": false,\n \"info_on_disabling_jsonc_sort_keys_rule\": false,\n \"import_ignore_exports\": [\n \"**/*.cjs\",\n \"verify-node-version.cjs\"\n ]\n }\n }\n}\n","import package_ from \"../../package.json\";\n\nconst linkify = (file: string) => `${package_.homepage}/blob/main/${file}`;\n\ninterface ErrorDetails {\n details: string;\n message: string;\n}\n\nexport type ErrorDefinition = (context: ErrorContext) => ErrorDetails;\n\nexport interface ErrorContext {\n npmPublish?: boolean;\n npmrc?: string;\n pkgRoot?: string;\n publishBranch?: string;\n registry?: string;\n tarballDir?: string;\n version?: string;\n}\n\nexport const errors = {\n EINVALIDBRANCHES: (branches: string[]) => {\n return {\n details: `The [branches option](${linkify(\"README.md#branches\")}) option, if defined, must be an array of \\`String\\`.\nYour configuration for the \\`branches\\` option is \\`${branches}\\`.`,\n message: \"Invalid `branches` option.\",\n };\n },\n EINVALIDNPMPUBLISH: ({ npmPublish }: ErrorContext) => {\n return {\n details: `The [npmPublish option](${linkify(\"README.md#npmpublish\")}) option, if defined, must be a \\`Boolean\\`.\nYour configuration for the \\`npmPublish\\` option is \\`${npmPublish}\\`.`,\n message: \"Invalid `npmPublish` option.\",\n };\n },\n EINVALIDNPMTOKEN: ({ registry }: ErrorContext) => {\n return {\n details: `The [npm token](${linkify(\n \"README.md#npm-registry-authentication\",\n )}) configured in the \\`NPM_TOKEN\\` environment variable must be a valid [token](https://docs.npmjs.com/getting-started/working_with_tokens) allowing to publish to the registry \\`${registry}\\`.\nIf you are using Two Factor Authentication for your account, set its level to [\"Authorization only\"](https://docs.npmjs.com/getting-started/using-two-factor-authentication#levels-of-authentication) in your account settings. **semantic-release** cannot publish with the default \"Authorization and writes\" level.\nPlease make sure to set the \\`NPM_TOKEN\\` environment variable in your CI with the exact value of the npm token.`,\n message: \"Invalid npm token.\",\n };\n },\n EINVALIDPKGROOT: ({ pkgRoot }: ErrorContext) => {\n return {\n details: `The [pkgRoot option](${linkify(\"README.md#pkgroot\")}) option, if defined, must be a \\`String\\`.\nYour configuration for the \\`pkgRoot\\` option is \\`${pkgRoot}\\`.`,\n message: \"Invalid `pkgRoot` option.\",\n };\n },\n EINVALIDPNPM: ({ version }: ErrorContext) => {\n return {\n details: `The version of Pnpm that you are using is not compatible. Please refer to [the README](${linkify(\n \"README.md#install\",\n )}) to review which versions of Pnpm are currently supported\n\nYour version of Pnpm is \"${version}\".`,\n message: \"Incompatible Pnpm version detected.\",\n };\n },\n EINVALIDPUBLISHBRANCH: ({ publishBranch }: ErrorContext) => {\n return {\n details: `The [publishBranch option](${linkify(\"README.md#publishBranch\")}) option, if defined, must be a \\`String\\`.\nYour configuration for the \\`publishBranch\\` option is \\`${publishBranch}\\`.`,\n message: \"Invalid `publishBranch` option.\",\n };\n },\n EINVALIDTARBALLDIR: ({ tarballDir }: ErrorContext) => {\n return {\n details: `The [tarballDir option](${linkify(\"README.md#tarballdir\")}) option, if defined, must be a \\`String\\`.\nYour configuration for the \\`tarballDir\\` option is \\`${tarballDir}\\`.`,\n message: \"Invalid `tarballDir` option.\",\n };\n },\n ENONPMTOKEN: ({ registry }: ErrorContext) => {\n return {\n details: `An [npm token](${linkify(\n \"README.md#npm-registry-authentication\",\n )}) must be created and set in the \\`NPM_TOKEN\\` environment variable on your CI environment.\nPlease make sure to create an [npm token](https://docs.npmjs.com/getting-started/working_with_tokens#how-to-create-new-tokens) and to set it in the \\`NPM_TOKEN\\` environment variable on your CI environment. The token must allow to publish to the registry \\`${registry}\\`.`,\n message: \"No npm token specified.\",\n };\n },\n ENOPKG: () => {\n return {\n details: `A [package.json file](https://docs.npmjs.com/files/package.json) at the root of your project is required to release on npm.\nPlease follow the [npm guideline](https://docs.npmjs.com/getting-started/creating-node-modules) to create a valid \\`package.json\\` file.`,\n message: \"Missing `package.json` file.\",\n };\n },\n ENOPKGNAME: () => {\n return {\n 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.\nPlease make sure to add a valid \\`name\\` for your package in your \\`package.json\\`.`,\n message: \"Missing `name` property in `package.json`.\",\n };\n },\n ENOPNPM: () => {\n return {\n details: `The Pnpm CLI could not be found in your PATH. Make sure Pnpm is installed and try again.`,\n message: \"Pnpm not found.\",\n };\n },\n ENOPNPMRC: () => {\n return {\n details: `Didnt find a \\`.npmrc\\` file or it was not possible to create , in the root of your project.`,\n message: \"Missing `.npmrc` file.\",\n };\n },\n};\n","import type { PackageJson } from \"@visulima/package\";\nimport { resolve } from \"@visulima/path\";\nimport type { AuthOptions } from \"registry-auth-token\";\n\nimport { DEFAULT_NPM_REGISTRY } from \"../definitions/constants\";\nimport type { CommonContext } from \"../definitions/context\";\nimport rc from \"./rc\";\n\nconst getRegistryUrl = (scope: string, npmrc: AuthOptions[\"npmrc\"]): string => {\n let url: string = DEFAULT_NPM_REGISTRY;\n\n if (npmrc) {\n const registryUrl = npmrc[`${scope}:registry`] ?? npmrc[\"registry\"];\n\n if (registryUrl) {\n url = registryUrl;\n }\n }\n\n return url.slice(-1) === \"/\" ? url : `${url}/`;\n};\n\nexport default ({ name, publishConfig: { registry } = {} }: PackageJson, { cwd, env }: CommonContext): string =>\n registry ??\n env.NPM_CONFIG_REGISTRY ??\n getRegistryUrl(\n (name as string).split(\"/\")[0] as string,\n rc(\"npm\", {\n config: env.NPM_CONFIG_USERCONFIG ?? resolve(cwd, \".npmrc\"),\n cwd,\n defaults: { registry: \"https://registry.npmjs.org/\" },\n }).config as AuthOptions[\"npmrc\"],\n );\n","// eslint-disable-next-line import/prefer-default-export\nexport const DEFAULT_NPM_REGISTRY = \"https://registry.npmjs.org/\";\n","import { homedir } from \"node:os\";\nimport { cwd, env } from \"node:process\";\n\nimport { findUpSync, isAccessibleSync, readFileSync } from \"@visulima/fs\";\nimport { parseJson, stripJsonComments } from \"@visulima/fs/utils\";\nimport { join } from \"@visulima/path\";\nimport { parse } from \"ini\";\nimport { merge } from \"ts-deepmerge\";\n\nimport isJson from \"./is-json\";\n\n// eslint-disable-next-line sonarjs/cognitive-complexity,@typescript-eslint/no-explicit-any\nconst getEnvironment = (prefix: string, environment = env): Record<string, any> => {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const returnValue: Record<string, any> = {};\n const l = prefix.length;\n\n // eslint-disable-next-line no-loops/no-loops,no-restricted-syntax\n for (const k in environment) {\n if (k.toLowerCase().indexOf(prefix.toLowerCase()) === 0) {\n const keypath = k.slice(Math.max(0, l)).split(\"__\");\n\n // Trim empty strings from keypath array\n let emptyStringIndex;\n\n // eslint-disable-next-line no-loops/no-loops,no-cond-assign\n while ((emptyStringIndex = keypath.indexOf(\"\")) > -1) {\n keypath.splice(emptyStringIndex, 1);\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n let cursor: Record<string, any> = returnValue;\n\n keypath.forEach((subkey, index) => {\n // (check for subkey first so we ignore empty strings)\n // (check for cursor to avoid assignment to primitive objects)\n if (!subkey || typeof cursor !== \"object\") {\n return;\n }\n\n // If this is the last key, just stuff the value in there\n // Assigns actual value from env variable to final key\n // (unless it's just an empty string- in that case use the last valid key)\n if (index === keypath.length - 1) {\n cursor[subkey] = environment[k];\n }\n\n // Build sub-object if nothing already exists at the keypath\n if (cursor[subkey] === undefined) {\n cursor[subkey] = {};\n }\n\n // Increment cursor used to track the object at the current depth\n cursor = cursor[subkey];\n });\n }\n }\n\n return returnValue;\n};\n\n/**\n * Will look in all the obvious places for configuration:\n *\n * - The defaults object you passed in\n * - `$HOME/.${appname}rc`\n * - `$HOME/.${appname}/config`\n * - `$HOME/.config/${appname}`\n * - `$HOME/.config/${appname}/config`\n * - a local `.${appname}/config` and `.${appname}rc` and all found looking in `./ ../ ../../ ../../../` etc.\n * - if you passed environment variable `${appname}_config` then from that file\n * - environment variables prefixed with `${appname}_`\n * or use \"\\_\\_\" to indicate nested properties <br/> _(e.g. `appname_foo__bar__baz` => `foo.bar.baz`)_\n *\n * @param {string} name\n * @param {string} home\n * @param {string} internalCwd\n * @param {string} environmentConfig\n * @param {string} optionConfig\n * @returns {Array<string>}\n */\nconst getConfigFiles = (name: string, home: string, internalCwd: string, environmentConfig?: string, optionConfig?: string) => {\n const configFiles = new Set<string>();\n\n if (optionConfig && isAccessibleSync(optionConfig)) {\n configFiles.add(optionConfig);\n }\n\n // eslint-disable-next-line no-loops/no-loops,no-restricted-syntax\n for (const file of [`/etc/${name}rc`, `/etc/${name}/config`]) {\n if (isAccessibleSync(file)) {\n configFiles.add(file);\n }\n }\n\n // eslint-disable-next-line no-loops/no-loops,no-restricted-syntax\n for (const file of [join(home, \".config\", name, \"config\"), join(home, \".config\", name), join(home, `.${name}`, \"config\"), join(home, `.${name}rc`)]) {\n if (isAccessibleSync(file)) {\n configFiles.add(file);\n }\n\n if (isAccessibleSync(`${file}.json`)) {\n configFiles.add(`${file}.json`);\n }\n }\n\n // eslint-disable-next-line no-loops/no-loops,no-restricted-syntax\n for (const file of [`.${name}rc.json`, `.${name}rc`, `.${name}`, \"config.json\", \"config\"]) {\n // TODO: use later findsUpSync\n const foundConfigFile = findUpSync(file, {\n cwd: internalCwd,\n type: \"file\",\n });\n\n if (foundConfigFile) {\n configFiles.add(foundConfigFile);\n }\n }\n\n if (typeof environmentConfig === \"string\" && isAccessibleSync(environmentConfig)) {\n configFiles.add(environmentConfig);\n }\n\n // This is to ensure that the user's config file is the last one to be read\n return [...configFiles].reverse();\n};\n\nexport default (\n name: string,\n options: {\n config?: string;\n cwd?: string;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n defaults?: Record<string, any>;\n home?: string;\n } = {},\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n): { config: Record<string, any>; files: string[] } => {\n // eslint-disable-next-line no-param-reassign\n options = {\n cwd: cwd(),\n home: homedir(),\n ...options,\n };\n\n const { config: environmentConfig, ...environment } = getEnvironment(`${name}_`);\n\n const configFiles = getConfigFiles(\n name,\n options.home as string,\n options.cwd as string,\n env[`${name}_config`] ?? (environmentConfig as string | undefined),\n options.config,\n );\n\n const configs: object[] = [options.defaults ?? {}];\n\n // eslint-disable-next-line no-loops/no-loops,no-restricted-syntax\n for (const file of configFiles) {\n const content = readFileSync(file);\n\n if (isJson(content)) {\n configs.push(parseJson(stripJsonComments(content)));\n } else {\n configs.push(parse(content));\n }\n }\n\n if (environment) {\n configs.push(environment);\n }\n\n return { config: merge(...configs), files: configFiles };\n};\n","/**\n * Checks if string is a parseable JSON string.\n *\n * @param {string} value\n * @returns {boolean}\n */\nconst isJson = (value: string): boolean => {\n try {\n JSON.parse(value);\n } catch {\n return false;\n }\n\n return true;\n};\n\nexport default isJson;\n","import type { PackageJson } from \"@visulima/package\";\nimport normalizeUrl from \"normalize-url\";\n\nimport type { PublishContext } from \"../definitions/context\";\n\nexport interface ReleaseInfo {\n channel: string;\n name: string;\n url?: string;\n}\n\nexport const getReleaseInfo = (\n { name }: PackageJson,\n { env: { DEFAULT_NPM_REGISTRY = \"https://registry.npmjs.org/\" }, nextRelease: { version } }: PublishContext,\n distributionTag: string,\n registry: string,\n): ReleaseInfo => {\n return {\n channel: distributionTag,\n name: `pnpm package (@${distributionTag} dist-tag)`,\n url: normalizeUrl(registry) === normalizeUrl(DEFAULT_NPM_REGISTRY) ? `https://www.npmjs.com/package/${name}/v/${version}` : undefined,\n };\n};\n","import type { PackageJson } from \"@visulima/package\";\n\nimport type { PluginConfig } from \"../definitions/plugin-config\";\n\n/**\n * Returns null if `npmPublish` is not `false` and `pkg.private` is not\n * `true` or `pkg.workspaces` is not `undefined`.\n * Returns reason otherwise.\n */\nexport const reasonToNotPublish = (pluginConfig: PluginConfig, package_: PackageJson): string | null =>\n (pluginConfig.npmPublish === false\n ? \"npmPublish plugin option is false\"\n : package_.private === true && package_.workspaces === undefined\n ? \"package is private and has no workspaces\"\n : null);\n\nexport const shouldPublish = (pluginConfig: PluginConfig, package_: PackageJson): boolean => reasonToNotPublish(pluginConfig, package_) === null;\n","import { resolve } from \"@visulima/path\";\nimport { execa } from \"execa\";\nimport { moveFile } from \"move-file\";\n\nimport type { PrepareContext } from \"./definitions/context\";\nimport type { PluginConfig } from \"./definitions/plugin-config\";\n\nexport default async ({ pkgRoot, tarballDir }: PluginConfig, { cwd, env, logger, nextRelease: { version }, stderr, stdout }: PrepareContext): Promise<void> => {\n const basePath = pkgRoot ? resolve(cwd, pkgRoot) : cwd;\n\n logger.log(\"Write version %s to package.json in %s\", version, basePath);\n\n const versionResult = execa(\"pnpm\", [\"version\", version, \"--no-git-tag-version\", \"--allow-same-version\"], {\n cwd: basePath,\n env,\n preferLocal: true,\n });\n\n versionResult.stdout.pipe(stdout, { end: false });\n versionResult.stderr.pipe(stderr, { end: false });\n\n await versionResult;\n\n if (tarballDir) {\n logger.log(\"Creating npm package version %s\", version);\n\n const packResult = execa(\"pnpm\", [\"pack\", basePath], { cwd, env, preferLocal: true });\n\n packResult.stdout.pipe(stdout, { end: false });\n packResult.stderr.pipe(stderr, { end: false });\n\n // eslint-disable-next-line unicorn/no-await-expression-member\n const tarball = (await packResult).stdout.split(\"\\n\").pop() as string;\n const tarballSource = resolve(cwd, tarball);\n const tarballDestination = resolve(cwd, tarballDir.trim(), tarball);\n\n // Only move the tarball if we need to\n // Fixes: https://github.com/semantic-release/npm/issues/169\n if (tarballSource !== tarballDestination) {\n await moveFile(tarballSource, tarballDestination);\n }\n }\n};\n","import type { PackageJson } from \"@visulima/package\";\nimport { resolve } from \"@visulima/path\";\nimport AggregateError from \"aggregate-error\";\nimport { execa } from \"execa\";\n\nimport type { PublishContext } from \"./definitions/context\";\nimport type { PluginConfig } from \"./definitions/plugin-config\";\nimport getChannel from \"./utils/get-channel\";\nimport getRegistry from \"./utils/get-registry\";\nimport type { ReleaseInfo } from \"./utils/get-release-info\";\nimport { getReleaseInfo } from \"./utils/get-release-info\";\nimport { reasonToNotPublish, shouldPublish } from \"./utils/should-publish\";\n\nexport default async (pluginConfig: PluginConfig, package_: PackageJson, context: PublishContext): Promise<ReleaseInfo | false> => {\n const {\n cwd,\n env,\n logger,\n nextRelease: { channel, version },\n stderr,\n stdout,\n } = context;\n const { pkgRoot, publishBranch: publishBranchConfig } = pluginConfig;\n\n if (shouldPublish(pluginConfig, package_)) {\n const basePath = pkgRoot ? resolve(cwd, pkgRoot) : cwd;\n const registry = getRegistry(package_, context);\n const distributionTag = getChannel(channel);\n\n const { stdout: currentBranch } = await execa(\"git\", [\"rev-parse\", \"--abbrev-ref\", \"HEAD\"], {\n cwd,\n env,\n preferLocal: true,\n });\n const publishBranches = typeof publishBranchConfig === \"string\" && publishBranchConfig.split(\"|\");\n const isPublishBranch = publishBranches && publishBranches?.includes(currentBranch);\n const publishBranch = isPublishBranch ? currentBranch : \"main\";\n\n logger.log(`Publishing version ${version} on branch ${publishBranch} to npm registry on dist-tag ${distributionTag}`);\n\n const pnpmArguments = [\"publish\", basePath, \"--publish-branch\", publishBranch, \"--tag\", distributionTag, \"--registry\", registry, \"--no-git-checks\"];\n\n if (pluginConfig.disableScripts) {\n pnpmArguments.push(\"--ignore-scripts\");\n }\n\n const result = execa(\"pnpm\", pnpmArguments, {\n cwd,\n env,\n preferLocal: true,\n });\n\n result.stdout.pipe(stdout, { end: false });\n result.stderr.pipe(stderr, { end: false });\n\n try {\n await result;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n } catch (error: any) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n logger.log(`Failed to publish ${package_.name}@${version} to dist-tag @${distributionTag} on ${registry}: ${error.message ?? error}`);\n\n throw new AggregateError([error]);\n }\n\n logger.log(`Published ${package_.name}@${version} to dist-tag @${distributionTag} on ${registry}`);\n\n return getReleaseInfo(package_, context, distributionTag, registry);\n }\n\n logger.log(`Skip publishing to npm registry as ${reasonToNotPublish(pluginConfig, package_)}`);\n\n return false;\n};\n","// eslint-disable-next-line unicorn/prevent-abbreviations\nimport type { PackageJson } from \"@visulima/package\";\nimport { findPackageJson } from \"@visulima/package\";\nimport { resolve } from \"@visulima/path\";\nimport AggregateError from \"aggregate-error\";\n\nimport type { CommonContext } from \"../definitions/context\";\nimport getError from \"./get-error\";\n\ninterface Options {\n pkgRoot?: string;\n}\n\nexport default async ({ pkgRoot }: Options, { cwd }: { cwd: CommonContext[\"cwd\"] }): Promise<PackageJson> => {\n try {\n const { packageJson } = await findPackageJson(pkgRoot ? resolve(cwd, pkgRoot) : cwd);\n\n if (!packageJson.name) {\n throw new AggregateError([getError(\"ENOPKGNAME\")]);\n }\n\n return packageJson;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n } catch (error: any) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n if (error.code === \"ENOENT\") {\n throw new AggregateError([getError(\"ENOPKG\")]);\n }\n\n throw error;\n }\n};\n","import AggregateError from \"aggregate-error\";\n\nimport type { VerifyConditionsContext } from \"../definitions/context\";\nimport type { PluginConfig } from \"../definitions/plugin-config\";\nimport getNpmrc from \"../utils/get-npmrc\";\nimport getPackage from \"../utils/get-pkg\";\nimport { shouldPublish } from \"../utils/should-publish\";\nimport verifyAuth from \"./verify-auth\";\nimport verifyConfig from \"./verify-config\";\nimport verifyPnpm from \"./verify-pnpm\";\n\nconst verify = async (pluginConfig: PluginConfig, context: VerifyConditionsContext): Promise<void> => {\n let errors: Error[] = verifyConfig(pluginConfig);\n\n try {\n verifyPnpm(context);\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n } catch (error: any) {\n const typedError = error as AggregateError;\n\n errors = [...errors, ...(typedError.errors ?? [error])];\n }\n\n try {\n const packageJson = await getPackage(pluginConfig, context);\n\n if (shouldPublish(pluginConfig, packageJson)) {\n const npmrc = getNpmrc(context.cwd, context.env);\n\n await verifyAuth(npmrc, packageJson, context);\n }\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n } catch (error: any) {\n const typedError = error as AggregateError;\n\n errors = [...errors, ...(typedError.errors ?? [error])];\n }\n\n if (errors.length > 0) {\n throw new AggregateError(errors);\n }\n};\n\nexport default verify;\n","import type { PackageJson } from \"@visulima/package\";\nimport AggregateError from \"aggregate-error\";\nimport { execa } from \"execa\";\nimport normalizeUrl from \"normalize-url\";\n\nimport type { CommonContext } from \"../definitions/context\";\nimport getError from \"../utils/get-error\";\nimport getRegistry from \"../utils/get-registry\";\nimport setNpmrcAuth from \"../utils/set-npmrc-auth\";\n\nexport default async (npmrc: string, package_: PackageJson, context: CommonContext): Promise<void> => {\n const {\n cwd,\n env: { DEFAULT_NPM_REGISTRY = \"https://registry.npmjs.org/\", ...environment },\n logger,\n stderr,\n stdout,\n } = context;\n const registry = getRegistry(package_, context);\n\n await setNpmrcAuth(npmrc, registry, context);\n\n if (normalizeUrl(registry) === normalizeUrl(DEFAULT_NPM_REGISTRY)) {\n try {\n logger.log(`Running \"pnpm whoami\" to verify authentication on registry \"${registry}\"`);\n\n const whoamiResult = execa(\"pnpm\", [\"whoami\", \"--userconfig\", npmrc, \"--registry\", registry], {\n cwd,\n env: environment,\n preferLocal: true,\n });\n\n whoamiResult.stdout.pipe(stdout, { end: false });\n whoamiResult.stderr.pipe(stderr, { end: false });\n\n await whoamiResult;\n } catch {\n throw new AggregateError([getError(\"EINVALIDNPMTOKEN\", { registry })]);\n }\n } else {\n logger.log(`Skipping authentication verification for non-default registry \"${registry}\"`);\n }\n};\n","import { writeFile } from \"@visulima/fs\";\nimport { resolve } from \"@visulima/path\";\nimport AggregateError from \"aggregate-error\";\nimport { stringify } from \"ini\";\nimport type { AuthOptions } from \"registry-auth-token\";\nimport getAuthToken from \"registry-auth-token\";\n\nimport { DEFAULT_NPM_REGISTRY } from \"../definitions/constants\";\nimport type { CommonContext } from \"../definitions/context\";\nimport getError from \"./get-error\";\nimport nerfDart from \"./nerf-dart\";\nimport rc from \"./rc\";\n\nexport default async (\n npmrc: string,\n registry: string,\n { cwd, env: { NPM_CONFIG_USERCONFIG, NPM_EMAIL, NPM_PASSWORD, NPM_TOKEN, NPM_USERNAME }, logger }: CommonContext,\n): Promise<void> => {\n logger.log(\"Verify authentication for registry %s\", registry);\n\n const { config, files } = rc(\"npm\", {\n config: NPM_CONFIG_USERCONFIG ?? resolve(cwd, \".npmrc\"),\n cwd,\n defaults: { registry: DEFAULT_NPM_REGISTRY },\n });\n\n if (files) {\n logger.log(\"Reading npm config from %s\", files.join(\", \"));\n }\n\n if (getAuthToken(registry, { npmrc: config } as AuthOptions)) {\n await writeFile(npmrc, stringify(config));\n\n return;\n }\n\n if (NPM_USERNAME && NPM_PASSWORD && NPM_EMAIL) {\n await writeFile(npmrc, `${config ? `${stringify(config)}\\n` : \"\"}_auth = \\${LEGACY_TOKEN}\\nemail = \\${NPM_EMAIL}`);\n\n logger.log(`Wrote NPM_USERNAME, NPM_PASSWORD, and NPM_EMAIL to ${npmrc}`);\n } else if (NPM_TOKEN) {\n await writeFile(npmrc, `${config ? `${stringify(config)}\\n` : \"\"}${nerfDart(registry)}:_authToken = \\${NPM_TOKEN}`);\n\n logger.log(`Wrote NPM_TOKEN to ${npmrc}`);\n } else {\n throw new AggregateError([getError(\"ENONPMTOKEN\", { registry })]);\n }\n};\n","import { URL } from \"node:url\";\n\n/**\n * Maps a URL to an identifier.\n *\n * The ISC License\n * Copyright (c) npm, Inc.\n *\n * Name courtesy schiffertronix media LLC, a New Jersey corporation\n *\n * @param {String} url The URL to be nerfed.\n *\n * @returns {String} A nerfed URL.\n */\nconst nerfDart = (url: string): string => {\n const parsed = new URL(url);\n const from = `${parsed.protocol}//${parsed.host}${parsed.pathname}`;\n const real = new URL(\".\", from);\n\n return `//${real.host}${real.pathname}`;\n};\n\nexport default nerfDart;\n","import type SemanticReleaseError from \"@semantic-release/error\";\n\nimport type { PluginConfig } from \"../definitions/plugin-config\";\nimport getError from \"../utils/get-error\";\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst isString = (value: any): boolean => typeof value === \"string\";\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst isNil = (value: any): boolean => value === null || value === undefined;\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst isNonEmptyString = (value: any): boolean => {\n if (!isString(value)) {\n return false;\n }\n\n return (value as string).trim() !== \"\";\n};\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype ValidatorFunction = (value: any) => boolean;\n\nconst VALIDATORS: Record<string, ValidatorFunction> = {\n branches: Array.isArray,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n npmPublish: (value: any): boolean => typeof value === \"boolean\",\n pkgRoot: isNonEmptyString,\n publishBranch: isNonEmptyString,\n tarballDir: isNonEmptyString,\n};\n\nexport default (config: PluginConfig): SemanticReleaseError[] =>\n // eslint-disable-next-line unicorn/no-array-reduce\n Object.entries(config).reduce((errors, [option, value]) => {\n if (isNil(value)) {\n return errors;\n }\n\n if (!(option in VALIDATORS)) {\n return errors;\n }\n\n if (VALIDATORS[option]?.(value)) {\n return errors;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return [...errors, getError(`EINVALID${option.toUpperCase()}` as any, { [option]: value })];\n }, [] as SemanticReleaseError[]);\n","import { getPackageManagerVersion } from \"@visulima/package\";\nimport AggregateError from \"aggregate-error\";\nimport { gte } from \"semver\";\n\nimport type { CommonContext } from \"../definitions/context\";\nimport getError from \"../utils/get-error\";\n\nconst MIN_PNPM_VERSION = \"8.0.0\";\n\nexport default async function verifyPnpm({ logger }: CommonContext): Promise<void> {\n logger.log(`Verify pnpm version is >= ${MIN_PNPM_VERSION}`);\n\n const version = await getPackageManagerVersion(\"pnpm\");\n\n if (version === undefined) {\n throw new AggregateError([new Error(\"pnpm is not installed\")]);\n }\n\n if (gte(MIN_PNPM_VERSION, version)) {\n throw new AggregateError([getError(\"EINVALIDPNPM\", { version: String(version) })]);\n }\n}\n","import addChannelNpm from \"./add-channel\";\nimport type { AddChannelContext, PrepareContext, PublishContext, VerifyConditionsContext } from \"./definitions/context\";\nimport type { PluginConfig } from \"./definitions/plugin-config\";\nimport prepareNpm from \"./prepare\";\nimport publishNpm from \"./publish\";\nimport getPackage from \"./utils/get-pkg\";\nimport type { ReleaseInfo } from \"./utils/get-release-info\";\nimport verify from \"./verify\";\n\nconst PLUGIN_NAME = \"semantic-release-pnpm\";\n\nlet verified: boolean;\nlet prepared: boolean;\n\nexport const verifyConditions = async (pluginConfig: PluginConfig, context: VerifyConditionsContext): Promise<void> => {\n /**\n * If the plugin is used and has `npmPublish`, `tarballDir` or\n * `pkgRoot` configured, validate them now in order to prevent any release if\n * the configuration is wrong\n */\n if (context.options?.[\"publish\"]) {\n const publish = Array.isArray(context.options?.[\"publish\"]) ? context.options?.[\"publish\"] : [context.options?.[\"publish\"]];\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n const publishPlugin = publish.find((config) => config.path && config.path === PLUGIN_NAME) || {};\n\n // eslint-disable-next-line no-param-reassign,@typescript-eslint/no-unsafe-member-access\n pluginConfig.npmPublish = pluginConfig.npmPublish ?? publishPlugin.npmPublish;\n // eslint-disable-next-line no-param-reassign,@typescript-eslint/no-unsafe-member-access\n pluginConfig.tarballDir = pluginConfig.tarballDir ?? publishPlugin.tarballDir;\n // eslint-disable-next-line no-param-reassign,@typescript-eslint/no-unsafe-member-access\n pluginConfig.pkgRoot = pluginConfig.pkgRoot ?? publishPlugin.pkgRoot;\n // eslint-disable-next-line no-param-reassign,@typescript-eslint/no-unsafe-member-access\n pluginConfig.disableScripts = pluginConfig.disableScripts ?? publishPlugin.disableScripts;\n // eslint-disable-next-line no-param-reassign,@typescript-eslint/no-unsafe-member-access\n pluginConfig.branches = pluginConfig.branches ?? publishPlugin.branches;\n }\n\n await verify(pluginConfig, context);\n\n verified = true;\n};\n\nexport const prepare = async (pluginConfig: PluginConfig, context: PrepareContext): Promise<void> => {\n if (!verified) {\n await verify(pluginConfig, context);\n }\n\n await prepareNpm(pluginConfig, context);\n\n prepared = true;\n};\n\nexport const publish = async (pluginConfig: PluginConfig, context: PublishContext): Promise<ReleaseInfo | false> => {\n const packageJson = await getPackage(pluginConfig, context);\n\n if (!verified) {\n await verify(pluginConfig, context);\n }\n\n if (!prepared) {\n await prepareNpm(pluginConfig, context);\n }\n\n return publishNpm(pluginConfig, packageJson, context);\n};\n\nexport const addChannel = async (pluginConfig: PluginConfig, context: AddChannelContext): Promise<ReleaseInfo | false> => {\n if (!verified) {\n await verify(pluginConfig, context);\n }\n\n const packageJson = await getPackage(pluginConfig, context);\n\n return addChannelNpm(pluginConfig, packageJson, context);\n};\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/add-channel.ts","../src/utils/get-channel.ts","../src/utils/get-npmrc-path.ts","../src/utils/get-error.ts","../package.json","../src/definitions/errors.ts","../src/utils/get-registry.ts","../src/definitions/constants.ts","../src/utils/get-release-info.ts","../src/utils/should-publish.ts","../src/prepare.ts","../src/publish.ts","../src/utils/get-pkg.ts","../src/verify/index.ts","../src/verify/verify-auth.ts","../src/utils/set-npmrc-auth.ts","../src/utils/nerf-dart.ts","../src/verify/verify-config.ts","../src/verify/verify-pnpm.ts","../src/index.ts"],"names":["execa","validRange","get_channel_default","channel","ensureFileSync","isAccessibleSync","findCacheDirectorySync","resolve","SemanticReleaseError","package_default","linkify","file","errors","branches","npmPublish","registry","pkgRoot","version","publishBranch","tarballDir","get_error_default","code","context","details","message","getNpmrcPath","cwd","environment","npmrc","npmrcPath","temporaryNpmrcPath","get_npmrc_path_default","rc","DEFAULT_NPM_REGISTRY","getRegistryUrl","scope","url","registryUrl","get_registry_default","name","env","normalizeUrl","getReleaseInfo","distributionTag","reasonToNotPublish","pluginConfig","package_","shouldPublish","add_channel_default","logger","stderr","stdout","result","moveFile","prepare_default","basePath","versionResult","packResult","tarball","tarballSource","tarballDestination","AggregateError","publish_default","publishBranchConfig","currentBranch","publishBranches","pnpmArguments","error","findPackageJson","get_pkg_default","packageJson","writeFile","stringify","getAuthToken","URL","nerfDart","parsed","from","real","nerf_dart_default","set_npmrc_auth_default","NPM_CONFIG_USERCONFIG","NPM_EMAIL","NPM_PASSWORD","NPM_TOKEN","NPM_USERNAME","config","files","verify_auth_default","whoamiResult","isString","value","isNil","isNonEmptyString","VALIDATORS","verify_config_default","option","getPackageManagerVersion","gte","MIN_PNPM_VERSION","verifyPnpm","verify","typedError","verify_default","PLUGIN_NAME","verified","prepared","verifyConditions","publishPlugin","prepare","publish","addChannel"],"mappings":"AACA,OAAS,SAAAA,OAAa,QCDtB,OAAS,cAAAC,OAAk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a,YAAc+D,EAAc,WAEnE/D,EAAa,WAAaA,EAAa,YAAc+D,EAAc,WAEnE/D,EAAa,QAAUA,EAAa,SAAW+D,EAAc,QAE7D/D,EAAa,eAAiBA,EAAa,gBAAkB+D,EAAc,eAE3E/D,EAAa,SAAWA,EAAa,UAAY+D,EAAc,QACnE,CAEA,MAAML,EAAO1D,EAAcvB,CAAO,EAElCmF,EAAW,EACf,EAEaI,GAAU,MAAOhE,EAA4BvB,IAA2C,CAC5FmF,GACD,MAAMF,EAAO1D,EAAcvB,CAAO,EAGtC,MAAMgC,EAAWT,EAAcvB,CAAO,EAEtCoF,GAAW,EACf,EAEaI,GAAU,MAAOjE,EAA4BvB,IAA0D,CAChH,IAAMgD,EAAc,MAAMD,EAAWxB,EAAcvB,CAAO,EAE1D,OAAKmF,GACD,MAAMF,EAAO1D,EAAcvB,CAAO,EAGjCoF,IACD,MAAMpD,EAAWT,EAAcvB,CAAO,EAGnC,MAAMwC,EAAWjB,EAAcyB,EAAahD,CAAO,CAC9D,EAEayF,GAAa,MAAOlE,EAA4BvB,IAA6D,CACjHmF,GACD,MAAMF,EAAO1D,EAAcvB,CAAO,EAGtC,IAAMgD,EAAc,MAAMD,EAAWxB,EAAcvB,CAAO,EAE1D,OAAO,MAAM0B,EAAcH,EAAcyB,EAAahD,CAAO,CACjE","sourcesContent":["import type { PackageJson } from \"@visulima/package\";\nimport { execa } from \"execa\";\n\nimport type { AddChannelContext } from \"./definitions/context\";\nimport type { PluginConfig } from \"./definitions/plugin-config\";\nimport getChannel from \"./utils/get-channel\";\nimport getNpmrcPath from \"./utils/get-npmrc-path\";\nimport getRegistry from \"./utils/get-registry\";\nimport type { ReleaseInfo } from \"./utils/get-release-info\";\nimport { getReleaseInfo } from \"./utils/get-release-info\";\nimport { reasonToNotPublish, shouldPublish } from \"./utils/should-publish\";\n\nexport default async (pluginConfig: PluginConfig, package_: PackageJson, context: AddChannelContext): Promise<ReleaseInfo | false> => {\n const {\n cwd,\n env,\n logger,\n nextRelease: { channel, version },\n stderr,\n stdout,\n } = context;\n\n if (shouldPublish(pluginConfig, package_)) {\n const registry = getRegistry(package_, context);\n const distributionTag = getChannel(channel);\n\n logger.log(`Adding version ${version} to npm registry on dist-tag ${distributionTag}`);\n\n const npmrc = getNpmrcPath(cwd, env);\n\n const result = execa(\"pnpm\", [\"dist-tag\", \"add\", `${package_.name}@${version}`, distributionTag, \"--userconfig\", npmrc, \"--registry\", registry], {\n cwd,\n env,\n preferLocal: true,\n });\n\n result.stdout.pipe(stdout, { end: false });\n result.stderr.pipe(stderr, { end: false });\n\n await result;\n\n logger.log(`Added ${package_.name}@${version} to dist-tag @${distributionTag} on ${registry}`);\n\n return getReleaseInfo(package_, context, distributionTag, registry);\n }\n\n logger.log(`Skip adding to npm channel as ${reasonToNotPublish(pluginConfig, package_)}`);\n\n return false;\n};\n","import { validRange } from \"semver\";\n\nexport default (channel: string | null | undefined): string => (channel ? (validRange(channel) ? `release-${channel}` : channel) : \"latest\");\n","import { ensureFileSync, isAccessibleSync } from \"@visulima/fs\";\nimport { findCacheDirectorySync } from \"@visulima/package\";\nimport { resolve } from \"@visulima/path\";\n\nimport getError from \"./get-error\";\n\nconst getNpmrcPath = (cwd: string, environment: NodeJS.ProcessEnv): string => {\n let npmrc: string | undefined;\n\n const npmrcPath = resolve(cwd, \".npmrc\");\n\n if (environment.NPM_CONFIG_USERCONFIG && isAccessibleSync(environment.NPM_CONFIG_USERCONFIG)) {\n npmrc = environment.NPM_CONFIG_USERCONFIG;\n } else if (isAccessibleSync(npmrcPath)) {\n npmrc = npmrcPath;\n } else {\n const temporaryNpmrcPath = findCacheDirectorySync(\"semantic-release-pnpm\", { create: true, cwd });\n\n if (temporaryNpmrcPath) {\n ensureFileSync(temporaryNpmrcPath);\n\n npmrc = temporaryNpmrcPath;\n }\n }\n\n if (npmrc === undefined) {\n // eslint-disable-next-line unicorn/error-message\n throw new AggregateError([\n getError(\"ENOPNPMRC\", {\n npmrc: npmrcPath,\n }),\n ]);\n }\n\n return npmrc;\n};\n\nexport default getNpmrcPath;\n","import SemanticReleaseError from \"@semantic-release/error\";\n\nimport type { ErrorContext, ErrorDefinition } from \"../definitions/errors\";\nimport { errors } from \"../definitions/errors\";\n\nexport default <T extends keyof typeof errors>(code: T, context: ErrorContext = {}): SemanticReleaseError => {\n // eslint-disable-next-line security/detect-object-injection\n const { details, message }: { details?: string; message: string } = (errors[code] as ErrorDefinition)(context);\n\n return new SemanticReleaseError(message, code, details);\n};\n","{\n \"name\": \"@anolilab/semantic-release-pnpm\",\n \"version\": \"0.0.0\",\n \"description\": \"Semantic-release plugin to publish a npm package with pnpm.\",\n \"keywords\": [\n \"anolilab\",\n \"npm\",\n \"pnpm\",\n \"publish\",\n \"monorepo\",\n \"semantic-release\",\n \"semantic-release-plugin\",\n \"semantic-release-pnpm\"\n ],\n \"homepage\": \"https://github.com/anolilab/semantic-release/tree/main/packages/semantic-release-pnpm\",\n \"bugs\": {\n \"url\": \"https://github.com/anolilab/semantic-release/issues\"\n },\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"git+https://github.com/anolilab/semantic-release.git\",\n \"directory\": \"packages/semantic-release-pnpm\"\n },\n \"funding\": [\n {\n \"type\": \"github\",\n \"url\": \"https://github.com/sponsors/prisis\"\n },\n {\n \"type\": \"consulting\",\n \"url\": \"https://anolilab.com/support\"\n }\n ],\n \"license\": \"MIT\",\n \"author\": {\n \"name\": \"Daniel Bannert\",\n \"email\": \"d.bannert@anolilab.de\"\n },\n \"sideEffects\": false,\n \"type\": \"module\",\n \"exports\": \"./dist/index.js\",\n \"main\": \"dist/index.js\",\n \"types\": \"dist/index.d.ts\",\n \"files\": [\n \"dist\",\n \"README.md\",\n \"CHANGELOG.md\"\n ],\n \"scripts\": {\n \"build\": \"cross-env NODE_ENV=development tsup\",\n \"build:prod\": \"cross-env NODE_ENV=production tsup\",\n \"clean\": \"rimraf node_modules dist .eslintcache\",\n \"dev\": \"pnpm run build --watch\",\n \"lint:eslint\": \"eslint . --ext js,cjs,mjs,jsx,ts,tsx,json,yaml,yml,md,mdx --max-warnings=0 --config .eslintrc.cjs\",\n \"lint:eslint:fix\": \"eslint . --ext js,cjs,mjs,jsx,ts,tsx,json,yaml,yml,md,mdx --max-warnings=0 --config .eslintrc.cjs --fix\",\n \"lint:package-json\": \"publint --strict\",\n \"lint:prettier\": \"prettier --config=.prettierrc.cjs --check .\",\n \"lint:prettier:fix\": \"prettier --config=.prettierrc.cjs --write .\",\n \"lint:types\": \"tsc --noEmit\",\n \"test\": \"vitest run\",\n \"test:coverage\": \"vitest run --coverage\",\n \"test:ui\": \"vitest --ui --coverage.enabled=true\",\n \"test:watch\": \"vitest\"\n },\n \"dependencies\": {\n \"@anolilab/rc\": \"workspace:*\",\n \"@semantic-release/error\": \"^4.0.0\",\n \"@visulima/fs\": \"^2.1.1\",\n \"@visulima/package\": \"1.8.1\",\n \"@visulima/path\": \"^1.0.0\",\n \"aggregate-error\": \"^5.0.0\",\n \"execa\": \"^9.1.0\",\n \"ini\": \"4.1.2\",\n \"move-file\": \"^3.1.0\",\n \"normalize-url\": \"^8.0.1\",\n \"registry-auth-token\": \"^5.0.2\",\n \"semver\": \"^7.6.2\"\n },\n \"devDependencies\": {\n \"@anolilab/eslint-config\": \"^15.0.3\",\n \"@anolilab/prettier-config\": \"^5.0.14\",\n \"@anolilab/semantic-release-preset\": \"^8.0.3\",\n \"@babel/core\": \"^7.24.3\",\n \"@rushstack/eslint-plugin-security\": \"^0.8.1\",\n \"@secretlint/secretlint-rule-preset-recommend\": \"^8.1.2\",\n \"@semantic-release/changelog\": \"^6.0.3\",\n \"@semantic-release/git\": \"^10.0.1\",\n \"@semantic-release/github\": \"^10.0.4\",\n \"@types/dockerode\": \"^3.3.29\",\n \"@types/ini\": \"^4.1.0\",\n \"@types/node\": \"18.18.14\",\n \"@types/semantic-release__error\": \"3.0.3\",\n \"@types/semver\": \"7.5.8\",\n \"@types/stream-buffers\": \"^3.0.7\",\n \"@vitest/coverage-v8\": \"^1.4.0\",\n \"@vitest/ui\": \"^1.4.0\",\n \"cross-env\": \"^7.0.3\",\n \"dockerode\": \"4.0.2\",\n \"eslint\": \"^8.57.0\",\n \"eslint-plugin-deprecation\": \"^2.0.0\",\n \"eslint-plugin-editorconfig\": \"^4.0.3\",\n \"eslint-plugin-import\": \"npm:eslint-plugin-i@2.29.1\",\n \"eslint-plugin-mdx\": \"^3.1.5\",\n \"eslint-plugin-n\": \"^17.7.0\",\n \"eslint-plugin-vitest\": \"^0.4.1\",\n \"eslint-plugin-vitest-globals\": \"^1.5.0\",\n \"eslint-plugin-you-dont-need-lodash-underscore\": \"^6.14.0\",\n \"get-stream\": \"9.0.1\",\n \"got\": \"^14.2.1\",\n \"p-retry\": \"^6.2.0\",\n \"prettier\": \"^3.2.5\",\n \"rimraf\": \"^5.0.5\",\n \"secretlint\": \"8.1.2\",\n \"semantic-release\": \"^23.0.5\",\n \"sort-package-json\": \"^2.8.0\",\n \"stream-buffers\": \"^3.0.2\",\n \"tempy\": \"^3.1.0\",\n \"tsup\": \"^8.0.2\",\n \"typescript\": \"^5.4.3\",\n \"vitest\": \"^1.4.0\"\n },\n \"engines\": {\n \"node\": \">=18.* <=21.*\"\n },\n \"publishConfig\": {\n \"access\": \"public\",\n \"provenance\": true\n },\n \"anolilab\": {\n \"eslint-config\": {\n \"plugin\": {\n \"etc\": false,\n \"tsdoc\": false\n },\n \"warn_on_unsupported_typescript_version\": false,\n \"info_on_disabling_jsx_react_rule\": false,\n \"info_on_disabling_prettier_conflict_rule\": false,\n \"info_on_disabling_jsonc_sort_keys_rule\": false,\n \"import_ignore_exports\": [\n \"**/*.cjs\"\n ]\n }\n }\n}\n","import package_ from \"../../package.json\";\n\nconst linkify = (file: string) => `${package_.homepage}/blob/main/${file}`;\n\ninterface ErrorDetails {\n details: string;\n message: string;\n}\n\nexport type ErrorDefinition = (context: ErrorContext) => ErrorDetails;\n\nexport interface ErrorContext {\n npmPublish?: boolean;\n npmrc?: string;\n pkgRoot?: string;\n publishBranch?: string;\n registry?: string;\n tarballDir?: string;\n version?: string;\n}\n\nexport const errors: {\n EINVALIDBRANCHES: (branches: string[]) => { details: string; message: string };\n EINVALIDNPMPUBLISH: ({ npmPublish }: ErrorContext) => { details: string; message: string };\n EINVALIDNPMTOKEN: ({ registry }: ErrorContext) => { details: string; message: string };\n EINVALIDPKGROOT: ({ pkgRoot }: ErrorContext) => { details: string; message: string };\n EINVALIDPNPM: ({ version }: ErrorContext) => { details: string; message: string };\n EINVALIDPUBLISHBRANCH: ({ publishBranch }: ErrorContext) => { details: string; message: string };\n EINVALIDTARBALLDIR: ({ tarballDir }: ErrorContext) => { details: string; message: string };\n ENONPMTOKEN: ({ registry }: ErrorContext) => { details: string; message: string };\n ENOPKG: () => { details: string; message: string };\n ENOPKGNAME: () => { details: string; message: string };\n ENOPNPM: () => { details: string; message: string };\n ENOPNPMRC: () => { details: string; message: string };\n} = {\n EINVALIDBRANCHES: (branches: string[]) => {\n return {\n details: `The [branches option](${linkify(\"README.md#branches\")}) option, if defined, must be an array of \\`String\\`.\nYour configuration for the \\`branches\\` option is \\`${branches.join(\",\")}\\`.`,\n message: \"Invalid `branches` option.\",\n };\n },\n EINVALIDNPMPUBLISH: ({ npmPublish }: ErrorContext) => {\n return {\n details: `The [npmPublish option](${linkify(\"README.md#npmpublish\")}) option, if defined, must be a \\`Boolean\\`.\nYour configuration for the \\`npmPublish\\` option is \\`${npmPublish}\\`.`,\n message: \"Invalid `npmPublish` option.\",\n };\n },\n EINVALIDNPMTOKEN: ({ registry }: ErrorContext) => {\n return {\n details: `The [npm token](${linkify(\n \"README.md#npm-registry-authentication\",\n )}) configured in the \\`NPM_TOKEN\\` environment variable must be a valid [token](https://docs.npmjs.com/getting-started/working_with_tokens) allowing to publish to the registry \\`${registry}\\`.\nIf you are using Two Factor Authentication for your account, set its level to [\"Authorization only\"](https://docs.npmjs.com/getting-started/using-two-factor-authentication#levels-of-authentication) in your account settings. **semantic-release** cannot publish with the default \"Authorization and writes\" level.\nPlease make sure to set the \\`NPM_TOKEN\\` environment variable in your CI with the exact value of the npm token.`,\n message: \"Invalid npm token.\",\n };\n },\n EINVALIDPKGROOT: ({ pkgRoot }: ErrorContext) => {\n return {\n details: `The [pkgRoot option](${linkify(\"README.md#pkgroot\")}) option, if defined, must be a \\`String\\`.\nYour configuration for the \\`pkgRoot\\` option is \\`${pkgRoot}\\`.`,\n message: \"Invalid `pkgRoot` option.\",\n };\n },\n EINVALIDPNPM: ({ version }: ErrorContext) => {\n return {\n details: `The version of Pnpm that you are using is not compatible. Please refer to [the README](${linkify(\n \"README.md#install\",\n )}) to review which versions of Pnpm are currently supported\n\nYour version of Pnpm is \"${version}\".`,\n message: \"Incompatible Pnpm version detected.\",\n };\n },\n EINVALIDPUBLISHBRANCH: ({ publishBranch }: ErrorContext) => {\n return {\n details: `The [publishBranch option](${linkify(\"README.md#publishBranch\")}) option, if defined, must be a \\`String\\`.\nYour configuration for the \\`publishBranch\\` option is \\`${publishBranch}\\`.`,\n message: \"Invalid `publishBranch` option.\",\n };\n },\n EINVALIDTARBALLDIR: ({ tarballDir }: ErrorContext) => {\n return {\n details: `The [tarballDir option](${linkify(\"README.md#tarballdir\")}) option, if defined, must be a \\`String\\`.\nYour configuration for the \\`tarballDir\\` option is \\`${tarballDir}\\`.`,\n message: \"Invalid `tarballDir` option.\",\n };\n },\n ENONPMTOKEN: ({ registry }: ErrorContext) => {\n return {\n details: `An [npm token](${linkify(\n \"README.md#npm-registry-authentication\",\n )}) must be created and set in the \\`NPM_TOKEN\\` environment variable on your CI environment.\nPlease make sure to create an [npm token](https://docs.npmjs.com/getting-started/working_with_tokens#how-to-create-new-tokens) and to set it in the \\`NPM_TOKEN\\` environment variable on your CI environment. The token must allow to publish to the registry \\`${registry}\\`.`,\n message: \"No npm token specified.\",\n };\n },\n ENOPKG: () => {\n return {\n details: `A [package.json file](https://docs.npmjs.com/files/package.json) at the root of your project is required to release on npm.\nPlease follow the [npm guideline](https://docs.npmjs.com/getting-started/creating-node-modules) to create a valid \\`package.json\\` file.`,\n message: \"Missing `package.json` file.\",\n };\n },\n ENOPKGNAME: () => {\n return {\n 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.\nPlease make sure to add a valid \\`name\\` for your package in your \\`package.json\\`.`,\n message: \"Missing `name` property in `package.json`.\",\n };\n },\n ENOPNPM: () => {\n return {\n details: `The Pnpm CLI could not be found in your PATH. Make sure Pnpm is installed and try again.`,\n message: \"Pnpm not found.\",\n };\n },\n ENOPNPMRC: () => {\n return {\n details: `Didnt find a \\`.npmrc\\` file or it was not possible to create , in the root of your project.`,\n message: \"Missing `.npmrc` file.\",\n };\n },\n};\n","import { rc } from \"@anolilab/rc\";\nimport type { PackageJson } from \"@visulima/package\";\nimport { resolve } from \"@visulima/path\";\nimport type { AuthOptions } from \"registry-auth-token\";\n\nimport { DEFAULT_NPM_REGISTRY } from \"../definitions/constants\";\nimport type { CommonContext } from \"../definitions/context\";\n\nconst getRegistryUrl = (scope: string, npmrc: AuthOptions[\"npmrc\"]): string => {\n let url: string = DEFAULT_NPM_REGISTRY;\n\n if (npmrc) {\n const registryUrl = npmrc[`${scope}:registry`] ?? npmrc.registry;\n\n if (registryUrl) {\n url = registryUrl;\n }\n }\n\n return url.endsWith(\"/\") ? url : `${url}/`;\n};\n\nexport default ({ name, publishConfig: { registry } = {} }: PackageJson, { cwd, env }: CommonContext): string =>\n registry ??\n env.NPM_CONFIG_REGISTRY ??\n getRegistryUrl(\n (name as string).split(\"/\")[0] as string,\n rc(\"npm\", {\n config: env.NPM_CONFIG_USERCONFIG ?? resolve(cwd, \".npmrc\"),\n cwd,\n defaults: { registry: \"https://registry.npmjs.org/\" },\n }).config as AuthOptions[\"npmrc\"],\n );\n","// eslint-disable-next-line import/prefer-default-export\nexport const DEFAULT_NPM_REGISTRY = \"https://registry.npmjs.org/\";\n","import type { PackageJson } from \"@visulima/package\";\nimport normalizeUrl from \"normalize-url\";\n\nimport type { PublishContext } from \"../definitions/context\";\n\nexport interface ReleaseInfo {\n channel: string;\n name: string;\n url?: string;\n}\n\nexport const getReleaseInfo = (\n { name }: PackageJson,\n { env: { DEFAULT_NPM_REGISTRY = \"https://registry.npmjs.org/\" }, nextRelease: { version } }: PublishContext,\n distributionTag: string,\n registry: string,\n): ReleaseInfo => {\n return {\n channel: distributionTag,\n name: `pnpm package (@${distributionTag} dist-tag)`,\n url: normalizeUrl(registry) === normalizeUrl(DEFAULT_NPM_REGISTRY) ? `https://www.npmjs.com/package/${name}/v/${version}` : undefined,\n };\n};\n","import type { PackageJson } from \"@visulima/package\";\n\nimport type { PluginConfig } from \"../definitions/plugin-config\";\n\n/**\n * Returns null if `npmPublish` is not `false` and `pkg.private` is not\n * `true` or `pkg.workspaces` is not `undefined`.\n * Returns reason otherwise.\n */\nexport const reasonToNotPublish = (pluginConfig: PluginConfig, package_: PackageJson): string | null =>\n (pluginConfig.npmPublish === false\n ? \"npmPublish plugin option is false\"\n : package_.private === true && package_.workspaces === undefined\n ? \"package is private and has no workspaces\"\n : null);\n\nexport const shouldPublish = (pluginConfig: PluginConfig, package_: PackageJson): boolean => reasonToNotPublish(pluginConfig, package_) === null;\n","import { resolve } from \"@visulima/path\";\nimport { execa } from \"execa\";\nimport { moveFile } from \"move-file\";\n\nimport type { PrepareContext } from \"./definitions/context\";\nimport type { PluginConfig } from \"./definitions/plugin-config\";\n\nexport default async ({ pkgRoot, tarballDir }: PluginConfig, { cwd, env, logger, nextRelease: { version }, stderr, stdout }: PrepareContext): Promise<void> => {\n const basePath = pkgRoot ? resolve(cwd, pkgRoot) : cwd;\n\n logger.log(\"Write version %s to package.json in %s\", version, basePath);\n\n const versionResult = execa(\"pnpm\", [\"version\", version, \"--no-git-tag-version\", \"--allow-same-version\"], {\n cwd: basePath,\n env,\n preferLocal: true,\n });\n\n versionResult.stdout.pipe(stdout, { end: false });\n versionResult.stderr.pipe(stderr, { end: false });\n\n await versionResult;\n\n if (tarballDir) {\n logger.log(\"Creating npm package version %s\", version);\n\n const packResult = execa(\"pnpm\", [\"pack\", basePath], { cwd, env, preferLocal: true });\n\n packResult.stdout.pipe(stdout, { end: false });\n packResult.stderr.pipe(stderr, { end: false });\n\n // eslint-disable-next-line unicorn/no-await-expression-member\n const tarball = (await packResult).stdout.split(\"\\n\").pop() as string;\n const tarballSource = resolve(cwd, tarball);\n const tarballDestination = resolve(cwd, tarballDir.trim(), tarball);\n\n // Only move the tarball if we need to\n // Fixes: https://github.com/semantic-release/npm/issues/169\n if (tarballSource !== tarballDestination) {\n await moveFile(tarballSource, tarballDestination);\n }\n }\n};\n","import type { PackageJson } from \"@visulima/package\";\nimport { resolve } from \"@visulima/path\";\nimport AggregateError from \"aggregate-error\";\nimport { execa } from \"execa\";\n\nimport type { PublishContext } from \"./definitions/context\";\nimport type { PluginConfig } from \"./definitions/plugin-config\";\nimport getChannel from \"./utils/get-channel\";\nimport getRegistry from \"./utils/get-registry\";\nimport type { ReleaseInfo } from \"./utils/get-release-info\";\nimport { getReleaseInfo } from \"./utils/get-release-info\";\nimport { reasonToNotPublish, shouldPublish } from \"./utils/should-publish\";\n\nexport default async (pluginConfig: PluginConfig, package_: PackageJson, context: PublishContext): Promise<ReleaseInfo | false> => {\n const {\n cwd,\n env,\n logger,\n nextRelease: { channel, version },\n stderr,\n stdout,\n } = context;\n const { pkgRoot, publishBranch: publishBranchConfig } = pluginConfig;\n\n if (shouldPublish(pluginConfig, package_)) {\n const basePath = pkgRoot ? resolve(cwd, pkgRoot) : cwd;\n const registry = getRegistry(package_, context);\n const distributionTag = getChannel(channel);\n\n const { stdout: currentBranch } = await execa(\"git\", [\"rev-parse\", \"--abbrev-ref\", \"HEAD\"], {\n cwd,\n env,\n preferLocal: true,\n });\n const publishBranches = typeof publishBranchConfig === \"string\" && publishBranchConfig.split(\"|\");\n const isPublishBranch = publishBranches && publishBranches.includes(currentBranch);\n const publishBranch = isPublishBranch ? currentBranch : \"main\";\n\n logger.log(`Publishing version ${version} on branch ${publishBranch} to npm registry on dist-tag ${distributionTag}`);\n\n const pnpmArguments = [\"publish\", basePath, \"--publish-branch\", publishBranch, \"--tag\", distributionTag, \"--registry\", registry, \"--no-git-checks\"];\n\n if (pluginConfig.disableScripts) {\n pnpmArguments.push(\"--ignore-scripts\");\n }\n\n const result = execa(\"pnpm\", pnpmArguments, {\n cwd,\n env,\n preferLocal: true,\n });\n\n result.stdout.pipe(stdout, { end: false });\n result.stderr.pipe(stderr, { end: false });\n\n try {\n await result;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n } catch (error: any) {\n logger.log(`Failed to publish ${package_.name}@${version} to dist-tag @${distributionTag} on ${registry}: ${error.message ?? error}`);\n\n throw new AggregateError([error]);\n }\n\n logger.log(`Published ${package_.name}@${version} to dist-tag @${distributionTag} on ${registry}`);\n\n return getReleaseInfo(package_, context, distributionTag, registry);\n }\n\n logger.log(`Skip publishing to npm registry as ${reasonToNotPublish(pluginConfig, package_)}`);\n\n return false;\n};\n","// eslint-disable-next-line unicorn/prevent-abbreviations\nimport type { PackageJson } from \"@visulima/package\";\nimport { findPackageJson } from \"@visulima/package\";\nimport { resolve } from \"@visulima/path\";\nimport AggregateError from \"aggregate-error\";\n\nimport type { CommonContext } from \"../definitions/context\";\nimport getError from \"./get-error\";\n\ninterface Options {\n pkgRoot?: string;\n}\n\nexport default async ({ pkgRoot }: Options, { cwd }: { cwd: CommonContext[\"cwd\"] }): Promise<PackageJson> => {\n try {\n const { packageJson } = await findPackageJson(pkgRoot ? resolve(cwd, pkgRoot) : cwd);\n\n if (!packageJson.name) {\n throw new AggregateError([getError(\"ENOPKGNAME\")]);\n }\n\n return packageJson;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n } catch (error: any) {\n if (error.code === \"ENOENT\") {\n throw new AggregateError([getError(\"ENOPKG\")]);\n }\n\n throw error;\n }\n};\n","import AggregateError from \"aggregate-error\";\n\nimport type { VerifyConditionsContext } from \"../definitions/context\";\nimport type { PluginConfig } from \"../definitions/plugin-config\";\nimport getNpmrcPath from \"../utils/get-npmrc-path\";\nimport getPackage from \"../utils/get-pkg\";\nimport { shouldPublish } from \"../utils/should-publish\";\nimport verifyAuth from \"./verify-auth\";\nimport verifyConfig from \"./verify-config\";\nimport verifyPnpm from \"./verify-pnpm\";\n\nconst verify = async (pluginConfig: PluginConfig, context: VerifyConditionsContext): Promise<void> => {\n let errors: Error[] = verifyConfig(pluginConfig);\n\n try {\n await verifyPnpm(context);\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n } catch (error: any) {\n const typedError = error as AggregateError;\n\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n errors = [...errors, ...(typedError.errors ?? [error])];\n }\n\n try {\n const packageJson = await getPackage(pluginConfig, context);\n\n if (shouldPublish(pluginConfig, packageJson)) {\n const npmrc = getNpmrcPath(context.cwd, context.env);\n\n await verifyAuth(npmrc, packageJson, context);\n }\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n } catch (error: any) {\n const typedError = error as AggregateError;\n\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n errors = [...errors, ...(typedError.errors ?? [error])];\n }\n\n if (errors.length > 0) {\n throw new AggregateError(errors);\n }\n};\n\nexport default verify;\n","import type { PackageJson } from \"@visulima/package\";\nimport AggregateError from \"aggregate-error\";\nimport { execa } from \"execa\";\nimport normalizeUrl from \"normalize-url\";\n\nimport type { CommonContext } from \"../definitions/context\";\nimport getError from \"../utils/get-error\";\nimport getRegistry from \"../utils/get-registry\";\nimport setNpmrcAuth from \"../utils/set-npmrc-auth\";\n\nexport default async (npmrc: string, package_: PackageJson, context: CommonContext): Promise<void> => {\n const {\n cwd,\n env: { DEFAULT_NPM_REGISTRY = \"https://registry.npmjs.org/\", ...environment },\n logger,\n stderr,\n stdout,\n } = context;\n const registry = getRegistry(package_, context);\n\n await setNpmrcAuth(npmrc, registry, context);\n\n if (normalizeUrl(registry) === normalizeUrl(DEFAULT_NPM_REGISTRY)) {\n try {\n logger.log(`Running \"pnpm whoami\" to verify authentication on registry \"${registry}\"`);\n\n const whoamiResult = execa(\"pnpm\", [\"whoami\", \"--userconfig\", npmrc, \"--registry\", registry], {\n cwd,\n env: environment,\n preferLocal: true,\n });\n\n whoamiResult.stdout.pipe(stdout, { end: false });\n whoamiResult.stderr.pipe(stderr, { end: false });\n\n await whoamiResult;\n } catch {\n throw new AggregateError([getError(\"EINVALIDNPMTOKEN\", { registry })]);\n }\n } else {\n logger.log(`Skipping authentication verification for non-default registry \"${registry}\"`);\n }\n};\n","import { rc } from \"@anolilab/rc\";\nimport { writeFile } from \"@visulima/fs\";\nimport { resolve } from \"@visulima/path\";\nimport AggregateError from \"aggregate-error\";\nimport { stringify } from \"ini\";\nimport type { AuthOptions } from \"registry-auth-token\";\nimport getAuthToken from \"registry-auth-token\";\n\nimport { DEFAULT_NPM_REGISTRY } from \"../definitions/constants\";\nimport type { CommonContext } from \"../definitions/context\";\nimport getError from \"./get-error\";\nimport nerfDart from \"./nerf-dart\";\n\nexport default async (\n npmrc: string,\n registry: string,\n { cwd, env: { NPM_CONFIG_USERCONFIG, NPM_EMAIL, NPM_PASSWORD, NPM_TOKEN, NPM_USERNAME }, logger }: CommonContext,\n): Promise<void> => {\n logger.log(\"Verify authentication for registry %s\", registry);\n\n const { config, files } = rc(\"npm\", {\n config: NPM_CONFIG_USERCONFIG ?? resolve(cwd, \".npmrc\"),\n cwd,\n defaults: { registry: DEFAULT_NPM_REGISTRY },\n });\n\n if (Array.isArray(files)) {\n logger.log(\"Reading npm config from %s\", files.join(\", \"));\n }\n\n if (getAuthToken(registry, { npmrc: config } as AuthOptions)) {\n await writeFile(npmrc, stringify(config));\n\n return;\n }\n\n if (NPM_USERNAME && NPM_PASSWORD && NPM_EMAIL) {\n await writeFile(npmrc, `${Object.keys(config).length > 0 ? `${stringify(config)}\\n` : \"\"}_auth = \\${LEGACY_TOKEN}\\nemail = \\${NPM_EMAIL}`);\n\n logger.log(`Wrote NPM_USERNAME, NPM_PASSWORD, and NPM_EMAIL to ${npmrc}`);\n } else if (NPM_TOKEN) {\n await writeFile(npmrc, `${Object.keys(config).length > 0 ? `${stringify(config)}\\n` : \"\"}${nerfDart(registry)}:_authToken = \\${NPM_TOKEN}`);\n\n logger.log(`Wrote NPM_TOKEN to ${npmrc}`);\n } else {\n throw new AggregateError([getError(\"ENONPMTOKEN\", { registry })]);\n }\n};\n","import { URL } from \"node:url\";\n\n/**\n * Maps a URL to an identifier.\n *\n * The ISC License\n * Copyright (c) npm, Inc.\n *\n * Name courtesy schiffertronix media LLC, a New Jersey corporation\n *\n * @param {String} url The URL to be nerfed.\n *\n * @returns {String} A nerfed URL.\n */\nconst nerfDart = (url: string): string => {\n const parsed = new URL(url);\n const from = `${parsed.protocol}//${parsed.host}${parsed.pathname}`;\n const real = new URL(\".\", from);\n\n return `//${real.host}${real.pathname}`;\n};\n\nexport default nerfDart;\n","import type SemanticReleaseError from \"@semantic-release/error\";\n\nimport type { PluginConfig } from \"../definitions/plugin-config\";\nimport getError from \"../utils/get-error\";\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst isString = (value: any): boolean => typeof value === \"string\";\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst isNil = (value: any): boolean => value === null || value === undefined;\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst isNonEmptyString = (value: any): boolean => {\n if (!isString(value)) {\n return false;\n }\n\n return (value as string).trim() !== \"\";\n};\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype ValidatorFunction = (value: any) => boolean;\n\nconst VALIDATORS: Record<string, ValidatorFunction> = {\n branches: Array.isArray,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n npmPublish: (value: any): boolean => typeof value === \"boolean\",\n pkgRoot: isNonEmptyString,\n publishBranch: isNonEmptyString,\n tarballDir: isNonEmptyString,\n};\n\nexport default (config: PluginConfig): SemanticReleaseError[] =>\n // eslint-disable-next-line unicorn/no-array-reduce\n Object.entries(config).reduce<SemanticReleaseError[]>((errors, [option, value]) => {\n if (isNil(value)) {\n return errors;\n }\n\n if (!(option in VALIDATORS)) {\n return errors;\n }\n\n // eslint-disable-next-line security/detect-object-injection\n if (VALIDATORS[option]?.(value)) {\n return errors;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return [...errors, getError(`EINVALID${option.toUpperCase()}` as any, { [option]: value })];\n }, []);\n","import { getPackageManagerVersion } from \"@visulima/package\";\nimport AggregateError from \"aggregate-error\";\nimport { gte } from \"semver\";\n\nimport type { CommonContext } from \"../definitions/context\";\nimport getError from \"../utils/get-error\";\n\nconst MIN_PNPM_VERSION = \"8.0.0\";\n\nexport default async function verifyPnpm({ logger }: CommonContext): Promise<void> {\n logger.log(`Verify pnpm version is >= ${MIN_PNPM_VERSION}`);\n\n const version = getPackageManagerVersion(\"pnpm\");\n\n if (version !== \"pnpm\") {\n throw new AggregateError([new Error(\"pnpm is not installed\")]);\n }\n\n if (gte(MIN_PNPM_VERSION, version)) {\n throw new AggregateError([getError(\"EINVALIDPNPM\", { version: String(version) })]);\n }\n}\n","import addChannelNpm from \"./add-channel\";\nimport type { AddChannelContext, PrepareContext, PublishContext, VerifyConditionsContext } from \"./definitions/context\";\nimport type { PluginConfig } from \"./definitions/plugin-config\";\nimport prepareNpm from \"./prepare\";\nimport publishNpm from \"./publish\";\nimport getPackage from \"./utils/get-pkg\";\nimport type { ReleaseInfo } from \"./utils/get-release-info\";\nimport verify from \"./verify\";\n\nconst PLUGIN_NAME = \"semantic-release-pnpm\";\n\nlet verified: boolean;\nlet prepared: boolean;\n\nexport const verifyConditions = async (pluginConfig: PluginConfig, context: VerifyConditionsContext): Promise<void> => {\n /**\n * If the plugin is used and has `npmPublish`, `tarballDir` or\n * `pkgRoot` configured, validate them now in order to prevent any release if\n * the configuration is wrong\n */\n if (context.options.publish) {\n const publish = Array.isArray(context.options.publish) ? context.options.publish : [context.options.publish];\n\n const publishPlugin = publish.find((config) => config.path && config.path === PLUGIN_NAME) || {};\n\n // eslint-disable-next-line no-param-reassign\n pluginConfig.npmPublish = pluginConfig.npmPublish ?? publishPlugin.npmPublish;\n // eslint-disable-next-line no-param-reassign\n pluginConfig.tarballDir = pluginConfig.tarballDir ?? publishPlugin.tarballDir;\n // eslint-disable-next-line no-param-reassign\n pluginConfig.pkgRoot = pluginConfig.pkgRoot ?? publishPlugin.pkgRoot;\n // eslint-disable-next-line no-param-reassign\n pluginConfig.disableScripts = pluginConfig.disableScripts ?? publishPlugin.disableScripts;\n // eslint-disable-next-line no-param-reassign\n pluginConfig.branches = pluginConfig.branches ?? publishPlugin.branches;\n }\n\n await verify(pluginConfig, context);\n\n verified = true;\n};\n\nexport const prepare = async (pluginConfig: PluginConfig, context: PrepareContext): Promise<void> => {\n if (!verified) {\n await verify(pluginConfig, context);\n }\n\n await prepareNpm(pluginConfig, context);\n\n prepared = true;\n};\n\nexport const publish = async (pluginConfig: PluginConfig, context: PublishContext): Promise<ReleaseInfo | false> => {\n const packageJson = await getPackage(pluginConfig, context);\n\n if (!verified) {\n await verify(pluginConfig, context);\n }\n\n if (!prepared) {\n await prepareNpm(pluginConfig, context);\n }\n\n return await publishNpm(pluginConfig, packageJson, context);\n};\n\nexport const addChannel = async (pluginConfig: PluginConfig, context: AddChannelContext): Promise<ReleaseInfo | false> => {\n if (!verified) {\n await verify(pluginConfig, context);\n }\n\n const packageJson = await getPackage(pluginConfig, context);\n\n return await addChannelNpm(pluginConfig, packageJson, context);\n};\n"]}
|
package/package.json
CHANGED
|
@@ -1,148 +1,144 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
"
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
"
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
"
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
"
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
"
|
|
115
|
-
"
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
"
|
|
124
|
-
|
|
2
|
+
"name": "@anolilab/semantic-release-pnpm",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Semantic-release plugin to publish a npm package with pnpm.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"anolilab",
|
|
7
|
+
"npm",
|
|
8
|
+
"pnpm",
|
|
9
|
+
"publish",
|
|
10
|
+
"monorepo",
|
|
11
|
+
"semantic-release",
|
|
12
|
+
"semantic-release-plugin",
|
|
13
|
+
"semantic-release-pnpm"
|
|
14
|
+
],
|
|
15
|
+
"homepage": "https://github.com/anolilab/semantic-release/tree/main/packages/semantic-release-pnpm",
|
|
16
|
+
"bugs": {
|
|
17
|
+
"url": "https://github.com/anolilab/semantic-release/issues"
|
|
18
|
+
},
|
|
19
|
+
"repository": {
|
|
20
|
+
"type": "git",
|
|
21
|
+
"url": "git+https://github.com/anolilab/semantic-release.git",
|
|
22
|
+
"directory": "packages/semantic-release-pnpm"
|
|
23
|
+
},
|
|
24
|
+
"funding": [
|
|
25
|
+
{
|
|
26
|
+
"type": "github",
|
|
27
|
+
"url": "https://github.com/sponsors/prisis"
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"type": "consulting",
|
|
31
|
+
"url": "https://anolilab.com/support"
|
|
32
|
+
}
|
|
33
|
+
],
|
|
34
|
+
"license": "MIT",
|
|
35
|
+
"author": {
|
|
36
|
+
"name": "Daniel Bannert",
|
|
37
|
+
"email": "d.bannert@anolilab.de"
|
|
38
|
+
},
|
|
39
|
+
"sideEffects": false,
|
|
40
|
+
"type": "module",
|
|
41
|
+
"exports": "./dist/index.js",
|
|
42
|
+
"main": "dist/index.js",
|
|
43
|
+
"types": "dist/index.d.ts",
|
|
44
|
+
"files": [
|
|
45
|
+
"dist",
|
|
46
|
+
"README.md",
|
|
47
|
+
"CHANGELOG.md"
|
|
48
|
+
],
|
|
49
|
+
"scripts": {
|
|
50
|
+
"build": "cross-env NODE_ENV=development tsup",
|
|
51
|
+
"build:prod": "cross-env NODE_ENV=production tsup",
|
|
52
|
+
"clean": "rimraf node_modules dist .eslintcache",
|
|
53
|
+
"dev": "pnpm run build --watch",
|
|
54
|
+
"lint:eslint": "eslint . --ext js,cjs,mjs,jsx,ts,tsx,json,yaml,yml,md,mdx --max-warnings=0 --config .eslintrc.cjs",
|
|
55
|
+
"lint:eslint:fix": "eslint . --ext js,cjs,mjs,jsx,ts,tsx,json,yaml,yml,md,mdx --max-warnings=0 --config .eslintrc.cjs --fix",
|
|
56
|
+
"lint:package-json": "publint --strict",
|
|
57
|
+
"lint:prettier": "prettier --config=.prettierrc.cjs --check .",
|
|
58
|
+
"lint:prettier:fix": "prettier --config=.prettierrc.cjs --write .",
|
|
59
|
+
"lint:types": "tsc --noEmit",
|
|
60
|
+
"test": "vitest run",
|
|
61
|
+
"test:coverage": "vitest run --coverage",
|
|
62
|
+
"test:ui": "vitest --ui --coverage.enabled=true",
|
|
63
|
+
"test:watch": "vitest"
|
|
64
|
+
},
|
|
65
|
+
"dependencies": {
|
|
66
|
+
"@anolilab/rc": "1.0.0",
|
|
67
|
+
"@semantic-release/error": "^4.0.0",
|
|
68
|
+
"@visulima/fs": "^2.1.1",
|
|
69
|
+
"@visulima/package": "1.8.1",
|
|
70
|
+
"@visulima/path": "^1.0.0",
|
|
71
|
+
"aggregate-error": "^5.0.0",
|
|
72
|
+
"execa": "^9.1.0",
|
|
73
|
+
"ini": "4.1.2",
|
|
74
|
+
"move-file": "^3.1.0",
|
|
75
|
+
"normalize-url": "^8.0.1",
|
|
76
|
+
"registry-auth-token": "^5.0.2",
|
|
77
|
+
"semver": "^7.6.2"
|
|
78
|
+
},
|
|
79
|
+
"devDependencies": {
|
|
80
|
+
"@anolilab/eslint-config": "^15.0.3",
|
|
81
|
+
"@anolilab/prettier-config": "^5.0.14",
|
|
82
|
+
"@anolilab/semantic-release-preset": "^8.0.3",
|
|
83
|
+
"@babel/core": "^7.24.3",
|
|
84
|
+
"@rushstack/eslint-plugin-security": "^0.8.1",
|
|
85
|
+
"@secretlint/secretlint-rule-preset-recommend": "^8.1.2",
|
|
86
|
+
"@semantic-release/changelog": "^6.0.3",
|
|
87
|
+
"@semantic-release/git": "^10.0.1",
|
|
88
|
+
"@semantic-release/github": "^10.0.4",
|
|
89
|
+
"@types/dockerode": "^3.3.29",
|
|
90
|
+
"@types/ini": "^4.1.0",
|
|
91
|
+
"@types/node": "18.18.14",
|
|
92
|
+
"@types/semantic-release__error": "3.0.3",
|
|
93
|
+
"@types/semver": "7.5.8",
|
|
94
|
+
"@types/stream-buffers": "^3.0.7",
|
|
95
|
+
"@vitest/coverage-v8": "^1.4.0",
|
|
96
|
+
"@vitest/ui": "^1.4.0",
|
|
97
|
+
"cross-env": "^7.0.3",
|
|
98
|
+
"dockerode": "4.0.2",
|
|
99
|
+
"eslint": "^8.57.0",
|
|
100
|
+
"eslint-plugin-deprecation": "^2.0.0",
|
|
101
|
+
"eslint-plugin-editorconfig": "^4.0.3",
|
|
102
|
+
"eslint-plugin-import": "npm:eslint-plugin-i@2.29.1",
|
|
103
|
+
"eslint-plugin-mdx": "^3.1.5",
|
|
104
|
+
"eslint-plugin-n": "^17.7.0",
|
|
105
|
+
"eslint-plugin-vitest": "^0.4.1",
|
|
106
|
+
"eslint-plugin-vitest-globals": "^1.5.0",
|
|
107
|
+
"eslint-plugin-you-dont-need-lodash-underscore": "^6.14.0",
|
|
108
|
+
"get-stream": "9.0.1",
|
|
109
|
+
"got": "^14.2.1",
|
|
110
|
+
"p-retry": "^6.2.0",
|
|
111
|
+
"prettier": "^3.2.5",
|
|
112
|
+
"rimraf": "^5.0.5",
|
|
113
|
+
"secretlint": "8.1.2",
|
|
114
|
+
"semantic-release": "^23.0.5",
|
|
115
|
+
"sort-package-json": "^2.8.0",
|
|
116
|
+
"stream-buffers": "^3.0.2",
|
|
117
|
+
"tempy": "^3.1.0",
|
|
118
|
+
"tsup": "^8.0.2",
|
|
119
|
+
"typescript": "^5.4.3",
|
|
120
|
+
"vitest": "^1.4.0"
|
|
121
|
+
},
|
|
122
|
+
"engines": {
|
|
123
|
+
"node": ">=18.* <=21.*"
|
|
124
|
+
},
|
|
125
|
+
"publishConfig": {
|
|
126
|
+
"access": "public",
|
|
127
|
+
"provenance": true
|
|
128
|
+
},
|
|
129
|
+
"anolilab": {
|
|
130
|
+
"eslint-config": {
|
|
131
|
+
"plugin": {
|
|
132
|
+
"etc": false,
|
|
133
|
+
"tsdoc": false
|
|
134
|
+
},
|
|
135
|
+
"warn_on_unsupported_typescript_version": false,
|
|
136
|
+
"info_on_disabling_jsx_react_rule": false,
|
|
137
|
+
"info_on_disabling_prettier_conflict_rule": false,
|
|
138
|
+
"info_on_disabling_jsonc_sort_keys_rule": false,
|
|
139
|
+
"import_ignore_exports": [
|
|
140
|
+
"**/*.cjs"
|
|
141
|
+
]
|
|
142
|
+
}
|
|
125
143
|
}
|
|
126
|
-
|
|
127
|
-
"scripts": {
|
|
128
|
-
"build": "cross-env NODE_ENV=development tsup",
|
|
129
|
-
"build:prod": "cross-env NODE_ENV=production tsup",
|
|
130
|
-
"lint:eslint": "eslint . --ext js,cjs,mjs,jsx,ts,tsx,json,yaml,yml,md,mdx --max-warnings=0 --config .eslintrc.cjs",
|
|
131
|
-
"lint:eslint:fix": "pnpm run lint:eslint --fix",
|
|
132
|
-
"lint:fix": "pnpm run lint:prettier:fix && pnpm run lint:eslint:fix",
|
|
133
|
-
"lint:packagejson": "publint --strict",
|
|
134
|
-
"lint:prettier": "prettier --config=.prettierrc.cjs --check .",
|
|
135
|
-
"lint:prettier:fix": "prettier --config=.prettierrc.cjs --write .",
|
|
136
|
-
"lint:secrets": "secretlint **/*",
|
|
137
|
-
"lint:staged": "lint-staged --verbose --concurrent false --debug",
|
|
138
|
-
"lint:text": "textlint ./.github/ ./README.md ./UPGRADE.md --parallel --experimental --cache --dry-run",
|
|
139
|
-
"lint:text:fix": "textlint ./.github/ ./README.md ./UPGRADE.md --parallel --experimental --fix",
|
|
140
|
-
"lint:types": "tsc --noEmit",
|
|
141
|
-
"sort-package-json": "sort-package-json ./package.json",
|
|
142
|
-
"test": "vitest run",
|
|
143
|
-
"test:bench": "vitest bench",
|
|
144
|
-
"test:coverage": "vitest run --coverage",
|
|
145
|
-
"test:watch": "vitest",
|
|
146
|
-
"update:deps": "taze"
|
|
147
|
-
}
|
|
148
|
-
}
|
|
144
|
+
}
|