lerna-clean-changelogs 3.0.10 → 3.0.11

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/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2010-2021 Roy Revelt and other contributors
3
+ Copyright (c) 2010-2022 Roy Revelt and other contributors
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining
6
6
  a copy of this software and associated documentation files (the
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
+ 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`.
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
@@ -101,8 +99,6 @@ To report bugs or request features or assistance, [raise an issue](https://githu
101
99
 
102
100
  MIT License
103
101
 
104
- Copyright (c) 2010-2021 Roy Revelt and other contributors
105
-
102
+ Copyright (c) 2010-2022 Roy Revelt and other contributors
106
103
 
107
104
  <img src="https://codsen.com/images/png-codsen-ok.png" width="98" alt="ok" align="center"> <img src="https://codsen.com/images/png-codsen-1.png" width="148" alt="codsen" align="center"> <img src="https://codsen.com/images/png-codsen-star-small.png" width="32" alt="star" align="center">
108
-
@@ -1,15 +1,15 @@
1
1
  /**
2
2
  * @name lerna-clean-changelogs
3
3
  * @fileoverview Removes frivolous entries from commitizen generated changelogs
4
- * @version 3.0.10
4
+ * @version 3.0.11
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="3.0.10";var p=u;function t(r){return typeof r=="string"}function y(r,a=!1){if(r===void 0)throw new Error("lerna-clean-changelogs: [THROW_ID_01] The first input argument is missing!");if(!t(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="3.0.11";var m=u;function i(r){return typeof r=="string"}function y(r,a=!1){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 o,l=!1;if(typeof r=="string"&&r.length&&(!r.includes(`
12
- `)||!r.includes("\r"))){let c=t(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 s=r.split(/\r?\n/);a&&s.forEach((e,i)=>{e.startsWith("#")&&(s[i]=e.replace(/(#+) \[?(\d+\.\d+\.\d+)\s?\]\([^)]*\)/g,"$1 $2")),i&&s[i].startsWith("# ")&&(s[i]=`#${s[i]}`)});let n=[];for(let e=s.length;e--;){if(s[e].startsWith("**Note:** Version bump only")||a&&s[e].toLowerCase().includes("wip")){for(;t(s[e-1])&&!s[e-1].trim()&&e;)e-=1;for(e&&t(s[e-1])&&s[e-1].trim().startsWith("#")&&(e-=1);t(s[e-1])&&!s[e-1].trim()&&e;)e-=1}else s[e].trim()?s[e][0]==="*"&&s[e][1]===" "?n.unshift(`- ${s[e].slice(2)}`):n.unshift(s[e]):l||(n.unshift(s[e].trim()),l=!0);s[e].trim()&&(l=!1)}o=`${n.join(`
14
- `)}${c?`
15
- `:""}`}return{version:p,res:o||r}}export{y as cleanChangelogs,p as version};
12
+ `)||!r.includes("\r"))){let p=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 s=r.split(/\r?\n/);a&&s.forEach((e,t)=>{e.startsWith("#")&&(s[t]=e.replace(/(#+) \[?(\d+\.\d+\.\d+)\s?\]\([^)]*\)/g,"$1 $2")),t&&s[t].startsWith("# ")&&(s[t]=`#${s[t]}`)});let n=[];for(let e=s.length;e--;){if(s[e].startsWith("**Note:** Version bump only")||a&&s[e].toLowerCase().includes("wip")){for(;i(s[e-1])&&!s[e-1].trim()&&e;)e-=1;for(e&&i(s[e-1])&&s[e-1].trim().startsWith("#")&&(e-=1);i(s[e-1])&&!s[e-1].trim()&&e;)e-=1}else s[e].trim()?s[e][0]==="*"&&s[e][1]===" "?n.unshift(`- ${s[e].slice(2)}`):n.unshift(s[e]):l||(n.unshift(s[e].trim()),l=!0);s[e].trim()&&(l=!1)}o=`${n.join(`
14
+ `)}${p?`
15
+ `:""}`}return{version:m,res:o||r}}export{y as cleanChangelogs,m 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 3.0.10
4
+ * @version 3.0.11
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 c=Object.defineProperty;var d=Object.getOwnPropertyDescriptor;var f=Object.getOwnPropertyNames;var y=Object.prototype.hasOwnProperty;var $=e=>c(e,"__esModule",{value:!0});var h=(e,i)=>{for(var t in i)c(e,t,{get:i[t],enumerable:!0})},g=(e,i,t,l)=>{if(i&&typeof i=="object"||typeof i=="function")for(let n of f(i))!y.call(e,n)&&(t||n!=="default")&&c(e,n,{get:()=>i[n],enumerable:!(l=d(i,n))||l.enumerable});return e};var b=(e=>(i,t)=>e&&e.get(i)||(t=g($({}),i,1),e&&e.set(i,t),t))(typeof WeakMap!="undefined"?new WeakMap:0);var W={};h(W,{cleanChangelogs:()=>v,version:()=>p});var m="3.0.10";var p=m;function o(e){return typeof e=="string"}function v(e,i=!1){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 t,l=!1;if(typeof e=="string"&&e.length&&(!e.includes(`
10
+ var lernaCleanChangelogs=(()=>{var p=Object.defineProperty;var d=Object.getOwnPropertyDescriptor;var f=Object.getOwnPropertyNames;var y=Object.prototype.hasOwnProperty;var h=e=>p(e,"__esModule",{value:!0});var $=(e,t)=>{for(var i in t)p(e,i,{get:t[i],enumerable:!0})},g=(e,t,i,l)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of f(t))!y.call(e,n)&&(i||n!=="default")&&p(e,n,{get:()=>t[n],enumerable:!(l=d(t,n))||l.enumerable});return e};var b=(e=>(t,i)=>e&&e.get(t)||(i=g(h({}),t,1),e&&e.set(t,i),i))(typeof WeakMap!="undefined"?new WeakMap:0);var w={};$(w,{cleanChangelogs:()=>v,version:()=>m});var c="3.0.11";var m=c;function o(e){return typeof e=="string"}function v(e,t=!1){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,l=!1;if(typeof e=="string"&&e.length&&(!e.includes(`
12
12
  `)||!e.includes("\r"))){let n=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&&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&&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]):l||(u.unshift(s[r].trim()),l=!0);s[r].trim()&&(l=!1)}t=`${u.join(`
13
+ `||e[e.length-1]==="\r");e=e.trim().replace(/(https:\/\/git\.sr\.ht\/~[^/]+\/[^/]+\/)commits\//g,"$1commit/");let s=e.split(/\r?\n/);t&&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")||t&&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]):l||(u.unshift(s[r].trim()),l=!0);s[r].trim()&&(l=!1)}i=`${u.join(`
14
14
  `)}${n?`
15
- `:""}`}return{version:p,res:t||e}}return b(W);})();
15
+ `:""}`}return{version:m,res:i||e}}return b(w);})();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lerna-clean-changelogs",
3
- "version": "3.0.10",
3
+ "version": "3.0.11",
4
4
  "description": "Removes frivolous entries from commitizen generated changelogs",
