@anolilab/semantic-release-clean-package-json 3.0.2 → 3.0.4

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,37 @@
1
+ ## @anolilab/semantic-release-clean-package-json [3.0.4](https://github.com/anolilab/semantic-release/compare/@anolilab/semantic-release-clean-package-json@3.0.3...@anolilab/semantic-release-clean-package-json@3.0.4) (2025-09-22)
2
+
3
+ ### Bug Fixes
4
+
5
+ * **deps:** update dependencies across multiple packages ([150593f](https://github.com/anolilab/semantic-release/commit/150593fec51e1646e8bc5d8aa9db76a8370d42c1))
6
+ * update dependencies and configuration across multiple packages ([9c9b4cb](https://github.com/anolilab/semantic-release/commit/9c9b4cb5b1f9e172f2e1ce509491b950ae448c09))
7
+ * update dependencies and improve configuration ([de0cf70](https://github.com/anolilab/semantic-release/commit/de0cf702c2c5217203409b475f96061702806475))
8
+ * update Nx version and adjust package configurations ([d39ef78](https://github.com/anolilab/semantic-release/commit/d39ef78b608486214ca3a73c5903c00798e7c456))
9
+ * update package dependencies and configurations ([8241a76](https://github.com/anolilab/semantic-release/commit/8241a762582a25742d385d8cf113851ac8b9b801))
10
+
11
+ ### Code Refactoring
12
+
13
+ * simplify packem configuration and improve comments ([592de5b](https://github.com/anolilab/semantic-release/commit/592de5b367a448974fc41fd7336e01ba4865a4cf))
14
+
15
+
16
+ ### Dependencies
17
+
18
+ * **@anolilab/semantic-release-pnpm:** upgraded to 2.0.4
19
+
20
+ ## @anolilab/semantic-release-clean-package-json [3.0.3](https://github.com/anolilab/semantic-release/compare/@anolilab/semantic-release-clean-package-json@3.0.2...@anolilab/semantic-release-clean-package-json@3.0.3) (2025-07-31)
21
+
22
+ ### Bug Fixes
23
+
24
+ * update dependencies and improve configuration ([91c8546](https://github.com/anolilab/semantic-release/commit/91c8546aaa2f093f0f36b407b1bd4e4be34decbc))
25
+
26
+ ### Documentation
27
+
28
+ * add or update JSDoc comments ([#172](https://github.com/anolilab/semantic-release/issues/172)) ([d392c82](https://github.com/anolilab/semantic-release/commit/d392c8249ed88538f18cbbd9a337730e703cf5f8))
29
+
30
+
31
+ ### Dependencies
32
+
33
+ * **@anolilab/semantic-release-pnpm:** upgraded to 2.0.3
34
+
1
35
  ## @anolilab/semantic-release-clean-package-json [3.0.2](https://github.com/anolilab/semantic-release/compare/@anolilab/semantic-release-clean-package-json@3.0.1...@anolilab/semantic-release-clean-package-json@3.0.2) (2025-07-02)
2
36
 
3
37
  ### Bug Fixes
package/dist/index.d.ts CHANGED
@@ -44,20 +44,6 @@ interface Commit {
44
44
  };
45
45
  }
46
46
 
47
- interface CommonContext {
48
- branch: BranchSpec;
49
- branches: BranchSpec[];
50
- cwd: string;
51
- env: "object";
52
- logger: {
53
- error: (...message: string[]) => void;
54
- log: (...message: string[]) => void;
55
- success: (...message: string[]) => void;
56
- };
57
- options: Options;
58
- stderr: stream.Writable;
59
- stdout: stream.Writable;
60
- }
61
47
  type CommonContext2 = CommonContext & {
62
48
  releases: Release[];
63
49
  };
@@ -68,7 +54,6 @@ type CommonContext3 = CommonContext2 & {
68
54
  type CommonContext4 = CommonContext3 & {
69
55
  nextRelease: Release;
70
56
  };
71
- type PublishContext = CommonContext4;
72
57
  interface BranchSpec {
73
58
  name: string;
74
59
  tags?: Tag[];
@@ -87,6 +72,21 @@ interface Release {
87
72
  type?: "build" | "major" | "minor" | "patch" | "premajor" | "preminor" | "prepatch" | "prerelease" | undefined;
88
73
  version: string;
89
74
  }
75
+ interface CommonContext {
76
+ branch: BranchSpec;
77
+ branches: BranchSpec[];
78
+ cwd: string;
79
+ env: "object";
80
+ logger: {
81
+ error: (...message: string[]) => void;
82
+ log: (...message: string[]) => void;
83
+ success: (...message: string[]) => void;
84
+ };
85
+ options: Options;
86
+ stderr: stream.Writable;
87
+ stdout: stream.Writable;
88
+ }
89
+ type PublishContext = CommonContext4;
90
90
 
91
91
  interface PluginConfig {
92
92
  keep?: string[];
@@ -1 +1 @@
1
- var j=Object.defineProperty;var i=(s,e)=>j(s,"name",{value:e,configurable:!0});import{rm as b}from"node:fs/promises";import{findUp as y,readJson as f,writeJson as p,isAccessible as h}from"@visulima/fs";import{resolve as g,join as c}from"@visulima/path";import{NotFoundError as v}from"@visulima/fs/error";import E from"@semantic-release/error";const 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"];var P=Object.defineProperty,l=i((s,e)=>P(s,"name",{value:e,configurable:!0}),"e");const O={ENOPKG:l(()=>({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."}),"ENOPKG"),ENOPKGNAME:l(()=>({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`."}),"ENOPKGNAME")};var K=Object.defineProperty,A=i((s,e)=>K(s,"name",{value:e,configurable:!0}),"o");const u=A((s,e={})=>{const{details:o,message:t}=O[s](e);return new E(t,s,o)},"default");var R=Object.defineProperty,m=i((s,e)=>R(s,"name",{value:e,configurable:!0}),"n");const G=m(async s=>{const e={type:"file"};s&&(e.cwd=s);const o=await y("package.json",e);if(!o)throw new v("No such file or directory, for package.json found.");return{packageJson:await f(o),path:o}},"findPackageJson"),k=m(async({pkgRoot:s},{cwd:e})=>{try{const{packageJson:o}=await G(s?g(e,s):e);if(!o.name){const t=u("ENOPKGNAME");throw new AggregateError([t],t.message)}return o}catch(o){if(o.code==="ENOENT"){const t=u("ENOPKG");throw new AggregateError([t],t.message)}throw o}},"default");var M=Object.defineProperty,w=i((s,e)=>M(s,"name",{value:e,configurable:!0}),"c");const C=w(async(s,e)=>{const o=await k(s,e),t=s.pkgRoot?g(e.cwd,s.pkgRoot):e.cwd;await p(c(t,"package.json.back"),o,{detectIndent:!0}),e.logger.log("Created a backup of the package.json file.");const a=new Set([...N,...s.keep??[]]);e.logger.log(`Keeping the following properties: ${[...a].join(", ")}`);const n={...o};for(const r in n)if(!a.has(r)){if(r==="scripts"){for(const d in n.scripts)a.has(`${r}.${d}`)||delete n.scripts[d];if(n.scripts&&Object.keys(n.scripts).length>0)continue}e.logger.log(`Removing property "${r}"`),delete n[r]}await p(c(t,"package.json"),n,{detectIndent:!0})},"publish"),T=w(async(s,e)=>{const o=s.pkgRoot?g(e.cwd,s.pkgRoot):e.cwd,t=c(o,"package.json.back");if(await h(t)){const a=await k(s,e),n=await f(t);n.version=a.version,await p(c(o,"package.json"),n,{detectIndent:!0,overwrite:!0}),await b(t),e.logger.log("Restored modified package.json from backup.")}else e.logger.error("No backup package.json found.")},"success");export{C as publish,T as success};
1
+ var j=Object.defineProperty;var i=(s,e)=>j(s,"name",{value:e,configurable:!0});import{rm as b}from"node:fs/promises";import{findUp as y,readJson as u,writeJson as p,isAccessible as h}from"@visulima/fs";import{resolve as g,join as c}from"@visulima/path";import{NotFoundError as v}from"@visulima/fs/error";import E from"@semantic-release/error";const 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"];var P=Object.defineProperty,l=i((s,e)=>P(s,"name",{value:e,configurable:!0}),"e");const O={ENOPKG:l(()=>({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."}),"ENOPKG"),ENOPKGNAME:l(()=>({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`."}),"ENOPKGNAME")};var K=Object.defineProperty,A=i((s,e)=>K(s,"name",{value:e,configurable:!0}),"o");const m=A((s,e={})=>{const{details:o,message:t}=O[s](e);return new E(t,s,o)},"getError");var R=Object.defineProperty,f=i((s,e)=>R(s,"name",{value:e,configurable:!0}),"n");const $=f(async s=>{const e={type:"file"};s&&(e.cwd=s);const o=await y("package.json",e);if(!o)throw new v("No such file or directory, for package.json found.");return{packageJson:await u(o),path:o}},"findPackageJson"),k=f(async({pkgRoot:s},{cwd:e})=>{try{const{packageJson:o}=await $(s?g(e,s):e);if(!o.name){const t=m("ENOPKGNAME");throw new AggregateError([t],t.message)}return o}catch(o){if(o.code==="ENOENT"){const t=m("ENOPKG");throw new AggregateError([t],t.message)}throw o}},"getPackage");var G=Object.defineProperty,w=i((s,e)=>G(s,"name",{value:e,configurable:!0}),"c");const C=w(async(s,e)=>{const o=await k(s,e),t=s.pkgRoot?g(e.cwd,s.pkgRoot):e.cwd;await p(c(t,"package.json.back"),o,{detectIndent:!0}),e.logger.log("Created a backup of the package.json file.");const a=new Set([...N,...s.keep??[]]);e.logger.log(`Keeping the following properties: ${[...a].join(", ")}`);const n={...o};for(const r in n)if(!a.has(r)){if(r==="scripts"){for(const d in n.scripts)a.has(`${r}.${d}`)||delete n.scripts[d];if(n.scripts&&Object.keys(n.scripts).length>0)continue}e.logger.log(`Removing property "${r}"`),delete n[r]}await p(c(t,"package.json"),n,{detectIndent:!0})},"publish"),T=w(async(s,e)=>{const o=s.pkgRoot?g(e.cwd,s.pkgRoot):e.cwd,t=c(o,"package.json.back");if(await h(t)){const a=await k(s,e),n=await u(t);n.version=a.version,await p(c(o,"package.json"),n,{detectIndent:!0,overwrite:!0}),await b(t),e.logger.log("Restored modified package.json from backup.")}else e.logger.error("No backup package.json found.")},"success");export{C as publish,T as success};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@anolilab/semantic-release-clean-package-json",
3
- "version": "3.0.2",
3
+ "version": "3.0.4",
4
4
  "description": "Clean package.json before publish by removing unnecessary properties",
5
5
  "keywords": [
6
6
  "anolilab",
@@ -36,16 +36,16 @@
36
36
  },
37
37
  "sideEffects": false,
38
38
  "type": "module",
39
- "main": "./dist/index.mjs",
40
- "types": "./dist/index.d.mts",
39
+ "main": "./dist/index.js",
40
+ "types": "./dist/index.d.ts",
41
41
  "files": [
42
- "dist",
42
+ "CHANGELOG.md",
43
43
  "README.md",
44
- "CHANGELOG.md"
44
+ "dist"
45
45
  ],
46
46
  "dependencies": {
47
47
  "@semantic-release/error": "^4.0.0",
48
- "@visulima/fs": "^3.1.5",
48
+ "@visulima/fs": "^3.1.8",
49
49
  "@visulima/path": "^1.4.0"
50
50
  },
51
51
  "engines": {
package/dist/index.d.mts DELETED
@@ -1,99 +0,0 @@
1
- import stream from 'node:stream';
2
-
3
- interface BranchObject {
4
- channel?: string | false | undefined;
5
- name: string;
6
- prerelease?: boolean | string | undefined;
7
- range?: string | undefined;
8
- }
9
- type BranchSpec$1 = BranchObject | string;
10
- type PluginSpec<T = any> = string | [string, T];
11
- interface Options {
12
- [name: string]: any;
13
- branches?: BranchSpec$1 | ReadonlyArray<BranchSpec$1> | undefined;
14
- ci?: boolean | undefined;
15
- dryRun?: boolean | undefined;
16
- extends?: ReadonlyArray<string> | string | undefined;
17
- plugins?: ReadonlyArray<PluginSpec> | undefined;
18
- repositoryUrl?: string | undefined;
19
- tagFormat?: string | undefined;
20
- }
21
- interface Commit {
22
- author: {
23
- email: string;
24
- name: string;
25
- short: string;
26
- };
27
- body: string;
28
- commit: {
29
- long: string;
30
- short: string;
31
- };
32
- committer: {
33
- email: string;
34
- name: string;
35
- short: string;
36
- };
37
- committerDate: string;
38
- hash: string;
39
- message: string;
40
- subject: string;
41
- tree: {
42
- long: string;
43
- short: string;
44
- };
45
- }
46
-
47
- interface CommonContext {
48
- branch: BranchSpec;
49
- branches: BranchSpec[];
50
- cwd: string;
51
- env: "object";
52
- logger: {
53
- error: (...message: string[]) => void;
54
- log: (...message: string[]) => void;
55
- success: (...message: string[]) => void;
56
- };
57
- options: Options;
58
- stderr: stream.Writable;
59
- stdout: stream.Writable;
60
- }
61
- type CommonContext2 = CommonContext & {
62
- releases: Release[];
63
- };
64
- type CommonContext3 = CommonContext2 & {
65
- commits: Commit[];
66
- lastRelease: Release;
67
- };
68
- type CommonContext4 = CommonContext3 & {
69
- nextRelease: Release;
70
- };
71
- type PublishContext = CommonContext4;
72
- interface BranchSpec {
73
- name: string;
74
- tags?: Tag[];
75
- }
76
- interface Tag {
77
- channel?: string;
78
- gitHead?: string;
79
- gitTag?: string;
80
- version?: string;
81
- }
82
- interface Release {
83
- channel?: string | null;
84
- gitHead?: string;
85
- gitTag?: string;
86
- name?: string;
87
- type?: "build" | "major" | "minor" | "patch" | "premajor" | "preminor" | "prepatch" | "prerelease" | undefined;
88
- version: string;
89
- }
90
-
91
- interface PluginConfig {
92
- keep?: string[];
93
- pkgRoot?: string;
94
- }
95
-
96
- declare const publish: (pluginConfig: PluginConfig, context: PublishContext) => Promise<void>;
97
- declare const success: (pluginConfig: PluginConfig, context: CommonContext) => Promise<void>;
98
-
99
- export { publish, success };