@moneko/core 3.44.0 → 3.44.1

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.
@@ -0,0 +1,22 @@
1
+ import { argv } from 'node:process';
2
+ import lint from '@commitlint/lint';
3
+ import { ink, loadFileSync, println } from '@moneko/utils';
4
+ interface FormatOptions {
5
+ signs?: string[];
6
+ colors?: string[];
7
+ verbose?: boolean;
8
+ helpUrl?: string;
9
+ }
10
+ interface FormatProblem {
11
+ level: number;
12
+ message: string;
13
+ name: string;
14
+ }
15
+ interface FormatResult {
16
+ errors: FormatProblem[];
17
+ warnings: FormatProblem[];
18
+ }
19
+ declare function selectSign(result: FormatResult);
20
+ declare function selectColor(result: FormatResult);
21
+ declare function format(result: FormatResult, options?: FormatOptions): string[];
22
+ declare async function commitlint();
@@ -0,0 +1 @@
1
+ import{argv as e}from"node:process";import l from"@commitlint/lint";import{ink as t,loadFileSync as a,println as r}from"@moneko/utils";!async function(){let n=a(e[2]);if(null===n)throw Error("message read failed");let s=await l(n,{"body-leading-blank":[1,"always"],"body-max-line-length":[2,"always",100],"footer-leading-blank":[1,"always"],"footer-max-line-length":[2,"always",100],"header-max-length":[2,"always",100],"header-trim":[2,"always"],"subject-case":[2,"never",["sentence-case","start-case","pascal-case","upper-case"]],"subject-empty":[2,"never"],"subject-full-stop":[2,"never","."],"type-case":[2,"always","lower-case"],"type-empty":[2,"never"],"type-enum":[2,"always",["build","chore","ci","docs","feat","fix","perf","refactor","revert","style","test"]]},{});(function(e,l={}){let{signs:a=[" ","⚠","✖"],colors:r=["white","yellow","red"]}=l,{errors:n=[],warnings:s=[]}=e,o=[...n,...s].map(e=>`${t(a[e.level]||"",r[e.level]||"white")} ${e.message} ${t(`[${e.name}]`,"8")}`),i=t((e.errors||[]).length>0?"✖":(e.warnings||[]).length?"⚠":"✔",(e.errors||[]).length>0?"red":(e.warnings||[]).length?"yellow":"green"),c=o.length>0,m=l.verbose||c?`${i} found ${n.length} problems, ${s.length} warnings`:void 0,p=m?t(m,"8",{bold:!0}):m,d=c&&l.helpUrl?`ⓘ Get help: ${l.helpUrl}`:void 0;return[...o,c?"":void 0,p,d,c?"":void 0].filter(e=>"string"==typeof e)})(s).map(e=>{r(e)}),s.valid||process.exit(1)}();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moneko/core",
3
- "version": "3.44.0",
3
+ "version": "3.44.1",
4
4
  "description": "core",
5
5
  "main": "lib/index.mjs",
6
6
  "type": "module",
@@ -10,7 +10,8 @@
10
10
  },
11
11
  "bin": {
12
12
  "mo": "lib/bin/index.mjs",
13
- "pure-lint": "lib/bin/pure-lint.mjs"
13
+ "pure-lint": "lib/bin/pure-lint.mjs",
14
+ "commit-lint": "lib/bin/commit-lint.mjs"
14
15
  },
15
16
  "exports": {
16
17
  ".": {
@@ -135,6 +136,7 @@
135
136
  "webpack-virtual-modules": "0.6.2"
136
137
  },
137
138
  "devDependencies": {
139
+ "@commitlint/lint": "19.8.0",
138
140
  "@moneko/css": "1.2.0",
139
141
  "@types/babel__core": "7.20.5",
140
142
  "@types/stylis": "4.2.7",