@anolilab/semantic-release-clean-package-json 5.5.18 → 5.5.20

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 CHANGED
@@ -1,3 +1,29 @@
1
+ ## @anolilab/semantic-release-clean-package-json [5.5.20](https://github.com/anolilab/semantic-release/compare/@anolilab/semantic-release-clean-package-json@5.5.19...@anolilab/semantic-release-clean-package-json@5.5.20) (2026-09-13)
2
+
3
+
4
+ ### Dependencies
5
+
6
+ * **@anolilab/semantic-release-pnpm:** upgraded to 8.1.24
7
+
8
+ ## @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)
9
+
10
+ ### Bug Fixes
11
+
12
+ * **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))
13
+
14
+ ### Miscellaneous Chores
15
+
16
+ * point every Discord link at the anolilab server ([8cee2ca](https://github.com/anolilab/semantic-release/commit/8cee2ca80ba2b7bac1af7a1ead62441492afa001))
17
+
18
+ ### Code Refactoring
19
+
20
+ * serialize manifests through one shared helper ([18c6e0a](https://github.com/anolilab/semantic-release/commit/18c6e0a8e5658c34d12d444c9b1ed4563cb5b393))
21
+
22
+
23
+ ### Dependencies
24
+
25
+ * **@anolilab/semantic-release-pnpm:** upgraded to 8.1.22
26
+
1
27
  ## @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)
2
28
 
3
29
  ### 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/TtFJY8xkFK
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 k}from"node:module";import{findUp as b,readJson as u,writeJson as g,isAccessible as v}from"@visulima/fs";import{resolve as d,join as c}from"@visulima/path";import{NotFoundError as _}from"@visulima/fs/error";import E from"@semantic-release/error";let w;const j=o=>(w??=k(import.meta.url))(o),a=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,h=o=>{if(typeof a<"u"&&a.versions&&a.versions.node){const[e,s]=a.versions.node.split(".").map(Number);if(e>22||e===22&&s>=3||e===20&&s>=16)return a.getBuiltinModule(o)}return j(o)},{rm:y}=h("node:fs/promises"),N=["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"],R={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`."})},l=(o,e={})=>{const{details:s,message:n}=R[o](e);return new E(n,o,s)},P=async o=>{const e={type:"file"};o&&(e.cwd=o);const s=await b("package.json",e);if(!s)throw new _("No such file or directory, for package.json found.");return{packageJson:await u(s),path:s}},m=async({pkgRoot:o},{cwd:e})=>{try{const{packageJson:s}=await P(o?d(e,o):e);if(!s.name){const n=l("ENOPKGNAME");throw new AggregateError([n],n.message)}return s}catch(s){if(s instanceof Error&&"code"in s&&s.code==="ENOENT"){const n=l("ENOPKG");throw new AggregateError([n],n.message,{cause:s})}throw s}},x=async(o,e)=>{const s=await m(o,e),n=o.pkgRoot?d(e.cwd,o.pkgRoot):e.cwd;await g(c(n,"package.json.back"),s,{detectIndent:!0}),e.logger.log("Created a backup of the package.json file.");const p=o.keep??[],i=new Set([...N,...p]);e.logger.log(`Keeping the following properties: ${[...i].join(", ")}`);const t={...s},f=()=>{if(!t.scripts)return!1;for(const r in t.scripts)i.has(`scripts.${r}`)||delete t.scripts[r];return Object.keys(t.scripts).length>0};for(const r in t)i.has(r)||r==="scripts"&&f()||(e.logger.log(`Removing property "${r}"`),delete t[r]);await g(c(n,"package.json"),t,{detectIndent:!0})},D=async(o,e)=>{const s=o.pkgRoot?d(e.cwd,o.pkgRoot):e.cwd,n=c(s,"package.json.back");if(await v(n)){const p=await m(o,e),i=await u(n);i.version=p.version,await g(c(s,"package.json"),i,{detectIndent:!0,overwrite:!0}),await y(n),e.logger.log("Restored modified package.json from backup.")}else e.logger.error("No backup package.json found.")};export{x as publish,D as success};
1
+ import{createRequire as v}from"node:module";import{findUp as J,readJson as w,isAccessible as h,readFile as j,writeFile as l}from"@visulima/fs";import{resolve as m,join as d}from"@visulima/path";import{LF as u,detect as R,format as M}from"@visulima/fs/eol";import O from"detect-indent";import{NotFoundError as q}from"@visulima/fs/error";import A from"@semantic-release/error";let E;const N=o=>(E??=v(import.meta.url))(o),c=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,P=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 N(o)},{rm:_}=P("node:fs/promises"),D=2,f=(o,e)=>{if(!e)return`${JSON.stringify(o,void 0,D)}${u}`;const s=R(e)??u,r=JSON.stringify(o,void 0,O(e).indent);return M(r,s)+(e.endsWith(`
2
+ `)?s:"")},K=["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"],T={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:r}=T[o](e);return new A(r,o,s)},F=async o=>{const e={type:"file"};o&&(e.cwd=o);const s=await J("package.json",e);if(!s)throw new q("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 F(o?m(e,o):e);if(!s.name){const r=k("ENOPKGNAME");throw new AggregateError([r],r.message)}return s}catch(s){if(s instanceof Error&&"code"in s&&s.code==="ENOENT"){const r=k("ENOPKG");throw new AggregateError([r],r.message,{cause:s})}throw s}},I=async(o,e)=>{const s=await y(o,e),r=o.pkgRoot?m(e.cwd,o.pkgRoot):e.cwd,a=d(r,"package.json"),p=await h(a)?await j(a):void 0;await l(d(r,"package.json.back"),f(s,p)),e.logger.log("Created a backup of the package.json file.");const i=o.keep??[],g=new Set([...K,...i]);e.logger.log(`Keeping the following properties: ${[...g].join(", ")}`);const t={...s},b=()=>{if(!t.scripts)return!1;for(const n in t.scripts)g.has(`scripts.${n}`)||delete t.scripts[n];return Object.keys(t.scripts).length>0};for(const n in t)g.has(n)||n==="scripts"&&b()||(e.logger.log(`Removing property "${n}"`),delete t[n]);await l(a,f(t,p))},L=async(o,e)=>{const s=o.pkgRoot?m(e.cwd,o.pkgRoot):e.cwd,r=d(s,"package.json.back");if(await h(r)){const a=await y(o,e),p=await j(r),i=await w(r);a.version===void 0?delete i.version:i.version=a.version,await l(d(s,"package.json"),f(i,p)),await _(r),e.logger.log("Restored modified package.json from backup.")}else e.logger.error("No backup package.json found.")};export{I as publish,L 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.18",
3
+ "version": "5.5.20",
4
4
  "description": "Clean package.json before publish by removing unnecessary properties.",
5
5
  "keywords": [
6
6
  "anolilab",
@@ -60,7 +60,8 @@
60
60
  "dependencies": {
61
61
  "@semantic-release/error": "^4.0.0",
62
62
  "@visulima/fs": "^5.1.0",
63
- "@visulima/path": "^3.0.0",
63
+ "@visulima/path": "^3.1.0",
64
+ "detect-indent": "^7.0.2",
64
65
  "type-fest": "5.8.0"
65
66
  },
66
67
  "engines": {