@storm-software/config-tools 1.20.8 → 1.20.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/declarations.d.ts +81 -0
- package/index.cjs +7 -4
- package/index.js +7 -4
- package/meta.cjs.json +1 -1
- package/meta.esm.json +1 -1
- package/package.json +1 -1
- package/utilities/logger.cjs +7 -4
- package/utilities/logger.js +7 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
## 1.20.10 (2024-01-24)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### 🩹 Fixes
|
|
5
|
+
|
|
6
|
+
- **config-tools:** Added console logging function typings ([c20aac44](https://github.com/storm-software/storm-ops/commit/c20aac44))
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### ❤️ Thank You
|
|
10
|
+
|
|
11
|
+
- Patrick Sullivan
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
1
15
|
## 1.20.8 (2024-01-23)
|
|
2
16
|
|
|
3
17
|
|
package/declarations.d.ts
CHANGED
|
@@ -103,3 +103,84 @@ export { exitWithSuccess };
|
|
|
103
103
|
|
|
104
104
|
declare function handleProcess(config?: StormConfig): void;
|
|
105
105
|
export { handleProcess };
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* Write a message to the console at the `fatal` log level
|
|
109
|
+
*
|
|
110
|
+
* @param config - The Storm configuration
|
|
111
|
+
* @param message - The message to write
|
|
112
|
+
*/
|
|
113
|
+
declare function writeFatal(config: Partial<StormConfig>, message: string): void;
|
|
114
|
+
export { writeFatal };
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* Write a message to the console at the `error` log level
|
|
118
|
+
*
|
|
119
|
+
* @param config - The Storm configuration
|
|
120
|
+
* @param message - The message to write
|
|
121
|
+
*/
|
|
122
|
+
declare function writeError(config: Partial<StormConfig>, message: string): void;
|
|
123
|
+
export { writeError };
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* Write a message to the console at the `warning` log level
|
|
127
|
+
*
|
|
128
|
+
* @param config - The Storm configuration
|
|
129
|
+
* @param message - The message to write
|
|
130
|
+
*/
|
|
131
|
+
declare function writeWarning(config: Partial<StormConfig>, message: string): void;
|
|
132
|
+
export { writeWarning };
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* Write a message to the console at the `info` log level
|
|
136
|
+
*
|
|
137
|
+
* @param config - The Storm configuration
|
|
138
|
+
* @param message - The message to write
|
|
139
|
+
*/
|
|
140
|
+
declare function writeInfo(config: Partial<StormConfig>, message: string): void;
|
|
141
|
+
export { writeInfo };
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* Write a message to the console at the `success` log level
|
|
145
|
+
*
|
|
146
|
+
* @param config - The Storm configuration
|
|
147
|
+
* @param message - The message to write
|
|
148
|
+
*/
|
|
149
|
+
declare function writeSuccess(config: Partial<StormConfig>, message: string): void;
|
|
150
|
+
export { writeSuccess };
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* Write a message to the console at the `debug` log level
|
|
154
|
+
*
|
|
155
|
+
* @param config - The Storm configuration
|
|
156
|
+
* @param message - The message to write
|
|
157
|
+
*/
|
|
158
|
+
declare function writeDebug(config: Partial<StormConfig>, message: string): void;
|
|
159
|
+
export { writeDebug };
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* Write a message to the console at the `trace` log level
|
|
163
|
+
*
|
|
164
|
+
* @param config - The Storm configuration
|
|
165
|
+
* @param message - The message to write
|
|
166
|
+
*/
|
|
167
|
+
declare function writeTrace(config: Partial<StormConfig>, message: string): void;
|
|
168
|
+
export { writeTrace };
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
* Write a message to the console at the `all` log level
|
|
172
|
+
*
|
|
173
|
+
* @param config - The Storm configuration
|
|
174
|
+
* @param message - The message to write
|
|
175
|
+
*/
|
|
176
|
+
declare function writeSystem(config: Partial<StormConfig>, message: string): void;
|
|
177
|
+
export { writeSystem };
|
|
178
|
+
|
|
179
|
+
/**
|
|
180
|
+
* Get a stopwatch function
|
|
181
|
+
*
|
|
182
|
+
* @param name - The name of the process
|
|
183
|
+
* @returns The stopwatch function
|
|
184
|
+
*/
|
|
185
|
+
declare function getStopwatch(name: string): () => void;
|
|
186
|
+
export { getStopwatch };
|
package/index.cjs
CHANGED
|
@@ -419,12 +419,15 @@ ${rf.bold.hex(u?.colors?.warning?u.colors.warning:"#fcc419")(">")} ${rf.bold.bgH
|
|
|
419
419
|
`)}:typeof m=="number"&&fc.INFO>=m||typeof m=="string"&&fc.INFO>=Lh(m)?v=>{console.info(`
|
|
420
420
|
${rf.bold.hex(u?.colors?.info?u.colors.info:"#0ea5e9")(">")} ${rf.bold.bgHex(u?.colors?.info?u.colors.info:"#0ea5e9").white(" \u2139 Info ")} ${rf.hex(u?.colors?.info?u.colors.info:"#0ea5e9")(v)}
|
|
421
421
|
`)}:typeof m=="number"&&fc.INFO>=m||typeof m=="string"&&fc.INFO>=Lh(m)?v=>{console.info(`
|
|
422
|
-
${rf.bold.hex(u?.colors?.success?u.colors.success:"#087f5b")(">")} ${rf.bold.bgHex(u?.colors?.success?u.colors.success:"#087f5b").white(" \
|
|
422
|
+
${rf.bold.hex(u?.colors?.success?u.colors.success:"#087f5b")(">")} ${rf.bold.bgHex(u?.colors?.success?u.colors.success:"#087f5b").white(" \u2713 Success ")} ${rf.hex(u?.colors?.success?u.colors.success:"#087f5b")(v)}
|
|
423
423
|
`)}:typeof m=="number"&&fc.DEBUG>=m||typeof m=="string"&&fc.DEBUG>=Lh(m)?v=>{console.debug(`
|
|
424
|
-
${rf.bold.hex(u?.colors?.primary?u.colors.primary:"#1fb2a6")(">")} ${rf.bold.bgHex(u?.colors?.primary?u.colors.primary:"#1fb2a6").white("
|
|
424
|
+
${rf.bold.hex(u?.colors?.primary?u.colors.primary:"#1fb2a6")(">")} ${rf.bold.bgHex(u?.colors?.primary?u.colors.primary:"#1fb2a6").white(" \u{1F6E0} Debug ")} ${rf.hex(u?.colors?.primary?u.colors.primary:"#1fb2a6")(v)}
|
|
425
425
|
`)}:v=>{console.log(`
|
|
426
|
-
${rf.bold.hex(u?.colors?.primary?u.colors.primary:"#1fb2a6")(">")} ${rf.bold.bgHex(u?.colors?.primary?u.colors.primary:"#1fb2a6").white("
|
|
427
|
-
`)},dpe=(u,m)=>LS(u,fc.FATAL)(m),ZA=(u,m)=>LS(u,fc.ERROR)(m),mpe=(u,m)=>LS(u,fc.WARN)(m),xSt=(u,m)=>LS(u,fc.INFO)(m),gpe=(u,m)=>LS(u,fc.SUCCESS)(m),TSt=(u,m)=>LS(u,fc.DEBUG)(m),hpe=(u,m)=>LS(u,fc.TRACE)(m),SSt=(u,m)=>LS(u,fc.ALL)(m),kSt=u=>{let m=process.hrtime();return()=>{let v=process.hrtime(m);console.info(rf.dim(
|
|
426
|
+
${rf.bold.hex(u?.colors?.primary?u.colors.primary:"#1fb2a6")(">")} ${rf.bold.bgHex(u?.colors?.primary?u.colors.primary:"#1fb2a6").white(" \u2709 System ")} ${rf.hex(u?.colors?.primary?u.colors.primary:"#1fb2a6")(v)}
|
|
427
|
+
`)},dpe=(u,m)=>LS(u,fc.FATAL)(m),ZA=(u,m)=>LS(u,fc.ERROR)(m),mpe=(u,m)=>LS(u,fc.WARN)(m),xSt=(u,m)=>LS(u,fc.INFO)(m),gpe=(u,m)=>LS(u,fc.SUCCESS)(m),TSt=(u,m)=>LS(u,fc.DEBUG)(m),hpe=(u,m)=>LS(u,fc.TRACE)(m),SSt=(u,m)=>LS(u,fc.ALL)(m),kSt=u=>{let m=process.hrtime();return()=>{let v=process.hrtime(m);console.info(rf.dim(`
|
|
428
|
+
\u23F1\uFE0F The${u?` ${u}`:""} process took ${Math.round(v[0]*1e3+v[1]/1e6)}ms to complete
|
|
429
|
+
|
|
430
|
+
`))}};var gL=u=>{dpe(u,"Exiting script with an error status..."),process.exit(1)},CSt=u=>{gpe(u,"Script completed successfully. Exiting..."),process.exit(0)},wSt=u=>{hpe(u,`Using the following arguments to process the script: ${process.argv.join(", ")}`),process.on("unhandledRejection",m=>{ZA(u,`An Unhandled Rejection occurred while running the program: ${m}`),gL(u)}),process.on("uncaughtException",m=>{ZA(u,`An Uncaught Exception occurred while running the program: ${m.message}
|
|
428
431
|
Stacktrace: ${m.stack}`),gL(u)}),process.on("SIGTERM",m=>{ZA(u,`The program terminated with signal code: ${m}`),gL(u)}),process.on("SIGINT",m=>{ZA(u,`The program terminated with signal code: ${m}`),gL(u)})};var dBe=require("node:buffer"),mBe=Ih(require("node:path"),1),l$=Ih(require("node:child_process"),1),bL=Ih(require("node:process"),1),gBe=Ih(dRe(),1);function Epe(u){let m=typeof u=="string"?`
|
|
429
432
|
`:`
|
|
430
433
|
`.charCodeAt(),v=typeof u=="string"?"\r":"\r".charCodeAt();return u[u.length-1]===m&&(u=u.slice(0,-1)),u[u.length-1]===v&&(u=u.slice(0,-1)),u}var hL=Ih(require("node:process"),1),tD=Ih(require("node:path"),1),mRe=Ih(require("node:url"),1);function Qq(u={}){let{env:m=process.env,platform:v=process.platform}=u;return v!=="win32"?"PATH":Object.keys(m).reverse().find(k=>k.toUpperCase()==="PATH")||"Path"}function KSt(u={}){let{cwd:m=hL.default.cwd(),path:v=hL.default.env[Qq()],execPath:k=hL.default.execPath}=u,N,J=m instanceof URL?mRe.default.fileURLToPath(m):m,te=tD.default.resolve(J),xe=[];for(;N!==te;)xe.push(tD.default.join(te,"node_modules/.bin")),N=te,te=tD.default.resolve(te,"..");return xe.push(tD.default.resolve(J,k,"..")),[...xe,v].join(tD.default.delimiter)}function gRe({env:u=hL.default.env,...m}={}){u={...u};let v=Qq({env:u});return m.path=u[v],u[v]=KSt(m),u}var ekt=(u,m,v,k)=>{if(v==="length"||v==="prototype"||v==="arguments"||v==="caller")return;let N=Object.getOwnPropertyDescriptor(u,v),J=Object.getOwnPropertyDescriptor(m,v);!tkt(N,J)&&k||Object.defineProperty(u,v,J)},tkt=function(u,m){return u===void 0||u.configurable||u.writable===m.writable&&u.enumerable===m.enumerable&&u.configurable===m.configurable&&(u.writable||u.value===m.value)},rkt=(u,m)=>{let v=Object.getPrototypeOf(m);v!==Object.getPrototypeOf(u)&&Object.setPrototypeOf(u,v)},nkt=(u,m)=>`/* Wrapped ${u}*/
|
package/index.js
CHANGED
|
@@ -419,12 +419,15 @@ ${nf.bold.hex(u?.colors?.warning?u.colors.warning:"#fcc419")(">")} ${nf.bold.bgH
|
|
|
419
419
|
`)}:typeof m=="number"&&xc.INFO>=m||typeof m=="string"&&xc.INFO>=q1(m)?v=>{console.info(`
|
|
420
420
|
${nf.bold.hex(u?.colors?.info?u.colors.info:"#0ea5e9")(">")} ${nf.bold.bgHex(u?.colors?.info?u.colors.info:"#0ea5e9").white(" \u2139 Info ")} ${nf.hex(u?.colors?.info?u.colors.info:"#0ea5e9")(v)}
|
|
421
421
|
`)}:typeof m=="number"&&xc.INFO>=m||typeof m=="string"&&xc.INFO>=q1(m)?v=>{console.info(`
|
|
422
|
-
${nf.bold.hex(u?.colors?.success?u.colors.success:"#087f5b")(">")} ${nf.bold.bgHex(u?.colors?.success?u.colors.success:"#087f5b").white(" \
|
|
422
|
+
${nf.bold.hex(u?.colors?.success?u.colors.success:"#087f5b")(">")} ${nf.bold.bgHex(u?.colors?.success?u.colors.success:"#087f5b").white(" \u2713 Success ")} ${nf.hex(u?.colors?.success?u.colors.success:"#087f5b")(v)}
|
|
423
423
|
`)}:typeof m=="number"&&xc.DEBUG>=m||typeof m=="string"&&xc.DEBUG>=q1(m)?v=>{console.debug(`
|
|
424
|
-
${nf.bold.hex(u?.colors?.primary?u.colors.primary:"#1fb2a6")(">")} ${nf.bold.bgHex(u?.colors?.primary?u.colors.primary:"#1fb2a6").white("
|
|
424
|
+
${nf.bold.hex(u?.colors?.primary?u.colors.primary:"#1fb2a6")(">")} ${nf.bold.bgHex(u?.colors?.primary?u.colors.primary:"#1fb2a6").white(" \u{1F6E0} Debug ")} ${nf.hex(u?.colors?.primary?u.colors.primary:"#1fb2a6")(v)}
|
|
425
425
|
`)}:v=>{console.log(`
|
|
426
|
-
${nf.bold.hex(u?.colors?.primary?u.colors.primary:"#1fb2a6")(">")} ${nf.bold.bgHex(u?.colors?.primary?u.colors.primary:"#1fb2a6").white("
|
|
427
|
-
`)},gFe=(u,m)=>hC(u,xc.FATAL)(m),pL=(u,m)=>hC(u,xc.ERROR)(m),hFe=(u,m)=>hC(u,xc.WARN)(m),K4t=(u,m)=>hC(u,xc.INFO)(m),yFe=(u,m)=>hC(u,xc.SUCCESS)(m),e3t=(u,m)=>hC(u,xc.DEBUG)(m),vFe=(u,m)=>hC(u,xc.TRACE)(m),t3t=(u,m)=>hC(u,xc.ALL)(m),r3t=u=>{let m=process.hrtime();return()=>{let v=process.hrtime(m);console.info(nf.dim(
|
|
426
|
+
${nf.bold.hex(u?.colors?.primary?u.colors.primary:"#1fb2a6")(">")} ${nf.bold.bgHex(u?.colors?.primary?u.colors.primary:"#1fb2a6").white(" \u2709 System ")} ${nf.hex(u?.colors?.primary?u.colors.primary:"#1fb2a6")(v)}
|
|
427
|
+
`)},gFe=(u,m)=>hC(u,xc.FATAL)(m),pL=(u,m)=>hC(u,xc.ERROR)(m),hFe=(u,m)=>hC(u,xc.WARN)(m),K4t=(u,m)=>hC(u,xc.INFO)(m),yFe=(u,m)=>hC(u,xc.SUCCESS)(m),e3t=(u,m)=>hC(u,xc.DEBUG)(m),vFe=(u,m)=>hC(u,xc.TRACE)(m),t3t=(u,m)=>hC(u,xc.ALL)(m),r3t=u=>{let m=process.hrtime();return()=>{let v=process.hrtime(m);console.info(nf.dim(`
|
|
428
|
+
\u23F1\uFE0F The${u?` ${u}`:""} process took ${Math.round(v[0]*1e3+v[1]/1e6)}ms to complete
|
|
429
|
+
|
|
430
|
+
`))}};var Wq=u=>{gFe(u,"Exiting script with an error status..."),process.exit(1)},s3t=u=>{yFe(u,"Script completed successfully. Exiting..."),process.exit(0)},a3t=u=>{vFe(u,`Using the following arguments to process the script: ${process.argv.join(", ")}`),process.on("unhandledRejection",m=>{pL(u,`An Unhandled Rejection occurred while running the program: ${m}`),Wq(u)}),process.on("uncaughtException",m=>{pL(u,`An Uncaught Exception occurred while running the program: ${m.message}
|
|
428
431
|
Stacktrace: ${m.stack}`),Wq(u)}),process.on("SIGTERM",m=>{pL(u,`The program terminated with signal code: ${m}`),Wq(u)}),process.on("SIGINT",m=>{pL(u,`The program terminated with signal code: ${m}`),Wq(u)})};var XRe=EO(oRe(),1);import{Buffer as zkt}from"node:buffer";import Ukt from"node:path";import Rpe from"node:child_process";import s$ from"node:process";function dpe(u){let m=typeof u=="string"?`
|
|
429
432
|
`:`
|
|
430
433
|
`.charCodeAt(),v=typeof u=="string"?"\r":"\r".charCodeAt();return u[u.length-1]===m&&(u=u.slice(0,-1)),u[u.length-1]===v&&(u=u.slice(0,-1)),u}import Gq from"node:process";import dL from"node:path";import ASt from"node:url";function $q(u={}){let{env:m=process.env,platform:v=process.platform}=u;return v!=="win32"?"PATH":Object.keys(m).reverse().find(k=>k.toUpperCase()==="PATH")||"Path"}function DSt(u={}){let{cwd:m=Gq.cwd(),path:v=Gq.env[$q()],execPath:k=Gq.execPath}=u,N,J=m instanceof URL?ASt.fileURLToPath(m):m,te=dL.resolve(J),xe=[];for(;N!==te;)xe.push(dL.join(te,"node_modules/.bin")),N=te,te=dL.resolve(te,"..");return xe.push(dL.resolve(J,k,"..")),[...xe,v].join(dL.delimiter)}function cRe({env:u=Gq.env,...m}={}){u={...u};let v=$q({env:u});return m.path=u[v],u[v]=DSt(m),u}var NSt=(u,m,v,k)=>{if(v==="length"||v==="prototype"||v==="arguments"||v==="caller")return;let N=Object.getOwnPropertyDescriptor(u,v),J=Object.getOwnPropertyDescriptor(m,v);!ISt(N,J)&&k||Object.defineProperty(u,v,J)},ISt=function(u,m){return u===void 0||u.configurable||u.writable===m.writable&&u.enumerable===m.enumerable&&u.configurable===m.configurable&&(u.writable||u.value===m.value)},PSt=(u,m)=>{let v=Object.getPrototypeOf(m);v!==Object.getPrototypeOf(u)&&Object.setPrototypeOf(u,v)},OSt=(u,m)=>`/* Wrapped ${u}*/
|