@anolilab/semantic-release-clean-package-json 5.5.17 → 5.5.19
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 +30 -0
- package/README.md +1 -1
- package/dist/index.js +2 -1
- package/package.json +2 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,33 @@
|
|
|
1
|
+
## @anolilab/semantic-release-clean-package-json [5.5.19](https://github.com/anolilab/semantic-release/compare/@anolilab/semantic-release-clean-package-json@5.5.18...@anolilab/semantic-release-clean-package-json@5.5.19) (2026-09-08)
|
|
2
|
+
|
|
3
|
+
### Bug Fixes
|
|
4
|
+
|
|
5
|
+
* **lint:** type rc and clean-package-json instead of asserting past the checks ([#425](https://github.com/anolilab/semantic-release/issues/425)) ([5dd68e2](https://github.com/anolilab/semantic-release/commit/5dd68e252cd84f6994854f596960e8be551e0f92))
|
|
6
|
+
|
|
7
|
+
### Miscellaneous Chores
|
|
8
|
+
|
|
9
|
+
* point every Discord link at the anolilab server ([8cee2ca](https://github.com/anolilab/semantic-release/commit/8cee2ca80ba2b7bac1af7a1ead62441492afa001))
|
|
10
|
+
|
|
11
|
+
### Code Refactoring
|
|
12
|
+
|
|
13
|
+
* serialize manifests through one shared helper ([18c6e0a](https://github.com/anolilab/semantic-release/commit/18c6e0a8e5658c34d12d444c9b1ed4563cb5b393))
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
### Dependencies
|
|
17
|
+
|
|
18
|
+
* **@anolilab/semantic-release-pnpm:** upgraded to 8.1.22
|
|
19
|
+
|
|
20
|
+
## @anolilab/semantic-release-clean-package-json [5.5.18](https://github.com/anolilab/semantic-release/compare/@anolilab/semantic-release-clean-package-json@5.5.17...@anolilab/semantic-release-clean-package-json@5.5.18) (2026-08-20)
|
|
21
|
+
|
|
22
|
+
### Bug Fixes
|
|
23
|
+
|
|
24
|
+
* **ci:** unbreak eslint on main ([b60faae](https://github.com/anolilab/semantic-release/commit/b60faaecf512768c5c420eab2167fca92b9faa8d))
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
### Dependencies
|
|
28
|
+
|
|
29
|
+
* **@anolilab/semantic-release-pnpm:** upgraded to 8.1.20
|
|
30
|
+
|
|
1
31
|
## @anolilab/semantic-release-clean-package-json [5.5.17](https://github.com/anolilab/semantic-release/compare/@anolilab/semantic-release-clean-package-json@5.5.16...@anolilab/semantic-release-clean-package-json@5.5.17) (2026-08-19)
|
|
2
32
|
|
|
3
33
|
### Bug Fixes
|
package/README.md
CHANGED
|
@@ -277,7 +277,7 @@ The anolilab semantic-release-clean-package-json is open-sourced software licens
|
|
|
277
277
|
[prs-welcome-badge]: https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=for-the-badge
|
|
278
278
|
[prs-welcome]: https://github.com/anolilab/multi-semantic-release/blob/main/.github/CONTRIBUTING.md
|
|
279
279
|
[chat-badge]: https://img.shields.io/discord/902465130518949899.svg?style=for-the-badge
|
|
280
|
-
[chat]: https://discord.gg/
|
|
280
|
+
[chat]: https://discord.gg/eajEZvk2PG
|
|
281
281
|
[typescript-badge]: https://img.shields.io/badge/Typescript-294E80.svg?style=for-the-badge&logo=typescript
|
|
282
282
|
[typescript-url]: https://www.typescriptlang.org/
|
|
283
283
|
[license-url]: LICENSE.md
|
package/dist/index.js
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
import{createRequire as
|
|
1
|
+
import{createRequire as v}from"node:module";import{findUp as O,readJson as w,isAccessible as j,readFile as h,writeFile as l}from"@visulima/fs";import{resolve as f,join as g}from"@visulima/path";import{LF as u,detect as P,format as q}from"@visulima/fs/eol";import M from"detect-indent";import{NotFoundError as A}from"@visulima/fs/error";import K from"@semantic-release/error";let N;const _=o=>(N??=v(import.meta.url))(o),c=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,E=o=>{if(typeof c<"u"&&c.versions&&c.versions.node){const[e,s]=c.versions.node.split(".").map(Number);if(e>22||e===22&&s>=3||e===20&&s>=16)return c.getBuiltinModule(o)}return _(o)},{rm:R}=E("node:fs/promises"),x=2,m=(o,e)=>{if(!e)return`${JSON.stringify(o,void 0,x)}${u}`;const s=P(e)??u,n=JSON.stringify(o,void 0,M(e).indent);return q(n,s)+(e.endsWith(`
|
|
2
|
+
`)?s:"")},D=["name","version","private","publishConfig","scripts.preinstall","scripts.install","scripts.postinstall","scripts.dependencies","files","bin","browser","main","man","jsdelivr","unpkg","dependencies","peerDependencies","peerDependenciesMeta","bundledDependencies","optionalDependencies","engines","os","cpu","description","keywords","author","contributors","license","homepage","repository","bugs","funding","type","exports","imports","sponsor","publisher","displayName","categories","galleryBanner","preview","contributes","activationEvents","badges","markdown","qna","extensionPack","extensionDependencies","extensionKind","icon","fesm2020","fesm2015","esm2020","es2020","types","typings","typesVersions","module","sideEffects"],J={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`."})},k=(o,e={})=>{const{details:s,message:n}=J[o](e);return new K(n,o,s)},T=async o=>{const e={type:"file"};o&&(e.cwd=o);const s=await O("package.json",e);if(!s)throw new A("No such file or directory, for package.json found.");return{packageJson:await w(s),path:s}},y=async({pkgRoot:o},{cwd:e})=>{try{const{packageJson:s}=await T(o?f(e,o):e);if(!s.name){const n=k("ENOPKGNAME");throw new AggregateError([n],n.message)}return s}catch(s){if(s instanceof Error&&"code"in s&&s.code==="ENOENT"){const n=k("ENOPKG");throw new AggregateError([n],n.message,{cause:s})}throw s}},U=async(o,e)=>{const s=await y(o,e),n=o.pkgRoot?f(e.cwd,o.pkgRoot):e.cwd,r=g(n,"package.json"),p=await j(r)?await h(r):void 0;await l(g(n,"package.json.back"),m(s,p)),e.logger.log("Created a backup of the package.json file.");const a=o.keep??[],d=new Set([...D,...a]);e.logger.log(`Keeping the following properties: ${[...d].join(", ")}`);const t={...s},b=()=>{if(!t.scripts)return!1;for(const i in t.scripts)d.has(`scripts.${i}`)||delete t.scripts[i];return Object.keys(t.scripts).length>0};for(const i in t)d.has(i)||i==="scripts"&&b()||(e.logger.log(`Removing property "${i}"`),delete t[i]);await l(r,m(t,p))},V=async(o,e)=>{const s=o.pkgRoot?f(e.cwd,o.pkgRoot):e.cwd,n=g(s,"package.json.back");if(await j(n)){const r=await y(o,e),p=await h(n),a=await w(n);r.version===void 0?delete a.version:a.version=r.version,await l(g(s,"package.json"),m(a,p)),await R(n),e.logger.log("Restored modified package.json from backup.")}else e.logger.error("No backup package.json found.")};export{U as publish,V as success};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@anolilab/semantic-release-clean-package-json",
|
|
3
|
-
"version": "5.5.
|
|
3
|
+
"version": "5.5.19",
|
|
4
4
|
"description": "Clean package.json before publish by removing unnecessary properties.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"anolilab",
|
|
@@ -61,6 +61,7 @@
|
|
|
61
61
|
"@semantic-release/error": "^4.0.0",
|
|
62
62
|
"@visulima/fs": "^5.1.0",
|
|
63
63
|
"@visulima/path": "^3.0.0",
|
|
64
|
+
"detect-indent": "^7.0.2",
|
|
64
65
|
"type-fest": "5.8.0"
|
|
65
66
|
},
|
|
66
67
|
"engines": {
|