@storm-software/linting-tools 1.27.0 → 1.27.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/CHANGELOG.md CHANGED
@@ -1,3 +1,17 @@
1
+ ## [1.27.1](https://github.com/storm-software/storm-ops/compare/linting-tools-v1.27.0...linting-tools-v1.27.1) (2024-01-18)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **config-tools:** Resolved empty config file loading error ([6b84a12](https://github.com/storm-software/storm-ops/commit/6b84a12f762ac038d9ca6131249c8b51979d0320))
7
+
8
+ # [1.27.0](https://github.com/storm-software/storm-ops/compare/linting-tools-v1.26.15...linting-tools-v1.27.0) (2024-01-18)
9
+
10
+
11
+ ### Features
12
+
13
+ * **workspace-tools:** Added the `typia` executor ([feb49f7](https://github.com/storm-software/storm-ops/commit/feb49f71a2b54c14c4ea34ebbde529b89e6b4b42))
14
+
1
15
  ## [1.26.15](https://github.com/storm-software/storm-ops/compare/linting-tools-v1.26.14...linting-tools-v1.26.15) (2024-01-18)
2
16
 
3
17
 
package/bin/cli.mjs CHANGED
@@ -1,5 +1,8 @@
1
1
  #!/usr/bin/env zx
2
2
 
3
+ // biome-ignore lint/correctness/noUndeclaredVariables: <explanation>
4
+ cd(__dirname);
5
+
3
6
  import { writeFatal, writeSuccess } from "../../config-tools/utilities/logger.js";
4
7
  import { prepareWorkspace } from "../../config-tools/utilities/prepare-workspace.js";
5
8
  import { createProgram } from "../cli/index.js";
package/cli/index.js CHANGED
@@ -278217,6 +278217,176 @@ var init_lib2 = __esm({
278217
278217
 
278218
278218
  // packages/config-tools/src/config-file/get-config-file.ts
278219
278219
  var import_cosmiconfig = __toESM(require_dist(), 1);
278220
+
278221
+ // packages/config-tools/src/utilities/logger.ts
278222
+ var chalk = __toESM(require_source(), 1);
278223
+
278224
+ // packages/config-tools/src/types.ts
278225
+ var LogLevel = {
278226
+ SILENT: 0,
278227
+ FATAL: 10,
278228
+ ERROR: 20,
278229
+ WARN: 30,
278230
+ INFO: 40,
278231
+ SUCCESS: 45,
278232
+ DEBUG: 60,
278233
+ TRACE: 70,
278234
+ ALL: 100
278235
+ };
278236
+ var LogLevelLabel = {
278237
+ SILENT: "silent",
278238
+ FATAL: "fatal",
278239
+ ERROR: "error",
278240
+ WARN: "warn",
278241
+ INFO: "info",
278242
+ DEBUG: "debug",
278243
+ TRACE: "trace",
278244
+ ALL: "all"
278245
+ };
278246
+
278247
+ // packages/config-tools/src/utilities/get-log-level.ts
278248
+ var getLogLevel = (label) => {
278249
+ switch (label) {
278250
+ case "all":
278251
+ return LogLevel.ALL;
278252
+ case "trace":
278253
+ return LogLevel.TRACE;
278254
+ case "debug":
278255
+ return LogLevel.DEBUG;
278256
+ case "info":
278257
+ return LogLevel.INFO;
278258
+ case "warn":
278259
+ return LogLevel.WARN;
278260
+ case "error":
278261
+ return LogLevel.ERROR;
278262
+ case "fatal":
278263
+ return LogLevel.FATAL;
278264
+ case "silent":
278265
+ return LogLevel.SILENT;
278266
+ default:
278267
+ return LogLevel.INFO;
278268
+ }
278269
+ };
278270
+ var getLogLevelLabel = (logLevel) => {
278271
+ if (logLevel >= LogLevel.ALL) {
278272
+ return LogLevelLabel.ALL;
278273
+ }
278274
+ if (logLevel >= LogLevel.TRACE) {
278275
+ return LogLevelLabel.TRACE;
278276
+ }
278277
+ if (logLevel >= LogLevel.DEBUG) {
278278
+ return LogLevelLabel.DEBUG;
278279
+ }
278280
+ if (logLevel >= LogLevel.INFO) {
278281
+ return LogLevelLabel.INFO;
278282
+ }
278283
+ if (logLevel >= LogLevel.WARN) {
278284
+ return LogLevelLabel.WARN;
278285
+ }
278286
+ if (logLevel >= LogLevel.ERROR) {
278287
+ return LogLevelLabel.ERROR;
278288
+ }
278289
+ if (logLevel >= LogLevel.FATAL) {
278290
+ return LogLevelLabel.FATAL;
278291
+ }
278292
+ if (logLevel <= LogLevel.SILENT) {
278293
+ return LogLevelLabel.SILENT;
278294
+ }
278295
+ return LogLevelLabel.INFO;
278296
+ };
278297
+
278298
+ // packages/config-tools/src/utilities/logger.ts
278299
+ var getLogFn = (config2 = {}, logLevel = LogLevel.INFO) => {
278300
+ if (typeof logLevel === "number" && (logLevel >= getLogLevel(config2.logLevel ?? process.env?.STORM_LOG_LEVEL) || logLevel <= LogLevel.SILENT) || typeof logLevel === "string" && getLogLevel(logLevel) >= getLogLevel(config2.logLevel ?? process.env?.STORM_LOG_LEVEL)) {
278301
+ return (_) => {
278302
+ };
278303
+ }
278304
+ if (typeof logLevel === "number" && LogLevel.FATAL >= logLevel || typeof logLevel === "string" && LogLevel.FATAL >= getLogLevel(logLevel)) {
278305
+ return (message) => {
278306
+ console.error(
278307
+ `
278308
+ ${chalk.bold.hex(config2?.colors?.fatal ? config2.colors.fatal : "#1fb2a6")(">")} ${chalk.bold.bgHex(config2?.colors?.fatal ? config2.colors.fatal : "#1fb2a6").white(" \u{1F480} Fatal ")} ${chalk.hex(
278309
+ config2?.colors?.fatal ? config2.colors.fatal : "#1fb2a6"
278310
+ )(message)}
278311
+
278312
+ `
278313
+ );
278314
+ };
278315
+ }
278316
+ if (typeof logLevel === "number" && LogLevel.ERROR >= logLevel || typeof logLevel === "string" && LogLevel.ERROR >= getLogLevel(logLevel)) {
278317
+ return (message) => {
278318
+ console.error(
278319
+ `
278320
+ ${chalk.bold.hex(config2?.colors?.error ? config2.colors.error : "#7d1a1a")(">")} ${chalk.bold.bgHex(config2?.colors?.error ? config2.colors.error : "#7d1a1a").white(" \u{1F6D1} Error ")} ${chalk.hex(
278321
+ config2?.colors?.error ? config2.colors.error : "#7d1a1a"
278322
+ )(message)}
278323
+ `
278324
+ );
278325
+ };
278326
+ }
278327
+ if (typeof logLevel === "number" && LogLevel.WARN >= logLevel || typeof logLevel === "string" && LogLevel.WARN >= getLogLevel(logLevel)) {
278328
+ return (message) => {
278329
+ console.warn(
278330
+ `
278331
+ ${chalk.bold.hex(config2?.colors?.warning ? config2.colors.warning : "#fcc419")(">")} ${chalk.bold.bgHex(config2?.colors?.warning ? config2.colors.warning : "#fcc419").white(" \u26A0\uFE0F Warn ")} ${chalk.hex(
278332
+ config2?.colors?.warning ? config2.colors.warning : "#fcc419"
278333
+ )(message)}
278334
+ `
278335
+ );
278336
+ };
278337
+ }
278338
+ if (typeof logLevel === "number" && LogLevel.INFO >= logLevel || typeof logLevel === "string" && LogLevel.INFO >= getLogLevel(logLevel)) {
278339
+ return (message) => {
278340
+ console.info(
278341
+ `
278342
+ ${chalk.bold.hex(config2?.colors?.info ? config2.colors.info : "#0ea5e9")(">")} ${chalk.bold.bgHex(config2?.colors?.info ? config2.colors.info : "#0ea5e9").white(" \u{1F4EC} Info ")} ${chalk.hex(
278343
+ config2?.colors?.info ? config2.colors.info : "#0ea5e9"
278344
+ )(message)}
278345
+ `
278346
+ );
278347
+ };
278348
+ }
278349
+ if (typeof logLevel === "number" && LogLevel.INFO >= logLevel || typeof logLevel === "string" && LogLevel.INFO >= getLogLevel(logLevel)) {
278350
+ return (message) => {
278351
+ console.info(
278352
+ `
278353
+ ${chalk.bold.hex(config2?.colors?.success ? config2.colors.success : "#087f5b")(">")} ${chalk.bold.bgHex(config2?.colors?.success ? config2.colors.success : "#087f5b").white(" \u{1F389} Success ")} ${chalk.hex(
278354
+ config2?.colors?.success ? config2.colors.success : "#087f5b"
278355
+ )(message)}
278356
+ `
278357
+ );
278358
+ };
278359
+ }
278360
+ if (typeof logLevel === "number" && LogLevel.DEBUG >= logLevel || typeof logLevel === "string" && LogLevel.DEBUG >= getLogLevel(logLevel)) {
278361
+ return (message) => {
278362
+ console.debug(
278363
+ `
278364
+ ${chalk.bold.hex(config2?.colors?.primary ? config2.colors.primary : "#1fb2a6")(">")} ${chalk.bold.bgHex(config2?.colors?.primary ? config2.colors.primary : "#1fb2a6").white(" \u{1F9EA} Debug ")} ${chalk.hex(
278365
+ config2?.colors?.primary ? config2.colors.primary : "#1fb2a6"
278366
+ )(message)}
278367
+ `
278368
+ );
278369
+ };
278370
+ }
278371
+ return (message) => {
278372
+ console.log(
278373
+ `
278374
+ ${chalk.bold.hex(config2?.colors?.primary ? config2.colors.primary : "#1fb2a6")(">")} ${chalk.bold.bgHex(config2?.colors?.primary ? config2.colors.primary : "#1fb2a6").white(" \u{1F4E2} System ")} ${chalk.hex(
278375
+ config2?.colors?.primary ? config2.colors.primary : "#1fb2a6"
278376
+ )(message)}
278377
+ `
278378
+ );
278379
+ };
278380
+ };
278381
+ var writeFatal = (config2, message) => getLogFn(config2, LogLevel.FATAL)(message);
278382
+ var writeError = (config2, message) => getLogFn(config2, LogLevel.ERROR)(message);
278383
+ var writeWarning = (config2, message) => getLogFn(config2, LogLevel.WARN)(message);
278384
+ var writeInfo = (config2, message) => getLogFn(config2, LogLevel.INFO)(message);
278385
+ var writeSuccess = (config2, message) => getLogFn(config2, LogLevel.SUCCESS)(message);
278386
+ var writeDebug = (config2, message) => getLogFn(config2, LogLevel.DEBUG)(message);
278387
+ var writeTrace = (config2, message) => getLogFn(config2, LogLevel.TRACE)(message);
278388
+
278389
+ // packages/config-tools/src/config-file/get-config-file.ts
278220
278390
  var _static_cache = void 0;
278221
278391
  var getConfigFileName = async (fileName, filePath2) => (0, import_cosmiconfig.cosmiconfig)(fileName, { cache: true }).search(filePath2);
278222
278392
  var getConfigFile = async (filePath2) => {
@@ -278243,6 +278413,10 @@ var getConfigFile = async (filePath2) => {
278243
278413
  console.warn(
278244
278414
  "No Storm config file found in the current workspace. Please ensure this is the expected behavior - you can add a `storm.config.js` file to the root of your workspace if it is not."
278245
278415
  );
278416
+ writeWarning(
278417
+ { logLevel: "error" },
278418
+ "No Storm config file found in the current workspace. Please ensure this is the expected behavior - you can add a `storm.config.js` file to the root of your workspace if it is not."
278419
+ );
278246
278420
  return void 0;
278247
278421
  }
278248
278422
  const config2 = cosmiconfigResult.config ?? {};
@@ -282033,171 +282207,6 @@ var getDefaultConfig = (config2 = {}, root) => {
282033
282207
  });
282034
282208
  };
282035
282209
 
282036
- // packages/config-tools/src/types.ts
282037
- var LogLevel = {
282038
- SILENT: 0,
282039
- FATAL: 10,
282040
- ERROR: 20,
282041
- WARN: 30,
282042
- INFO: 40,
282043
- SUCCESS: 45,
282044
- DEBUG: 60,
282045
- TRACE: 70,
282046
- ALL: 100
282047
- };
282048
- var LogLevelLabel = {
282049
- SILENT: "silent",
282050
- FATAL: "fatal",
282051
- ERROR: "error",
282052
- WARN: "warn",
282053
- INFO: "info",
282054
- DEBUG: "debug",
282055
- TRACE: "trace",
282056
- ALL: "all"
282057
- };
282058
-
282059
- // packages/config-tools/src/utilities/get-log-level.ts
282060
- var getLogLevel = (label) => {
282061
- switch (label) {
282062
- case "all":
282063
- return LogLevel.ALL;
282064
- case "trace":
282065
- return LogLevel.TRACE;
282066
- case "debug":
282067
- return LogLevel.DEBUG;
282068
- case "info":
282069
- return LogLevel.INFO;
282070
- case "warn":
282071
- return LogLevel.WARN;
282072
- case "error":
282073
- return LogLevel.ERROR;
282074
- case "fatal":
282075
- return LogLevel.FATAL;
282076
- case "silent":
282077
- return LogLevel.SILENT;
282078
- default:
282079
- return LogLevel.INFO;
282080
- }
282081
- };
282082
- var getLogLevelLabel = (logLevel) => {
282083
- if (logLevel >= LogLevel.ALL) {
282084
- return LogLevelLabel.ALL;
282085
- }
282086
- if (logLevel >= LogLevel.TRACE) {
282087
- return LogLevelLabel.TRACE;
282088
- }
282089
- if (logLevel >= LogLevel.DEBUG) {
282090
- return LogLevelLabel.DEBUG;
282091
- }
282092
- if (logLevel >= LogLevel.INFO) {
282093
- return LogLevelLabel.INFO;
282094
- }
282095
- if (logLevel >= LogLevel.WARN) {
282096
- return LogLevelLabel.WARN;
282097
- }
282098
- if (logLevel >= LogLevel.ERROR) {
282099
- return LogLevelLabel.ERROR;
282100
- }
282101
- if (logLevel >= LogLevel.FATAL) {
282102
- return LogLevelLabel.FATAL;
282103
- }
282104
- if (logLevel <= LogLevel.SILENT) {
282105
- return LogLevelLabel.SILENT;
282106
- }
282107
- return LogLevelLabel.INFO;
282108
- };
282109
-
282110
- // packages/config-tools/src/utilities/logger.ts
282111
- var chalk = __toESM(require_source(), 1);
282112
- var getLogFn = (config2 = {}, logLevel = LogLevel.INFO) => {
282113
- if (typeof logLevel === "number" && (logLevel >= getLogLevel(config2.logLevel ?? process.env?.STORM_LOG_LEVEL) || logLevel <= LogLevel.SILENT) || typeof logLevel === "string" && getLogLevel(logLevel) >= getLogLevel(config2.logLevel ?? process.env?.STORM_LOG_LEVEL)) {
282114
- return (_) => {
282115
- };
282116
- }
282117
- if (typeof logLevel === "number" && LogLevel.FATAL >= logLevel || typeof logLevel === "string" && LogLevel.FATAL >= getLogLevel(logLevel)) {
282118
- return (message) => {
282119
- console.error(
282120
- `
282121
- ${chalk.bold.hex(config2?.colors?.fatal ? config2.colors.fatal : "#1fb2a6")(">")} ${chalk.bold.bgHex(config2?.colors?.fatal ? config2.colors.fatal : "#1fb2a6").white(" \u{1F480} Fatal ")} ${chalk.hex(
282122
- config2?.colors?.fatal ? config2.colors.fatal : "#1fb2a6"
282123
- )(message)}
282124
-
282125
- `
282126
- );
282127
- };
282128
- }
282129
- if (typeof logLevel === "number" && LogLevel.ERROR >= logLevel || typeof logLevel === "string" && LogLevel.ERROR >= getLogLevel(logLevel)) {
282130
- return (message) => {
282131
- console.error(
282132
- `
282133
- ${chalk.bold.hex(config2?.colors?.error ? config2.colors.error : "#7d1a1a")(">")} ${chalk.bold.bgHex(config2?.colors?.error ? config2.colors.error : "#7d1a1a").white(" \u{1F6D1} Error ")} ${chalk.hex(
282134
- config2?.colors?.error ? config2.colors.error : "#7d1a1a"
282135
- )(message)}
282136
- `
282137
- );
282138
- };
282139
- }
282140
- if (typeof logLevel === "number" && LogLevel.WARN >= logLevel || typeof logLevel === "string" && LogLevel.WARN >= getLogLevel(logLevel)) {
282141
- return (message) => {
282142
- console.warn(
282143
- `
282144
- ${chalk.bold.hex(config2?.colors?.warning ? config2.colors.warning : "#fcc419")(">")} ${chalk.bold.bgHex(config2?.colors?.warning ? config2.colors.warning : "#fcc419").white(" \u26A0\uFE0F Warn ")} ${chalk.hex(
282145
- config2?.colors?.warning ? config2.colors.warning : "#fcc419"
282146
- )(message)}
282147
- `
282148
- );
282149
- };
282150
- }
282151
- if (typeof logLevel === "number" && LogLevel.INFO >= logLevel || typeof logLevel === "string" && LogLevel.INFO >= getLogLevel(logLevel)) {
282152
- return (message) => {
282153
- console.info(
282154
- `
282155
- ${chalk.bold.hex(config2?.colors?.info ? config2.colors.info : "#0ea5e9")(">")} ${chalk.bold.bgHex(config2?.colors?.info ? config2.colors.info : "#0ea5e9").white(" \u{1F4EC} Info ")} ${chalk.hex(
282156
- config2?.colors?.info ? config2.colors.info : "#0ea5e9"
282157
- )(message)}
282158
- `
282159
- );
282160
- };
282161
- }
282162
- if (typeof logLevel === "number" && LogLevel.INFO >= logLevel || typeof logLevel === "string" && LogLevel.INFO >= getLogLevel(logLevel)) {
282163
- return (message) => {
282164
- console.info(
282165
- `
282166
- ${chalk.bold.hex(config2?.colors?.success ? config2.colors.success : "#087f5b")(">")} ${chalk.bold.bgHex(config2?.colors?.success ? config2.colors.success : "#087f5b").white(" \u{1F389} Success ")} ${chalk.hex(
282167
- config2?.colors?.success ? config2.colors.success : "#087f5b"
282168
- )(message)}
282169
- `
282170
- );
282171
- };
282172
- }
282173
- if (typeof logLevel === "number" && LogLevel.DEBUG >= logLevel || typeof logLevel === "string" && LogLevel.DEBUG >= getLogLevel(logLevel)) {
282174
- return (message) => {
282175
- console.debug(
282176
- `
282177
- ${chalk.bold.hex(config2?.colors?.primary ? config2.colors.primary : "#1fb2a6")(">")} ${chalk.bold.bgHex(config2?.colors?.primary ? config2.colors.primary : "#1fb2a6").white(" \u{1F9EA} Debug ")} ${chalk.hex(
282178
- config2?.colors?.primary ? config2.colors.primary : "#1fb2a6"
282179
- )(message)}
282180
- `
282181
- );
282182
- };
282183
- }
282184
- return (message) => {
282185
- console.log(
282186
- `
282187
- ${chalk.bold.hex(config2?.colors?.primary ? config2.colors.primary : "#1fb2a6")(">")} ${chalk.bold.bgHex(config2?.colors?.primary ? config2.colors.primary : "#1fb2a6").white(" \u{1F4E2} System ")} ${chalk.hex(
282188
- config2?.colors?.primary ? config2.colors.primary : "#1fb2a6"
282189
- )(message)}
282190
- `
282191
- );
282192
- };
282193
- };
282194
- var writeFatal = (config2, message) => getLogFn(config2, LogLevel.FATAL)(message);
282195
- var writeError = (config2, message) => getLogFn(config2, LogLevel.ERROR)(message);
282196
- var writeInfo = (config2, message) => getLogFn(config2, LogLevel.INFO)(message);
282197
- var writeSuccess = (config2, message) => getLogFn(config2, LogLevel.SUCCESS)(message);
282198
- var writeDebug = (config2, message) => getLogFn(config2, LogLevel.DEBUG)(message);
282199
- var writeTrace = (config2, message) => getLogFn(config2, LogLevel.TRACE)(message);
282200
-
282201
282210
  // packages/config-tools/src/env/set-env.ts
282202
282211
  var setExtensionEnv = (extensionName, extension) => {
282203
282212
  for (const key of Object.keys(extension ?? {})) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@storm-software/linting-tools",
3
- "version": "1.27.0",
3
+ "version": "1.27.2",
4
4
  "private": false,
5
5
  "description": "⚡ A package containing various linting tools used to validate syntax, enforce design standards, and format code in a Storm workspace.",
6
6
  "keywords": [