@anolilab/semantic-release-clean-package-json 1.0.0 → 1.0.1-alpha.2
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 +17 -0
- package/dist/index.d.mts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,20 @@
|
|
|
1
|
+
## @anolilab/semantic-release-clean-package-json [1.0.1-alpha.2](https://github.com/anolilab/semantic-release/compare/@anolilab/semantic-release-clean-package-json@1.0.1-alpha.1...@anolilab/semantic-release-clean-package-json@1.0.1-alpha.2) (2025-01-21)
|
|
2
|
+
|
|
3
|
+
### Bug Fixes
|
|
4
|
+
|
|
5
|
+
* **semantic-release-clean-package-json:** try the new backup script ([61b94b7](https://github.com/anolilab/semantic-release/commit/61b94b7685ca2b85e10729a9e46c69c4cf777526))
|
|
6
|
+
|
|
7
|
+
## @anolilab/semantic-release-clean-package-json [1.0.1-alpha.1](https://github.com/anolilab/semantic-release/compare/@anolilab/semantic-release-clean-package-json@1.0.0...@anolilab/semantic-release-clean-package-json@1.0.1-alpha.1) (2025-01-21)
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **semantic-release-clean-package-json:** adding a success function to restore the old package.json with the new version ([43d1964](https://github.com/anolilab/semantic-release/commit/43d19644518642d427d82f71c3b8c052e040f24f))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### Dependencies
|
|
15
|
+
|
|
16
|
+
* **@anolilab/semantic-release-pnpm:** upgraded to 1.1.9-alpha.1
|
|
17
|
+
|
|
1
18
|
## @anolilab/semantic-release-clean-package-json 1.0.0 (2025-01-16)
|
|
2
19
|
|
|
3
20
|
### Features
|
package/dist/index.d.mts
CHANGED
|
@@ -94,5 +94,6 @@ interface PluginConfig {
|
|
|
94
94
|
}
|
|
95
95
|
|
|
96
96
|
declare const prepare: (pluginConfig: PluginConfig, context: PrepareContext) => Promise<void>;
|
|
97
|
+
declare const success: (pluginConfig: PluginConfig, context: PrepareContext) => Promise<void>;
|
|
97
98
|
|
|
98
|
-
export { prepare };
|
|
99
|
+
export { prepare, success };
|
package/dist/index.d.ts
CHANGED
|
@@ -94,5 +94,6 @@ interface PluginConfig {
|
|
|
94
94
|
}
|
|
95
95
|
|
|
96
96
|
declare const prepare: (pluginConfig: PluginConfig, context: PrepareContext) => Promise<void>;
|
|
97
|
+
declare const success: (pluginConfig: PluginConfig, context: PrepareContext) => Promise<void>;
|
|
97
98
|
|
|
98
|
-
export { prepare };
|
|
99
|
+
export { prepare, success };
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
var w=Object.defineProperty;var r=(o,e)=>w(o,"name",{value:e,configurable:!0});import{findUp as j,readJson as u,writeJson as c,isAccessible as y}from"@visulima/fs";import{resolve as p,join as i}from"@visulima/path";import{NotFoundError as v}from"@visulima/fs/error";import b from"@semantic-release/error";import{rm as h}from"node:fs/promises";const E=["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 N=Object.defineProperty,d=r((o,e)=>N(o,"name",{value:e,configurable:!0}),"e");const P={ENOPKG:d(()=>({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:d(()=>({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 O=Object.defineProperty,K=r((o,e)=>O(o,"name",{value:e,configurable:!0}),"o");const l=K((o,e={})=>{const{details:s,message:n}=P[o](e);return new b(n,o,s)},"default");var A=Object.defineProperty,f=r((o,e)=>A(o,"name",{value:e,configurable:!0}),"n");const R=f(async o=>{const e={type:"file"};o&&(e.cwd=o);const s=await j("package.json",e);if(!s)throw new v("No such file or directory, for package.json found.");return{packageJson:await u(s),path:s}},"findPackageJson"),m=f(async({pkgRoot:o},{cwd:e})=>{try{const{packageJson:s}=await R(o?p(e,o):e);if(!s.name){const n=l("ENOPKGNAME");throw new AggregateError([n],n.message)}return s}catch(s){if(s.code==="ENOENT"){const n=l("ENOPKG");throw new AggregateError([n],n.message)}throw s}},"default");var G=Object.defineProperty,k=r((o,e)=>G(o,"name",{value:e,configurable:!0}),"c");const I=k(async(o,e)=>{const s=await m(o,e),n=o.pkgRoot?p(e.cwd,o.pkgRoot):e.cwd;await c(i(n,"package.json.back"),{...s},{detectIndent:!0}),e.logger.log("Backup package.json created.");const t=new Set([...E,...o.keep??[]]);e.logger.log(`Keeping the following properties: ${[...t].join(", ")}`);for(const a in s)if(!t.has(a)){if(a==="scripts"){for(const g in s.scripts)t.has(`${a}.${g}`)||delete s.scripts[g];if(s.scripts&&Object.keys(s.scripts).length>0)continue}e.logger.log(`Removing property "${a}"`),delete s[a]}await c(i(n,"package.json"),s,{detectIndent:!0})},"prepare"),B=k(async(o,e)=>{const s=o.pkgRoot?p(e.cwd,o.pkgRoot):e.cwd,n=i(s,"package.json.back");if(await y(n)){const t=await m(o,e),a=await u(n);await c(i(s,"package.json"),{...a,version:t.version},{detectIndent:!0,overwrite:!0}),await h(n),e.logger.log("Restored modified package.json from backup.")}else e.logger.error("No backup package.json found.")},"success");export{I as prepare,B as success};
|