5
5
  "keywords": [
6
6
  "changelog",
@@ -37,13 +37,15 @@
37
37
  "scripts": {
38
38
  "build": "node '../../ops/scripts/esbuild.js' && yarn run dts",
39
39
  "dev": "DEV=true node '../../ops/scripts/esbuild.js' && yarn run dts",
40
- "dts": "rollup -c",
40
+ "dts": "rollup -c && yarn run prettier 'types/index.d.ts' --write",
41
41
  "examples": "node '../../ops/scripts/run-examples.js'",
42
42
  "lect": "node '../../ops/lect/lect.js'",
43
43
  "letspublish": "yarn publish || :",
44
44
  "lint": "eslint . --fix",
45
45
  "perf": "node perf/check.js",
46
46
  "prepare": "echo 'ready'",
47
+ "prettier": "prettier",
48
+ "prettier:format": "prettier --write '**/*.{ts,tsx,md}' --no-error-on-unmatched-pattern",
47
49
  "pretest": "yarn run lect && yarn run build",
48
50
  "test": "c8 yarn run unit && yarn run examples && yarn run lint",
49
51
  "unit": "uvu test"
package/types/index.d.ts CHANGED
@@ -1,7 +1,10 @@
1
1
  declare const version: string;
2
- declare function cleanChangelogs(changelogContents: string, extras?: boolean): {
3
- version: string;
4
- res: string;
2
+ declare function cleanChangelogs(
3
+ changelogContents: string,
4
+ extras?: boolean
5
+ ): {
6
+ version: string;
7
+ res: string;
5
8
  };
6
9
 
7
10
  export { cleanChangelogs, version };