@anolilab/semantic-release-clean-package-json 1.0.0-alpha.2 → 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 CHANGED
@@ -1,3 +1,21 @@
1
+ ## @anolilab/semantic-release-clean-package-json 1.0.0 (2025-01-16)
2
+
3
+ ### Features
4
+
5
+ * new clean-package-json package for semantic-release ([#106](https://github.com/anolilab/semantic-release/issues/106)) ([94218d7](https://github.com/anolilab/semantic-release/commit/94218d72b21e698f46b96749d9216209782d381a))
6
+
7
+ ### Bug Fixes
8
+
9
+ * changed plugin order to not publish cleaned package.json to github ([6673e69](https://github.com/anolilab/semantic-release/commit/6673e69723fd340380250fa2d986e4c37091351f))
10
+ * remove usage of aggregate-error library ([e0c6e95](https://github.com/anolilab/semantic-release/commit/e0c6e95b07416d6694fa192ddca96e17a4c1c4b8))
11
+ * **semantic-release-clean-package-json:** fixed circular dependency ([93b51f9](https://github.com/anolilab/semantic-release/commit/93b51f9c03503e10f0c0a23dcd55273622b40aa0))
12
+ * **semantic-release-clean-package-json:** removed cjs exports, semantic-release dont supports both types at the same time ([48c93c0](https://github.com/anolilab/semantic-release/commit/48c93c09cd5d6429b7658bc9a4fc573ea23462e2))
13
+
14
+
15
+ ### Dependencies
16
+
17
+ * **@anolilab/semantic-release-pnpm:** upgraded to 1.1.8
18
+
1
19
  ## @anolilab/semantic-release-clean-package-json [1.0.0-alpha.2](https://github.com/anolilab/semantic-release/compare/@anolilab/semantic-release-clean-package-json@1.0.0-alpha.1...@anolilab/semantic-release-clean-package-json@1.0.0-alpha.2) (2025-01-16)
2
20
 
3
21
  ### Bug Fixes
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- var l=Object.defineProperty;var r=(n,e)=>l(n,"name",{value:e,configurable:!0});import{findUp as g,readJson as m,writeJson as f}from"@visulima/fs";import{resolve as u,join as y}from"@visulima/path";import{NotFoundError as k}from"@visulima/fs/error";import i from"aggregate-error";import j from"@semantic-release/error";const w=["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 h=Object.defineProperty,p=r((n,e)=>h(n,"name",{value:e,configurable:!0}),"e");const v={ENOPKG:p(()=>({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:p(()=>({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 b=Object.defineProperty,E=r((n,e)=>b(n,"name",{value:e,configurable:!0}),"o");const c=E((n,e={})=>{const{details:s,message:o}=v[n](e);return new j(o,n,s)},"default");var N=Object.defineProperty,d=r((n,e)=>N(n,"name",{value:e,configurable:!0}),"n");const P=d(async n=>{const e={type:"file"};n&&(e.cwd=n);const s=await g("package.json",e);if(!s)throw new k("No such file or directory, for package.json found.");return{packageJson:await m(s),path:s}},"findPackageJson"),O=d(async({pkgRoot:n},{cwd:e})=>{try{const{packageJson:s}=await P(n?u(e,n):e);if(!s.name)throw new i([c("ENOPKGNAME")]);return s}catch(s){throw s.code==="ENOENT"?new i([c("ENOPKG")]):s}},"default");var $=Object.defineProperty,K=r((n,e)=>$(n,"name",{value:e,configurable:!0}),"p");const q=K(async(n,e)=>{const s=await O(n,e),o=new Set([...w,...n.keep??[]]);e.logger.log(`Keeping the following properties: ${[...o].join(", ")}`);for(const t in s)if(!o.has(t)){if(t==="scripts"){for(const a in s.scripts)o.has(`${t}.${a}`)||delete s.scripts[a];if(s.scripts&&Object.keys(s.scripts).length>0)continue}e.logger.log(`Removing property "${t}"`),delete s[t]}await f(y(e.cwd,"package.json"),s,{detectIndent:!0})},"prepare");export{q as prepare};
1
+ var g=Object.defineProperty;var r=(s,e)=>g(s,"name",{value:e,configurable:!0});import{findUp as d,readJson as l,writeJson as f}from"@visulima/fs";import{resolve as m,join as u}from"@visulima/path";import{NotFoundError as y}from"@visulima/fs/error";import k from"@semantic-release/error";const w=["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 h=Object.defineProperty,i=r((s,e)=>h(s,"name",{value:e,configurable:!0}),"e");const j={ENOPKG:i(()=>({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:i(()=>({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 v=Object.defineProperty,b=r((s,e)=>v(s,"name",{value:e,configurable:!0}),"o");const p=b((s,e={})=>{const{details:n,message:o}=j[s](e);return new k(o,s,n)},"default");var E=Object.defineProperty,c=r((s,e)=>E(s,"name",{value:e,configurable:!0}),"n");const N=c(async s=>{const e={type:"file"};s&&(e.cwd=s);const n=await d("package.json",e);if(!n)throw new y("No such file or directory, for package.json found.");return{packageJson:await l(n),path:n}},"findPackageJson"),P=c(async({pkgRoot:s},{cwd:e})=>{try{const{packageJson:n}=await N(s?m(e,s):e);if(!n.name){const o=p("ENOPKGNAME");throw new AggregateError([o],o.message)}return n}catch(n){if(n.code==="ENOENT"){const o=p("ENOPKG");throw new AggregateError([o],o.message)}throw n}},"default");var O=Object.defineProperty,K=r((s,e)=>O(s,"name",{value:e,configurable:!0}),"p");const D=K(async(s,e)=>{const n=await P(s,e),o=new Set([...w,...s.keep??[]]);e.logger.log(`Keeping the following properties: ${[...o].join(", ")}`);for(const t in n)if(!o.has(t)){if(t==="scripts"){for(const a in n.scripts)o.has(`${t}.${a}`)||delete n.scripts[a];if(n.scripts&&Object.keys(n.scripts).length>0)continue}e.logger.log(`Removing property "${t}"`),delete n[t]}await f(u(e.cwd,"package.json"),n,{detectIndent:!0})},"prepare");export{D as prepare};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@anolilab/semantic-release-clean-package-json",
3
- "version": "1.0.0-alpha.2",
3
+ "version": "1.0.0",
4
4
  "description": "Clean package.json before publish by removing unnecessary properties",
5
5
  "keywords": [
6
6
  "anolilab",
@@ -36,29 +36,8 @@
36
36
  },
37
37
  "sideEffects": false,
38
38
  "type": "module",
39
- "exports": {
40
- ".": {
41
- "require": {
42
- "types": "./dist/index.d.cts",
43
- "default": "./dist/index.cjs"
44
- },
45
- "import": {
46
- "types": "./dist/index.d.mts",
47
- "default": "./dist/index.mjs"
48
- }
49
- },
50
- "./package.json": "./package.json"
51
- },
52
- "main": "dist/index.cjs",
53
- "module": "dist/index.mjs",
54
- "types": "dist/index.d.ts",
55
- "typesVersions": {
56
- ">=5.0": {
57
- ".": [
58
- "./dist/index.d.ts"
59
- ]
60
- }
61
- },
39
+ "main": "./dist/index.mjs",
40
+ "types": "./dist/index.d.mts",
62
41
  "files": [
63
42
  "dist",
64
43
  "README.md",
@@ -67,8 +46,7 @@
67
46
  "dependencies": {
68
47
  "@semantic-release/error": "^4.0.0",
69
48
  "@visulima/fs": "^2.3.7",
70
- "@visulima/path": "^1.3.3",
71
- "aggregate-error": "^5.0.0"
49
+ "@visulima/path": "^1.3.3"
72
50
  },
73
51
  "engines": {
74
52
  "node": ">=18.0.0 <=23.x"
package/dist/index.cjs DELETED
@@ -1 +0,0 @@
1
- "use strict";var f=Object.defineProperty;var t=(e,n)=>f(e,"name",{value:n,configurable:!0});Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("@visulima/fs"),d=require("@visulima/path"),m=require("@visulima/fs/error"),y=require("aggregate-error"),j=require("@semantic-release/error"),u=t(e=>e&&typeof e=="object"&&"default"in e?e.default:e,"_interopDefaultCompat"),c=u(y),k=u(j),v=["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 h=Object.defineProperty,p=t((e,n)=>h(e,"name",{value:n,configurable:!0}),"e");const w={ENOPKG:p(()=>({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:p(()=>({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 b=Object.defineProperty,P=t((e,n)=>b(e,"name",{value:n,configurable:!0}),"o");const l=P((e,n={})=>{const{details:s,message:o}=w[e](n);return new k(o,e,s)},"default");var E=Object.defineProperty,g=t((e,n)=>E(e,"name",{value:n,configurable:!0}),"n");const N=g(async e=>{const n={type:"file"};e&&(n.cwd=e);const s=await a.findUp("package.json",n);if(!s)throw new m.NotFoundError("No such file or directory, for package.json found.");return{packageJson:await a.readJson(s),path:s}},"findPackageJson"),O=g(async({pkgRoot:e},{cwd:n})=>{try{const{packageJson:s}=await N(e?d.resolve(n,e):n);if(!s.name)throw new c([l("ENOPKGNAME")]);return s}catch(s){throw s.code==="ENOENT"?new c([l("ENOPKG")]):s}},"default");var $=Object.defineProperty,q=t((e,n)=>$(e,"name",{value:n,configurable:!0}),"p");const K=q(async(e,n)=>{const s=await O(e,n),o=new Set([...v,...e.keep??[]]);n.logger.log(`Keeping the following properties: ${[...o].join(", ")}`);for(const r in s)if(!o.has(r)){if(r==="scripts"){for(const i in s.scripts)o.has(`${r}.${i}`)||delete s.scripts[i];if(s.scripts&&Object.keys(s.scripts).length>0)continue}n.logger.log(`Removing property "${r}"`),delete s[r]}await a.writeJson(d.join(n.cwd,"package.json"),s,{detectIndent:!0})},"prepare");exports.prepare=K;
package/dist/index.d.cts DELETED
@@ -1,98 +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 PrepareContext = 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 prepare: (pluginConfig: PluginConfig, context: PrepareContext) => Promise<void>;
97
-
98
- export { prepare };