lerna-clean-changelogs 4.1.0 → 4.1.3

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.1 (2022-04-18)
7
+
8
+ ### Bug Fixes
9
+
10
+ - tweak types ([97ea400](https://github.com/codsen/codsen/commit/97ea4001c1bb6bf1a9a09d36fa2d1694f2c4d974))
11
+
6
12
  # 4.1.0 (2022-04-10)
7
13
 
8
14
  ### Features
package/README.md CHANGED
@@ -26,14 +26,12 @@
26
26
 
27
27
  ## Install
28
28
 
29
- This package is ESM only: Node 12+ is needed to use it and it must be imported instead of required:
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
33
33
  ```
34
34
 
35
- If you need a legacy version which works with `require`, use version 2.1.0
36
-
37
35
  ## Quick Take
38
36
 
39
37
  ```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.1.0
4
+ * @version 4.1.3
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.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
- ${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.3";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,f as defaults,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.1.0
4
+ * @version 4.1.3
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 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(`
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.3";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
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(`
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
14
  `)}${g?`
15
- `:""}`}return{version:h,res:l||e}}return W(L);})();
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.1.0",
3
+ "version": "4.1.3",
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
@@ -4,8 +4,8 @@ interface Opts {
4
4
  }
5
5
  declare const defaults: Opts;
6
6
  declare function cleanChangelogs(
7
- changelogContents: string,
8
- originalOpts?: Partial<Opts>
7
+ changelog: string,
8
+ opts?: Partial<Opts>
9
9
  ): {
10
10
  version: string;
11
11
  res: string;