@clerc/core 0.34.0 → 0.34.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.
- package/dist/index.d.ts +12 -11
- package/dist/index.js +1 -1
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -307,8 +307,8 @@ type MakeEventMap<T extends Commands> = {
|
|
|
307
307
|
};
|
|
308
308
|
type FallbackFlags<F extends Flags | undefined> = Equals<NonNullableFlag<F>["flags"], {}> extends true ? Dict<any> : NonNullableFlag<F>["flags"];
|
|
309
309
|
type NonNullableFlag<F extends Flags | undefined> = TypeFlag<NonNullable<F>>;
|
|
310
|
-
type ParseFlag<C extends Commands, N extends keyof C, GF extends
|
|
311
|
-
type ParseRaw<C extends Command, GF extends
|
|
310
|
+
type ParseFlag<C extends Commands, N extends keyof C, GF extends GlobalFlagOptions = {}> = N extends keyof C ? OmitIndexSignature<NonNullableFlag<C[N]["flags"] & GF>["flags"]> : FallbackFlags<C[N]["flags"] & GF>["flags"];
|
|
311
|
+
type ParseRaw<C extends Command, GF extends GlobalFlagOptions = {}> = NonNullableFlag<C["flags"] & GF> & {
|
|
312
312
|
flags: FallbackFlags<C["flags"] & GF>;
|
|
313
313
|
parameters: string[];
|
|
314
314
|
mergedFlags: FallbackFlags<C["flags"] & GF> & NonNullableFlag<C["flags"] & GF>["unknownFlags"];
|
|
@@ -333,9 +333,9 @@ type FlagOptions = FlagSchema & {
|
|
|
333
333
|
type Flag = FlagOptions & {
|
|
334
334
|
name: string;
|
|
335
335
|
};
|
|
336
|
-
type
|
|
336
|
+
type GlobalFlagOption = FlagSchema;
|
|
337
337
|
type Flags = Dict<FlagOptions>;
|
|
338
|
-
type
|
|
338
|
+
type GlobalFlagOptions = Dict<GlobalFlagOption>;
|
|
339
339
|
declare interface CommandCustomProperties {
|
|
340
340
|
}
|
|
341
341
|
interface CommandOptions<P extends string[] = string[], A extends MaybeArray$1<string | RootType> = MaybeArray$1<string | RootType>, F extends Flags = Flags> extends CommandCustomProperties {
|
|
@@ -362,7 +362,7 @@ interface ParseOptions {
|
|
|
362
362
|
argv?: string[];
|
|
363
363
|
run?: boolean;
|
|
364
364
|
}
|
|
365
|
-
interface HandlerContext<C extends Commands = Commands, N extends keyof C = keyof C, GF extends
|
|
365
|
+
interface HandlerContext<C extends Commands = Commands, N extends keyof C = keyof C, GF extends GlobalFlagOptions = {}> {
|
|
366
366
|
name?: LiteralUnion<N, string>;
|
|
367
367
|
called?: string | RootType;
|
|
368
368
|
resolved: boolean;
|
|
@@ -374,7 +374,7 @@ interface HandlerContext<C extends Commands = Commands, N extends keyof C = keyo
|
|
|
374
374
|
flags: Simplify<ParseFlag<C, N, GF> & Record<string, any>>;
|
|
375
375
|
cli: Clerc<C, GF>;
|
|
376
376
|
}
|
|
377
|
-
type Handler<C extends Commands = Commands, K extends keyof C = keyof C, GF extends
|
|
377
|
+
type Handler<C extends Commands = Commands, K extends keyof C = keyof C, GF extends GlobalFlagOptions = {}> = (ctx: HandlerContext<C, K, GF>) => void;
|
|
378
378
|
type HandlerInCommand<C extends HandlerContext> = (ctx: {
|
|
379
379
|
[K in keyof C]: C[K];
|
|
380
380
|
}) => void;
|
|
@@ -391,7 +391,7 @@ interface InspectorObject<C extends Commands = Commands> {
|
|
|
391
391
|
|
|
392
392
|
declare const Root: unique symbol;
|
|
393
393
|
type RootType = typeof Root;
|
|
394
|
-
declare class Clerc<C extends Commands = {}, GF extends
|
|
394
|
+
declare class Clerc<C extends Commands = {}, GF extends GlobalFlagOptions = {}> {
|
|
395
395
|
#private;
|
|
396
396
|
i18n: I18N;
|
|
397
397
|
private constructor();
|
|
@@ -517,18 +517,19 @@ declare class Clerc<C extends Commands = {}, GF extends FlagsWithoutDescription
|
|
|
517
517
|
/**
|
|
518
518
|
* Register a global flag
|
|
519
519
|
* @param name
|
|
520
|
+
* @param description
|
|
520
521
|
* @param options
|
|
521
522
|
* @returns
|
|
522
523
|
* @example
|
|
523
524
|
* ```ts
|
|
524
525
|
* Clerc.create()
|
|
525
|
-
* .flag("help", {
|
|
526
|
+
* .flag("help", "help", {
|
|
526
527
|
* alias: "h",
|
|
527
|
-
*
|
|
528
|
+
* type: Boolean,
|
|
528
529
|
* })
|
|
529
530
|
* ```
|
|
530
531
|
*/
|
|
531
|
-
flag<N extends string, O extends
|
|
532
|
+
flag<N extends string, O extends GlobalFlagOption>(name: N, description: string, options: O): this & Clerc<C, GF & Record<N, O>>;
|
|
532
533
|
/**
|
|
533
534
|
* Register a handler
|
|
534
535
|
* @param name
|
|
@@ -646,4 +647,4 @@ declare const formatCommandName: (name: string | string[] | RootType) => string;
|
|
|
646
647
|
declare const detectLocale: () => string;
|
|
647
648
|
declare const stripFlags: (argv: string[]) => string[];
|
|
648
649
|
|
|
649
|
-
export { Clerc, Command, CommandAlias, CommandCustomProperties, CommandExistsError, CommandNameConflictError, CommandOptions, CommandType, CommandWithHandler, Commands, DescriptionNotSetError, FallbackType, Flag, FlagOptions,
|
|
650
|
+
export { Clerc, Command, CommandAlias, CommandCustomProperties, CommandExistsError, CommandNameConflictError, CommandOptions, CommandType, CommandWithHandler, Commands, DescriptionNotSetError, FallbackType, Flag, FlagOptions, Flags, GlobalFlagOption, GlobalFlagOptions, Handler, HandlerContext, HandlerInCommand, I18N, Inspector, InspectorContext, InspectorFn, InspectorObject, InvalidCommandNameError, LocaleNotCalledFirstError, Locales, MakeEventMap, NameNotSetError, NoCommandGivenError, NoSuchCommandError, ParseOptions, Plugin, Root, RootType, TranslateFn, VersionNotSetError, compose, defineCommand, defineHandler, defineInspector, definePlugin, detectLocale, formatCommandName, isValidName, resolveArgv, resolveCommand, resolveCommandStrict, resolveFlattenCommands, resolveRootCommands, resolveSubcommandsByParent, stripFlags, withBrackets };
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{format as ce}from"node:util";class Re{constructor(){this.listenerMap={},this.wildcardListeners=new Set}on(t,s){return t==="*"?(this.wildcardListeners.add(s),this):(this.listenerMap[t]||(this.listenerMap[t]=new Set),this.listenerMap[t].add(s),this)}emit(t,...s){return this.listenerMap[t]&&(this.wildcardListeners.forEach(r=>r(t,...s)),this.listenerMap[t].forEach(r=>r(...s))),this}off(t,s){var r,n;return t==="**"?(this.listenerMap={},this.wildcardListeners.clear(),this):t==="*"?(s?this.wildcardListeners.delete(s):this.wildcardListeners.clear(),this):(s?(r=this.listenerMap[t])==null||r.delete(s):(n=this.listenerMap[t])==null||n.clear(),this)}}const $e="known-flag",je="unknown-flag",qe="argument",{stringify:A}=JSON,Te=/\B([A-Z])/g,Ge=e=>e.replace(Te,"-$1").toLowerCase(),{hasOwnProperty:He}=Object.prototype,k=(e,t)=>He.call(e,t),Ue=e=>Array.isArray(e),ue=e=>typeof e=="function"?[e,!1]:Ue(e)?[e[0],!0]:ue(e.type),Ve=(e,t)=>e===Boolean?t!=="false":t,Je=(e,t)=>typeof t=="boolean"?t:e===Number&&t===""?Number.NaN:e(t),ze=/[\s.:=]/,Ke=e=>{const t=`Flag name ${A(e)}`;if(e.length===0)throw new Error(`${t} cannot be empty`);if(e.length===1)throw new Error(`${t} must be longer than a character`);const s=e.match(ze);if(s)throw new Error(`${t} cannot contain ${A(s==null?void 0:s[0])}`)},Ze=e=>{const t={},s=(r,n)=>{if(k(t,r))throw new Error(`Duplicate flags named ${A(r)}`);t[r]=n};for(const r in e){if(!k(e,r))continue;Ke(r);const n=e[r],o=[[],...ue(n),n];s(r,o);const a=Ge(r);if(r!==a&&s(a,o),"alias"in n&&typeof n.alias=="string"){const{alias:i}=n,c=`Flag alias ${A(i)} for flag ${A(r)}`;if(i.length===0)throw new Error(`${c} cannot be empty`);if(i.length>1)throw new Error(`${c} must be a single character`);s(i,o)}}return t},Qe=(e,t)=>{const s={};for(const r in e){if(!k(e,r))continue;const[n,,o,a]=t[r];if(n.length===0&&"default"in a){let{default:i}=a;typeof i=="function"&&(i=i()),s[r]=i}else s[r]=o?n:n.pop()}return s},R="--",Xe=/[.:=]/,Ye=/^-{1,2}\w/,et=e=>{if(!Ye.test(e))return;const t=!e.startsWith(R);let s=e.slice(t?1:2),r;const n=s.match(Xe);if(n){const{index:o}=n;r=s.slice(o+1),s=s.slice(0,o)}return[s,r,t]},tt=(e,{onFlag:t,onArgument:s})=>{let r;const n=(o,a)=>{if(typeof r!="function")return!0;r(o,a),r=void 0};for(let o=0;o<e.length;o+=1){const a=e[o];if(a===R){n();const c=e.slice(o+1);s==null||s(c,[o],!0);break}const i=et(a);if(i){if(n(),!t)continue;const[c,l,m]=i;if(m)for(let d=0;d<c.length;d+=1){n();const g=d===c.length-1;r=t(c[d],g?l:void 0,[o,d+1,g])}else r=t(c,l,[o])}else n(a,[o])&&(s==null||s([a],[o]))}n()},st=(e,t)=>{for(const[s,r,n]of t.reverse()){if(r){const o=e[s];let a=o.slice(0,r);if(n||(a+=o.slice(r+1)),a!=="-"){e[s]=a;continue}}e.splice(s,1)}},le=(e,t=process.argv.slice(2),{ignore:s}={})=>{const r=[],n=Ze(e),o={},a=[];return a[R]=[],tt(t,{onFlag(i,c,l){const m=k(n,i);if(!(s!=null&&s(m?$e:je,i,c))){if(m){const[d,g]=n[i],S=Ve(g,c),v=(T,G)=>{r.push(l),G&&r.push(G),d.push(Je(g,T||""))};return S===void 0?v:v(S)}k(o,i)||(o[i]=[]),o[i].push(c===void 0?!0:c),r.push(l)}},onArgument(i,c,l){s!=null&&s(qe,t[c[0]])||(a.push(...i),l?(a[R]=i,t.splice(c[0])):r.push(c))}}),st(t,r),{flags:Qe(e,n),unknownFlags:o,_:a}};function H(e){return e!==null&&typeof e=="object"}function U(e,t,s=".",r){if(!H(t))return U(e,{},s,r);const n=Object.assign({},t);for(const o in e){if(o==="__proto__"||o==="constructor")continue;const a=e[o];a!=null&&(r&&r(n,o,a,s)||(Array.isArray(a)&&Array.isArray(n[o])?n[o]=[...a,...n[o]]:H(a)&&H(n[o])?n[o]=U(a,n[o],(s?`${s}.`:"")+o.toString(),r):n[o]=a))}return n}function rt(e){return(...t)=>t.reduce((s,r)=>U(s,r,"",e),{})}const ot=rt(),V=e=>Array.isArray(e)?e:[e],nt=e=>e.replace(/[\W_]([a-z\d])?/gi,(t,s)=>s?s.toUpperCase():""),he=(e,t)=>t.length!==e.length?!1:e.every((s,r)=>s===t[r]),de=(e,t)=>t.length>e.length?!1:he(e.slice(0,t.length),t),L=JSON.stringify;class fe extends Error{constructor(t,s){super(s("core.commandExists",L(t))),this.commandName=t}}class me extends Error{constructor(t,s){super(s("core.noSuchCommand",L(t))),this.commandName=t}}class pe extends Error{constructor(t){super(t("core.noCommandGiven"))}}class Ce extends Error{constructor(t,s,r){super(r("core.commandNameConflict",L(t),L(s))),this.n1=t,this.n2=s}}class we extends Error{constructor(t){super(t("core.nameNotSet"))}}class ge extends Error{constructor(t){super(t("core.descriptionNotSet"))}}class Ee extends Error{constructor(t){super(t("core.versionNotSet"))}}class _e extends Error{constructor(t,s){super(s("core.badNameFormat",L(t))),this.commandName=t}}class J extends Error{constructor(t){super(t("core.localeMustBeCalledFirst"))}}const ve=typeof Deno!="undefined",at=typeof process!="undefined"&&!ve,it=process.versions.electron&&!process.defaultApp;function Me(e,t,s,r){if(s.alias){const n=V(s.alias);for(const o of n){if(o in t)throw new Ce(t[o].name,s.name,r);e.set(typeof o=="symbol"?o:o.split(" "),{...s,__isAlias:!0})}}}function z(e,t){const s=new Map;e[f]&&(s.set(f,e[f]),Me(s,e,e[f],t));for(const r of Object.values(e))Me(s,e,r,t),s.set(r.name.split(" "),r);return s}function Fe(e,t,s){const r=z(e,s);for(const[n,o]of r.entries()){const a=le((o==null?void 0:o.flags)||{},[...t]),{_:i}=a;if(n!==f&&de(i,n))return[o,n]}return r.has(f)?[r.get(f),f]:[void 0,void 0]}function ct(e,t,s){if(t===f)return[e[f],f];const r=V(t),n=z(e,s);let o,a;return n.forEach((i,c)=>{c===f||a===f||he(r,c)&&(o=i,a=c)}),[o,a]}function ye(e,t,s=1/0){const r=t===""?[]:Array.isArray(t)?t:t.split(" ");return Object.values(e).filter(n=>{const o=n.name.split(" ");return de(o,r)&&o.length-r.length<=s})}const ut=e=>ye(e,"",1),K=()=>at?process.argv.slice(it?1:2):ve?Deno.args:[];function Be(e){const t={pre:[],normal:[],post:[]};for(const r of e){const n=typeof r=="object"?r:{fn:r},{enforce:o,fn:a}=n;o==="post"||o==="pre"?t[o].push(a):t.normal.push(a)}const s=[...t.pre,...t.normal,...t.post];return r=>{const n=[];let o=0;const a=i=>{o=i;const c=s[i],l=c(r,a.bind(null,i+1));l&&n.push(l)};if(a(0),o+1===s.length)for(const i of n)i()}}const lt=/\s\s+/,Ne=e=>e===f?!0:!(e.startsWith(" ")||e.endsWith(" "))&&!lt.test(e),ht=(e,t)=>t?`[${e}]`:`<${e}>`,dt="<Root>",Se=e=>Array.isArray(e)?e.join(" "):typeof e=="string"?e:dt,Ae=()=>process.env.CLERC_LOCALE?process.env.CLERC_LOCALE:Intl.DateTimeFormat().resolvedOptions().locale,ke=e=>e.filter(t=>!t.startsWith("-")),{stringify:B}=JSON;function Z(e,t){const s=[];let r,n;for(const o of e){if(n)throw new Error(t("core.spreadParameterMustBeLast",B(n)));const a=o[0],i=o[o.length-1];let c;if(a==="<"&&i===">"&&(c=!0,r))throw new Error(t("core.requiredParameterMustBeBeforeOptional",B(o),B(r)));if(a==="["&&i==="]"&&(c=!1,r=o),c===void 0)throw new Error(t("core.parameterMustBeWrappedInBrackets",B(o)));let l=o.slice(1,-1);const m=l.slice(-3)==="...";m&&(n=o,l=l.slice(0,-3)),s.push({name:l,required:c,spread:m})}return s}function Q(e,t,s,r){for(let n=0;n<t.length;n+=1){const{name:o,required:a,spread:i}=t[n],c=nt(o);if(c in e)throw new Error(r("core.parameterIsUsedMoreThanOnce",B(o)));const l=i?s.slice(n):s[n];if(i&&(n=t.length),a&&(!l||i&&l.length===0))throw new Error(r("core.missingRequiredParameter",B(o)));e[c]=l}}const ft={en:{"core.commandExists":'Command "%s" exists.',"core.noSuchCommand":"No such command: %s.","core.noCommandGiven":"No command given.","core.commandNameConflict":"Command name %s conflicts with %s. Maybe caused by alias.","core.nameNotSet":"Name not set.","core.descriptionNotSet":"Description not set.","core.versionNotSet":"Version not set.","core.badNameFormat":"Bad name format: %s.","core.localeMustBeCalledFirst":"locale() or fallbackLocale() must be called at first.","core.cliParseMustBeCalled":"cli.parse() must be called.","core.spreadParameterMustBeLast":"Invalid Parameter: Spread parameter %s must be last.","core.requiredParameterCannotComeAfterOptionalParameter":"Invalid Parameter: Required parameter %s cannot come after optional parameter %s.","core.parameterMustBeWrappedInBrackets":"Invalid Parameter: Parameter %s must be wrapped in <> (required parameter) or [] (optional parameter).","core.parameterIsUsedMoreThanOnce":"Invalid Parameter: Parameter %s is used more than once.","core.missingRequiredParameter":"Missing required parameter %s."},"zh-CN":{"core.commandExists":'\u547D\u4EE4 "%s" \u5DF2\u5B58\u5728\u3002',"core.noSuchCommand":"\u627E\u4E0D\u5230\u547D\u4EE4: %s\u3002","core.noCommandGiven":"\u6CA1\u6709\u8F93\u5165\u547D\u4EE4\u3002","core.commandNameConflict":"\u547D\u4EE4\u540D\u79F0 %s \u548C %s \u51B2\u7A81\u3002 \u53EF\u80FD\u662F\u7531\u4E8E\u522B\u540D\u5BFC\u81F4\u7684\u3002","core.nameNotSet":"\u672A\u8BBE\u7F6ECLI\u540D\u79F0\u3002","core.descriptionNotSet":"\u672A\u8BBE\u7F6ECLI\u63CF\u8FF0\u3002","core.versionNotSet":"\u672A\u8BBE\u7F6ECLI\u7248\u672C\u3002","core.badNameFormat":"\u9519\u8BEF\u7684\u547D\u4EE4\u540D\u5B57\u683C\u5F0F: %s\u3002","core.localeMustBeCalledFirst":"locale() \u6216 fallbackLocale() \u5FC5\u987B\u5728\u6700\u5F00\u59CB\u8C03\u7528\u3002","core.cliParseMustBeCalled":"cli.parse() \u5FC5\u987B\u88AB\u8C03\u7528\u3002","core.spreadParameterMustBeLast":"\u4E0D\u5408\u6CD5\u7684\u53C2\u6570: \u5C55\u5F00\u53C2\u6570 %s \u5FC5\u987B\u5728\u6700\u540E\u3002","core.requiredParameterCannotComeAfterOptionalParameter":"\u4E0D\u5408\u6CD5\u7684\u53C2\u6570: \u5FC5\u586B\u53C2\u6570 %s \u4E0D\u80FD\u5728\u53EF\u9009\u53C2\u6570 %s \u4E4B\u540E\u3002","core.parameterMustBeWrappedInBrackets":"\u4E0D\u5408\u6CD5\u7684\u53C2\u6570: \u53C2\u6570 %s \u5FC5\u987B\u88AB <> (\u5FC5\u586B\u53C2\u6570) \u6216 [] (\u53EF\u9009\u53C2\u6570) \u5305\u88F9\u3002","core.parameterIsUsedMoreThanOnce":"\u4E0D\u5408\u6CD5\u7684\u53C2\u6570: \u53C2\u6570 %s \u88AB\u4F7F\u7528\u4E86\u591A\u6B21\u3002","core.missingRequiredParameter":"\u7F3A\u5C11\u5FC5\u586B\u53C2\u6570 %s\u3002"}};var X=(e,t,s)=>{if(!t.has(e))throw TypeError("Cannot "+s)},u=(e,t,s)=>(X(e,t,"read from private field"),s?s.call(e):t.get(e)),h=(e,t,s)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,s)},C=(e,t,s,r)=>(X(e,t,"write to private field"),r?r.call(e,s):t.set(e,s),s),p=(e,t,s)=>(X(e,t,"access private method"),s),_,M,F,W,D,$,j,N,b,O,P,I,x,y,Y,Le,ee,We,te,De,w,E,se,be,re,Oe,oe,Pe,q,ne,ae,Ie;const f=Symbol.for("Clerc.Root"),xe=class{constructor(e,t,s){h(this,Y),h(this,ee),h(this,te),h(this,w),h(this,se),h(this,re),h(this,oe),h(this,q),h(this,ae),h(this,_,""),h(this,M,""),h(this,F,""),h(this,W,[]),h(this,D,{}),h(this,$,new Re),h(this,j,{}),h(this,N,new Set),h(this,b,void 0),h(this,O,[]),h(this,P,!1),h(this,I,"en"),h(this,x,"en"),h(this,y,{}),this.i18n={add:r=>{C(this,y,ot(u(this,y),r))},t:(r,...n)=>{const o=u(this,y)[u(this,x)]||u(this,y)[u(this,I)],a=u(this,y)[u(this,I)];return o[r]?ce(o[r],...n):a[r]?ce(a[r],...n):void 0}},C(this,_,e||u(this,_)),C(this,M,t||u(this,M)),C(this,F,s||u(this,F)),C(this,x,Ae()),p(this,te,De).call(this)}get _name(){return u(this,_)}get _description(){return u(this,M)}get _version(){return u(this,F)}get _inspectors(){return u(this,W)}get _commands(){return u(this,D)}get _flags(){return u(this,j)}static create(e,t,s){return new xe(e,t,s)}name(e){return p(this,w,E).call(this),C(this,_,e),this}description(e){return p(this,w,E).call(this),C(this,M,e),this}version(e){return p(this,w,E).call(this),C(this,F,e),this}locale(e){if(u(this,P))throw new J(this.i18n.t);return C(this,x,e),this}fallbackLocale(e){if(u(this,P))throw new J(this.i18n.t);return C(this,I,e),this}errorHandler(e){return u(this,O).push(e),this}command(e,t,s={}){return p(this,q,ne).call(this,()=>p(this,se,be).call(this,e,t,s)),this}flag(e,t,s){return u(this,j)[e]={description:t,...s},this}on(e,t){return u(this,$).on(e,t),this}use(e){return p(this,w,E).call(this),e.setup(this)}inspector(e){return p(this,w,E).call(this),u(this,W).push(e),this}parse(e=K()){p(this,w,E).call(this);const{argv:t,run:s}=Array.isArray(e)?{argv:e,run:!0}:{argv:K(),...e};return C(this,b,[...t]),p(this,re,Oe).call(this),s&&this.runMatchedCommand(),this}runMatchedCommand(){return p(this,q,ne).call(this,()=>p(this,ae,Ie).call(this)),process.title=u(this,_),this}};let mt=xe;_=new WeakMap,M=new WeakMap,F=new WeakMap,W=new WeakMap,D=new WeakMap,$=new WeakMap,j=new WeakMap,N=new WeakMap,b=new WeakMap,O=new WeakMap,P=new WeakMap,I=new WeakMap,x=new WeakMap,y=new WeakMap,Y=new WeakSet,Le=function(){return u(this,N).has(f)},ee=new WeakSet,We=function(){return Object.prototype.hasOwnProperty.call(this._commands,f)},te=new WeakSet,De=function(){this.i18n.add(ft)},w=new WeakSet,E=function(){C(this,P,!0)},se=new WeakSet,be=function(e,t,s={}){p(this,w,E).call(this);const{t:r}=this.i18n,o=(d=>!(typeof d=="string"||d===f))(e),a=o?e.name:e;if(!Ne(a))throw new _e(a,r);const{handler:i=void 0,...c}=o?e:{name:a,description:t,...s},l=[c.name],m=c.alias?V(c.alias):[];c.alias&&l.push(...m);for(const d of l)if(u(this,N).has(d))throw new fe(Se(d),r);return u(this,D)[a]=c,u(this,N).add(c.name),m.forEach(d=>u(this,N).add(d)),o&&i&&this.on(e.name,i),this},re=new WeakSet,Oe=function(){const{t:e}=this.i18n;if(!u(this,_))throw new we(e);if(!u(this,M))throw new ge(e);if(!u(this,F))throw new Ee(e)},oe=new WeakSet,Pe=function(e){const t=u(this,b),{t:s}=this.i18n,[r,n]=e(),o=!!r,a=le((r==null?void 0:r.flags)||{},[...t]),{_:i,flags:c,unknownFlags:l}=a;let m=!o||r.name===f?i:i.slice(r.name.split(" ").length),d=(r==null?void 0:r.parameters)||[];const g=d.indexOf("--"),S=d.slice(g+1)||[],v=Object.create(null);if(g>-1&&S.length>0){d=d.slice(0,g);const ie=i["--"];m=m.slice(0,-ie.length||void 0),Q(v,Z(d,s),m,s),Q(v,Z(S,s),ie,s)}else Q(v,Z(d,s),m,s);const T={...c,...l};return{name:r==null?void 0:r.name,called:Array.isArray(n)?n.join(" "):n,resolved:o,hasRootOrAlias:u(this,Y,Le),hasRoot:u(this,ee,We),raw:{...a,parameters:m,mergedFlags:T},parameters:v,flags:c,unknownFlags:l,cli:this}},q=new WeakSet,ne=function(e){try{e()}catch(t){if(u(this,O).length>0)u(this,O).forEach(s=>s(t));else throw t}},ae=new WeakSet,Ie=function(){p(this,w,E).call(this);const{t:e}=this.i18n,t=u(this,b);if(!t)throw new Error(e("core.cliParseMustBeCalled"));const s=()=>Fe(u(this,D),t,e),r=()=>p(this,oe,Pe).call(this,s),n={enforce:"post",fn:i=>{const[c]=s(),l=ke(t).join(" ");if(!c)throw l?new me(l,e):new pe(e);u(this,$).emit(c.name,i)}},o=[...u(this,W),n];Be(o)(r())};const pt=e=>e,Ct=(e,t,s)=>s,wt=(e,t)=>t,gt=(e,t)=>({...e,handler:t});export{mt as Clerc,fe as CommandExistsError,Ce as CommandNameConflictError,ge as DescriptionNotSetError,_e as InvalidCommandNameError,J as LocaleNotCalledFirstError,we as NameNotSetError,pe as NoCommandGivenError,me as NoSuchCommandError,f as Root,Ee as VersionNotSetError,Be as compose,gt as defineCommand,Ct as defineHandler,wt as defineInspector,pt as definePlugin,Ae as detectLocale,Se as formatCommandName,Ne as isValidName,K as resolveArgv,Fe as resolveCommand,ct as resolveCommandStrict,z as resolveFlattenCommands,ut as resolveRootCommands,ye as resolveSubcommandsByParent,ke as stripFlags,ht as withBrackets};
|
|
1
|
+
import{format as ce}from"node:util";class Re{constructor(){this.listenerMap={},this.wildcardListeners=new Set}on(t,s){return t==="*"?(this.wildcardListeners.add(s),this):(this.listenerMap[t]||(this.listenerMap[t]=new Set),this.listenerMap[t].add(s),this)}emit(t,...s){return this.listenerMap[t]&&(this.wildcardListeners.forEach(r=>r(t,...s)),this.listenerMap[t].forEach(r=>r(...s))),this}off(t,s){var r,n;return t==="**"?(this.listenerMap={},this.wildcardListeners.clear(),this):t==="*"?(s?this.wildcardListeners.delete(s):this.wildcardListeners.clear(),this):(s?(r=this.listenerMap[t])==null||r.delete(s):(n=this.listenerMap[t])==null||n.clear(),this)}}const $e="known-flag",je="unknown-flag",qe="argument",{stringify:k}=JSON,Te=/\B([A-Z])/g,Ge=e=>e.replace(Te,"-$1").toLowerCase(),{hasOwnProperty:He}=Object.prototype,L=(e,t)=>He.call(e,t),Ue=e=>Array.isArray(e),ue=e=>typeof e=="function"?[e,!1]:Ue(e)?[e[0],!0]:ue(e.type),Ve=(e,t)=>e===Boolean?t!=="false":t,Je=(e,t)=>typeof t=="boolean"?t:e===Number&&t===""?Number.NaN:e(t),ze=/[\s.:=]/,Ke=e=>{const t=`Flag name ${k(e)}`;if(e.length===0)throw new Error(`${t} cannot be empty`);if(e.length===1)throw new Error(`${t} must be longer than a character`);const s=e.match(ze);if(s)throw new Error(`${t} cannot contain ${k(s==null?void 0:s[0])}`)},Ze=e=>{const t={},s=(r,n)=>{if(L(t,r))throw new Error(`Duplicate flags named ${k(r)}`);t[r]=n};for(const r in e){if(!L(e,r))continue;Ke(r);const n=e[r],o=[[],...ue(n),n];s(r,o);const a=Ge(r);if(r!==a&&s(a,o),"alias"in n&&typeof n.alias=="string"){const{alias:i}=n,c=`Flag alias ${k(i)} for flag ${k(r)}`;if(i.length===0)throw new Error(`${c} cannot be empty`);if(i.length>1)throw new Error(`${c} must be a single character`);s(i,o)}}return t},Qe=(e,t)=>{const s={};for(const r in e){if(!L(e,r))continue;const[n,,o,a]=t[r];if(n.length===0&&"default"in a){let{default:i}=a;typeof i=="function"&&(i=i()),s[r]=i}else s[r]=o?n:n.pop()}return s},q="--",Xe=/[.:=]/,Ye=/^-{1,2}\w/,et=e=>{if(!Ye.test(e))return;const t=!e.startsWith(q);let s=e.slice(t?1:2),r;const n=s.match(Xe);if(n){const{index:o}=n;r=s.slice(o+1),s=s.slice(0,o)}return[s,r,t]},tt=(e,{onFlag:t,onArgument:s})=>{let r;const n=(o,a)=>{if(typeof r!="function")return!0;r(o,a),r=void 0};for(let o=0;o<e.length;o+=1){const a=e[o];if(a===q){n();const c=e.slice(o+1);s==null||s(c,[o],!0);break}const i=et(a);if(i){if(n(),!t)continue;const[c,l,p]=i;if(p)for(let d=0;d<c.length;d+=1){n();const C=d===c.length-1;r=t(c[d],C?l:void 0,[o,d+1,C])}else r=t(c,l,[o])}else n(a,[o])&&(s==null||s([a],[o]))}n()},st=(e,t)=>{for(const[s,r,n]of t.reverse()){if(r){const o=e[s];let a=o.slice(0,r);if(n||(a+=o.slice(r+1)),a!=="-"){e[s]=a;continue}}e.splice(s,1)}},le=(e,t=process.argv.slice(2),{ignore:s}={})=>{const r=[],n=Ze(e),o={},a=[];return a[q]=[],tt(t,{onFlag(i,c,l){const p=L(n,i);if(!(s!=null&&s(p?$e:je,i,c))){if(p){const[d,C]=n[i],y=Ve(C,c),A=(B,j)=>{r.push(l),j&&r.push(j),d.push(Je(C,B||""))};return y===void 0?A:A(y)}L(o,i)||(o[i]=[]),o[i].push(c===void 0?!0:c),r.push(l)}},onArgument(i,c,l){s!=null&&s(qe,t[c[0]])||(a.push(...i),l?(a[q]=i,t.splice(c[0])):r.push(c))}}),st(t,r),{flags:Qe(e,n),unknownFlags:o,_:a}};function H(e){return e!==null&&typeof e=="object"}function U(e,t,s=".",r){if(!H(t))return U(e,{},s,r);const n=Object.assign({},t);for(const o in e){if(o==="__proto__"||o==="constructor")continue;const a=e[o];a!=null&&(r&&r(n,o,a,s)||(Array.isArray(a)&&Array.isArray(n[o])?n[o]=[...a,...n[o]]:H(a)&&H(n[o])?n[o]=U(a,n[o],(s?`${s}.`:"")+o.toString(),r):n[o]=a))}return n}function rt(e){return(...t)=>t.reduce((s,r)=>U(s,r,"",e),{})}const ot=rt(),V=e=>Array.isArray(e)?e:[e],nt=e=>e.replace(/[\W_]([a-z\d])?/gi,(t,s)=>s?s.toUpperCase():""),he=(e,t)=>t.length!==e.length?!1:e.every((s,r)=>s===t[r]),de=(e,t)=>t.length>e.length?!1:he(e.slice(0,t.length),t),W=JSON.stringify;class fe extends Error{constructor(t,s){super(s("core.commandExists",W(t))),this.commandName=t}}class me extends Error{constructor(t,s){super(s("core.noSuchCommand",W(t))),this.commandName=t}}class pe extends Error{constructor(t){super(t("core.noCommandGiven"))}}class Ce extends Error{constructor(t,s,r){super(r("core.commandNameConflict",W(t),W(s))),this.n1=t,this.n2=s}}class we extends Error{constructor(t){super(t("core.nameNotSet"))}}class ge extends Error{constructor(t){super(t("core.descriptionNotSet"))}}class Ee extends Error{constructor(t){super(t("core.versionNotSet"))}}class _e extends Error{constructor(t,s){super(s("core.badNameFormat",W(t))),this.commandName=t}}class J extends Error{constructor(t){super(t("core.localeMustBeCalledFirst"))}}const ve=typeof Deno!="undefined",at=typeof process!="undefined"&&!ve,it=process.versions.electron&&!process.defaultApp;function Me(e,t,s,r){if(s.alias){const n=V(s.alias);for(const o of n){if(o in t)throw new Ce(t[o].name,s.name,r);e.set(typeof o=="symbol"?o:o.split(" "),{...s,__isAlias:!0})}}}function z(e,t){const s=new Map;e[f]&&(s.set(f,e[f]),Me(s,e,e[f],t));for(const r of Object.values(e))Me(s,e,r,t),s.set(r.name.split(" "),r);return s}function Fe(e,t,s){const r=z(e,s);for(const[n,o]of r.entries()){const a=le((o==null?void 0:o.flags)||{},[...t]),{_:i}=a;if(n!==f&&de(i,n))return[o,n]}return r.has(f)?[r.get(f),f]:[void 0,void 0]}function ct(e,t,s){if(t===f)return[e[f],f];const r=V(t),n=z(e,s);let o,a;return n.forEach((i,c)=>{c===f||a===f||he(r,c)&&(o=i,a=c)}),[o,a]}function ye(e,t,s=1/0){const r=t===""?[]:Array.isArray(t)?t:t.split(" ");return Object.values(e).filter(n=>{const o=n.name.split(" ");return de(o,r)&&o.length-r.length<=s})}const ut=e=>ye(e,"",1),K=()=>at?process.argv.slice(it?1:2):ve?Deno.args:[];function Be(e){const t={pre:[],normal:[],post:[]};for(const r of e){const n=typeof r=="object"?r:{fn:r},{enforce:o,fn:a}=n;o==="post"||o==="pre"?t[o].push(a):t.normal.push(a)}const s=[...t.pre,...t.normal,...t.post];return r=>{const n=[];let o=0;const a=i=>{o=i;const c=s[i],l=c(r,a.bind(null,i+1));l&&n.push(l)};if(a(0),o+1===s.length)for(const i of n)i()}}const lt=/\s\s+/,Ne=e=>e===f?!0:!(e.startsWith(" ")||e.endsWith(" "))&&!lt.test(e),ht=(e,t)=>t?`[${e}]`:`<${e}>`,dt="<Root>",Se=e=>Array.isArray(e)?e.join(" "):typeof e=="string"?e:dt,Ae=()=>process.env.CLERC_LOCALE?process.env.CLERC_LOCALE:Intl.DateTimeFormat().resolvedOptions().locale,ke=e=>e.filter(t=>!t.startsWith("-")),{stringify:N}=JSON;function Z(e,t){const s=[];let r,n;for(const o of e){if(n)throw new Error(t("core.spreadParameterMustBeLast",N(n)));const a=o[0],i=o[o.length-1];let c;if(a==="<"&&i===">"&&(c=!0,r))throw new Error(t("core.requiredParameterMustBeBeforeOptional",N(o),N(r)));if(a==="["&&i==="]"&&(c=!1,r=o),c===void 0)throw new Error(t("core.parameterMustBeWrappedInBrackets",N(o)));let l=o.slice(1,-1);const p=l.slice(-3)==="...";p&&(n=o,l=l.slice(0,-3)),s.push({name:l,required:c,spread:p})}return s}function Q(e,t,s,r){for(let n=0;n<t.length;n+=1){const{name:o,required:a,spread:i}=t[n],c=nt(o);if(c in e)throw new Error(r("core.parameterIsUsedMoreThanOnce",N(o)));const l=i?s.slice(n):s[n];if(i&&(n=t.length),a&&(!l||i&&l.length===0))throw new Error(r("core.missingRequiredParameter",N(o)));e[c]=l}}const ft={en:{"core.commandExists":'Command "%s" exists.',"core.noSuchCommand":"No such command: %s.","core.noCommandGiven":"No command given.","core.commandNameConflict":"Command name %s conflicts with %s. Maybe caused by alias.","core.nameNotSet":"Name not set.","core.descriptionNotSet":"Description not set.","core.versionNotSet":"Version not set.","core.badNameFormat":"Bad name format: %s.","core.localeMustBeCalledFirst":"locale() or fallbackLocale() must be called at first.","core.cliParseMustBeCalled":"cli.parse() must be called.","core.spreadParameterMustBeLast":"Invalid Parameter: Spread parameter %s must be last.","core.requiredParameterCannotComeAfterOptionalParameter":"Invalid Parameter: Required parameter %s cannot come after optional parameter %s.","core.parameterMustBeWrappedInBrackets":"Invalid Parameter: Parameter %s must be wrapped in <> (required parameter) or [] (optional parameter).","core.parameterIsUsedMoreThanOnce":"Invalid Parameter: Parameter %s is used more than once.","core.missingRequiredParameter":"Missing required parameter %s."},"zh-CN":{"core.commandExists":'\u547D\u4EE4 "%s" \u5DF2\u5B58\u5728\u3002',"core.noSuchCommand":"\u627E\u4E0D\u5230\u547D\u4EE4: %s\u3002","core.noCommandGiven":"\u6CA1\u6709\u8F93\u5165\u547D\u4EE4\u3002","core.commandNameConflict":"\u547D\u4EE4\u540D\u79F0 %s \u548C %s \u51B2\u7A81\u3002 \u53EF\u80FD\u662F\u7531\u4E8E\u522B\u540D\u5BFC\u81F4\u7684\u3002","core.nameNotSet":"\u672A\u8BBE\u7F6ECLI\u540D\u79F0\u3002","core.descriptionNotSet":"\u672A\u8BBE\u7F6ECLI\u63CF\u8FF0\u3002","core.versionNotSet":"\u672A\u8BBE\u7F6ECLI\u7248\u672C\u3002","core.badNameFormat":"\u9519\u8BEF\u7684\u547D\u4EE4\u540D\u5B57\u683C\u5F0F: %s\u3002","core.localeMustBeCalledFirst":"locale() \u6216 fallbackLocale() \u5FC5\u987B\u5728\u6700\u5F00\u59CB\u8C03\u7528\u3002","core.cliParseMustBeCalled":"cli.parse() \u5FC5\u987B\u88AB\u8C03\u7528\u3002","core.spreadParameterMustBeLast":"\u4E0D\u5408\u6CD5\u7684\u53C2\u6570: \u5C55\u5F00\u53C2\u6570 %s \u5FC5\u987B\u5728\u6700\u540E\u3002","core.requiredParameterCannotComeAfterOptionalParameter":"\u4E0D\u5408\u6CD5\u7684\u53C2\u6570: \u5FC5\u586B\u53C2\u6570 %s \u4E0D\u80FD\u5728\u53EF\u9009\u53C2\u6570 %s \u4E4B\u540E\u3002","core.parameterMustBeWrappedInBrackets":"\u4E0D\u5408\u6CD5\u7684\u53C2\u6570: \u53C2\u6570 %s \u5FC5\u987B\u88AB <> (\u5FC5\u586B\u53C2\u6570) \u6216 [] (\u53EF\u9009\u53C2\u6570) \u5305\u88F9\u3002","core.parameterIsUsedMoreThanOnce":"\u4E0D\u5408\u6CD5\u7684\u53C2\u6570: \u53C2\u6570 %s \u88AB\u4F7F\u7528\u4E86\u591A\u6B21\u3002","core.missingRequiredParameter":"\u7F3A\u5C11\u5FC5\u586B\u53C2\u6570 %s\u3002"}};var X=(e,t,s)=>{if(!t.has(e))throw TypeError("Cannot "+s)},u=(e,t,s)=>(X(e,t,"read from private field"),s?s.call(e):t.get(e)),h=(e,t,s)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,s)},w=(e,t,s,r)=>(X(e,t,"write to private field"),r?r.call(e,s):t.set(e,s),s),m=(e,t,s)=>(X(e,t,"access private method"),s),_,v,M,D,b,T,O,S,P,I,x,R,$,F,Y,Le,ee,We,te,De,g,E,se,be,re,Oe,oe,Pe,G,ne,ae,Ie;const f=Symbol.for("Clerc.Root"),xe=class{constructor(e,t,s){h(this,Y),h(this,ee),h(this,te),h(this,g),h(this,se),h(this,re),h(this,oe),h(this,G),h(this,ae),h(this,_,""),h(this,v,""),h(this,M,""),h(this,D,[]),h(this,b,{}),h(this,T,new Re),h(this,O,{}),h(this,S,new Set),h(this,P,void 0),h(this,I,[]),h(this,x,!1),h(this,R,"en"),h(this,$,"en"),h(this,F,{}),this.i18n={add:r=>{w(this,F,ot(u(this,F),r))},t:(r,...n)=>{const o=u(this,F)[u(this,$)]||u(this,F)[u(this,R)],a=u(this,F)[u(this,R)];return o[r]?ce(o[r],...n):a[r]?ce(a[r],...n):void 0}},w(this,_,e||u(this,_)),w(this,v,t||u(this,v)),w(this,M,s||u(this,M)),w(this,$,Ae()),m(this,te,De).call(this)}get _name(){return u(this,_)}get _description(){return u(this,v)}get _version(){return u(this,M)}get _inspectors(){return u(this,D)}get _commands(){return u(this,b)}get _flags(){return u(this,O)}static create(e,t,s){return new xe(e,t,s)}name(e){return m(this,g,E).call(this),w(this,_,e),this}description(e){return m(this,g,E).call(this),w(this,v,e),this}version(e){return m(this,g,E).call(this),w(this,M,e),this}locale(e){if(u(this,x))throw new J(this.i18n.t);return w(this,$,e),this}fallbackLocale(e){if(u(this,x))throw new J(this.i18n.t);return w(this,R,e),this}errorHandler(e){return u(this,I).push(e),this}command(e,t,s={}){return m(this,G,ne).call(this,()=>m(this,se,be).call(this,e,t,s)),this}flag(e,t,s){return u(this,O)[e]={description:t,...s},this}on(e,t){return u(this,T).on(e,t),this}use(e){return m(this,g,E).call(this),e.setup(this)}inspector(e){return m(this,g,E).call(this),u(this,D).push(e),this}parse(e=K()){m(this,g,E).call(this);const{argv:t,run:s}=Array.isArray(e)?{argv:e,run:!0}:{argv:K(),...e};return w(this,P,[...t]),m(this,re,Oe).call(this),s&&this.runMatchedCommand(),this}runMatchedCommand(){return m(this,G,ne).call(this,()=>m(this,ae,Ie).call(this)),process.title=u(this,_),this}};let mt=xe;_=new WeakMap,v=new WeakMap,M=new WeakMap,D=new WeakMap,b=new WeakMap,T=new WeakMap,O=new WeakMap,S=new WeakMap,P=new WeakMap,I=new WeakMap,x=new WeakMap,R=new WeakMap,$=new WeakMap,F=new WeakMap,Y=new WeakSet,Le=function(){return u(this,S).has(f)},ee=new WeakSet,We=function(){return Object.prototype.hasOwnProperty.call(this._commands,f)},te=new WeakSet,De=function(){this.i18n.add(ft)},g=new WeakSet,E=function(){w(this,x,!0)},se=new WeakSet,be=function(e,t,s={}){m(this,g,E).call(this);const{t:r}=this.i18n,o=(d=>!(typeof d=="string"||d===f))(e),a=o?e.name:e;if(!Ne(a))throw new _e(a,r);const{handler:i=void 0,...c}=o?e:{name:a,description:t,...s},l=[c.name],p=c.alias?V(c.alias):[];c.alias&&l.push(...p);for(const d of l)if(u(this,S).has(d))throw new fe(Se(d),r);return u(this,b)[a]=c,u(this,S).add(c.name),p.forEach(d=>u(this,S).add(d)),o&&i&&this.on(e.name,i),this},re=new WeakSet,Oe=function(){const{t:e}=this.i18n;if(!u(this,_))throw new we(e);if(!u(this,v))throw new ge(e);if(!u(this,M))throw new Ee(e)},oe=new WeakSet,Pe=function(e){const t=u(this,P),{t:s}=this.i18n,[r,n]=e(),o=!!r,a={...u(this,O),...r==null?void 0:r.flags},i=le(a,[...t]),{_:c,flags:l,unknownFlags:p}=i;let d=!o||r.name===f?c:c.slice(r.name.split(" ").length),C=(r==null?void 0:r.parameters)||[];const y=C.indexOf("--"),A=C.slice(y+1)||[],B=Object.create(null);if(y>-1&&A.length>0){C=C.slice(0,y);const ie=c["--"];d=d.slice(0,-ie.length||void 0),Q(B,Z(C,s),d,s),Q(B,Z(A,s),ie,s)}else Q(B,Z(C,s),d,s);const j={...l,...p};return{name:r==null?void 0:r.name,called:Array.isArray(n)?n.join(" "):n,resolved:o,hasRootOrAlias:u(this,Y,Le),hasRoot:u(this,ee,We),raw:{...i,parameters:d,mergedFlags:j},parameters:B,flags:l,unknownFlags:p,cli:this}},G=new WeakSet,ne=function(e){try{e()}catch(t){if(u(this,I).length>0)u(this,I).forEach(s=>s(t));else throw t}},ae=new WeakSet,Ie=function(){m(this,g,E).call(this);const{t:e}=this.i18n,t=u(this,P);if(!t)throw new Error(e("core.cliParseMustBeCalled"));const s=()=>Fe(u(this,b),t,e),r=()=>m(this,oe,Pe).call(this,s),n={enforce:"post",fn:i=>{const[c]=s(),l=ke(t).join(" ");if(!c)throw l?new me(l,e):new pe(e);u(this,T).emit(c.name,i)}},o=[...u(this,D),n];Be(o)(r())};const pt=e=>e,Ct=(e,t,s)=>s,wt=(e,t)=>t,gt=(e,t)=>({...e,handler:t});export{mt as Clerc,fe as CommandExistsError,Ce as CommandNameConflictError,ge as DescriptionNotSetError,_e as InvalidCommandNameError,J as LocaleNotCalledFirstError,we as NameNotSetError,pe as NoCommandGivenError,me as NoSuchCommandError,f as Root,Ee as VersionNotSetError,Be as compose,gt as defineCommand,Ct as defineHandler,wt as defineInspector,pt as definePlugin,Ae as detectLocale,Se as formatCommandName,Ne as isValidName,K as resolveArgv,Fe as resolveCommand,ct as resolveCommandStrict,z as resolveFlattenCommands,ut as resolveRootCommands,ye as resolveSubcommandsByParent,ke as stripFlags,ht as withBrackets};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@clerc/core",
|
|
3
|
-
"version": "0.34.
|
|
3
|
+
"version": "0.34.1",
|
|
4
4
|
"author": "Ray <i@mk1.io> (https://github.com/so1ve)",
|
|
5
5
|
"description": "Clerc core",
|
|
6
6
|
"keywords": [
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"lite-emit": "^1.4.0",
|
|
53
53
|
"type-fest": "^3.6.0",
|
|
54
54
|
"type-flag": "^3.0.0",
|
|
55
|
-
"@clerc/utils": "0.34.
|
|
55
|
+
"@clerc/utils": "0.34.1"
|
|
56
56
|
},
|
|
57
57
|
"scripts": {
|
|
58
58
|
"build": "puild --minify",
|