@sprucelabs/spruce-skill-utils 31.1.15 → 31.2.0
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.
|
@@ -56,6 +56,9 @@ export default function buildLog(prefix = undefined, options) {
|
|
|
56
56
|
}
|
|
57
57
|
function write(chalkMethod, rawArgs, level) {
|
|
58
58
|
var _a, _b, _c, _d, _e;
|
|
59
|
+
if (shouldNotWrite(level)) {
|
|
60
|
+
return '';
|
|
61
|
+
}
|
|
59
62
|
const args = rawArgs.map((a) => { var _a, _b; return (_b = (_a = a === null || a === void 0 ? void 0 : a.toString) === null || _a === void 0 ? void 0 : _a.call(a)) !== null && _b !== void 0 ? _b : 'undefined'; });
|
|
60
63
|
let chalkArgs = [...args];
|
|
61
64
|
let builtPrefix = pre;
|
|
@@ -127,3 +130,13 @@ export const stubLog = buildLog('STUB', {
|
|
|
127
130
|
log: () => { },
|
|
128
131
|
useColors: false,
|
|
129
132
|
});
|
|
133
|
+
const logLevels = ['INFO', 'WARN', 'ERROR', 'NONE'];
|
|
134
|
+
function shouldNotWrite(level) {
|
|
135
|
+
var _a, _b;
|
|
136
|
+
const requestedLogLevelStrength = logLevels.indexOf(level);
|
|
137
|
+
const allowedLogLevelStrength = logLevels.indexOf((_b = (_a = process.env.LOG_LEVEL) === null || _a === void 0 ? void 0 : _a.toUpperCase()) !== null && _b !== void 0 ? _b : 'INFO');
|
|
138
|
+
if (allowedLogLevelStrength === -1) {
|
|
139
|
+
return false;
|
|
140
|
+
}
|
|
141
|
+
return requestedLogLevelStrength < allowedLogLevelStrength;
|
|
142
|
+
}
|
|
@@ -64,6 +64,9 @@ function buildLog(prefix = undefined, options) {
|
|
|
64
64
|
return t;
|
|
65
65
|
}
|
|
66
66
|
function write(chalkMethod, rawArgs, level) {
|
|
67
|
+
if (shouldNotWrite(level)) {
|
|
68
|
+
return '';
|
|
69
|
+
}
|
|
67
70
|
const args = rawArgs.map((a) => a?.toString?.() ?? 'undefined');
|
|
68
71
|
let chalkArgs = [...args];
|
|
69
72
|
let builtPrefix = pre;
|
|
@@ -134,3 +137,12 @@ exports.stubLog = buildLog('STUB', {
|
|
|
134
137
|
log: () => { },
|
|
135
138
|
useColors: false,
|
|
136
139
|
});
|
|
140
|
+
const logLevels = ['INFO', 'WARN', 'ERROR', 'NONE'];
|
|
141
|
+
function shouldNotWrite(level) {
|
|
142
|
+
const requestedLogLevelStrength = logLevels.indexOf(level);
|
|
143
|
+
const allowedLogLevelStrength = logLevels.indexOf(process.env.LOG_LEVEL?.toUpperCase() ?? 'INFO');
|
|
144
|
+
if (allowedLogLevelStrength === -1) {
|
|
145
|
+
return false;
|
|
146
|
+
}
|
|
147
|
+
return requestedLogLevelStrength < allowedLogLevelStrength;
|
|
148
|
+
}
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
|
-
"version": "31.
|
|
6
|
+
"version": "31.2.0",
|
|
7
7
|
"skill": {
|
|
8
8
|
"namespace": "skill-utils",
|
|
9
9
|
"upgradeIgnoreList": [
|
|
@@ -59,22 +59,22 @@
|
|
|
59
59
|
},
|
|
60
60
|
"dependencies": {
|
|
61
61
|
"@sprucelabs/globby": "^2.0.501",
|
|
62
|
-
"@sprucelabs/schema": "^31.0.
|
|
62
|
+
"@sprucelabs/schema": "^31.0.10",
|
|
63
63
|
"chalk": "^4.1.2",
|
|
64
64
|
"dotenv": "^16.4.7",
|
|
65
65
|
"fs-extra": "^11.2.0",
|
|
66
|
-
"inflection": "^3.0.
|
|
66
|
+
"inflection": "^3.0.2",
|
|
67
67
|
"lodash": "^4.17.21",
|
|
68
68
|
"uuid": "^11.0.4"
|
|
69
69
|
},
|
|
70
70
|
"devDependencies": {
|
|
71
71
|
"@sprucelabs/esm-postbuild": "^6.0.535",
|
|
72
|
-
"@sprucelabs/jest-json-reporter": "^8.0.
|
|
72
|
+
"@sprucelabs/jest-json-reporter": "^8.0.561",
|
|
73
73
|
"@sprucelabs/jest-sheets-reporter": "^3.0.198",
|
|
74
74
|
"@sprucelabs/resolve-path-aliases": "^2.0.524",
|
|
75
75
|
"@sprucelabs/semantic-release": "^5.0.2",
|
|
76
|
-
"@sprucelabs/test": "^9.0.
|
|
77
|
-
"@sprucelabs/test-utils": "^5.1.
|
|
76
|
+
"@sprucelabs/test": "^9.0.66",
|
|
77
|
+
"@sprucelabs/test-utils": "^5.1.537",
|
|
78
78
|
"@types/fs-extra": "^11.0.4",
|
|
79
79
|
"@types/inflection": "^1.13.2",
|
|
80
80
|
"@types/lodash": "^4.17.14",
|
|
@@ -88,7 +88,7 @@
|
|
|
88
88
|
"prettier": "^3.4.2",
|
|
89
89
|
"ts-node": "^10.9.2",
|
|
90
90
|
"tsc-watch": "^6.2.1",
|
|
91
|
-
"typescript": "^5.7.
|
|
91
|
+
"typescript": "^5.7.3"
|
|
92
92
|
},
|
|
93
93
|
"jest": {
|
|
94
94
|
"maxWorkers": 4,
|