lerna-clean-changelogs 4.0.0 → 4.1.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 CHANGED
@@ -3,6 +3,18 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## 4.1.1 (2022-04-18)
7
+
8
+ ### Bug Fixes
9
+
10
+ - tweak types ([97ea400](https://github.com/codsen/codsen/commit/97ea4001c1bb6bf1a9a09d36fa2d1694f2c4d974))
11
+
12
+ # 4.1.0 (2022-04-10)
13
+
14
+ ### Features
15
+
16
+ - export defaults ([4bc7c0f](https://github.com/codsen/codsen/commit/4bc7c0fd98f3c2e768df04a8e34b6465d04835d9))
17
+
6
18
  # [4.0.0](https://github.com/codsen/codsen/compare/lerna-clean-changelogs@3.0.11...lerna-clean-changelogs@4.0.0) (2022-01-22)
7
19
 
8
20
  ### Bug Fixes
package/README.md CHANGED
@@ -26,7 +26,7 @@
26
26
 
27
27
  ## Install
28
28
 
29
- The latest version is **ESM only**: Node 12+ is needed to use it and it must be `import`ed instead of `require`d. If your project is not on ESM yet and you want to use `require`, use an older version of this program, `2.1.0`.
29
+ This package is [pure ESM](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c). If you're not ready yet, install an older version of this program, 2.1.0 (`npm i lerna-clean-changelogs@2.1.0`).
30
30
 
31
31
  ```bash
32
32
  npm i lerna-clean-changelogs
@@ -1,15 +1,15 @@
1
1
  /**
2
2
  * @name lerna-clean-changelogs
3
3
  * @fileoverview Removes frivolous entries from commitizen generated changelogs
4
- * @version 4.0.0
4
+ * @version 4.1.2
5
5
  * @author Roy Revelt, Codsen Ltd
6
6
  * @license MIT
7
7
  * {@link https://codsen.com/os/lerna-clean-changelogs/}
8
8
  */
9
9
 
10
- var u="4.0.0";var d=u;function i(r){return typeof r=="string"}var f={extras:!1};function $(r,p){if(r===void 0)throw new Error("lerna-clean-changelogs: [THROW_ID_01] The first input argument is missing!");if(!i(r))throw new Error(`lerna-clean-changelogs: [THROW_ID_02] The first input argument must be a string! It was given as ${Array.isArray(r)?"array":typeof r}, equal to:
11
- ${JSON.stringify(r,null,4)}`);let a={...f,...p},o,l=!1;if(typeof r=="string"&&r.length&&(!r.includes(`
12
- `)||!r.includes("\r"))){let c=i(r)&&r.length&&(r[r.length-1]===`
13
- `||r[r.length-1]==="\r");r=r.trim().replace(/(https:\/\/git\.sr\.ht\/~[^/]+\/[^/]+\/)commits\//g,"$1commit/");let t=r.split(/\r?\n/);a.extras&&t.forEach((e,s)=>{e.startsWith("#")&&(t[s]=e.replace(/(#+) \[?(\d+\.\d+\.\d+)\s?\]\([^)]*\)/g,"$1 $2")),s&&t[s].startsWith("# ")&&(t[s]=`#${t[s]}`)});let n=[];for(let e=t.length;e--;){if(t[e].startsWith("**Note:** Version bump only")||a.extras&&t[e].toLowerCase().includes("wip")){for(;i(t[e-1])&&!t[e-1].trim()&&e;)e-=1;for(e&&i(t[e-1])&&t[e-1].trim().startsWith("#")&&(e-=1);i(t[e-1])&&!t[e-1].trim()&&e;)e-=1}else t[e].trim()?t[e][0]==="*"&&t[e][1]===" "?n.unshift(`- ${t[e].slice(2)}`):n.unshift(t[e]):l||(n.unshift(t[e].trim()),l=!0);t[e].trim()&&(l=!1)}o=`${n.join(`
10
+ var p="4.1.2";var d=p;function n(t){return typeof t=="string"}var f={extras:!1};function $(t,u){if(t===void 0)throw new Error("lerna-clean-changelogs: [THROW_ID_01] The first input argument is missing!");if(!n(t))throw new Error(`lerna-clean-changelogs: [THROW_ID_02] The first input argument must be a string! It was given as ${Array.isArray(t)?"array":typeof t}, equal to:
11
+ ${JSON.stringify(t,null,4)}`);let a={...f,...u},o,l=!1;if(typeof t=="string"&&t.length&&(!t.includes(`
12
+ `)||!t.includes("\r"))){let c=n(t)&&t.length&&(t[t.length-1]===`
13
+ `||t[t.length-1]==="\r");t=t.trim().replace(/(https:\/\/git\.sr\.ht\/~[^/]+\/[^/]+\/)commits\//g,"$1commit/");let s=t.split(/\r?\n/);a.extras&&s.forEach((e,r)=>{e.startsWith("#")&&(s[r]=e.replace(/(#+) \[?(\d+\.\d+\.\d+)\s?\]\([^)]*\)/g,"$1 $2")),r&&s[r].startsWith("# ")&&(s[r]=`#${s[r]}`)});let i=[];for(let e=s.length;e--;){if(s[e].startsWith("**Note:** Version bump only")||a.extras&&s[e].toLowerCase().includes("wip")){for(;n(s[e-1])&&!s[e-1].trim()&&e;)e-=1;for(e&&n(s[e-1])&&s[e-1].trim().startsWith("#")&&(e-=1);n(s[e-1])&&!s[e-1].trim()&&e;)e-=1}else s[e].trim()?s[e][0]==="*"&&s[e][1]===" "?i.unshift(`- ${s[e].slice(2)}`):i.unshift(s[e]):l||(i.unshift(s[e].trim()),l=!0);s[e].trim()&&(l=!1)}o=`${i.join(`
14
14
  `)}${c?`
15
- `:""}`}return{version:d,res:o||r}}export{$ as cleanChangelogs,d as version};
15
+ `:""}`}return{version:d,res:o||t}}export{$ as cleanChangelogs,f as defaults,d as version};
@@ -1,15 +1,15 @@
1
- /**
1
+ "use strict";/**
2
2
  * @name lerna-clean-changelogs
3
3
  * @fileoverview Removes frivolous entries from commitizen generated changelogs
4
- * @version 4.0.0
4
+ * @version 4.1.2
5
5
  * @author Roy Revelt, Codsen Ltd
6
6
  * @license MIT
7
7
  * {@link https://codsen.com/os/lerna-clean-changelogs/}
8
8
  */
9
9
 
10
- var lernaCleanChangelogs=(()=>{var p=Object.defineProperty;var g=Object.getOwnPropertyDescriptor;var b=Object.getOwnPropertyNames,m=Object.getOwnPropertySymbols;var d=Object.prototype.hasOwnProperty,E=Object.prototype.propertyIsEnumerable;var f=(e,r,s)=>r in e?p(e,r,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[r]=s,c=(e,r)=>{for(var s in r||(r={}))d.call(r,s)&&f(e,s,r[s]);if(m)for(var s of m(r))E.call(r,s)&&f(e,s,r[s]);return e};var x=e=>p(e,"__esModule",{value:!0});var v=(e,r)=>{for(var s in r)p(e,s,{get:r[s],enumerable:!0})},w=(e,r,s,l)=>{if(r&&typeof r=="object"||typeof r=="function")for(let n of b(r))!d.call(e,n)&&(s||n!=="default")&&p(e,n,{get:()=>r[n],enumerable:!(l=g(r,n))||l.enumerable});return e};var W=(e=>(r,s)=>e&&e.get(r)||(s=w(x({}),r,1),e&&e.set(r,s),s))(typeof WeakMap!="undefined"?new WeakMap:0);var O={};v(O,{cleanChangelogs:()=>L,version:()=>h});var y="4.0.0";var h=y;function o(e){return typeof e=="string"}var D={extras:!1};function L(e,r){if(e===void 0)throw new Error("lerna-clean-changelogs: [THROW_ID_01] The first input argument is missing!");if(!o(e))throw new Error(`lerna-clean-changelogs: [THROW_ID_02] The first input argument must be a string! It was given as ${Array.isArray(e)?"array":typeof e}, equal to:
11
- ${JSON.stringify(e,null,4)}`);let s=c(c({},D),r),l,n=!1;if(typeof e=="string"&&e.length&&(!e.includes(`
12
- `)||!e.includes("\r"))){let $=o(e)&&e.length&&(e[e.length-1]===`
13
- `||e[e.length-1]==="\r");e=e.trim().replace(/(https:\/\/git\.sr\.ht\/~[^/]+\/[^/]+\/)commits\//g,"$1commit/");let i=e.split(/\r?\n/);s.extras&&i.forEach((t,a)=>{t.startsWith("#")&&(i[a]=t.replace(/(#+) \[?(\d+\.\d+\.\d+)\s?\]\([^)]*\)/g,"$1 $2")),a&&i[a].startsWith("# ")&&(i[a]=`#${i[a]}`)});let u=[];for(let t=i.length;t--;){if(i[t].startsWith("**Note:** Version bump only")||s.extras&&i[t].toLowerCase().includes("wip")){for(;o(i[t-1])&&!i[t-1].trim()&&t;)t-=1;for(t&&o(i[t-1])&&i[t-1].trim().startsWith("#")&&(t-=1);o(i[t-1])&&!i[t-1].trim()&&t;)t-=1}else i[t].trim()?i[t][0]==="*"&&i[t][1]===" "?u.unshift(`- ${i[t].slice(2)}`):u.unshift(i[t]):n||(u.unshift(i[t].trim()),n=!0);i[t].trim()&&(n=!1)}l=`${u.join(`
14
- `)}${$?`
15
- `:""}`}return{version:h,res:l||e}}return W(O);})();
10
+ var lernaCleanChangelogs=(()=>{var u=Object.defineProperty;var b=Object.getOwnPropertyDescriptor;var E=Object.getOwnPropertyNames,m=Object.getOwnPropertySymbols;var f=Object.prototype.hasOwnProperty,x=Object.prototype.propertyIsEnumerable;var d=(e,s,n)=>s in e?u(e,s,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[s]=n,c=(e,s)=>{for(var n in s||(s={}))f.call(s,n)&&d(e,n,s[n]);if(m)for(var n of m(s))x.call(s,n)&&d(e,n,s[n]);return e};var v=(e,s)=>{for(var n in s)u(e,n,{get:s[n],enumerable:!0})},w=(e,s,n,l)=>{if(s&&typeof s=="object"||typeof s=="function")for(let i of E(s))!f.call(e,i)&&i!==n&&u(e,i,{get:()=>s[i],enumerable:!(l=b(s,i))||l.enumerable});return e};var W=e=>w(u({},"__esModule",{value:!0}),e);var D={};v(D,{cleanChangelogs:()=>O,defaults:()=>$,version:()=>h});var y="4.1.2";var h=y;function o(e){return typeof e=="string"}var $={extras:!1};function O(e,s){if(e===void 0)throw new Error("lerna-clean-changelogs: [THROW_ID_01] The first input argument is missing!");if(!o(e))throw new Error(`lerna-clean-changelogs: [THROW_ID_02] The first input argument must be a string! It was given as ${Array.isArray(e)?"array":typeof e}, equal to:
11
+ ${JSON.stringify(e,null,4)}`);let n=c(c({},$),s),l,i=!1;if(typeof e=="string"&&e.length&&(!e.includes(`
12
+ `)||!e.includes("\r"))){let g=o(e)&&e.length&&(e[e.length-1]===`
13
+ `||e[e.length-1]==="\r");e=e.trim().replace(/(https:\/\/git\.sr\.ht\/~[^/]+\/[^/]+\/)commits\//g,"$1commit/");let r=e.split(/\r?\n/);n.extras&&r.forEach((t,a)=>{t.startsWith("#")&&(r[a]=t.replace(/(#+) \[?(\d+\.\d+\.\d+)\s?\]\([^)]*\)/g,"$1 $2")),a&&r[a].startsWith("# ")&&(r[a]=`#${r[a]}`)});let p=[];for(let t=r.length;t--;){if(r[t].startsWith("**Note:** Version bump only")||n.extras&&r[t].toLowerCase().includes("wip")){for(;o(r[t-1])&&!r[t-1].trim()&&t;)t-=1;for(t&&o(r[t-1])&&r[t-1].trim().startsWith("#")&&(t-=1);o(r[t-1])&&!r[t-1].trim()&&t;)t-=1}else r[t].trim()?r[t][0]==="*"&&r[t][1]===" "?p.unshift(`- ${r[t].slice(2)}`):p.unshift(r[t]):i||(p.unshift(r[t].trim()),i=!0);r[t].trim()&&(i=!1)}l=`${p.join(`
14
+ `)}${g?`
15
+ `:""}`}return{version:h,res:l||e}}return W(D);})();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lerna-clean-changelogs",
3
- "version": "4.0.0",
3
+ "version": "4.1.2",
4
4
  "description": "Removes frivolous entries from commitizen generated changelogs",
5
5
  "keywords": [
6
6
  "changelog",
@@ -30,6 +30,7 @@
30
30
  },
31
31
  "type": "module",
32
32
  "exports": {
33
+ "types": "./types/index.d.ts",
33
34
  "script": "./dist/lerna-clean-changelogs.umd.js",
34
35
  "default": "./dist/lerna-clean-changelogs.esm.js"
35
36
  },
package/types/index.d.ts CHANGED
@@ -2,12 +2,13 @@ declare const version: string;
2
2
  interface Opts {
3
3
  extras: boolean;
4
4
  }
5
+ declare const defaults: Opts;
5
6
  declare function cleanChangelogs(
6
- changelogContents: string,
7
- originalOpts?: Partial<Opts>
7
+ changelog: string,
8
+ opts?: Partial<Opts>
8
9
  ): {
9
10
  version: string;
10
11
  res: string;
11
12
  };
12
13
 
13
- export { cleanChangelogs, version };
14
+ export { cleanChangelogs, defaults, version };