@nice-move/cli 0.12.0 → 0.12.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/README.md +2 -0
- package/dist/cli.mjs +1 -1
- package/dist/cmd/git.mjs +1 -1
- package/dist/cmd/lint.mjs +1 -1
- package/dist/{dist-C92sbTTu.mjs → dist-DZo1mBt4.mjs} +1 -1
- package/dist/{git-hooks-2wDoOncq.mjs → git-hooks-ukr62xCA.mjs} +1 -1
- package/dist/{lib-ClAZZHmX.mjs → lib-B9YSDxfE.mjs} +1 -1
- package/dist/{lib-BGxhLM1P.mjs → lib-PLIKbC88.mjs} +2 -2
- package/dist/lint-CIBWRpM4.mjs +1 -0
- package/dist/{lint-F5AnrbQa.mjs → lint-CvrvpJvb.mjs} +1 -1
- package/dist/rolldown-runtime-Dn1JIVgp.mjs +1 -0
- package/package.json +2 -2
- package/dist/lint-auI-Wp-E.mjs +0 -1
- package/dist/rolldown-runtime-9nwCUaSw.mjs +0 -1
package/README.md
CHANGED
|
@@ -40,6 +40,8 @@ Use [commitlint](https://commitlint.js.org/) to enforcing [conventional commits]
|
|
|
40
40
|
npm exec nice-move lint commit
|
|
41
41
|
```
|
|
42
42
|
|
|
43
|
+
The commit message file is located with `git rev-parse --git-path COMMIT_EDITMSG`, so it works in the main worktree and in linked worktrees, and from any subdirectory.
|
|
44
|
+
|
|
43
45
|
### `lint staged`
|
|
44
46
|
|
|
45
47
|
Lint and format git staged files.
|
package/dist/cli.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{a as e,i as t}from"./git-hooks-
|
|
2
|
+
import{a as e,i as t}from"./git-hooks-ukr62xCA.mjs";import{a as n,i as r}from"./lint-CIBWRpM4.mjs";import{Cheetor as i}from"cheetor";import{fileURLToPath as a}from"node:url";function o(){if(n(`svgo/package.json`)&&n(`svgo-config/package.json`))return{command:`svgo`,describe:"Run `svgo` to optimize `*.svg`",async handler(t){let[n=`./`]=t._;try{await e(`svgo`,[`-r`,`-q`,`--pretty`,`--indent`,`2`,`--config`,a(import.meta.resolve(`svgo-config`)),`-f`,n]),console.log(`Done: calling svgo`)}catch(e){process.exitCode=1,console.error(`Error:`,e.message)}}}}process.on(`SIGINT`,()=>{}),new i(`../package.json`,import.meta.url).website(`https://www.npmjs.com/org/nice-move`).command(r).command(t).commandSmart(o).setup();export{};
|
package/dist/cmd/git.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{t as builder,n as command,r as description}from"../git-hooks-
|
|
1
|
+
export{t as builder,n as command,r as description}from"../git-hooks-ukr62xCA.mjs";
|
package/dist/cmd/lint.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{t as builder,n as command,r as description}from"../lint-
|
|
1
|
+
export{t as builder,n as command,r as description}from"../lint-CIBWRpM4.mjs";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as e,t}from"./rolldown-runtime-
|
|
1
|
+
import{r as e,t}from"./rolldown-runtime-Dn1JIVgp.mjs";var n=/* @__PURE__ */ t((e=>{let t=Symbol.for(`yaml.alias`),n=Symbol.for(`yaml.document`),r=Symbol.for(`yaml.map`),i=Symbol.for(`yaml.pair`),a=Symbol.for(`yaml.scalar`),o=Symbol.for(`yaml.seq`),s=Symbol.for(`yaml.node.type`),c=e=>!!e&&typeof e==`object`&&e[s]===t,l=e=>!!e&&typeof e==`object`&&e[s]===n,u=e=>!!e&&typeof e==`object`&&e[s]===r,d=e=>!!e&&typeof e==`object`&&e[s]===i,f=e=>!!e&&typeof e==`object`&&e[s]===a,p=e=>!!e&&typeof e==`object`&&e[s]===o;function m(e){if(e&&typeof e==`object`)switch(e[s]){case r:case o:return!0}return!1}function h(e){if(e&&typeof e==`object`)switch(e[s]){case t:case r:case a:case o:return!0}return!1}e.ALIAS=t,e.DOC=n,e.MAP=r,e.NODE_TYPE=s,e.PAIR=i,e.SCALAR=a,e.SEQ=o,e.hasAnchor=e=>(f(e)||m(e))&&!!e.anchor,e.isAlias=c,e.isCollection=m,e.isDocument=l,e.isMap=u,e.isNode=h,e.isPair=d,e.isScalar=f,e.isSeq=p})),r=/* @__PURE__ */ t((e=>{var t=n();let r=Symbol(`break visit`),i=Symbol(`skip children`),a=Symbol(`remove node`);function o(e,n){let r=u(n);t.isDocument(e)?s(null,e.contents,r,Object.freeze([e]))===a&&(e.contents=null):s(null,e,r,Object.freeze([]))}o.BREAK=r,o.SKIP=i,o.REMOVE=a;function s(e,n,i,o){let c=d(e,n,i,o);if(t.isNode(c)||t.isPair(c))return f(e,o,c),s(e,c,i,o);if(typeof c!=`symbol`){if(t.isCollection(n)){o=Object.freeze(o.concat(n));for(let e=0;e<n.items.length;++e){let t=s(e,n.items[e],i,o);if(typeof t==`number`)e=t-1;else if(t===r)return r;else t===a&&(n.items.splice(e,1),--e)}}else if(t.isPair(n)){o=Object.freeze(o.concat(n));let e=s(`key`,n.key,i,o);if(e===r)return r;e===a&&(n.key=null);let t=s(`value`,n.value,i,o);if(t===r)return r;t===a&&(n.value=null)}}return c}async function c(e,n){let r=u(n);t.isDocument(e)?await l(null,e.contents,r,Object.freeze([e]))===a&&(e.contents=null):await l(null,e,r,Object.freeze([]))}c.BREAK=r,c.SKIP=i,c.REMOVE=a;async function l(e,n,i,o){let s=await d(e,n,i,o);if(t.isNode(s)||t.isPair(s))return f(e,o,s),l(e,s,i,o);if(typeof s!=`symbol`){if(t.isCollection(n)){o=Object.freeze(o.concat(n));for(let e=0;e<n.items.length;++e){let t=await l(e,n.items[e],i,o);if(typeof t==`number`)e=t-1;else if(t===r)return r;else t===a&&(n.items.splice(e,1),--e)}}else if(t.isPair(n)){o=Object.freeze(o.concat(n));let e=await l(`key`,n.key,i,o);if(e===r)return r;e===a&&(n.key=null);let t=await l(`value`,n.value,i,o);if(t===r)return r;t===a&&(n.value=null)}}return s}function u(e){return typeof e==`object`&&(e.Collection||e.Node||e.Value)?Object.assign({Alias:e.Node,Map:e.Node,Scalar:e.Node,Seq:e.Node},e.Value&&{Map:e.Value,Scalar:e.Value,Seq:e.Value},e.Collection&&{Map:e.Collection,Seq:e.Collection},e):e}function d(e,n,r,i){if(typeof r==`function`)return r(e,n,i);if(t.isMap(n))return r.Map?.(e,n,i);if(t.isSeq(n))return r.Seq?.(e,n,i);if(t.isPair(n))return r.Pair?.(e,n,i);if(t.isScalar(n))return r.Scalar?.(e,n,i);if(t.isAlias(n))return r.Alias?.(e,n,i)}function f(e,n,r){let i=n[n.length-1];if(t.isCollection(i))i.items[e]=r;else if(t.isPair(i))e===`key`?i.key=r:i.value=r;else if(t.isDocument(i))i.contents=r;else{let e=t.isAlias(i)?`alias`:`scalar`;throw Error(`Cannot replace node with ${e} parent`)}}e.visit=o,e.visitAsync=c})),i=/* @__PURE__ */ t((e=>{var t=n(),i=r();let a={"!":`%21`,",":`%2C`,"[":`%5B`,"]":`%5D`,"{":`%7B`,"}":`%7D`},o=e=>e.replace(/[!,[\]{}]/g,e=>a[e]);var s=class e{constructor(t,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},e.defaultYaml,t),this.tags=Object.assign({},e.defaultTags,n)}clone(){let t=new e(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){let t=new e(this.yaml,this.tags);switch(this.yaml.version){case`1.1`:this.atNextDocument=!0;break;case`1.2`:this.atNextDocument=!1,this.yaml={explicit:e.defaultYaml.explicit,version:`1.2`},this.tags=Object.assign({},e.defaultTags)}return t}add(t,n){this.atNextDocument&&=(this.yaml={explicit:e.defaultYaml.explicit,version:`1.1`},this.tags=Object.assign({},e.defaultTags),!1);let r=t.trim().split(/[ \t]+/),i=r.shift();switch(i){case`%TAG`:{if(r.length!==2&&(n(0,`%TAG directive should contain exactly two parts`),r.length<2))return!1;let[e,t]=r;return this.tags[e]=t,!0}case`%YAML`:{if(this.yaml.explicit=!0,r.length!==1)return n(0,`%YAML directive should contain exactly one part`),!1;let[e]=r;if(e===`1.1`||e===`1.2`)return this.yaml.version=e,!0;{let t=/^\d+\.\d+$/.test(e);return n(6,`Unsupported YAML version ${e}`,t),!1}}default:return n(0,`Unknown directive ${i}`,!0),!1}}tagName(e,t){if(e===`!`)return`!`;if(e[0]!==`!`)return t(`Not a valid tag: ${e}`),null;if(e[1]===`<`){let n=e.slice(2,-1);return n===`!`||n===`!!`?(t(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==`>`&&t(`Verbatim tags must end with a >`),n)}let[,n,r]=e.match(/^(.*!)([^!]*)$/s);r||t(`The ${e} tag has no suffix`);let i=this.tags[n];if(i)try{return i+decodeURIComponent(r)}catch(e){return t(String(e)),null}return n===`!`?e:(t(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[t,n]of Object.entries(this.tags))if(e.startsWith(n))return t+o(e.substring(n.length));return e[0]===`!`?e:`!<${e}>`}toString(e){let n=this.yaml.explicit?[`%YAML ${this.yaml.version||`1.2`}`]:[],r=Object.entries(this.tags),a;if(e&&r.length>0&&t.isNode(e.contents)){let n={};i.visit(e.contents,(e,r)=>{t.isNode(r)&&r.tag&&(n[r.tag]=!0)}),a=Object.keys(n)}else a=[];for(let[t,i]of r)t===`!!`&&i===`tag:yaml.org,2002:`||e&&!a.some(e=>e.startsWith(i))||n.push(`%TAG ${t} ${i}`);return n.join(`
|
|
2
2
|
`)}};s.defaultYaml={explicit:!1,version:`1.2`},s.defaultTags={"!!":`tag:yaml.org,2002:`},e.Directives=s})),a=/* @__PURE__ */ t((e=>{var t=n(),i=r();function a(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){let t=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw Error(t)}return!0}function o(e){let t=/* @__PURE__ */ new Set;return i.visit(e,{Value(e,n){n.anchor&&t.add(n.anchor)}}),t}function s(e,t){for(let n=1;;++n){let r=`${e}${n}`;if(!t.has(r))return r}}function c(e,n){let r=[],i=/* @__PURE__ */ new Map,a=null;return{onAnchor:t=>{r.push(t),a??=o(e);let i=s(n,a);return a.add(i),i},setAnchors:()=>{for(let e of r){let n=i.get(e);if(typeof n==`object`&&n.anchor&&(t.isScalar(n.node)||t.isCollection(n.node)))n.node.anchor=n.anchor;else{let t=/* @__PURE__ */ Error(`Failed to resolve repeated object (this should not happen)`);throw t.source=e,t}}},sourceObjects:i}}e.anchorIsValid=a,e.anchorNames=o,e.createNodeAnchors=c,e.findNewAnchor=s})),o=/* @__PURE__ */ t((e=>{function t(e,n,r,i){if(i&&typeof i==`object`){if(Array.isArray(i))for(let n=0,r=i.length;n<r;++n){let r=i[n],a=t(e,i,String(n),r);a===void 0?delete i[n]:a!==r&&(i[n]=a)}else if(i instanceof Map)for(let n of Array.from(i.keys())){let r=i.get(n),a=t(e,i,n,r);a===void 0?i.delete(n):a!==r&&i.set(n,a)}else if(i instanceof Set)for(let n of Array.from(i)){let r=t(e,i,n,n);r===void 0?i.delete(n):r!==n&&(i.delete(n),i.add(r))}else for(let[n,r]of Object.entries(i)){let a=t(e,i,n,r);a===void 0?delete i[n]:a!==r&&(i[n]=a)}}return e.call(n,r,i)}e.applyReviver=t})),s=/* @__PURE__ */ t((e=>{var t=n();function r(e,n,i){if(Array.isArray(e))return e.map((e,t)=>r(e,String(t),i));if(e&&typeof e.toJSON==`function`){if(!i||!t.hasAnchor(e))return e.toJSON(n,i);let r={aliasCount:0,count:1,res:void 0};i.anchors.set(e,r),i.onCreate=e=>{r.res=e,delete i.onCreate};let a=e.toJSON(n,i);return i.onCreate&&i.onCreate(a),a}return typeof e==`bigint`&&!i?.keep?Number(e):e}e.toJS=r})),c=/* @__PURE__ */ t((e=>{var t=o(),r=n(),i=s();e.NodeBase=class{constructor(e){Object.defineProperty(this,r.NODE_TYPE,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:n,maxAliasCount:a,onAnchor:o,reviver:s}={}){if(!r.isDocument(e))throw TypeError(`A document argument is required`);let c={anchors:/* @__PURE__ */ new Map,doc:e,keep:!0,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof a==`number`?a:100},l=i.toJS(this,``,c);if(typeof o==`function`)for(let{count:e,res:t}of c.anchors.values())o(t,e);return typeof s==`function`?t.applyReviver(s,{"":l},``,l):l}}})),l=/* @__PURE__ */ t((e=>{var t=a(),i=r(),o=n(),l=c(),u=s(),d=class extends l.NodeBase{constructor(e){super(o.ALIAS),this.source=e,Object.defineProperty(this,"tag",{set(){throw Error(`Alias nodes cannot have tags`)}})}resolve(e,t){if(t?.maxAliasCount===0)throw ReferenceError(`Alias resolution is disabled`);let n;t?.aliasResolveCache?n=t.aliasResolveCache:(n=[],i.visit(e,{Node:(e,t)=>{(o.isAlias(t)||o.hasAnchor(t))&&n.push(t)}}),t&&(t.aliasResolveCache=n));let r;for(let e of n){if(e===this)break;e.anchor===this.source&&(r=e)}if(r&&t){let{anchors:e,doc:n,maxAliasCount:i}=t,a=e.get(r);
|
|
3
3
|
/* istanbul ignore if */
|
|
4
4
|
if(a||=(u.toJS(r,null,t),e.get(r)),a?.res===void 0)throw ReferenceError(`This should not happen: Alias anchor was not resolved?`);if(i>=0&&(a.count+=1,a.aliasCount===0&&(a.aliasCount=f(n,r,e)),a.count*a.aliasCount>i))throw ReferenceError(`Excessive alias count indicates a resource exhaustion attack`)}return r}toJSON(e,t){if(!t)return{source:this.source};let n=this.resolve(t.doc,t);if(!n){let e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw ReferenceError(e)}return t.anchors.get(n).res}toString(e,n,r){let i=`*${this.source}`;if(e){if(t.anchorIsValid(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw Error(e)}if(e.implicitKey)return`${i} `}return i}};function f(e,t,n){if(o.isAlias(t)){let r=t.resolve(e),i=n&&r&&n.get(r);return i?i.count*i.aliasCount:0}if(o.isCollection(t)){let r=0;for(let i of t.items){let t=f(e,i,n);t>r&&(r=t)}return r}if(o.isPair(t)){let r=f(e,t.key,n),i=f(e,t.value,n);return Math.max(r,i)}return 1}e.Alias=d})),u=/* @__PURE__ */ t((e=>{var t=n(),r=c(),i=s();let a=e=>!e||typeof e!=`function`&&typeof e!=`object`;var o=class extends r.NodeBase{constructor(e){super(t.SCALAR),this.value=e}toJSON(e,t){return t?.keep?this.value:i.toJS(this.value,e,t)}toString(){return String(this.value)}};o.BLOCK_FOLDED=`BLOCK_FOLDED`,o.BLOCK_LITERAL=`BLOCK_LITERAL`,o.PLAIN=`PLAIN`,o.QUOTE_DOUBLE=`QUOTE_DOUBLE`,o.QUOTE_SINGLE=`QUOTE_SINGLE`,e.Scalar=o,e.isScalarValue=a})),d=/* @__PURE__ */ t((e=>{var t=l(),r=n(),i=u();function a(e,t,n){if(t){let e=n.filter(e=>e.tag===t),r=e.find(e=>!e.format)??e[0];if(!r)throw Error(`Tag ${t} not found`);return r}return n.find(t=>t.identify?.(e)&&!t.format)}function o(e,n,o){if(r.isDocument(e)&&(e=e.contents),r.isNode(e))return e;if(r.isPair(e)){let t=o.schema[r.MAP].createNode?.(o.schema,null,o);return t.items.push(e),t}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<`u`&&e instanceof BigInt)&&(e=e.valueOf());let{aliasDuplicateObjects:s,onAnchor:c,onTagObj:l,schema:u,sourceObjects:d}=o,f;if(s&&e&&typeof e==`object`){if(f=d.get(e),f)return f.anchor??(f.anchor=c(e)),new t.Alias(f.anchor);f={anchor:null,node:null},d.set(e,f)}n?.startsWith(`!!`)&&(n=`tag:yaml.org,2002:`+n.slice(2));let p=a(e,n,u.tags);if(!p){if(e&&typeof e.toJSON==`function`&&(e=e.toJSON()),!e||typeof e!=`object`){let t=new i.Scalar(e);return f&&(f.node=t),t}p=e instanceof Map?u[r.MAP]:Symbol.iterator in Object(e)?u[r.SEQ]:u[r.MAP]}l&&(l(p),delete o.onTagObj);let m=p?.createNode?p.createNode(o.schema,e,o):typeof p?.nodeClass?.from==`function`?p.nodeClass.from(o.schema,e,o):new i.Scalar(e);return n?m.tag=n:p.default||(m.tag=p.tag),f&&(f.node=m),m}e.createNode=o})),f=/* @__PURE__ */ t((e=>{var t=d(),r=n(),i=c();function a(e,n,r){let i=r;for(let e=n.length-1;e>=0;--e){let t=n[e];if(typeof t==`number`&&Number.isInteger(t)&&t>=0){let e=[];e[t]=i,i=e}else i=/* @__PURE__ */ new Map([[t,i]])}return t.createNode(i,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw Error(`This should not happen, please report a bug.`)},schema:e,sourceObjects:/* @__PURE__ */ new Map})}let o=e=>e==null||typeof e==`object`&&!!e[Symbol.iterator]().next().done;e.Collection=class extends i.NodeBase{constructor(e,t){super(e),Object.defineProperty(this,"schema",{value:t,configurable:!0,enumerable:!1,writable:!0})}clone(e){let t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(t.schema=e),t.items=t.items.map(t=>r.isNode(t)||r.isPair(t)?t.clone(e):t),this.range&&(t.range=this.range.slice()),t}addIn(e,t){if(o(e))this.add(t);else{let[n,...i]=e,o=this.get(n,!0);if(r.isCollection(o))o.addIn(i,t);else if(o===void 0&&this.schema)this.set(n,a(this.schema,i,t));else throw Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}}deleteIn(e){let[t,...n]=e;if(n.length===0)return this.delete(t);let i=this.get(t,!0);if(r.isCollection(i))return i.deleteIn(n);throw Error(`Expected YAML collection at ${t}. Remaining path: ${n}`)}getIn(e,t){let[n,...i]=e,a=this.get(n,!0);return i.length===0?!t&&r.isScalar(a)?a.value:a:r.isCollection(a)?a.getIn(i,t):void 0}hasAllNullValues(e){return this.items.every(t=>{if(!r.isPair(t))return!1;let n=t.value;return n==null||e&&r.isScalar(n)&&n.value==null&&!n.commentBefore&&!n.comment&&!n.tag})}hasIn(e){let[t,...n]=e;if(n.length===0)return this.has(t);let i=this.get(t,!0);return r.isCollection(i)?i.hasIn(n):!1}setIn(e,t){let[n,...i]=e;if(i.length===0)this.set(n,t);else{let e=this.get(n,!0);if(r.isCollection(e))e.setIn(i,t);else if(e===void 0&&this.schema)this.set(n,a(this.schema,i,t));else throw Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}}},e.collectionFromPath=a,e.isEmptyPath=o})),p=/* @__PURE__ */ t((e=>{let t=e=>e.replace(/^(?!$)(?: $)?/gm,`#`);function n(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}e.indentComment=n,e.lineComment=(e,t,r)=>e.endsWith(`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-
|
|
1
|
+
import{n as e}from"./rolldown-runtime-Dn1JIVgp.mjs";import{fileURLToPath as t}from"node:url";import{ChildProcess as n,execFile as r,spawn as i,spawnSync as a}from"node:child_process";import o,{execArgv as s,execPath as c,hrtime as l,platform as u}from"node:process";import{aborted as d,callbackify as f,debuglog as p,inspect as m,promisify as h,stripVTControlCharacters as g}from"node:util";import{StringDecoder as _}from"node:string_decoder";import v from"node:tty";import y from"node:path";import{scheduler as b,setImmediate as x,setTimeout as S}from"node:timers/promises";import{constants as C}from"node:os";import{EventEmitter as ee,addAbortListener as w,on as T,once as E,setMaxListeners as te}from"node:events";import{serialize as ne}from"node:v8";import re,{appendFileSync as ie,closeSync as ae,createReadStream as oe,createWriteStream as se,openSync as ce,readFileSync as le,readSync as ue,statSync as de,writeFileSync as fe}from"node:fs";import{Buffer as D}from"node:buffer";import{finished as O}from"node:stream/promises";import{Duplex as k,PassThrough as pe,Readable as A,Transform as me,Writable as j,getDefaultHighWaterMark as he}from"node:stream";import ge from"node:path/win32";function M(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}const _e=(e,t)=>{let n=be(ve(e));if(typeof n!=`string`)throw TypeError(`${t} must be a string or a file URL: ${n}.`);return n},ve=e=>ye(e)?e.toString():e,ye=e=>typeof e!=`string`&&e&&Object.getPrototypeOf(e)===String.prototype,be=e=>e instanceof URL?t(e):e,xe=(e,t=[],n,...r)=>{if(r.length>0)throw TypeError(`Execa accepts at most three arguments: file, arguments, options.`);if(n!==void 0&&M(t))throw TypeError(`Execa accepts at most one options object. Please merge the second and third arguments.`);let i=_e(e,`First argument`),[a,o={}]=M(t)?[[],t]:[t,n];if(!Array.isArray(a))throw TypeError(`Second argument must be either an array of arguments or an options object: ${a}`);if(a.some(e=>typeof e==`object`&&!!e))throw TypeError(`Second argument must be an array of strings: ${a}`);let s=a.map(String),c=s.find(e=>e.includes(`\0`));if(c!==void 0)throw TypeError(`Arguments cannot contain null bytes ("\\0"): ${c}`);if(!M(o))throw TypeError(`Last argument must be an options object: ${o}`);return[i,s,{__proto__:null,...o}]},Se=(e,t,n)=>{let r=[e,...t],i=r.join(` `);return{command:i,escapedCommand:n?we(i):r.map(e=>Oe(we(e))).join(` `)}},Ce=e=>g(e).split(`
|
|
2
2
|
`).map(e=>we(e)).join(`
|
|
3
3
|
`),we=e=>e.replaceAll(Ee,e=>Te(e)),Te=e=>{let t=De[e];if(t!==void 0)return t;let n=e.codePointAt(0),r=n.toString(16);return n<=65535?`\\u${r.padStart(4,`0`)}`:`\\U${r}`},Ee=(()=>{try{return/* @__PURE__ */ RegExp(`\\p{Separator}|\\p{Other}`,`gu`)}catch{return/[\s\u0000-\u001F\u007F-\u009F\u00AD]/g}})(),De={" ":` `,"\b":`\\b`,"\f":`\\f`,"\n":`\\n`,"\r":`\\r`," ":`\\t`},Oe=e=>ke.test(e)?e:u===`win32`?`"${e.replaceAll(`"`,`""`)}"`:`'${e.replaceAll(`'`,`'\\''`)}'`,ke=/^[\w\-./]+$/,{toString:Ae}=Object.prototype,je=e=>Ae.call(e)===`[object ArrayBuffer]`,N=e=>Ae.call(e)===`[object Uint8Array]`,P=e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength),Me=new TextEncoder,Ne=e=>Me.encode(e),Pe=new TextDecoder,Fe=e=>Pe.decode(e),Ie=(e,t)=>Le(e,t).join(``),Le=(e,t)=>{if(t===`utf8`&&e.every(e=>typeof e==`string`))return e;let n=new _(t),r=e.map(e=>typeof e==`string`?Ne(e):e).map(e=>n.write(e)),i=n.end();return i===``?r:[...r,i]},Re=e=>e.length===1&&N(e[0])?e[0]:Be(ze(e)),ze=e=>e.map(e=>typeof e==`string`?Ne(e):e),Be=e=>{let t=new Uint8Array(Ve(e)),n=0;for(let r of e)t.set(r,n),n+=r.length;return t},Ve=e=>{let t=0;for(let n of e)t+=n.length;return t},He=(e,t,n)=>new(n?Ye:Je)(t,e instanceof Ue?{}:{cause:e});var Ue=class extends Error{};const We=(e,t)=>{Object.defineProperties(e.prototype,{name:{value:t,writable:!0,enumerable:!1,configurable:!0},[Ke]:{value:!0,writable:!1,enumerable:!1,configurable:!1}})},Ge=e=>qe(e)&&Ke in e,Ke=Symbol(`isExecaError`),qe=e=>e instanceof Error||Object.prototype.toString.call(e)===`[object Error]`;var Je=class extends Error{};We(Je,Je.name);var Ye=class extends Error{};We(Ye,Ye.name);const Xe=e=>e===null?`null`:typeof e,Ze=e=>Array.isArray(e)&&Array.isArray(e.raw),Qe=(e,t)=>{let n=[],r=!1;for(let[i,a]of e.entries())({tokens:n,isSeparated:r}=$e({templates:e,expressions:t,tokens:n,isSeparated:r,index:i,template:a}));if(n.length===0)throw TypeError(`Template script must not be empty`);let[i,...a]=n;return[i,a,{}]},$e=({templates:e,expressions:t,tokens:n,isSeparated:r,index:i,template:a})=>{if(a===void 0)throw TypeError(`Invalid backslash sequence: ${e.raw[i]}`);let{nextTokens:o,leadingWhitespaces:s,trailingWhitespaces:c}=et(a,e.raw[i]),l=it(n,o,r||s),u=c||o.length===0&&r;if(i===t.length)return{tokens:l,isSeparated:u};let d=t[i],f=Array.isArray(d)?d.map(e=>at(e)):[at(d)];return{tokens:it(l,f,u),isSeparated:f.length===0&&u}},et=(e,t)=>{if(e.length===0)return{nextTokens:[],leadingWhitespaces:!1,trailingWhitespaces:!1};let n=[],r=0,i=!1;for(let a=0,o=0;a<e.length;a+=1,o+=1){let s=t[o];if(nt.has(s))a===0&&(i=!0),r!==a&&n.push(e.slice(r,a)),r=a+1;else if(s===`\\`){let e=t[o+1];if(e===`
|
|
4
4
|
`)--a,o+=1;else if(e===`u`&&t[o+2]===`{`){let e=t.indexOf(`}`,o+3);tt(t.slice(o+3,e))&&(a+=1),o=e}else o+=rt[e]??1}}let a=r===e.length;return a||n.push(e.slice(r)),{nextTokens:n,leadingWhitespaces:i,trailingWhitespaces:a}},tt=e=>Number.parseInt(e,16)>65535,nt=/* @__PURE__ */ new Set([` `,` `,`\r`,`
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{i as e,t}from"./rolldown-runtime-
|
|
1
|
+
import{i as e,t}from"./rolldown-runtime-Dn1JIVgp.mjs";var n=/* @__PURE__ */ e((/* @__PURE__ */ t(((e,t)=>{let n=process||{},r=n.argv||[],i=n.env||{},a=!(i.NO_COLOR||r.includes(`--no-color`))&&(!!i.FORCE_COLOR||r.includes(`--color`)||n.platform===`win32`||(n.stdout||{}).isTTY&&i.TERM!==`dumb`||!!i.CI),o=(e,t,n=e)=>r=>{let i=``+r,a=i.indexOf(t,e.length);return~a?e+s(i,t,n,a)+t:e+i+t},s=(e,t,n,r)=>{let i=``,a=0;do i+=e.substring(a,r)+n,a=r+t.length,r=e.indexOf(t,a);while(~r);return i+e.substring(a)},c=(e=a)=>{let t=e?o:()=>String;return{isColorSupported:e,reset:t(`\x1B[0m`,`\x1B[0m`),bold:t(`\x1B[1m`,`\x1B[22m`,`\x1B[22m\x1B[1m`),dim:t(`\x1B[2m`,`\x1B[22m`,`\x1B[22m\x1B[2m`),italic:t(`\x1B[3m`,`\x1B[23m`),underline:t(`\x1B[4m`,`\x1B[24m`),inverse:t(`\x1B[7m`,`\x1B[27m`),hidden:t(`\x1B[8m`,`\x1B[28m`),strikethrough:t(`\x1B[9m`,`\x1B[29m`),black:t(`\x1B[30m`,`\x1B[39m`),red:t(`\x1B[31m`,`\x1B[39m`),green:t(`\x1B[32m`,`\x1B[39m`),yellow:t(`\x1B[33m`,`\x1B[39m`),blue:t(`\x1B[34m`,`\x1B[39m`),magenta:t(`\x1B[35m`,`\x1B[39m`),cyan:t(`\x1B[36m`,`\x1B[39m`),white:t(`\x1B[37m`,`\x1B[39m`),gray:t(`\x1B[90m`,`\x1B[39m`),bgBlack:t(`\x1B[40m`,`\x1B[49m`),bgRed:t(`\x1B[41m`,`\x1B[49m`),bgGreen:t(`\x1B[42m`,`\x1B[49m`),bgYellow:t(`\x1B[43m`,`\x1B[49m`),bgBlue:t(`\x1B[44m`,`\x1B[49m`),bgMagenta:t(`\x1B[45m`,`\x1B[49m`),bgCyan:t(`\x1B[46m`,`\x1B[49m`),bgWhite:t(`\x1B[47m`,`\x1B[49m`),blackBright:t(`\x1B[90m`,`\x1B[39m`),redBright:t(`\x1B[91m`,`\x1B[39m`),greenBright:t(`\x1B[92m`,`\x1B[39m`),yellowBright:t(`\x1B[93m`,`\x1B[39m`),blueBright:t(`\x1B[94m`,`\x1B[39m`),magentaBright:t(`\x1B[95m`,`\x1B[39m`),cyanBright:t(`\x1B[96m`,`\x1B[39m`),whiteBright:t(`\x1B[97m`,`\x1B[39m`),bgBlackBright:t(`\x1B[100m`,`\x1B[49m`),bgRedBright:t(`\x1B[101m`,`\x1B[49m`),bgGreenBright:t(`\x1B[102m`,`\x1B[49m`),bgYellowBright:t(`\x1B[103m`,`\x1B[49m`),bgBlueBright:t(`\x1B[104m`,`\x1B[49m`),bgMagentaBright:t(`\x1B[105m`,`\x1B[49m`),bgCyanBright:t(`\x1B[106m`,`\x1B[49m`),bgWhiteBright:t(`\x1B[107m`,`\x1B[49m`)}};t.exports=c(),t.exports.createColors=c})))(),1);const r=[` `,`⚠`,`✖`],i=[`white`,`yellow`,`red`];function a(e={},t={}){let{results:n=[]}=e,r=e=>o(e,t),i=e=>s(e,t);return n.filter(e=>Array.isArray(e.warnings)||Array.isArray(e.errors)).map(e=>[...r(e),...i(e)]).reduce((e,t)=>Array.isArray(t)?[...e,...t]:[...e,t],[]).join(`
|
|
2
2
|
`)}function o(e,t={}){let{color:r=!0,legacyOutput:i=!1}=t,{errors:a=[],warnings:o=[],input:s=``}=e;if(!s)return[``];let c=r?n.default.gray(`⧗`):`⧗`,l=r?n.default.bold(s):s,u=a.length>0||o.length>0;return t.verbose||u?i?[`${c} input: ${l}`]:[`${c} --- input ---\n${l}`]:[]}function s(e={},t={}){let{signs:a=r,colors:o=i,color:s=!0}=t,{errors:u=[],warnings:d=[]}=e,f=[...u,...d].map(e=>{let t=a[e.level]||``,r=o[e.level]||`white`,i=n.default[r],c=s?i(t):t,l=s?n.default.gray(`[${e.name}]`):`[${e.name}]`;return`${c} ${e.message} ${l}`}),p=c(e),m=l(e),h=s?n.default[m](p):p,g=u.length,_=d.length,v=f.length>0,y=t.verbose||v?`${h} found ${g} problems, ${_} warnings`:void 0,b=s&&typeof y==`string`?n.default.bold(y):y,x=v&&t.helpUrl?`ⓘ Get help: ${t.helpUrl}`:void 0;return[...f,v?``:void 0,b,x,v?``:void 0].filter(e=>typeof e==`string`)}function c(e){return(e.errors||[]).length>0?`✖`:(e.warnings||[]).length?`⚠`:`✔`}function l(e){return(e.errors||[]).length>0?`red`:(e.warnings||[]).length?`yellow`:`green`}export{a as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{i as e,t}from"./rolldown-runtime-
|
|
1
|
+
import{i as e,t}from"./rolldown-runtime-Dn1JIVgp.mjs";import{createRequire as n}from"node:module";import{fileURLToPath as r,pathToFileURL as i}from"node:url";import{exec as a,spawn as o}from"node:child_process";import{cwd as s}from"node:process";import c,{format as l,formatWithOptions as u,inspect as d,promisify as f}from"node:util";import p,{basename as m,delimiter as h,dirname as g,normalize as ee,resolve as _}from"node:path";import{closeSync as v,constants as y,openSync as b,readSync as x,statSync as S}from"node:fs";import C,{constants as w}from"node:fs/promises";import{pipeline as T}from"node:stream/promises";import{PassThrough as E}from"node:stream";import D from"node:readline";import O from"node:crypto";const te=`2.32.0`,ne=/git version\s+(\d+\.\d+\.\d+)/i,k=e=>e.match(ne)?.[1],A=/(\d+)\.(\d+)\.(\d+)/,j=e=>A.exec(e)?.slice(1,4).map(Number),M=(e,t)=>{let n=j(e),r=j(t);return n[0]===r[0]?n[1]===r[1]?n[2]>=r[2]:n[1]>r[1]:n[0]>r[0]},N=e=>{try{let t=k(e);return M(t,te)}catch{return!1}};let P=!1;const F=(e=process.stdout)=>c.styleText(`red`,`test`,{stream:e})!==`test`,I=e=>{P=!!e},L=e=>t=>P?c.styleText(e,t,{validateStream:!1}):t,R=L(`green`),z=L(`red`),B=L(`yellow`),V=L(`blue`),H=L(`dim`),U=L(`bold`),W=(...e)=>u({colors:P},...e);let G;const re=(e=console)=>{G=e},K=e=>{let t=process.hrtime.bigint();return(...n)=>{if(!G)return;let r=process.hrtime.bigint(),i=(r-t)/1000000n;t=r,G.debug(H(e+`: `)+W(...n)+H(` +${i}ms`))}},ie=/^path$/i,q={key:`PATH`,value:``};function ae(e){for(let t in e){if(!Object.prototype.hasOwnProperty.call(e,t)||!ie.test(t))continue;let n=e[t];return n?{key:t,value:n}:q}return q}function oe(e,t){let n=t.value.split(h),i=[],a=typeof e==`string`?e:r(e,{windows:!1}),o;do i.push(_(a,`node_modules`,`.bin`)),o=a,a=g(a);while(a!==o);i.push(g(process.execPath));let s=i.concat(n).join(h);return{key:t.key,value:s}}function se(e,t,n=!0){let r={...process.env,...t};if(!n)return r;let i=oe(e,ae(r));return r[i.key]=i.value,r}const ce=e=>{let t=e.length,n=new E,r=()=>{--t===0&&n.end()};for(let t of e)T(t,n,{end:!1}).then(r).catch(r);return n},le=/([()\][%!^"`<>&|;, *?])/g,ue=/^#!\s*(.+)/,de=/\.(?:com|exe)$/i,fe=/node_modules[\\/]\.bin[\\/][^\\/]+\.cmd$/i,pe=process.platform===`win32`,me=[`.EXE`,`.CMD`,`.BAT`,`.COM`],he=[``];function ge(e,t=[],n={}){if(n.shell===!0||!pe)return{command:e,args:t,options:n};let r=_e(e,n),i=null;if(r!==null){let e=Buffer.alloc(150),t=null;try{t=b(r,`r`),x(t,e,0,150,0)}catch{}finally{t!==null&&v(t)}let n=e.toString().match(ue);if(n!==null){let e=n[1].trim(),t=e.indexOf(` `),r=t===-1?e:e.slice(0,t),a=t===-1?``:e.slice(t+1),o=m(r);i=o===`env`?a||null:o}}if(i!==null&&r!==null&&(t=[r,...t],e=i,r=_e(e,n)),r===null||!de.test(r)){let i=r!==null&&fe.test(r);e=ee(e),e=e.replace(le,`^$1`),t=t.map(e=>(e=e.replace(/(?=(\\+?)?)\1"/g,`$1$1\\"`),e=e.replace(/(?=(\\+?)?)\1$/,`$1$1`),e=`"${e}"`,e=e.replace(le,`^$1`),i&&(e=e.replace(le,`^$1`)),e)),t=[`/d`,`/s`,`/c`,`"${[e,...t].join(` `)}"`],e=n.env?.comspec??`cmd.exe`,n={...n,windowsVerbatimArguments:!0}}return{command:e,args:t,options:n}}function _e(e,t){let n=(t.cwd??s()).toString(),r=t.env??process.env,i=ae(r).value,a=e.includes(`/`)||e.includes(`\\`)?[``]:[n,...i.split(h)],o=r.PATHEXT?r.PATHEXT.split(h):me;e.includes(`.`)&&o[0]!==``&&(o=[``,...o]);for(let t of[o,he])for(let r of a){let i=r.startsWith(`"`)&&r.endsWith(`"`)&&r.length>1?r.slice(1,-1):r,a=_(n,i,e);for(let e of t){let t=a+e;try{if(S(t).isFile())return t}catch{}}}return null}var ve=class extends Error{result;output;exitCode;get signalCode(){return this.result.signalCode}constructor(e,t,n,r){let i=`The process`;n&&(i=`The command \`${r?.length?`${n} ${r.map(e=>/[ "'`()]/.test(e)?JSON.stringify(e):e).join(` `)}`:n}\``);let a=e.exitCode??1;super(e.signalCode===null?`${i} exited with a non-zero status (${a})`:`${i} was killed by the signal ${e.signalCode}`),this.result=e,this.output=t,this.exitCode=a,Object.defineProperty(this,"result",{enumerable:!1,writable:!1,configurable:!1})}};const ye={timeout:void 0,persist:!1},be={windowsHide:!0};function xe(e){let t=new AbortController;for(let n of e){if(n.aborted)return t.abort(),n;n.addEventListener(`abort`,()=>{t.abort(n.reason)},{signal:t.signal})}return t.signal}async function Se(e){let t=``;try{for await(let n of e)t+=n.toString()}catch{}return t}var Ce=class{_process;_aborted=!1;_options;_command;_args;_resolveClose;_processClosed;_thrownError;get process(){return this._process}get pid(){return this._process?.pid}get exitCode(){if(this._process&&this._process.exitCode!==null)return this._process.exitCode}get signalCode(){return this._process?.signalCode??null}constructor(e,t,n){this._options={...ye,...n},this._command=e,this._args=t??[],this._processClosed=new Promise(e=>{this._resolveClose=e})}kill(e){return this._process?.kill(e)===!0}get aborted(){return this._aborted}get killed(){return this._process?.killed===!0}pipe(e,t,n){return we(e,t,{...n,stdin:this})}async*[Symbol.asyncIterator](){let e=this._process;if(!e)return;let t=[];this._streamErr&&t.push(this._streamErr),this._streamOut&&t.push(this._streamOut);let n=ce(t),r=D.createInterface({input:n});for await(let e of r)yield e.toString();if(await this._processClosed,e.removeAllListeners(),this._thrownError)throw this._thrownError;if(this._options?.throwOnError&&(this.exitCode!==0&&this.exitCode!==void 0||this.signalCode!==null))throw new ve(this,void 0,this._command,this._args)}async _waitForOutput(){let e=this._process;if(!e)throw Error(`No process was started`);let[t,n]=await Promise.all([this._streamOut?Se(this._streamOut):``,this._streamErr?Se(this._streamErr):``]);await this._processClosed;let{stdin:r}=this._options;if(r&&typeof r!=`string`&&await r,e.removeAllListeners(),this._thrownError)throw this._thrownError;let i={stderr:n,stdout:t,exitCode:this.exitCode};if(this._options.throwOnError&&(this.exitCode!==0&&this.exitCode!==void 0||this.signalCode!==null))throw new ve(this,i,this._command,this._args);return i}then(e,t){return this._waitForOutput().then(e,t)}_streamOut;_streamErr;spawn(){let e=this._options,t={...be,...e.nodeOptions},n=t?.cwd??s(),r=[];this._resetState(),e.timeout!==void 0&&r.push(AbortSignal.timeout(e.timeout)),e.signal!==void 0&&r.push(e.signal),e.persist===!0&&(t.detached=!0),r.length>0&&(t.signal=xe(r)),t.env=se(n,t.env,e.nodePath);let i=ge(this._command,this._args,t),a=o(i.command,i.args,i.options);if(a.stderr&&(this._streamErr=a.stderr),a.stdout&&(this._streamOut=a.stdout),this._process=a,a.once(`error`,this._onError),a.once(`close`,this._onClose),a.stdin){let{stdin:t}=e;typeof t==`string`?a.stdin.end(t):t?.process?.stdout?.pipe(a.stdin)}}_resetState(){this._aborted=!1,this._processClosed=new Promise(e=>{this._resolveClose=e}),this._thrownError=void 0}_onError=e=>{e.name===`AbortError`&&(!(e.cause instanceof Error)||e.cause.name!==`TimeoutError`)?this._aborted=!0:this._thrownError=e};_onClose=()=>{this._resolveClose&&this._resolveClose()}};const we=(e,t,n)=>{let r=new Ce(e,t,n);return r.spawn(),r},Te=K(`lint-staged:execGit`),Ee=[`-c`,`submodule.recurse=false`];[...Ee];const De=async(e,t)=>{Te(`Running git command:`,e);let n=await we(`git`,[...Ee,...e],{nodeOptions:{env:t?.env,cwd:t?.cwd}});if(n.exitCode>0)throw Error(n.stderr.trimEnd(),{cause:n});return t?.trim===!1?n.stdout:n.stdout.trimEnd()},J=()=>V(`⋯`),Oe=()=>R(`✔`),ke=()=>V(`→`),Y=()=>z(`✖`),Ae=()=>B(`⚠`),je=()=>H(`↓`),Me=()=>H(`┌`),Ne=()=>H(`│`),Pe=()=>H(`└`),Fe=(e,t,n)=>`${z(`${Y()} Validation Error:`)}
|
|
2
2
|
|
|
3
3
|
Invalid value for '${U(e)}': ${U(d(n))}
|
|
4
4
|
|
|
@@ -45,7 +45,7 @@ if(e===p.posix.sep||e===p.win32.sep)return p.posix.sep;let t=e.split(pt).join(p.
|
|
|
45
45
|
|
|
46
46
|
`);throw n.error($e(t,e)),Error(e)}return hn("Validated config from `%s`:\n%O",t,e),i},vn=(e,t,n)=>{try{return _n(e,t,n)}catch(e){throw n.error($e(t,e)),e}},yn=K(`lint-staged:getSpawnedTasks`),bn=async(e,t,n,r=0)=>{let i=typeof e==`function`,a=i?await e([...t]):e;if(!gn(a,r,!i))throw Error(Fe(i?`[Function]`:`[Commands]`,`Commands must be strings, with at most one nested array inside the sequential task list. Function results must preserve this nesting limit.`,a));if(Array.isArray(e))return[(await Promise.all(e.map(e=>bn(e,t,n,r+1)))).flat()];let o=e=>Array.isArray(e)?e.map(o):{command:e,files:i?[]:t},s=o(a),c=e=>Array.isArray(e)?e.every(c):e.command.length+(e.files.length?1+e.files.join(` `).length:0)<=n;if(!n||n===1/0||t.length<=1||c(s))return[s];let l=Math.ceil(t.length/2);return yn(`Splitting %d files for maxArgLength of %d`,t.length,n),(await Promise.all([bn(e,t.slice(0,l),n,r),bn(e,t.slice(l),n,r)])).flat()},xn=async(e,t,n)=>t.length===0?[]:(await bn(e,t,n)).flat(),Sn=async({abortController:e,commands:t,continueOnError:n,cwd:r,files:i,maxArgLength:a,topLevelDir:o,verbose:s})=>{yn(`Creating tasks for commands %o`,t);let c=await xn(t,i.map(e=>e.filepath),a),l=t=>({title:t.command,task:$t({abortController:e,command:t.command,continueOnError:n,cwd:r,files:t.files,topLevelDir:o,verbose:s})});return c.map(e=>Array.isArray(e)?e.map(l):l(e))},Cn=K(`lint-staged:file`),wn=async e=>(Cn(`Ensuring directory exists: %s`,e),await C.mkdir(e,{recursive:!0}),e),Tn=async e=>{Cn(`Removing directory: %s`,e);try{await C.rm(e,{recursive:!0,force:!0})}catch{}},En=async(e,t=!0)=>{Cn("Reading file `%s`",e);try{return await C.readFile(e)}catch(n){if(t&&n.code===`ENOENT`)return Cn("File `%s` doesn't exist, ignoring...",e),null;throw n}},Dn=async(e,t)=>{Cn("Writing file `%s`",e),await C.writeFile(e,t)},On=(e,t)=>{let n=t===void 0?`ACMR`:t.trim(),r=e===void 0?[`--staged`]:e.trim().split(` `);return[`diff`,`--diff-filter=${n}`,...r]},kn=(e,t)=>e?e.slice(1).split(`\0:`).map(an).flatMap(([e,n,r])=>{let[,i,,,a]=e.split(` `);if(i===`160000`||i===`120000`)return[];let o=a[0],s=r??n;return[{filepath:X(p.resolve(t,s)),status:o}]}):[],An=async({all:e,cwd:t,gitConfigDir:n,diff:r,diffFilter:i})=>{try{if(e){let e=await De([`ls-files`,`--full-name`,`-z`]);return an(e).map(e=>({filepath:X(p.resolve(t,e)),status:`X`}))}let a=async e=>{let n=await De([...e,`--ita-visible-in-index`,`--raw`,`-z`],{cwd:t});return kn(n,t)},o=await a(On(r,i));if(r||o.length===0||!await En(p.resolve(n,`MERGE_HEAD`)))return o;let s=new Set((await a([`diff`,`--staged`,`MERGE_HEAD`])).map(({filepath:e})=>e));return o.filter(({filepath:e})=>s.has(e))}catch{return null}},Q=K(`lint-staged:runParallelTasks`),jn=e=>e===!0||e===1/0?1/0:e===!1||e<1||!Number.isInteger(e)?1:e,Mn=async(e,t,{abortController:n,concurrent:r=!0,logger:i})=>{let a=jn(r);Q(`Running parallel tasks with concurrency:`,a);let o=t.length>1?` `:` `,s=[];for(let e of t){e.skip()?Q(`Skipped configuration:`,e.title):(Q(`Running configuration:`,e.title),t.length>1&&i?.log(H(`${o}${e.title}`)));for(let t of e.task)if(!e.skip()){if(t.skip())Q(`Skipped glob from configuration:`,e.title,t.title);else{Q(`Running glob:`,t.title),i?.log(H(`${o} ${t.title}`));for(let e of t.task)Array.isArray(e)?(Q(`Running ${e.length} parallel tasks:`,...e.map(e=>e.title)),e.forEach((t,n)=>{if(n===0)i?.log(`${o} ${Me()} ${J()} ${t.title}`);else{let r=n===e.length-1?Pe():Ne();i?.log(`${o} ${r} ${J()} ${t.title}`)}})):(Q(`Running task:`,e.title),i?.log(`${o} ${J()} ${e.title}`));s.push(t.task)}}}i?.log(``);let c=async({title:t,task:r})=>{if(n.signal.aborted)Q(`Skipped task because aborted:`,t),i?.warn(`${je()} ${t}`);else try{Q(`Running task:`,t),await r(e),Q(`Done running task:`,t),i?.log(`${Oe()} ${t}`)}catch{Q(`Failed to run task:`,t),i?.error(z(`${Y()} ${t}`))}},l=async e=>{for(let t of e)Array.isArray(t)?await Promise.all(t.map(c)):await c(t)},u=0,d=async()=>{for(;u<s.length;){let e=s[u++];await l(e)}},f=Math.min(s.length,a);Q(`Running workers with concurrency:`,f),await Promise.all(Array.from({length:f},d)),Q(`Done running workers`),i?.log(``)},$=K(`lint-staged:GitWorkflow`),Nn=/\x00/,Pn=(e,t=!0)=>e.reduce((e,n)=>{if(Nn.test(n)){let[r,i]=n.split(Nn);t&&e.push(i),e.push(r)}else e.push(n);return e},[]),Fn=`unstaged.patch`,In=[`--binary`,`--unified=0`,`--no-color`,`--no-ext-diff`,`--src-prefix=a/`,`--dst-prefix=b/`,`--patch`,`--submodule=short`],Ln=[`-v`,`--whitespace=nowarn`,`--recount`,`--unidiff-zero`],Rn=/^diff --git /m,zn=e=>{if(!e)return/* @__PURE__ */ new Map;let[t,n]=e.split(`\0\0`),r=an(t).filter((e,t)=>t%2==1),i=n.split(Rn).slice(1),a=r.values(),o=/* @__PURE__ */ new Map,s,c;for(let e of i){let t=e.slice(0,e.indexOf(`
|
|
47
47
|
`));t!==s&&(c=a.next().value,s=t),o.set(c,(o.get(c)??``)+e)}return o},Bn=/^"(.*)"$/,Vn=e=>e.map(e=>e.replace(Bn,`$1`)),Hn=/\x00(?=[ AMDRCU?!]{2} |$)/;var Un=class{constructor({allowEmpty:e,diff:t,diffFilter:n,failOnChanges:r,gitConfigDir:i,logger:a,maxArgLength:o,topLevelDir:s}){this.execGit=(e,t={})=>De(e,{...t,cwd:s}),this.allowEmpty=e,this.diff=t,this.diffFilter=n,this.gitConfigDir=i,this.failOnChanges=!!r,this.logger=a,this.maxArgLength=o,this.topLevelDir=s,this.mergeHeadFilename=p.resolve(i,`MERGE_HEAD`),this.mergeModeFilename=p.resolve(i,`MERGE_MODE`),this.mergeMsgFilename=p.resolve(i,`MERGE_MSG`)}async backupMergeStatus(){$(`Backing up merge state...`),await Promise.all([En(this.mergeHeadFilename).then(e=>this.mergeHeadBuffer=e),En(this.mergeModeFilename).then(e=>this.mergeModeBuffer=e),En(this.mergeMsgFilename).then(e=>this.mergeMsgBuffer=e)]),$(`Done backing up merge state!`)}async restoreMergeStatus(e){$(`Restoring merge state...`);try{await Promise.all([this.mergeHeadBuffer&&Dn(this.mergeHeadFilename,this.mergeHeadBuffer),this.mergeModeBuffer&&Dn(this.mergeModeFilename,this.mergeModeBuffer),this.mergeMsgBuffer&&Dn(this.mergeMsgFilename,this.mergeMsgBuffer)]),$(`Done restoring merge state!`)}catch(t){throw e.errors.add(Z),e.errors.add(Pt),$(`Failed restoring merge state with error:`),$(t),t}}async getUnstagedFiles({onlyPartial:e=!1}={}){$(`Getting partially staged files...`);let t=(await this.execGit([`status`,`-z`,`--untracked-files=no`])).split(Hn).filter(t=>{let[n,r]=t,i=n!==` `,a=r!==` `;return e?i&&a:a}).map(e=>e.slice(3)).filter(Boolean);return $(`Found ${e?`partially staged`:`unstaged`} files:`,t),t.length?t:null}async listStashes(){return await this.execGit([`stash`,`list`,`--format="%H %s"`,`-z`]).then(an).then(Vn)}async prepare(e){this.logger.log(H(`${J()} ${e.shouldBackup?`Backing up original state…`:`Preparing lint-staged…`}`));try{if(this.hiddenPath=p.join(this.gitConfigDir,`./lint-staged/${e.runId}`),e.shouldBackup&&await this.backupMergeStatus(),e.shouldHideUnstaged||e.shouldHideAll?(this.unstagedFiles=await this.getUnstagedFiles({onlyPartial:!1}),e.hasFilesToHide=!!this.unstagedFiles):e.shouldHidePartiallyStaged&&(this.unstagedFiles=await this.getUnstagedFiles({onlyPartial:!0}),e.hasFilesToHide=!!this.unstagedFiles),this.unstagedFiles){await wn(this.hiddenPath),e.unstagedPatch=p.join(this.hiddenPath,Fn);let t=Pn(this.unstagedFiles);await this.execGit([`diff`,...In,`--output`,e.unstagedPatch,`--`,...t])}if(e.shouldBackup){let t=`lint-staged automatic backup (${e.runId})`;if(e.shouldHideUnstaged||e.shouldHideAll){let n=[`stash`,`push`,`--keep-index`,`--message`,t];e.shouldHideAll&&n.push(`--include-untracked`),await this.execGit(n),e.backupHash=(await this.listStashes()).find(t=>t.includes(e.runId))?.split(` `)[0],await this.restoreMergeStatus(e)}else e.backupHash=await this.execGit([`stash`,`create`]),await this.execGit([`stash`,`store`,`--quiet`,`--message`,t,e.backupHash]);$(`Created backup stash with commit hash %s`,e.backupHash)}this.logger.log(`${Oe()} ${e.shouldBackup?`Done backing up original state (${await this.execGit([`rev-parse`,`--short`,e.backupHash])})!`:`Done preparing lint-staged!`}`)}catch(t){e.errors.add(Z);let n=e.shouldBackup?`Failed to back up original state!`:`Failed to prepare lint-staged!`;this.logger.error(`${Y()} ${n}`),$(t)}}async hidePartiallyStagedChanges(e){this.logger.log(H(`${J()} Hiding unstaged changes to partially staged files…`));try{let e=Pn(this.unstagedFiles,!1);await this.execGit([`restore`,`--worktree`,`--`,...e]),this.logger.log(`${Oe()} Done hiding unstaged changes to partially staged files!`)}catch(t){e.errors.add(Z),e.errors.add(Mt);let n=`${Y()} Failed to hude unstaged changes to partially staged files!`;this.logger.error(n),$(t)}}async runTasks(e,t,{abortController:n,concurrent:r}){this.logger.log(H(`${J()} Running tasks for ${this.diff?`changed`:`staged`} files…`));try{e.unstagedDiff=await this.execGit([`diff`,...In,`--raw`,`-z`,`--no-renames`,`--no-textconv`],{trim:!1})}catch(t){e.errors.add(Z),this.logger.error(`Failed to get diff of unstaged changes!`),$(t);return}let i=`${Y()} Failed to run tasks for ${this.diff?`changed`:`staged`} files!`;try{await Mn(e,t,{abortController:n,concurrent:r,logger:this.logger}),this.logger.log(e.errors.has(Lt)?i:`${Oe()} Done running tasks for ${this.diff?`changed`:`staged`} files!`)}catch(t){e.errors.add(Lt),this.logger.error(i),$(t)}}async updateIndex(e){this.logger.log(H(`${J()} Staging changes from tasks…`));try{let t=await this.execGit([`diff`,...In,`--raw`,`-z`,`--no-renames`,`--no-textconv`],{trim:!1}),n=zn(e.unstagedDiff),r=zn(t),i=/* @__PURE__ */ new Set;for(let e of/* @__PURE__ */ new Set([...n.keys(),...r.keys()]))n.get(e)!==r.get(e)&&i.add(X(p.resolve(this.topLevelDir,e)));if(e.shouldFailOnChanges&&i.size>0){e.errors.add(Rt),this.logger.error(`${Y()} Tasks modified files and --fail-on-changes was used!`);return}if(i.size>0){let e=await xn(`git add --`,[...i],this.maxArgLength),t=process.env.GIT_INDEX_FILE?X(process.env.GIT_INDEX_FILE):process.env.GIT_INDEX_FILE,n=t?.endsWith(`.lock`)?X(await this.execGit([`rev-parse`,`--path-format=absolute`,`--git-path`,`index.lock`])):void 0;for(let{files:r}of e)$(`Updating active Git index: %s`,t),await this.execGit([`add`,`--`,...r]),$(`Done updating Git index: %s`,t),n&&t!==n&&($(`Updating default Git index again: %s`,n),await this.execGit([`add`,`--`,...r],{env:{GIT_INDEX_FILE:n}}),$(`Done updating default Git index lock: %s`,n))}if(!this.allowEmpty&&an(await this.execGit([...On(this.diff,this.diffFilter),`--name-only`,`-z`])).length===0){e.errors.add(Tt),this.logger.error(`${Y()} Prevented an empty git commit!`);return}this.logger.log(`${Oe()} Done staging changes from tasks!`)}catch(t){e.errors.add(Z),this.logger.log(`${Y()} Failed to stage changes from tasks!`),$(t)}}async restoreUnstagedChanges(e){this.logger.log(H(`${J()} Restoring unstaged changes…`));let t=p.join(this.hiddenPath,Fn);try{await this.execGit([`apply`,...Ln,t]),await Tn(this.hiddenPath)}catch(n){$(`Error while restoring changes:`),$(n),$(`Retrying with 3-way merge`);try{await this.execGit([`apply`,...Ln,`--3way`,t]),await Tn(this.hiddenPath)}catch(t){e.errors.add(Z),e.errors.add(It),this.logger.error(`${Y()} Failed to restore unstaged changes!`),$(t)}}}async restoreUntrackedFiles(e){this.logger.log(H(`${J()} Restoring untracked files…`));try{let t=`${e.backupHash}^3`,n=await this.execGit([`ls-tree`,`-r`,`--name-only`,`-z`,t]).then(an);n.length?($(`Found untracked files: %s`,n),await this.execGit([`restore`,`--source`,t,`--`,...n.map(X)]),this.logger.log(`${Oe()} Done restoring untracked files!`)):this.logger.log(`${je()} ${H(`No untracked files to restore!`)}`)}catch(t){e.errors.add(Z),e.errors.add(It),this.logger.error(`${Y()} Failed to restore untracked files!`),$(t)}}async restoreOriginalState(e){this.logger.log(H(`${J()} Reverting to original state because of errors…`));try{$(`Restoring original state...`),await this.execGit([`reset`,`--hard`,`HEAD`]),await this.execGit([`stash`,`apply`,`--quiet`,`--index`,e.backupHash]),await this.restoreMergeStatus(e),await Tn(this.hiddenPath),this.logger.log(`${Oe()} Done reverting to original state!`)}catch(t){e.errors.add(Z),e.errors.add(Ft),this.logger.error(`${Y()} Failed to revert to original state!`),$(t)}}async cleanup(e){this.logger.log(H(`${J()} Cleaning up temporary files…`));try{let t=(await this.listStashes()).findIndex(t=>t.startsWith(e.backupHash));t>-1?(await this.execGit([`stash`,`drop`,`--quiet`,String(t)]),this.logger.log(`${Oe()} Done cleaning up temporary files!`)):this.logger.error(`${Y()} lint-staged automatic backup is missing!`)}catch(t){e.errors.add(Z),this.logger.error(`${Y()} Failed to clean up temporary files!`),$(t)}}};const Wn=K(`lint-staged:groupFilesByConfig`),Gn=async({configs:e,files:t,singleConfigMode:n})=>{Wn(`Grouping %d files by %d configurations`,t.length,Object.keys(e).length);let r={},i=Object.entries(e);if(n){let e=i[0];if(e){let[n,i]=e;r[n]={config:i,files:t}}return r}let a=/* @__PURE__ */ new Map,o=1/0;for(let[e,[t,n]]of i.entries()){r[t]={config:n,files:[]};let i=p.dirname(t);a.has(i)||a.set(i,e),o===1/0&&Object.keys(n).some(e=>e.startsWith(`..`))&&(o=e)}let s=/* @__PURE__ */ new Map,c=e=>{let t=s.get(e);if(t!==void 0)return t;let n=a.get(e)??1/0,r=p.dirname(e);return r!==e&&(n=Math.min(n,c(r))),s.set(e,n),n};for(let e of new Set(t)){let t=c(p.dirname(e.filepath)),n=Math.min(t,o);if(n!==1/0){let[t]=i[n];r[t].files.push(e)}}return r},Kn=K(`lint-staged:resolveGitRepo`),qn=async(e=process.cwd())=>{try{Kn("Resolving git repo from `%s`",e),Kn("Unset GIT_DIR (was `%s`)",process.env.GIT_DIR),delete process.env.GIT_DIR,Kn("Unset GIT_WORK_TREE (was `%s`)",process.env.GIT_WORK_TREE),delete process.env.GIT_WORK_TREE;let[t,n,r]=(await De([`rev-parse`,`--show-cdup`,`--show-toplevel`,`--absolute-git-dir`],{cwd:e})).split(`
|
|
48
|
-
`),i=X(p.join(e,t));Kn("Resolved git repository top-level directory to be `%s`",i);let a=p.relative(n,r),o=X(p.join(i,a));return Kn("Resolved git config directory to be `%s`",o),{topLevelDir:i,gitConfigDir:o}}catch(e){return Kn(`Failed to resolve git repo with error:`,e),{error:e,topLevelDir:null,gitConfigDir:null}}},Jn=`lint-staged`,Yn=`package.json`,Xn=[`package.yaml`,`package.yml`],Zn=[Yn,...Xn,`.lintstagedrc`,`.lintstagedrc.json`,`.lintstagedrc.yaml`,`.lintstagedrc.yml`,`.lintstagedrc.mjs`,`.lintstagedrc.mts`,`.lintstagedrc.js`,`.lintstagedrc.ts`,`.lintstagedrc.cjs`,`.lintstagedrc.cts`,`lint-staged.config.mjs`,`lint-staged.config.mts`,`lint-staged.config.js`,`lint-staged.config.ts`,`lint-staged.config.cjs`,`lint-staged.config.cts`],Qn=n(import.meta.url);function $n(e){try{return Qn.resolve(e)}catch{return e}}const er=K(`lint-staged:loadConfig`),tr=async e=>C.readFile(p.resolve(e),`utf-8`),nr=async e=>{let t=Yn.includes(p.basename(e));try{let n=await tr(e),r=JSON.parse(n);return t?r[Jn]:r}catch(t){if(p.basename(e)===`package.json`){er(`Ignoring invalid JSON file %s`,e);return}throw t}},rr=async t=>{let n=Xn.includes(p.basename(t));try{let[r,i]=await Promise.all([import(`./dist-
|
|
48
|
+
`),i=X(p.join(e,t));Kn("Resolved git repository top-level directory to be `%s`",i);let a=p.relative(n,r),o=X(p.join(i,a));return Kn("Resolved git config directory to be `%s`",o),{topLevelDir:i,gitConfigDir:o}}catch(e){return Kn(`Failed to resolve git repo with error:`,e),{error:e,topLevelDir:null,gitConfigDir:null}}},Jn=`lint-staged`,Yn=`package.json`,Xn=[`package.yaml`,`package.yml`],Zn=[Yn,...Xn,`.lintstagedrc`,`.lintstagedrc.json`,`.lintstagedrc.yaml`,`.lintstagedrc.yml`,`.lintstagedrc.mjs`,`.lintstagedrc.mts`,`.lintstagedrc.js`,`.lintstagedrc.ts`,`.lintstagedrc.cjs`,`.lintstagedrc.cts`,`lint-staged.config.mjs`,`lint-staged.config.mts`,`lint-staged.config.js`,`lint-staged.config.ts`,`lint-staged.config.cjs`,`lint-staged.config.cts`],Qn=n(import.meta.url);function $n(e){try{return Qn.resolve(e)}catch{return e}}const er=K(`lint-staged:loadConfig`),tr=async e=>C.readFile(p.resolve(e),`utf-8`),nr=async e=>{let t=Yn.includes(p.basename(e));try{let n=await tr(e),r=JSON.parse(n);return t?r[Jn]:r}catch(t){if(p.basename(e)===`package.json`){er(`Ignoring invalid JSON file %s`,e);return}throw t}},rr=async t=>{let n=Xn.includes(p.basename(t));try{let[r,i]=await Promise.all([import(`./dist-DZo1mBt4.mjs`).then(t=>/* @__PURE__ */ e(t.default,1)),tr(t)]),a=r.parse(i);return n?a[Jn]:a}catch(e){if(n){er(`Ignoring invalid YAML file %s`,t);return}throw e}},ir=e=>import(i(e)).then(e=>e.default),ar=`noExt`,or={[ar]:rr,".cjs":ir,".cts":ir,".js":ir,".json":nr,".mjs":ir,".mts":ir,".ts":ir,".yaml":rr,".yml":rr},sr=async e=>{let t=p.resolve(e),n=p.extname(t)||ar,r=or[n];return{config:await r(t),filepath:t}},cr=async(e,t)=>{try{er("Loading configuration from `%s`...",e);let t=await sr($n(e)),n=await t.config??null,r=t.filepath;return n?er("Successfully loaded config from `%s`:\n%O",r,n):er(`Found no config in %s`,r),{config:n,filepath:r}}catch(n){return er("Failed to load configuration from `%s` with error:\n",e,n),t.error(Qe(e)),{}}},lr=K(`lint-staged:searchConfigs`),ur=Zn.map(e=>`:(glob)**/${e}`),dr=e=>e.split(`/`).length,fr=(e,t)=>dr(t)-dr(e)||e.localeCompare(t),pr=/^[HSMRCK?U] /,mr=async({cwd:e,topLevelDir:t})=>De([`ls-files`,`-z`,`--full-name`,`-t`,`--cached`,`--others`,`--exclude-standard`,`--`,...ur],{cwd:e}).then(an).then(e=>{let n=e.flatMap(e=>{if(e.startsWith(`S `))return[];let n=e.replace(pr,``);return[X(p.join(t,n))]});return lr(`Found possible config files from git:`,n),n}),hr=async({cwd:e})=>{lr(`Listing possible configs from filesystem starting from "%s"...`,e);let t=(await Promise.allSettled(Zn.map(async t=>{let n=p.join(e,t);return await C.access(n,w.F_OK),n}))).flatMap(e=>e.status===`fulfilled`?[X(e.value)]:[]);if(t.length>0)return lr(`Found possible config files from filesystem:`,t),t;let n=p.dirname(e);return n===e?[]:hr({cwd:n})},gr=async({configObject:e,configPath:t,cwd:n=process.cwd(),topLevelDir:r=n},i)=>{if(lr(`Searching for configuration files...`),e)return lr(`Using single direct configuration object...`),{"":vn(e,`config object`,i)};if(t){lr(`Using single configuration path...`);let{config:e,filepath:n}=await cr(t,i);return e?{[t]:vn(e,n,i)}:{}}let a=/* @__PURE__ */ new Set,o=e=>{e.forEach(e=>{a.add(e)})};await Promise.all([mr({cwd:n,topLevelDir:r}).then(o),hr({cwd:n}).then(o)]);let s=[...a].toSorted(fr).reduce((e,t)=>Object.assign(e,{[t]:null}),{});await Promise.all(Object.keys(s).map(e=>cr(e,i).then(({config:t,filepath:n})=>{t&&(e!==n&&lr(`Config file "%s" resolved to "%s"`,e,n),s[e]=vn(t,n,i))})));let c=Object.entries(s).reduce((e,[t,n])=>(n&&Object.assign(e,{[t]:n}),e),{});return lr(`Found %d config files`,Object.keys(c).length),c},_r=K(`lint-staged:runAll`),vr=(e,t)=>{if(t){let t=()=>{};return{error:e.error,log:t,warn:t}}return e},yr=(e,t)=>Object.assign(Error(`lint-staged failed`,{cause:t}),{ctx:e}),br=async({all:e,allowEmpty:t,concurrent:n,configObject:r,configPath:i,continueOnError:a,cwd:o,diff:s,diffFilter:c,failOnChanges:l,hideAll:u,hideUnstaged:d,hidePartiallyStaged:f,maxArgLength:m,quiet:h,relative:g,stash:ee,revert:_,verbose:v},y=console)=>{let b=vr(y,h);_r(`Running all tasks...`);let x=!!o;o=x?p.resolve(o):process.cwd(),_r("Using working directory `%s`",o);let S=zt({failOnChanges:l,hideAll:u,hideUnstaged:d,hidePartiallyStaged:f,quiet:h,revert:_}),{topLevelDir:C,gitConfigDir:w}=await qn(o);if(!C)throw h||S.output.push(Ie()),S.errors.add(jt),yr(S,jt);let T=await De([`log`,`-1`],{cwd:C}).then(()=>!0).catch(()=>!1);S.shouldBackup=T&&ee,S.shouldBackup||b.warn(Ue(e,T,s)),S.shouldHidePartiallyStaged||S.shouldHideUnstaged||S.shouldHideAll||b.warn(We());let[E,D,O]=await Promise.all([An({all:e,cwd:C,diff:s,diffFilter:c,gitConfigDir:w}),sn({cwd:C}),gr({configObject:r,configPath:i,cwd:o,topLevelDir:C},b)]);if(!E)throw h||S.output.push(Le()),S.errors.add(kt),yr(S,kt);if(_r(`Loaded list of staged files in git:
|
|
49
49
|
%O`,E),E.length===0)return h||S.output.push(Ve()),S;if(D.length>0)throw S.errors.add(At),yr(S,D);let te=Object.keys(O).length;if(te===0)throw S.errors.add(Et),yr(S,Et);let ne=await Gn({configs:O,files:E,singleConfigMode:r||i!==void 0}),k=te>1,A=!1,j=[],M=vt();for(let[e,{config:t,files:n}]of Object.entries(ne)){let r=e?X(p.relative(o,e)):`Config object`,i=x||!k?o:p.dirname(e),s=await Promise.all(gt({config:t,cwd:i,files:n,relative:g}).map(e=>(tn(e.commands)?nn({abortController:M,command:e.commands,continueOnError:a,files:e.fileList,verbose:v}):Sn({abortController:M,commands:e.commands,continueOnError:a,cwd:i,files:e.fileList,maxArgLength:m,topLevelDir:C,verbose:v})).then(t=>{let n=e=>e.title.includes(`git add`);A||=t.some(e=>Array.isArray(e)?e.some(n):n(e));let r=e.fileList.length;return{title:`${e.pattern}${H(` — ${r} ${r===1?`file`:`files`}`)}`,task:t,skip:()=>r===0&&`${e.pattern}${H(` — no files`)}`}})));j.push({title:`${r}${H(` — ${n.length} ${n.length>1?`files`:`file`}`)}`,task:s,skip:()=>s.every(e=>e.skip())?`${r}${H(` — no tasks to run`)}`:!1})}if(A&&b.warn(Ge()),j.every(e=>e.skip()))return h||S.output.push(He()),S;let N=new Un({allowEmpty:t,diff:s,diffFilter:c,failOnChanges:l,gitConfigDir:w,logger:b,maxArgLength:m,topLevelDir:C});if(await N.prepare(S),Bt(S)&&await N.hidePartiallyStagedChanges(S),M.signal.aborted||S.errors.size>0?b.log(`${je()} ${H(`Skipped running tasks…`)}`):await N.runTasks(S,j,{abortController:M,concurrent:n}),Ut(S)?b.log(`${je()} ${H(`Skipped staging changes from tasks…`)}`):await N.updateIndex(S),Vt(S)&&(Wt(S)?b.log(`${je()} ${H(`Skipped restoring unstaged changes…`)}`):await N.restoreUnstagedChanges(S)),Ht(S)&&(Wt(S)?b.log(`${je()} ${H(`Skipped restoring untracked files…`)}`):await N.restoreUntrackedFiles(S)),Gt(S)&&(Kt(S)?b.log(`${je()} ${H(`Skipped reverting to original state because of errors…`)}`):await N.restoreOriginalState(S)),qt(S)&&(Jt(S)?b.log(`${je()} ${H(`Skipped cleaning up temporary files…`)}`):await N.cleanup(S)),S.errors.size>0)throw yr(S);return S},xr=K(`lint-staged:validateOptions`),Sr=e=>Number.isInteger(e)||e===1/0,Cr=async(e={},t)=>{xr(`Validating options...`);let{concurrent:n,cwd:r,maxArgLength:i}=e;if(n!==void 0&&typeof n!=`boolean`&&(!Sr(n)||n<1))throw t.error(Ye(`concurrent`,`${n}`,`Must be boolean, positive integer or Infinite`)),Nt;if(typeof r==`string`)try{let e=p.resolve(r);await C.access(e,y.F_OK)}catch(n){throw xr(`Failed to validate options: %o`,e),t.error(Ye(`cwd`,r,n.message)),Nt}if(i!=null&&(!Sr(i)||i<1))throw t.error(Ye(`maxArgLength`,`${i}`,`Must be positive integer, or Infinite`)),Nt;xr(`Validated options: %o`,e)},wr=async()=>JSON.parse(await C.readFile(new URL(`../package.json`,import.meta.url))).version,Tr=K(`lint-staged`),Er=async(e={},t=console)=>{let n=it(e);I(n.color),n.debug&&(re(t),Tr("Running `lint-staged@%s` on Node.js %s (%s)",await wr(),process.version,process.platform));let r=await De([`version`,`--build-options`],{cwd:n.cwd});if(Tr(`%s`,r),!N(r))throw Error(tt(te,r),{cause:r});await Cr(n,t),Tr("Unset GIT_LITERAL_PATHSPECS (was `%s`)",process.env.GIT_LITERAL_PATHSPECS),delete process.env.GIT_LITERAL_PATHSPECS;try{let e=await br(n,t);return Tr(`Tasks were executed successfully!`),at(e,t),!0}catch(e){if(e?.ctx?.errors){let{ctx:n}=e;return n.errors.has(Et)?t.error(Be()):n.errors.has(At)?t.error(Re(e.cause)):n.errors.has(Tt)?t.warn(Xe()):n.errors.has(Rt)?(t.warn(qe()+`
|
|
50
50
|
`),t.warn(Ze(n.backupHash))):n.errors.has(It)?(t.warn(et()),t.warn(n.unstagedPatch)):(n.errors.has(Z)||Jt(n))&&(t.error(Je()),n.shouldBackup&&t.error(Ze(n.backupHash)+`
|
|
51
51
|
`)),at(n,t),!1}throw e}};export{Er as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./rolldown-runtime-Dn1JIVgp.mjs";import{execFile as t}from"node:child_process";import{promisify as n}from"node:util";import{resolve as r}from"node:path";import{readFile as i}from"node:fs/promises";import{readFileSync as a,statSync as o}from"fs";import{createRequire as s}from"module";import{isAbsolute as c,resolve as l}from"path";const u=process.cwd(),d=s(import.meta.url);function f(e,t=u){return e.startsWith(`.`)?l(t,e):c(e)?e:d.resolve(e)}function p(e){try{return o(f(e)),!0}catch{return!1}}function m(e){try{let t=a(f(e),`utf8`);return JSON.parse(t)}catch{return{}}}function h(e,t={}){let n=m(`./package.json`);if(e){let{[e]:r=t}=n;return r}return n}const g=n(t),_={"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],"subject-case":[0],"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`]],"scope-case":[0],"body-case":[0],"header-case":[0]};async function v(e=process.cwd()){let{stdout:t}=await g(`git`,[`rev-parse`,`--git-path`,`COMMIT_EDITMSG`],{cwd:e,encoding:`utf8`});return r(e,t.trim())}async function y(){return i(await v(),`utf8`)}async function b(){let e=await y(),t=await import(`./lint-CvrvpJvb.mjs`).then(e=>e.default.default||e.default),n=await import(`./lib-B9YSDxfE.mjs`).then(e=>e.default.default||e.default),r=await t(e,_);return{result:r,output:await n({results:[r]})}}function x(e){e.command(`commit`,`Lint git commit message`,{},()=>{b().then(({result:e,output:t})=>{e.valid?console.log(`Pass.`):(console.log(`Fail:`),console.log(t),process.exitCode=1)}).catch(e=>{console.error(e),process.exitCode=1})})}function S(e){let t=Object.entries(e).map(([e,t])=>[e,t.filter(Boolean)]).filter(([e,t])=>t.length);return t.length>0?Object.fromEntries(t):void 0}function C({garou:e,stylelint:t,eslint:n,prettier:r}){let i=process.stdin.isTTY?` --color`:``;return S({"*.{vue,html,htm,md}":[e&&`garou`,r&&`prettier -w -u${i}`,t&&`stylelint --fix -- ${i}`,n&&`eslint --fix ${i}`],"*.{ts,tsx,mts,cts}":[e&&`garou`,r&&`prettier -w -u${i}`,n&&`eslint --fix ${i}`],"*.{js,jsx,mjs,cjs,wxs,qs}":[e&&`garou`,r&&`prettier -w -u${i}`,n&&`eslint --fix ${i}`],"*.{c,sc,le,wx,q,tt,jx,ac}ss":[e&&`garou`,r&&`prettier -w -u${i}`,t&&`stylelint --fix -- ${i}`],"*.{json,yml,yaml,svg}":[e&&`garou`,r&&`prettier -w -u${i}`],"{*.{jsonc,webmanifest,editorconfig,toml},.{babel,npm}rc}":[r&&`prettier -w -u${i}`],"{*.jenkinsfile,{j,J}enkinsfile}":[r&&`prettier -w -u${i}`],"yarn.lock":[e&&`garou`]})}function w(){let e=h(`devDependencies`),t=`prettier`in e,n=`eslint`in e,r=`stylelint`in e;return{garou:`garou`in e,stylelint:r,eslint:n,prettier:t}}async function T(){let{default:e}=await import(`./lib-PLIKbC88.mjs`);return e({allowEmpty:!0,concurrent:!0,config:C(w()),cwd:process.cwd(),debug:!1,quiet:!1,relative:!1,stash:!0})}function E(e){e.command(`staged`,`Lint and format git staged files`,{},()=>{T().then(e=>{process.exitCode=+!e}).catch(e=>{console.error(e),process.exitCode=1})})}var D=/* @__PURE__ */ e({builder:()=>A,command:()=>O,description:()=>``});const O=`lint`,k=``;function A(e){x(e),E(e),e.demandCommand(1,"Typing `commit` or `staged`")}export{p as a,D as i,O as n,k as r,A as t};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{i as e,t}from"./rolldown-runtime-
|
|
1
|
+
import{i as e,t}from"./rolldown-runtime-Dn1JIVgp.mjs";import n from"node:util";var r=/* @__PURE__ */ t(((e,t)=>{t.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:2**53-1||
|
|
2
2
|
/* istanbul ignore next */9007199254740991,RELEASE_TYPES:[`major`,`premajor`,`minor`,`preminor`,`patch`,`prepatch`,`prerelease`],SEMVER_SPEC_VERSION:`2.0.0`,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}})),i=/* @__PURE__ */ t(((e,t)=>{t.exports=typeof process==`object`&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error(`SEMVER`,...e):()=>{}})),a=/* @__PURE__ */ t(((e,t)=>{let{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:a,MAX_LENGTH:o}=r(),s=i();e=t.exports={};let c=e.re=[],l=e.safeRe=[],u=e.src=[],d=e.safeSrc=[],f=e.t={},p=0,m=`[a-zA-Z0-9-]`,h=[[`\\s`,1],[`\\d`,o],[m,a]],g=e=>{for(let[t,n]of h)e=e.split(`${t}*`).join(`${t}{0,${n}}`).split(`${t}+`).join(`${t}{1,${n}}`);return e},_=(e,t,n)=>{let r=g(t),i=p++;s(e,i,t),f[e]=i,u[i]=t,d[i]=r,c[i]=new RegExp(t,n?`g`:void 0),l[i]=new RegExp(r,n?`g`:void 0)};_(`NUMERICIDENTIFIER`,`0|[1-9]\\d*`),_(`NUMERICIDENTIFIERLOOSE`,`\\d+`),_(`NONNUMERICIDENTIFIER`,`\\d*[a-zA-Z-]${m}*`),_(`MAINVERSION`,`(${u[f.NUMERICIDENTIFIER]})\\.(${u[f.NUMERICIDENTIFIER]})\\.(${u[f.NUMERICIDENTIFIER]})`),_(`MAINVERSIONLOOSE`,`(${u[f.NUMERICIDENTIFIERLOOSE]})\\.(${u[f.NUMERICIDENTIFIERLOOSE]})\\.(${u[f.NUMERICIDENTIFIERLOOSE]})`),_(`PRERELEASEIDENTIFIER`,`(?:${u[f.NONNUMERICIDENTIFIER]}|${u[f.NUMERICIDENTIFIER]})`),_(`PRERELEASEIDENTIFIERLOOSE`,`(?:${u[f.NONNUMERICIDENTIFIER]}|${u[f.NUMERICIDENTIFIERLOOSE]})`),_(`PRERELEASE`,`(?:-(${u[f.PRERELEASEIDENTIFIER]}(?:\\.${u[f.PRERELEASEIDENTIFIER]})*))`),_(`PRERELEASELOOSE`,`(?:-?(${u[f.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${u[f.PRERELEASEIDENTIFIERLOOSE]})*))`),_(`BUILDIDENTIFIER`,`${m}+`),_(`BUILD`,`(?:\\+(${u[f.BUILDIDENTIFIER]}(?:\\.${u[f.BUILDIDENTIFIER]})*))`),_(`FULLPLAIN`,`v?${u[f.MAINVERSION]}${u[f.PRERELEASE]}?${u[f.BUILD]}?`),_(`FULL`,`^${u[f.FULLPLAIN]}$`),_(`LOOSEPLAIN`,`[v=\\s]*${u[f.MAINVERSIONLOOSE]}${u[f.PRERELEASELOOSE]}?${u[f.BUILD]}?`),_(`LOOSE`,`^${u[f.LOOSEPLAIN]}$`),_(`GTLT`,`((?:<|>)?=?)`),_(`XRANGEIDENTIFIERLOOSE`,`${u[f.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),_(`XRANGEIDENTIFIER`,`${u[f.NUMERICIDENTIFIER]}|x|X|\\*`),_(`XRANGEPLAIN`,`[v=\\s]*(${u[f.XRANGEIDENTIFIER]})(?:\\.(${u[f.XRANGEIDENTIFIER]})(?:\\.(${u[f.XRANGEIDENTIFIER]})(?:${u[f.PRERELEASE]})?${u[f.BUILD]}?)?)?`),_(`XRANGEPLAINLOOSE`,`[v=\\s]*(${u[f.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[f.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[f.XRANGEIDENTIFIERLOOSE]})(?:${u[f.PRERELEASELOOSE]})?${u[f.BUILD]}?)?)?`),_(`XRANGE`,`^${u[f.GTLT]}\\s*${u[f.XRANGEPLAIN]}$`),_(`XRANGELOOSE`,`^${u[f.GTLT]}\\s*${u[f.XRANGEPLAINLOOSE]}$`),_(`COERCEPLAIN`,`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?`),_(`COERCE`,`${u[f.COERCEPLAIN]}(?:$|[^\\d])`),_(`COERCEFULL`,u[f.COERCEPLAIN]+`(?:${u[f.PRERELEASE]})?(?:${u[f.BUILD]})?(?:$|[^\\d])`),_(`COERCERTL`,u[f.COERCE],!0),_(`COERCERTLFULL`,u[f.COERCEFULL],!0),_(`LONETILDE`,`(?:~>?)`),_(`TILDETRIM`,`(\\s*)${u[f.LONETILDE]}\\s+`,!0),e.tildeTrimReplace=`$1~`,_(`TILDE`,`^${u[f.LONETILDE]}${u[f.XRANGEPLAIN]}$`),_(`TILDELOOSE`,`^${u[f.LONETILDE]}${u[f.XRANGEPLAINLOOSE]}$`),_(`LONECARET`,`(?:\\^)`),_(`CARETTRIM`,`(\\s*)${u[f.LONECARET]}\\s+`,!0),e.caretTrimReplace=`$1^`,_(`CARET`,`^${u[f.LONECARET]}${u[f.XRANGEPLAIN]}$`),_(`CARETLOOSE`,`^${u[f.LONECARET]}${u[f.XRANGEPLAINLOOSE]}$`),_(`COMPARATORLOOSE`,`^${u[f.GTLT]}\\s*(${u[f.LOOSEPLAIN]})$|^$`),_(`COMPARATOR`,`^${u[f.GTLT]}\\s*(${u[f.FULLPLAIN]})$|^$`),_(`COMPARATORTRIM`,`(\\s*)${u[f.GTLT]}\\s*(${u[f.LOOSEPLAIN]}|${u[f.XRANGEPLAIN]})`,!0),e.comparatorTrimReplace=`$1$2$3`,_(`HYPHENRANGE`,`^\\s*(${u[f.XRANGEPLAIN]})\\s+-\\s+(${u[f.XRANGEPLAIN]})\\s*$`),_(`HYPHENRANGELOOSE`,`^\\s*(${u[f.XRANGEPLAINLOOSE]})\\s+-\\s+(${u[f.XRANGEPLAINLOOSE]})\\s*$`),_(`STAR`,`(<|>)?=?\\s*\\*`),_(`GTE0`,`^\\s*>=\\s*0\\.0\\.0\\s*$`),_(`GTE0PRE`,`^\\s*>=\\s*0\\.0\\.0-0\\s*$`)})),o=/* @__PURE__ */ t(((e,t)=>{let n=Object.freeze({loose:!0}),r=Object.freeze({});t.exports=e=>e?typeof e==`object`?e:n:r})),s=/* @__PURE__ */ t(((e,t)=>{let n=/^[0-9]+$/,r=(e,t)=>{if(typeof e==`number`&&typeof t==`number`)return e===t?0:e<t?-1:1;let r=n.test(e),i=n.test(t);return r&&i&&(e=+e,t=+t),e===t?0:r&&!i?-1:i&&!r?1:e<t?-1:1};t.exports={compareIdentifiers:r,rcompareIdentifiers:(e,t)=>r(t,e)}})),c=/* @__PURE__ */ t(((e,t)=>{let n=i(),{MAX_LENGTH:c,MAX_SAFE_INTEGER:l}=r(),{safeRe:u,t:d}=a(),f=o(),{compareIdentifiers:p}=s(),m=(e,t)=>{let n=t.split(`.`);if(n.length>e.length)return!1;for(let t=0;t<n.length;t++)if(p(e[t],n[t])!==0)return!1;return!0};t.exports=class e{constructor(t,r){if(r=f(r),t instanceof e){if(t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease)return t;t=t.version}else if(typeof t!=`string`)throw TypeError(`Invalid version. Must be a string. Got type "${typeof t}".`);if(t.length>c)throw TypeError(`version is longer than ${c} characters`);n(`SemVer`,t,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;let i=t.trim().match(r.loose?u[d.LOOSE]:u[d.FULL]);if(!i)throw TypeError(`Invalid Version: ${t}`);if(this.raw=t,this.major=+i[1],this.minor=+i[2],this.patch=+i[3],this.major>l||this.major<0)throw TypeError(`Invalid major version`);if(this.minor>l||this.minor<0)throw TypeError(`Invalid minor version`);if(this.patch>l||this.patch<0)throw TypeError(`Invalid patch version`);this.prerelease=i[4]?i[4].split(`.`).map(e=>{if(/^[0-9]+$/.test(e)){let t=+e;if(t>=0&&t<l)return t}return e}):[],this.build=i[5]?i[5].split(`.`):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(`.`)}`),this.version}toString(){return this.version}compare(t){if(n(`SemVer.compare`,this.version,this.options,t),!(t instanceof e)){if(typeof t==`string`&&t===this.version)return 0;t=new e(t,this.options)}return t.version===this.version?0:this.compareMain(t)||this.comparePre(t)}compareMain(t){return t instanceof e||(t=new e(t,this.options)),this.major<t.major?-1:this.major>t.major?1:this.minor<t.minor?-1:this.minor>t.minor?1:this.patch<t.patch?-1:+(this.patch>t.patch)}comparePre(t){if(t instanceof e||(t=new e(t,this.options)),this.prerelease.length&&!t.prerelease.length)return-1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;let r=0;do{let e=this.prerelease[r],i=t.prerelease[r];if(n(`prerelease compare`,r,e,i),e===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(e===void 0)return-1;if(e!==i)return p(e,i)}while(++r)}compareBuild(t){t instanceof e||(t=new e(t,this.options));let r=0;do{let e=this.build[r],i=t.build[r];if(n(`build compare`,r,e,i),e===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(e===void 0)return-1;if(e!==i)return p(e,i)}while(++r)}inc(e,t,n){if(e.startsWith(`pre`)){if(!t&&n===!1)throw Error(`invalid increment argument: identifier is empty`);if(t){let e=`-${t}`.match(this.options.loose?u[d.PRERELEASELOOSE]:u[d.PRERELEASE]);if(!e||e[1]!==t)throw Error(`invalid identifier: ${t}`)}}switch(e){case`premajor`:this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc(`pre`,t,n);break;case`preminor`:this.prerelease.length=0,this.patch=0,this.minor++,this.inc(`pre`,t,n);break;case`prepatch`:this.prerelease.length=0,this.inc(`patch`,t,n),this.inc(`pre`,t,n);break;case`prerelease`:this.prerelease.length===0&&this.inc(`patch`,t,n),this.inc(`pre`,t,n);break;case`release`:if(this.prerelease.length===0)throw Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case`major`:(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case`minor`:(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case`patch`:this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case`pre`:{let e=+!!Number(n);if(this.prerelease.length===0)this.prerelease=[e];else{let r=this.prerelease.length;for(;--r>=0;)typeof this.prerelease[r]==`number`&&(this.prerelease[r]++,r=-2);if(r===-1){if(t===this.prerelease.join(`.`)&&n===!1)throw Error(`invalid increment argument: identifier already exists`);this.prerelease.push(e)}}if(t){let r=[t,e];if(n===!1&&(r=[t]),m(this.prerelease,t)){let e=this.prerelease[t.split(`.`).length];isNaN(e)&&(this.prerelease=r)}else this.prerelease=r}break}default:throw Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(`.`)}`),this}}})),l=/* @__PURE__ */ t(((e,t)=>{let n=c();t.exports=(e,t,r=!1)=>{if(e instanceof n)return e;try{return new n(e,t)}catch(e){if(!r)return null;throw e}}})),u=/* @__PURE__ */ t(((e,t)=>{let n=l();t.exports=(e,t)=>{let r=n(e,t);return r?r.version:null}})),d=/* @__PURE__ */ t(((e,t)=>{let n=l();t.exports=(e,t)=>{let r=n(e.trim().replace(/^[=v]+/,``),t);return r?r.version:null}})),f=/* @__PURE__ */ t(((e,t)=>{let n=c();t.exports=(e,t,r,i,a)=>{typeof r==`string`&&(a=i,i=r,r=void 0);try{return new n(e instanceof n?e.version:e,r).inc(t,i,a).version}catch{return null}}})),p=/* @__PURE__ */ t(((e,t)=>{let n=l();t.exports=(e,t)=>{let r=n(e,null,!0),i=n(t,null,!0),a=r.compare(i);if(a===0)return null;let o=a>0,s=o?r:i,c=o?i:r,l=!!s.prerelease.length;if(c.prerelease.length&&!l){if(!c.patch&&!c.minor)return`major`;if(c.compareMain(s)===0)return c.minor&&!c.patch?`minor`:`patch`}let u=l?`pre`:``;return r.major===i.major?r.minor===i.minor?r.patch===i.patch?`prerelease`:u+`patch`:u+`minor`:u+`major`}})),m=/* @__PURE__ */ t(((e,t)=>{let n=c();t.exports=(e,t)=>new n(e,t).major})),h=/* @__PURE__ */ t(((e,t)=>{let n=c();t.exports=(e,t)=>new n(e,t).minor})),g=/* @__PURE__ */ t(((e,t)=>{let n=c();t.exports=(e,t)=>new n(e,t).patch})),_=/* @__PURE__ */ t(((e,t)=>{let n=l();t.exports=(e,t)=>{let r=n(e,t);return r&&r.prerelease.length?r.prerelease:null}})),v=/* @__PURE__ */ t(((e,t)=>{let n=c();t.exports=(e,t,r)=>new n(e,r).compare(new n(t,r))})),y=/* @__PURE__ */ t(((e,t)=>{let n=v();t.exports=(e,t,r)=>n(t,e,r)})),ee=/* @__PURE__ */ t(((e,t)=>{let n=v();t.exports=(e,t)=>n(e,t,!0)})),b=/* @__PURE__ */ t(((e,t)=>{let n=c();t.exports=(e,t,r)=>{let i=new n(e,r),a=new n(t,r);return i.compare(a)||i.compareBuild(a)}})),te=/* @__PURE__ */ t(((e,t)=>{let n=b();t.exports=(e,t)=>e.sort((e,r)=>n(e,r,t))})),ne=/* @__PURE__ */ t(((e,t)=>{let n=b();t.exports=(e,t)=>e.sort((e,r)=>n(r,e,t))})),x=/* @__PURE__ */ t(((e,t)=>{let n=v();t.exports=(e,t,r)=>n(e,t,r)>0})),S=/* @__PURE__ */ t(((e,t)=>{let n=v();t.exports=(e,t,r)=>n(e,t,r)<0})),C=/* @__PURE__ */ t(((e,t)=>{let n=v();t.exports=(e,t,r)=>n(e,t,r)===0})),re=/* @__PURE__ */ t(((e,t)=>{let n=v();t.exports=(e,t,r)=>n(e,t,r)!==0})),w=/* @__PURE__ */ t(((e,t)=>{let n=v();t.exports=(e,t,r)=>n(e,t,r)>=0})),T=/* @__PURE__ */ t(((e,t)=>{let n=v();t.exports=(e,t,r)=>n(e,t,r)<=0})),ie=/* @__PURE__ */ t(((e,t)=>{let n=C(),r=re(),i=x(),a=w(),o=S(),s=T();t.exports=(e,t,c,l)=>{switch(t){case`===`:return typeof e==`object`&&(e=e.version),typeof c==`object`&&(c=c.version),e===c;case`!==`:return typeof e==`object`&&(e=e.version),typeof c==`object`&&(c=c.version),e!==c;case``:case`=`:case`==`:return n(e,c,l);case`!=`:return r(e,c,l);case`>`:return i(e,c,l);case`>=`:return a(e,c,l);case`<`:return o(e,c,l);case`<=`:return s(e,c,l);default:throw TypeError(`Invalid operator: ${t}`)}}})),ae=/* @__PURE__ */ t(((e,t)=>{let n=c(),r=l(),{safeRe:i,t:o}=a();t.exports=(e,t)=>{if(e instanceof n)return e;if(typeof e==`number`&&(e=String(e)),typeof e!=`string`)return null;t||={};let a=null;if(!t.rtl)a=e.match(t.includePrerelease?i[o.COERCEFULL]:i[o.COERCE]);else{let n=t.includePrerelease?i[o.COERCERTLFULL]:i[o.COERCERTL],r;for(;(r=n.exec(e))&&(!a||a.index+a[0].length!==e.length);)a&&r.index+r[0].length===a.index+a[0].length||(a=r),n.lastIndex=r.index+r[1].length+r[2].length;n.lastIndex=-1}if(a===null)return null;let s=a[2],c=a[3]||`0`,l=a[4]||`0`,u=t.includePrerelease&&a[5]?`-${a[5]}`:``,d=t.includePrerelease&&a[6]?`+${a[6]}`:``;return r(`${s}.${c}.${l}${u}${d}`,t)}})),oe=/* @__PURE__ */ t(((e,t)=>{let n=l(),i=r(),a=c(),o=(e,t,n)=>{if(!i.RELEASE_TYPES.includes(t))return null;let r=s(e,n);return r&&u(r,t)},s=(e,t)=>{let r=e instanceof a?e.version:e;return n(r,t)},u=(e,t)=>{if(d(t))return e.version;switch(e.prerelease=[],t){case`major`:e.minor=0,e.patch=0;break;case`minor`:e.patch=0}return e.format()},d=e=>e.startsWith(`pre`);t.exports=o})),se=/* @__PURE__ */ t(((e,t)=>{t.exports=class{constructor(){this.max=1e3,this.map=/* @__PURE__ */ new Map}get(e){let t=this.map.get(e);if(t!==void 0)return this.map.delete(e),this.map.set(e,t),t}delete(e){return this.map.delete(e)}set(e,t){if(!this.delete(e)&&t!==void 0){if(this.map.size>=this.max){let e=this.map.keys().next().value;this.delete(e)}this.map.set(e,t)}return this}}})),E=/* @__PURE__ */ t(((e,t)=>{let n=/\s+/g;t.exports=class e{constructor(t,r){if(r=l(r),t instanceof e)return t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease?t:new e(t.raw,r);if(t instanceof u)return this.raw=t.value,this.set=[[t]],this.formatted=void 0,this;if(this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease,this.raw=t.trim().replace(n,` `),this.set=this.raw.split(`||`).map(e=>this.parseRange(e.trim())).filter(e=>e.length),!this.set.length)throw TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let e=this.set[0];if(this.set=this.set.filter(e=>!te(e[0])),this.set.length===0)this.set=[e];else if(this.set.length>1){for(let e of this.set)if(e.length===1&&ne(e[0])){this.set=[e];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted=``;for(let e=0;e<this.set.length;e++){e>0&&(this.formatted+=`||`);let t=this.set[e];for(let e=0;e<t.length;e++)e>0&&(this.formatted+=` `),this.formatted+=t[e].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){e=e.replace(b,``);let t=((this.options.includePrerelease&&y)|(this.options.loose&&ee))+`:`+e,n=s.get(t);if(n)return n;let r=this.options.loose,i=r?p[h.HYPHENRANGELOOSE]:p[h.HYPHENRANGE];e=e.replace(i,le(this.options.includePrerelease)),d(`hyphen replace`,e),e=e.replace(p[h.COMPARATORTRIM],g),d(`comparator trim`,e),e=e.replace(p[h.TILDETRIM],_),d(`tilde trim`,e),e=e.replace(p[h.CARETTRIM],v),d(`caret trim`,e);let a=e.split(` `).map(e=>S(e,this.options)).join(` `).split(/\s+/).map(e=>ce(e,this.options));r&&(a=a.filter(e=>(d(`loose invalid filter`,e,this.options),!!e.match(p[h.COMPARATORLOOSE])))),d(`range list`,a);let o=/* @__PURE__ */ new Map,c=a.map(e=>new u(e,this.options));for(let e of c){if(te(e))return[e];o.set(e.value,e)}o.size>1&&o.has(``)&&o.delete(``);let l=[...o.values()];return s.set(t,l),l}intersects(t,n){if(!(t instanceof e))throw TypeError(`a Range is required`);return this.set.some(e=>x(e,n)&&t.set.some(t=>x(t,n)&&e.every(e=>t.every(t=>e.intersects(t,n)))))}test(e){if(!e)return!1;if(typeof e==`string`)try{e=new f(e,this.options)}catch{return!1}for(let t=0;t<this.set.length;t++)if(ue(this.set[t],e,this.options))return!0;return!1}};let s=new(se()),l=o(),u=D(),d=i(),f=c(),{safeRe:p,src:m,t:h,comparatorTrimReplace:g,tildeTrimReplace:_,caretTrimReplace:v}=a(),{FLAG_INCLUDE_PRERELEASE:y,FLAG_LOOSE:ee}=r(),b=new RegExp(m[h.BUILD],`g`),te=e=>e.value===`<0.0.0-0`,ne=e=>e.value===``,x=(e,t)=>{let n=!0,r=e.slice(),i=r.pop();for(;n&&r.length;)n=r.every(e=>i.intersects(e,t)),i=r.pop();return n},S=(e,t)=>(e=e.replace(p[h.BUILD],``),d(`comp`,e,t),e=ie(e,t),d(`caret`,e),e=w(e,t),d(`tildes`,e),e=oe(e,t),d(`xrange`,e),e=O(e,t),d(`stars`,e),e),C=e=>!e||e.toLowerCase()===`x`||e===`*`,re=(e,t,n)=>C(e)&&!C(t)||C(t)&&n&&!C(n),w=(e,t)=>e.trim().split(/\s+/).map(e=>T(e,t)).join(` `),T=(e,t)=>{let n=t.loose?p[h.TILDELOOSE]:p[h.TILDE],r=t.includePrerelease?`-0`:``;return e.replace(n,(t,n,i,a,o)=>{d(`tilde`,e,t,n,i,a,o);let s;return C(n)?s=``:C(i)?s=`>=${n}.0.0${r} <${+n+1}.0.0-0`:C(a)?s=`>=${n}.${i}.0${r} <${n}.${+i+1}.0-0`:o?(d(`replaceTilde pr`,o),s=`>=${n}.${i}.${a}-${o} <${n}.${+i+1}.0-0`):s=`>=${n}.${i}.${a} <${n}.${+i+1}.0-0`,d(`tilde return`,s),s})},ie=(e,t)=>e.trim().split(/\s+/).map(e=>ae(e,t)).join(` `),ae=(e,t)=>{d(`caret`,e,t);let n=t.loose?p[h.CARETLOOSE]:p[h.CARET],r=t.includePrerelease?`-0`:``;return e.replace(n,(t,n,i,a,o)=>{d(`caret`,e,t,n,i,a,o);let s;return C(n)?s=``:C(i)?s=`>=${n}.0.0${r} <${+n+1}.0.0-0`:C(a)?s=n===`0`?`>=${n}.${i}.0${r} <${n}.${+i+1}.0-0`:`>=${n}.${i}.0${r} <${+n+1}.0.0-0`:o?(d(`replaceCaret pr`,o),s=n===`0`?i===`0`?`>=${n}.${i}.${a}-${o} <${n}.${i}.${+a+1}-0`:`>=${n}.${i}.${a}-${o} <${n}.${+i+1}.0-0`:`>=${n}.${i}.${a}-${o} <${+n+1}.0.0-0`):(d(`no pr`),s=n===`0`?i===`0`?`>=${n}.${i}.${a} <${n}.${i}.${+a+1}-0`:`>=${n}.${i}.${a} <${n}.${+i+1}.0-0`:`>=${n}.${i}.${a} <${+n+1}.0.0-0`),d(`caret return`,s),s})},oe=(e,t)=>(d(`replaceXRanges`,e,t),e.split(/\s+/).map(e=>E(e,t)).join(` `)),E=(e,t)=>{e=e.trim();let n=t.loose?p[h.XRANGELOOSE]:p[h.XRANGE];return e.replace(n,(n,r,i,a,o,s)=>{if(d(`xRange`,e,n,r,i,a,o,s),re(i,a,o))return e;let c=C(i),l=c||C(a),u=l||C(o),f=u;return r===`=`&&f&&(r=``),s=t.includePrerelease?`-0`:``,c?n=r===`>`||r===`<`?`<0.0.0-0`:`*`:r&&f?(l&&(a=0),o=0,r===`>`?(r=`>=`,l?(i=+i+1,a=0,o=0):(a=+a+1,o=0)):r===`<=`&&(r=`<`,l?i=+i+1:a=+a+1),r===`<`&&(s=`-0`),n=`${r+i}.${a}.${o}${s}`):l?n=`>=${i}.0.0${s} <${+i+1}.0.0-0`:u&&(n=`>=${i}.${a}.0${s} <${i}.${+a+1}.0-0`),d(`xRange return`,n),n})},O=(e,t)=>(d(`replaceStars`,e,t),e.trim().replace(p[h.STAR],``)),ce=(e,t)=>(d(`replaceGTE0`,e,t),e.trim().replace(p[t.includePrerelease?h.GTE0PRE:h.GTE0],``)),le=e=>(t,n,r,i,a,o,s,c,l,u,d,f)=>(n=C(r)?``:C(i)?`>=${r}.0.0${e?`-0`:``}`:C(a)?`>=${r}.${i}.0${e?`-0`:``}`:o?`>=${n}`:`>=${n}${e?`-0`:``}`,c=C(l)?``:C(u)?`<${+l+1}.0.0-0`:C(d)?`<${l}.${+u+1}.0-0`:f?`<=${l}.${u}.${d}-${f}`:e?`<${l}.${u}.${+d+1}-0`:`<=${c}`,`${n} ${c}`.trim()),ue=(e,t,n)=>{for(let n=0;n<e.length;n++)if(!e[n].test(t))return!1;if(t.prerelease.length&&!n.includePrerelease){for(let n=0;n<e.length;n++)if(d(e[n].semver),e[n].semver!==u.ANY&&e[n].semver.prerelease.length>0){let r=e[n].semver;if(r.major===t.major&&r.minor===t.minor&&r.patch===t.patch)return!0}return!1}return!0}})),D=/* @__PURE__ */ t(((e,t)=>{let n=Symbol(`SemVer ANY`);t.exports=class e{static get ANY(){return n}constructor(t,i){if(i=r(i),t instanceof e){if(t.loose===!!i.loose)return t;t=t.value}t=t.trim().split(/\s+/).join(` `),d(`comparator`,t,i),this.options=i,this.loose=!!i.loose,this.parse(t),this.value=this.semver===n?``:this.operator+this.semver.version,d(`comp`,this)}parse(e){let t=this.options.loose?s[l.COMPARATORLOOSE]:s[l.COMPARATOR],r=e.match(t);if(!r)throw TypeError(`Invalid comparator: ${e}`);this.operator=r[1]===void 0?``:r[1],this.operator===`=`&&(this.operator=``),this.semver=r[2]?new f(r[2],this.options.loose):n}toString(){return this.value}test(e){if(d(`Comparator.test`,e,this.options.loose),this.semver===n||e===n)return!0;if(typeof e==`string`)try{e=new f(e,this.options)}catch{return!1}return u(e,this.operator,this.semver,this.options)}intersects(t,n){if(!(t instanceof e))throw TypeError(`a Comparator is required`);return this.operator===``?this.value===``||new p(t.value,n).test(this.value):t.operator===``?t.value===``||new p(this.value,n).test(t.semver):(n=r(n),n.includePrerelease&&(this.value===`<0.0.0-0`||t.value===`<0.0.0-0`)||!n.includePrerelease&&(this.value.startsWith(`<0.0.0`)||t.value.startsWith(`<0.0.0`))?!1:!!(this.operator.startsWith(`>`)&&t.operator.startsWith(`>`)||this.operator.startsWith(`<`)&&t.operator.startsWith(`<`)||this.semver.version===t.semver.version&&this.operator.includes(`=`)&&t.operator.includes(`=`)||u(this.semver,`<`,t.semver,n)&&this.operator.startsWith(`>`)&&t.operator.startsWith(`<`)||u(this.semver,`>`,t.semver,n)&&this.operator.startsWith(`<`)&&t.operator.startsWith(`>`)))}};let r=o(),{safeRe:s,t:l}=a(),u=ie(),d=i(),f=c(),p=E()})),O=/* @__PURE__ */ t(((e,t)=>{let n=E();t.exports=(e,t,r)=>{try{t=new n(t,r)}catch{return!1}return t.test(e)}})),ce=/* @__PURE__ */ t(((e,t)=>{let n=E();t.exports=(e,t)=>new n(e,t).set.map(e=>e.map(e=>e.value).join(` `).trim().split(` `))})),le=/* @__PURE__ */ t(((e,t)=>{let n=c(),r=E();t.exports=(e,t,i)=>{let a=null,o=null,s=null;try{s=new r(t,i)}catch{return null}return e.forEach(e=>{s.test(e)&&(a&&o.compare(e)!==-1||(a=e,o=new n(a,i)))}),a}})),ue=/* @__PURE__ */ t(((e,t)=>{let n=c(),r=E();t.exports=(e,t,i)=>{let a=null,o=null,s=null;try{s=new r(t,i)}catch{return null}return e.forEach(e=>{s.test(e)&&(a&&o.compare(e)!==1||(a=e,o=new n(a,i)))}),a}})),de=/* @__PURE__ */ t(((e,t)=>{let n=c(),r=E(),i=x();t.exports=(e,t)=>{e=new r(e,t);let a=new n(`0.0.0`);if(e.test(a)||(a=new n(`0.0.0-0`),e.test(a)))return a;a=null;for(let t=0;t<e.set.length;++t){let r=e.set[t],o=null;r.forEach(e=>{let t=new n(e.semver.version);switch(e.operator){case`>`:t.prerelease.length===0?t.patch++:t.prerelease.push(0),t.raw=t.format();case``:case`>=`:(!o||i(t,o))&&(o=t);break;case`<`:case`<=`:break;
|
|
3
3
|
/* istanbul ignore next */
|
|
4
4
|
default:throw Error(`Unexpected operation: ${e.operator}`)}}),o&&(!a||i(a,o))&&(a=o)}return a&&e.test(a)?a:null}})),fe=/* @__PURE__ */ t(((e,t)=>{let n=E();t.exports=(e,t)=>{try{return new n(e,t).range||`*`}catch{return null}}})),pe=/* @__PURE__ */ t(((e,t)=>{let n=c(),r=D(),{ANY:i}=r,a=E(),o=O(),s=x(),l=S(),u=T(),d=w();t.exports=(e,t,c,f)=>{e=new n(e,f),t=new a(t,f);let p,m,h,g,_;switch(c){case`>`:p=s,m=u,h=l,g=`>`,_=`>=`;break;case`<`:p=l,m=d,h=s,g=`<`,_=`<=`;break;default:throw TypeError(`Must provide a hilo val of "<" or ">"`)}if(o(e,t,f))return!1;for(let n=0;n<t.set.length;++n){let a=t.set[n],o=null,s=null;if(a.forEach(e=>{e.semver===i&&(e=new r(`>=0.0.0`)),o||=e,s||=e,p(e.semver,o.semver,f)?o=e:h(e.semver,s.semver,f)&&(s=e)}),o.operator===g||o.operator===_||(!s.operator||s.operator===g)&&m(e,s.semver)||s.operator===_&&h(e,s.semver))return!1}return!0}})),me=/* @__PURE__ */ t(((e,t)=>{let n=pe();t.exports=(e,t,r)=>n(e,t,`>`,r)})),he=/* @__PURE__ */ t(((e,t)=>{let n=pe();t.exports=(e,t,r)=>n(e,t,`<`,r)})),ge=/* @__PURE__ */ t(((e,t)=>{let n=E();t.exports=(e,t,r)=>(e=new n(e,r),t=new n(t,r),e.intersects(t,r))})),_e=/* @__PURE__ */ t(((e,t)=>{let n=O(),r=v();t.exports=(e,t,i)=>{let a=[],o=null,s=null,c=e.sort((e,t)=>r(e,t,i));for(let e of c)n(e,t,i)?(s=e,o||=e):(s&&a.push([o,s]),s=null,o=null);o&&a.push([o,null]);let l=[];for(let[e,t]of a)e===t?l.push(e):!t&&e===c[0]?l.push(`*`):t?e===c[0]?l.push(`<=${t}`):l.push(`${e} - ${t}`):l.push(`>=${e}`);let u=l.join(` || `),d=typeof t.raw==`string`?t.raw:String(t);return u.length<d.length?u:t}})),ve=/* @__PURE__ */ t(((e,t)=>{let n=E(),r=D(),{ANY:i}=r,a=O(),o=v(),s=(e,t,r={})=>{if(e===t)return!0;e=new n(e,r),t=new n(t,r);let i=!1;OUTER:for(let n of e.set){for(let e of t.set){let t=u(n,e,r);if(i||=t!==null,t)continue OUTER}if(i)return!1}return!0},c=[new r(`>=0.0.0-0`)],l=[new r(`>=0.0.0`)],u=(e,t,n)=>{if(e===t)return!0;if(e.length===1&&e[0].semver===i){if(t.length===1&&t[0].semver===i)return!0;e=n.includePrerelease?c:l}if(t.length===1&&t[0].semver===i){if(n.includePrerelease)return!0;t=l}let r=/* @__PURE__ */ new Set,s,u;for(let t of e)t.operator===`>`||t.operator===`>=`?s=d(s,t,n):t.operator===`<`||t.operator===`<=`?u=f(u,t,n):r.add(t.semver);if(r.size>1)return null;let p;if(s&&u&&(p=o(s.semver,u.semver,n),p>0||p===0&&(s.operator!==`>=`||u.operator!==`<=`)))return null;for(let e of r){if(s&&!a(e,String(s),n)||u&&!a(e,String(u),n))return null;for(let r of t)if(!a(e,String(r),n))return!1;return!0}let m,h,g,_,v=u&&!n.includePrerelease&&u.semver.prerelease.length?u.semver:!1,y=s&&!n.includePrerelease&&s.semver.prerelease.length?s.semver:!1;v&&v.prerelease.length===1&&u.operator===`<`&&v.prerelease[0]===0&&(v=!1);for(let e of t){if(_=_||e.operator===`>`||e.operator===`>=`,g=g||e.operator===`<`||e.operator===`<=`,s){if(y&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===y.major&&e.semver.minor===y.minor&&e.semver.patch===y.patch&&(y=!1),e.operator===`>`||e.operator===`>=`){if(m=d(s,e,n),m===e&&m!==s)return!1}else if(s.operator===`>=`&&!e.test(s.semver))return!1}if(u){if(v&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===v.major&&e.semver.minor===v.minor&&e.semver.patch===v.patch&&(v=!1),e.operator===`<`||e.operator===`<=`){if(h=f(u,e,n),h===e&&h!==u)return!1}else if(u.operator===`<=`&&!e.test(u.semver))return!1}if(!e.operator&&(u||s)&&p!==0)return!1}return!(s&&g&&!u&&p!==0||u&&_&&!s&&p!==0||y||v)},d=(e,t,n)=>{if(!e)return t;let r=o(e.semver,t.semver,n);return r>0?e:r<0||t.operator===`>`&&e.operator===`>=`?t:e},f=(e,t,n)=>{if(!e)return t;let r=o(e.semver,t.semver,n);return r<0?e:r>0||t.operator===`<`&&e.operator===`<=`?t:e};t.exports=s})),ye=/* @__PURE__ */ e((/* @__PURE__ */ t(((e,t)=>{let n=a(),i=r(),o=c(),se=s();t.exports={parse:l(),valid:u(),clean:d(),inc:f(),diff:p(),major:m(),minor:h(),patch:g(),prerelease:_(),compare:v(),rcompare:y(),compareLoose:ee(),compareBuild:b(),sort:te(),rsort:ne(),gt:x(),lt:S(),eq:C(),neq:re(),gte:w(),lte:T(),cmp:ie(),coerce:ae(),truncate:oe(),Comparator:D(),Range:E(),satisfies:O(),toComparators:ce(),maxSatisfying:le(),minSatisfying:ue(),minVersion:de(),validRange:fe(),outside:pe(),gtr:me(),ltr:he(),intersects:ge(),simplifyRange:_e(),subset:ve(),SemVer:o,re:n.re,src:n.src,tokens:n.t,SEMVER_SPEC_VERSION:i.SEMVER_SPEC_VERSION,RELEASE_TYPES:i.RELEASE_TYPES,compareIdentifiers:se.compareIdentifiers,rcompareIdentifiers:se.rcompareIdentifiers}})))(),1);const be=e=>{let t=e.split(`
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createRequire as e}from"node:module";var t=Object.create,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,a=Object.getPrototypeOf,o=Object.prototype.hasOwnProperty,s=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t,t.exports),e=null),t.exports),c=(e,t)=>{let r=Object.setPrototypeOf({},null);for(var i in e)n(r,i,{get:e[i],enumerable:!0});return t&1||n(r,Symbol.toStringTag,{value:`Module`}),t&2?r:Object.preventExtensions(r)},l=(e,t,a,s)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var c=i(t),l=0,u=c.length,d;l<u;l++)d=c[l],!o.call(e,d)&&d!==a&&n(e,d,{get:(e=>t[e]).bind(null,d),enumerable:!(s=r(t,d))||s.enumerable});return e},u=(e,r,i)=>(i=e==null?{}:t(a(e)),l(r||!e||!e.__esModule||!o.call(e,`default`)?n(i,`default`,{value:e,enumerable:!0}):i,e)),d=/* @__PURE__ */ e(import.meta.url);export{u as i,c as n,d as r,s as t};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nice-move/cli",
|
|
3
|
-
"version": "0.12.
|
|
3
|
+
"version": "0.12.2",
|
|
4
4
|
"description": "Frontend develop helper for frontend development",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": {
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"settingz": "^0.2.0"
|
|
48
48
|
},
|
|
49
49
|
"engines": {
|
|
50
|
-
"node": "^24.0.0"
|
|
50
|
+
"node": "^24.15.0 || ^26.0.0"
|
|
51
51
|
},
|
|
52
52
|
"publishConfig": {
|
|
53
53
|
"access": "public",
|
package/dist/lint-auI-Wp-E.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-9nwCUaSw.mjs";import{resolve as t}from"node:path";import{readFile as n}from"node:fs/promises";import{readFileSync as r,statSync as i}from"fs";import{createRequire as a}from"module";import{isAbsolute as o,resolve as s}from"path";const c=process.cwd(),l=a(import.meta.url);function u(e,t=c){return e.startsWith(`.`)?s(t,e):o(e)?e:l.resolve(e)}function d(e){try{return i(u(e)),!0}catch{return!1}}function f(e){try{let t=r(u(e),`utf8`);return JSON.parse(t)}catch{return{}}}function p(e,t={}){let n=f(`./package.json`);if(e){let{[e]:r=t}=n;return r}return n}const m={"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],"subject-case":[0],"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`]],"scope-case":[0],"body-case":[0],"header-case":[0]};function h(){return t(process.cwd(),`.git/COMMIT_EDITMSG`)}function g(){return n(h(),`utf8`)}async function _(){let e=await g(),t=await import(`./lint-F5AnrbQa.mjs`).then(e=>e.default.default||e.default),n=await import(`./lib-ClAZZHmX.mjs`).then(e=>e.default.default||e.default),r=await t(e,m);return{result:r,output:await n({results:[r]})}}function v(e){e.command(`commit`,`Lint git commit message`,{},()=>{_().then(({result:e,output:t})=>{e.valid?console.log(`Pass.`):(console.log(`Fail:`),console.log(t),process.exitCode=1)}).catch(e=>{console.error(e),process.exitCode=1})})}function y(e){let t=Object.entries(e).map(([e,t])=>[e,t.filter(Boolean)]).filter(([e,t])=>t.length);return t.length>0?Object.fromEntries(t):void 0}function b({garou:e,stylelint:t,eslint:n,prettier:r}){let i=process.stdin.isTTY?` --color`:``;return y({"*.{vue,html,htm,md}":[e&&`garou`,r&&`prettier -w -u${i}`,t&&`stylelint --fix -- ${i}`,n&&`eslint --fix ${i}`],"*.{ts,tsx,mts,cts}":[e&&`garou`,r&&`prettier -w -u${i}`,n&&`eslint --fix ${i}`],"*.{js,jsx,mjs,cjs,wxs,qs}":[e&&`garou`,r&&`prettier -w -u${i}`,n&&`eslint --fix ${i}`],"*.{c,sc,le,wx,q,tt,jx,ac}ss":[e&&`garou`,r&&`prettier -w -u${i}`,t&&`stylelint --fix -- ${i}`],"*.{json,yml,yaml,svg}":[e&&`garou`,r&&`prettier -w -u${i}`],"{*.{jsonc,webmanifest,editorconfig,toml},.{babel,npm}rc}":[r&&`prettier -w -u${i}`],"{*.jenkinsfile,{j,J}enkinsfile}":[r&&`prettier -w -u${i}`],"yarn.lock":[e&&`garou`]})}function x(){let e=p(`devDependencies`),t=`prettier`in e,n=`eslint`in e,r=`stylelint`in e;return{garou:`garou`in e,stylelint:r,eslint:n,prettier:t}}async function S(){let{default:e}=await import(`./lib-BGxhLM1P.mjs`);return e({allowEmpty:!0,concurrent:!0,config:b(x()),cwd:process.cwd(),debug:!1,quiet:!1,relative:!1,stash:!0})}function C(e){e.command(`staged`,`Lint and format git staged files`,{},()=>{S().then(e=>{process.exitCode=+!e}).catch(e=>{console.error(e),process.exitCode=1})})}var w=/* @__PURE__ */ e({builder:()=>D,command:()=>T,description:()=>``});const T=`lint`,E=``;function D(e){v(e),C(e),e.demandCommand(1,"Typing `commit` or `staged`")}export{d as a,w as i,T as n,E as r,D as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{createRequire as e}from"node:module";var t=Object.create,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,a=Object.getPrototypeOf,o=Object.prototype.hasOwnProperty,s=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t,t.exports),e=null),t.exports),c=(e,t)=>{let r={};for(var i in e)n(r,i,{get:e[i],enumerable:!0});return t||n(r,Symbol.toStringTag,{value:`Module`}),r},l=(e,t,a,s)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var c=i(t),l=0,u=c.length,d;l<u;l++)d=c[l],!o.call(e,d)&&d!==a&&n(e,d,{get:(e=>t[e]).bind(null,d),enumerable:!(s=r(t,d))||s.enumerable});return e},u=(e,r,i)=>(i=e==null?{}:t(a(e)),l(r||!e||!e.__esModule||!o.call(e,`default`)?n(i,`default`,{value:e,enumerable:!0}):i,e)),d=/* @__PURE__ */ e(import.meta.url);export{u as i,c as n,d as r,s as t};
|