lerna-clean-changelogs 4.0.0 → 4.1.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
@@ -3,6 +3,12 @@
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.0 (2022-04-10)
7
+
8
+ ### Features
9
+
10
+ - export defaults ([4bc7c0f](https://github.com/codsen/codsen/commit/4bc7c0fd98f3c2e768df04a8e34b6465d04835d9))
11
+
6
12
  # [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
13
 
8
14
  ### Bug Fixes
package/README.md CHANGED
@@ -26,12 +26,14 @@
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 ESM only: Node 12+ is needed to use it and it must be imported instead of required:
30
30
 
31
31
  ```bash
32
32
  npm i lerna-clean-changelogs
33
33
  ```
34
34
 
35
+ If you need a legacy version which works with `require`, use version 2.1.0
36
+
35
37
  ## Quick Take
36
38
 
37
39
  ```js
@@ -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.0
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:
10
+ var u="4.1.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
11
  ${JSON.stringify(r,null,4)}`);let a={...f,...p},o,l=!1;if(typeof r=="string"&&r.length&&(!r.includes(`
12
12
  `)||!r.includes("\r"))){let c=i(r)&&r.length&&(r[r.length-1]===`
13
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(`
14
14
  `)}${c?`
15
- `:""}`}return{version:d,res:o||r}}export{$ as cleanChangelogs,d as version};
15
+ `:""}`}return{version:d,res:o||r}}export{$ as cleanChangelogs,f as defaults,d as version};
@@ -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.0
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 p=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,t,i)=>t in e?p(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,c=(e,t)=>{for(var i in t||(t={}))f.call(t,i)&&d(e,i,t[i]);if(m)for(var i of m(t))x.call(t,i)&&d(e,i,t[i]);return e};var v=(e,t)=>{for(var i in t)p(e,i,{get:t[i],enumerable:!0})},w=(e,t,i,l)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of E(t))!f.call(e,n)&&n!==i&&p(e,n,{get:()=>t[n],enumerable:!(l=b(t,n))||l.enumerable});return e};var W=e=>w(p({},"__esModule",{value:!0}),e);var L={};v(L,{cleanChangelogs:()=>D,defaults:()=>$,version:()=>h});var y="4.1.0";var h=y;function o(e){return typeof e=="string"}var $={extras:!1};function D(e,t){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 i=c(c({},$),t),l,n=!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 s=e.split(/\r?\n/);i.extras&&s.forEach((r,a)=>{r.startsWith("#")&&(s[a]=r.replace(/(#+) \[?(\d+\.\d+\.\d+)\s?\]\([^)]*\)/g,"$1 $2")),a&&s[a].startsWith("# ")&&(s[a]=`#${s[a]}`)});let u=[];for(let r=s.length;r--;){if(s[r].startsWith("**Note:** Version bump only")||i.extras&&s[r].toLowerCase().includes("wip")){for(;o(s[r-1])&&!s[r-1].trim()&&r;)r-=1;for(r&&o(s[r-1])&&s[r-1].trim().startsWith("#")&&(r-=1);o(s[r-1])&&!s[r-1].trim()&&r;)r-=1}else s[r].trim()?s[r][0]==="*"&&s[r][1]===" "?u.unshift(`- ${s[r].slice(2)}`):u.unshift(s[r]):n||(u.unshift(s[r].trim()),n=!0);s[r].trim()&&(n=!1)}l=`${u.join(`
14
+ `)}${g?`
15
+ `:""}`}return{version:h,res:l||e}}return W(L);})();
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.0",
4
4
  "description": "Removes frivolous entries from commitizen generated changelogs",
5
5
  "keywords": [
6
6
  "changelog",
package/types/index.d.ts CHANGED
@@ -2,6 +2,7 @@ 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
7
  changelogContents: string,
7
8
  originalOpts?: Partial<Opts>
@@ -10,4 +11,4 @@ declare function cleanChangelogs(
10
11
  res: string;
11
12
  };
12
13
 
13
- export { cleanChangelogs, version };
14
+ export { cleanChangelogs, defaults, version };