nanos-lint 2.8.0 → 2.8.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.
@@ -907,13 +907,17 @@ interface ParseOptionsResult {
907
907
  }
908
908
  //#endregion
909
909
  //#region src/cli.d.ts
910
+ /** Accumulates repeatable --ignore pattern arguments, splitting by comma and newline. */
910
911
  declare function collectIgnorePatterns(val: string, prev?: string[]): string[];
911
912
  interface CreateProgramOptions {
912
913
  setExitCode?: (code: number) => void;
913
914
  }
915
+ /** Constructs and configures the top-level Commander program and its CLI subcommands. */
914
916
  declare function createProgram(options?: CreateProgramOptions): Command;
917
+ /** Parses command-line arguments and executes the requested CLI action. */
915
918
  declare function runCLI(args?: string[]): Promise<number>;
919
+ /** Determines whether the current module is being directly executed as an application entrypoint. */
916
920
  declare function isDirectExecution(importMetaUrl?: string, argv1?: string | undefined): boolean;
917
921
  //#endregion
918
922
  export { runCLI as a, isDirectExecution as i, collectIgnorePatterns as n, createProgram as r, CreateProgramOptions as t };
919
- //# sourceMappingURL=cli-r8LDolDk.d.ts.map
923
+ //# sourceMappingURL=cli-dxsaVVVq.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"cli-r8LDolDk.d.ts","names":[],"sources":["../node_modules/commander/typings/index.d.ts","../src/cli.ts"],"x_google_ignoreList":[0],"mappings":";;;;;;;;;;KAWK,aAAa,aAAa,oCAC3B,eACC,WAAW;cAEH,uBAAuB;EAClC;EACA;EACA;EACA;;;;;;;EAQA,YAAY,kBAAkB,cAAc;;UAY7B;;;EAGf;;EAEA;;cAGW;EACX;EACA;EACA;EACA;EACA;EACA,YAAY,GAAG,eAAe,UAAU,MAAM;EAC9C;;;;;;EAOA,YAAY,aAAa;;;;EAKzB;;;;EAKA,QAAQ,gBAAgB;;;;EAKxB,UAAU,GAAG,KAAK,eAAe,UAAU,MAAM;;;;EAKjD,QAAQ;;;;EAKR;;;;EAKA;;cAGW;EACX;EACA;EAEA;EACA;EACA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AcjB,cAAc;;;;EAId;;;;;;EAOA,UAAU;;;;EAIV;;;;;;;;;;;;;EAcA,cAAc;;;;EAId;;;;;;;;;;;;;EAcA,aAAa;;;;EAIb;;;;;;;EAQA,WAAW,UAAU;;EAErB,WAAW,KAAK;;;;EAKhB,gBAAgB,UAAU;;;;;;EAO1B,WAAW,0BAA0B;;;;;EAMrC,cAAc,QAAQ;;;;;;EAOtB,KAAK,UAAU;;EAEf,KAAK,KAAK;;;;;;;EAQV,YAAY,UAAU,qBAAqB;EAC3C,YACE,UAAU,qBACV,OAAO,SAAS;;;;EAMlB,GAAG,wBAAwB,cAAc;;UAG1B;EACf;EACA;;EAEA;;UAEe,iCAAiC;EAChD;;UAGe;EACf;EACA;;;;iBC/iCc,sBAAsB,aAAa;UAqBlC;EACf,eAAe;;iBAGD,cAAc,UAAU,uBAAuB;iBAoRzC,OAAO,kBAAyC;iBA0DtD,kBACd,wBACA"}
1
+ {"version":3,"file":"cli-dxsaVVVq.d.ts","names":[],"sources":["../node_modules/commander/typings/index.d.ts","../src/cli.ts"],"x_google_ignoreList":[0],"mappings":";;;;;;;;;;KAWK,aAAa,aAAa,oCAC3B,eACC,WAAW;cAEH,uBAAuB;EAClC;EACA;EACA;EACA;;;;;;;EAQA,YAAY,kBAAkB,cAAc;;UAY7B;;;EAGf;;EAEA;;cAGW;EACX;EACA;EACA;EACA;EACA;EACA,YAAY,GAAG,eAAe,UAAU,MAAM;EAC9C;;;;;;EAOA,YAAY,aAAa;;;;EAKzB;;;;EAKA,QAAQ,gBAAgB;;;;EAKxB,UAAU,GAAG,KAAK,eAAe,UAAU,MAAM;;;;EAKjD,QAAQ;;;;EAKR;;;;EAKA;;cAGW;EACX;EACA;EAEA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,YAAY,GAAG,eAAe,UAAU,MAAM;EAC9C;EACA;EACA;EAEA,YAAY,eAAe;;;;EAK3B,QAAQ,gBAAgB;;;;;;;;;;;EAYxB,OAAO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AK;;;;EAKhB,gBAAgB,UAAU;;;;;;EAO1B,WAAW,0BAA0B;;;;;EAMrC,cAAc,QAAQ;;;;;;EAOtB,KAAK,UAAU;;EAEf,KAAK,KAAK;;;;;;;EAQV,YAAY,UAAU,qBAAqB;EAC3C,YACE,UAAU,qBACV,OAAO,SAAS;;;;EAMlB,GAAG,wBAAwB,cAAc;;UAG1B;EACf;EACA;;EAEA;;UAEe,iCAAiC;EAChD;;UAGe;EACf;EACA;;;;;iBC7iCc,sBAAsB,aAAa;UAqBlC;EACf,eAAe;;;iBAID,cAAc,UAAU,uBAAuB;;iBA6RzC,OAAO,kBAAyC;;iBA2DtD,kBACd,wBACA"}
package/dist/cli.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- import { a as runCLI, i as isDirectExecution, n as collectIgnorePatterns, r as createProgram, t as CreateProgramOptions } from "./cli-r8LDolDk.js";
1
+ import { a as runCLI, i as isDirectExecution, n as collectIgnorePatterns, r as createProgram, t as CreateProgramOptions } from "./cli-dxsaVVVq.js";
2
2
  export { CreateProgramOptions, collectIgnorePatterns, createProgram, isDirectExecution, runCLI };
package/dist/cli.js CHANGED
@@ -1,2 +1,2 @@
1
- import { i as runCLI, n as createProgram, r as isDirectExecution, t as collectIgnorePatterns } from "./cli-DGez8MSI.js";
1
+ import { i as runCLI, n as createProgram, r as isDirectExecution, t as collectIgnorePatterns } from "./cli-BTHx4yp_.js";
2
2
  export { collectIgnorePatterns, createProgram, isDirectExecution, runCLI };
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { a as runCLI, i as isDirectExecution, n as collectIgnorePatterns, r as createProgram, t as CreateProgramOptions } from "./cli-r8LDolDk.js";
1
+ import { a as runCLI, i as isDirectExecution, n as collectIgnorePatterns, r as createProgram, t as CreateProgramOptions } from "./cli-dxsaVVVq.js";
2
2
  //#region src/types.d.ts
3
3
  export type DiagnosticSeverity = "Error" | "Warning" | "Information" | "Hint";
4
4
  export type DiagnosticSeverityLevel = 1 | 2 | 3 | 4;
@@ -79,18 +79,22 @@ export declare function fileUriToPath(uri: string): string;
79
79
  * Finds the package root directory across both development (src/) and production (dist/) environments.
80
80
  */
81
81
  export declare function getPackageRoot(): string;
82
+ /** Resolves the default annotations path from environment variable, bundled file, or user cache. */
82
83
  export declare function getDefaultAnnotationsPath(): string;
83
84
  /**
84
85
  * @deprecated Use getDefaultAnnotationsPath() instead.
85
86
  * Returns the directory containing the resolved annotations.lua file.
86
87
  */
87
88
  export declare function getDefinitionsDir(): string;
89
+ /** Resolves the absolute path to the default .luarc.json template shipped with the package. */
88
90
  export declare function getDefaultTemplatePath(): string;
89
91
  /**
90
92
  * Strips single-line and multi-line comments from JSONC text using jsonc-parser.
91
93
  */
92
94
  export declare function stripJsonComments(text: string): string;
95
+ /** Parses JSONC text with support for comments and trailing commas. */
93
96
  export declare function parseJsonc<T = unknown>(text: string): T;
97
+ /** Reads and parses a .luarc.json configuration file from disk. */
94
98
  export declare function loadConfigFile(filePath: string): LuaRCConfig;
95
99
  /**
96
100
  * Removes trailing `/` characters from a path-like string.
@@ -147,17 +151,8 @@ export declare function initWorkspace(workspacePath: string, options?: InitWorks
147
151
  export declare const FALLBACK_LUALS_VERSION = "3.19.1";
148
152
  export declare const DEFAULT_LUALS_VERSION = "latest";
149
153
  /**
150
- * Validates a LuaLS version/tag and rebuilds it from the allow-list above.
151
- *
152
- * Version strings originate from untrusted sources: the GitHub releases API
153
- * response and user supplied `--luals-version` arguments. They are interpolated
154
- * into cache directory paths, download URLs, and the path of the binary that is
155
- * eventually executed, so they must be constrained to a single safe path
156
- * segment. Rebuilding the value character by character guarantees the returned
157
- * string only ever contains allow-listed characters (CodeQL: js/command-line-injection).
158
- *
159
- * @returns the normalized version (a single leading `v` is dropped), or `null`
160
- * when the input cannot be used as a version tag.
154
+ * Validates and normalizes a LuaLS version string to prevent path traversal or injection.
155
+ * Drops a single leading 'v' and returns null on invalid characters.
161
156
  */
162
157
  export declare function sanitizeLuaLSVersion(raw: string): string | null;
163
158
  /**
@@ -184,9 +179,11 @@ export interface PlatformInfo {
184
179
  assetName: string;
185
180
  binaryRelativePath: string;
186
181
  }
182
+ /** Resolves platform-specific binary naming and relative paths for the host operating system. */
187
183
  export declare function getPlatformInfo(version?: string): PlatformInfo;
188
184
  //#endregion
189
185
  //#region src/luals/cache.d.ts
186
+ /** Returns the base directory in the system cache where LuaLS versions and metadata are stored. */
190
187
  export declare function getBaseLuaLSCacheDir(): string;
191
188
  /**
192
189
  * Cache directory of a LuaLS version. `baseCacheDir` defaults to the system
@@ -207,8 +204,11 @@ export interface LuaLSMetadata {
207
204
  * Calculates the ISO 8601 week string for a given date in the format 'YYYY-Www' (e.g. '2026-W39').
208
205
  */
209
206
  export declare function getIsoWeek(d?: Date): string;
207
+ /** Returns the path to the LuaLS metadata.json file within the specified cache directory. */
210
208
  export declare function getLuaLSMetadataPath(baseCacheDir?: string): string;
209
+ /** Reads and parses the LuaLS metadata.json file, purging corrupted or invalid files automatically. */
211
210
  export declare function readLuaLSMetadata(baseCacheDir?: string): LuaLSMetadata | null;
211
+ /** Writes metadata.json containing the latest checked version and timestamp. */
212
212
  export declare function writeLuaLSMetadata(metadata: LuaLSMetadata, baseCacheDir?: string): void;
213
213
  /**
214
214
  * Lists all candidate LuaLS version directories under baseCacheDir without running
@@ -233,27 +233,98 @@ export declare function findExistingLuaLSDir(version: string, baseCacheDir?: str
233
233
  //#endregion
234
234
  //#region src/luals/validation.d.ts
235
235
  /**
236
- * Verifies that a LuaLS binary exists, has non-trivial size, and is executable.
236
+ * Escapes single quotes for safe PowerShell single-quoted string interpolation.
237
+ */
238
+ export declare function escapePowerShellSingleQuote(str: string): string;
239
+ /**
240
+ * Maximum total decompressed size of a LuaLS release archive (500 MB).
241
+ * Protects against zip bombs and maliciously inflated archives (#31).
242
+ */
243
+ export declare const MAX_DECOMPRESSED_SIZE_BYTES: number;
244
+ /**
245
+ * Maximum number of members allowed in a LuaLS release archive (10,000).
246
+ * Protects against inode exhaustion and archive recursion attacks (#31).
247
+ */
248
+ export declare const MAX_ARCHIVE_MEMBER_COUNT = 10000;
249
+ /** Parses the file size column from a 'tar -tvf' listing output line. */
250
+ export declare function parseTarTvSize(line: string): number;
251
+ /** Locates the platform tar executable path, checking System32 on Windows. */
252
+ export declare function getTarBinary(): string;
253
+ /** Pre-inspects a ZIP archive's central directory to enforce extraction safety constraints (#31). */
254
+ export declare function inspectZipMembers(archivePath: string): {
255
+ memberCount: number;
256
+ totalDeclaredSize: number;
257
+ };
258
+ /** Detects whether an archive file starts with ZIP magic bytes. */
259
+ export declare function isZipArchive(archivePath: string): boolean;
260
+ /** Detects whether an archive file starts with GZIP magic bytes. */
261
+ export declare function isGzipArchive(archivePath: string): boolean;
262
+ /** Pre-inspects archive members using tar listing or zip directory parsing to enforce extraction safety constraints (#31). */
263
+ export declare function validateArchiveMembers(archivePath: string): Promise<{
264
+ memberCount: number;
265
+ totalDeclaredSize: number;
266
+ }>;
267
+ /**
268
+ * Minimum plausible size of a downloaded LuaLS executable. Release assets are
269
+ * several megabytes, so anything smaller is a truncated download or a stray
270
+ * file. This floor only applies to binaries nanos-lint fetched itself: a
271
+ * user-supplied `LUALS_BIN` may legitimately be a small wrapper script.
272
+ */
273
+ export declare const MIN_DOWNLOADED_BINARY_SIZE_BYTES = 100000;
274
+ /**
275
+ * Verifies that a downloaded or cached LuaLS binary exists, has non-trivial
276
+ * size, and is executable.
237
277
  */
238
278
  export declare function isBinaryValid(binaryPath: string): boolean;
279
+ /**
280
+ * Verifies that an explicitly configured binary is a regular file that runs and
281
+ * reports a LuaLS version, without the downloaded-archive size heuristic so
282
+ * wrapper scripts (`LUALS_BIN=/usr/local/bin/lua-language-server`) keep working.
283
+ */
284
+ export declare function isBinaryRunnable(binaryPath: string): boolean;
285
+ /**
286
+ * Validates an explicitly configured LuaLS binary (`LUALS_BIN` environment
287
+ * variable or `--luals-bin` CLI option) and returns its path.
288
+ *
289
+ * Both are documented escape hatches, so a typo, a stale path, a directory or an
290
+ * unrelated executable must fail with an actionable error instead of a
291
+ * confusing low-level failure deep inside the check run (#26). Executables are
292
+ * accepted as-is when `--version` reports a version, including the thin wrapper
293
+ * scripts that Homebrew/mason-style installations put on `PATH`: the size floor
294
+ * used for downloaded archives would reject those.
295
+ *
296
+ * @param binaryPath Path exactly as the user supplied it.
297
+ * @param source Name of the setting being validated (`LUALS_BIN` / `--luals-bin`).
298
+ */
299
+ export declare function assertValidLuaLSBinary(binaryPath: string, source: string): string;
239
300
  //#endregion
240
301
  //#region src/luals/download.d.ts
302
+ export declare const DOWNLOAD_TIMEOUT_MS = 120000;
303
+ export declare const MAX_ARCHIVE_SIZE_BYTES: number;
304
+ export declare const ALLOWED_DOWNLOAD_DOMAINS: readonly string[];
241
305
  /**
242
- * Escapes single quotes for safe PowerShell single-quoted string interpolation.
306
+ * Validates that a download URL uses HTTPS and targets an allowlisted host.
243
307
  */
244
- export declare function escapePowerShellSingleQuote(str: string): string;
308
+ export declare function isAllowedDownloadUrl(urlString: string): boolean;
309
+ /**
310
+ * Calculates the SHA-256 hash of a file on disk in bounded memory.
311
+ */
312
+ export declare function computeFileSha256(filePath: string): string;
313
+ /**
314
+ * Enforces a maximum byte count on an asynchronous download stream.
315
+ */
316
+ export declare function limitDownloadStream(source: AsyncIterable<Uint8Array | Buffer>): AsyncGenerator<Uint8Array | Buffer, void, unknown>;
245
317
  export interface DownloadOptions {
246
318
  quiet?: boolean;
247
319
  reuseExisting?: boolean;
248
320
  /** Base directory searched for an installed copy when reusing. Defaults to the system cache. */
249
321
  cacheDir?: string;
250
322
  }
323
+ /** Downloads, verifies, and extracts the LuaLS release archive for the current platform. */
251
324
  export declare function downloadAndExtractLuaLS(version?: string, targetDir?: string, options?: DownloadOptions): Promise<string>;
252
325
  //#endregion
253
326
  //#region src/luals/files.d.ts
254
- /**
255
- * Counts candidate Lua files within targetPath, taking ignoreDir and files.exclude into account.
256
- */
327
+ /** Counts candidate Lua files within targetPath, taking workspace ignoreDir and files.exclude into account (#27). */
257
328
  export declare function countCheckedFiles(targetPath: string, configPath?: string): number;
258
329
  //#endregion
259
330
  //#region src/luals/runner.d.ts
@@ -264,7 +335,9 @@ export interface ResolveLuaLSOptions {
264
335
  /** Set to `false` to always fetch the archive instead of reusing an installed copy. */
265
336
  reuseExisting?: boolean;
266
337
  }
338
+ /** Resolves the executable path of a LuaLS binary from env, bundle, cache, or network download. */
267
339
  export declare function resolveLuaLSBinary(version?: string, options?: ResolveLuaLSOptions): Promise<string>;
340
+ /** Executes the LuaLS diagnostics check on the target path using merged configurations. */
268
341
  export declare function runLuaLSCheck(targetPath: string, configPath: string, options: CheckOptions): Promise<CheckResult>;
269
342
  //#endregion
270
343
  //#region src/reporter.d.ts
@@ -273,6 +346,7 @@ export declare function runLuaLSCheck(targetPath: string, configPath: string, op
273
346
  * and TTY detection.
274
347
  */
275
348
  export declare function shouldEnableColor(): boolean;
349
+ /** Returns ANSI color escape code helpers or empty strings when colors are disabled. */
276
350
  export declare function getColors(useColor?: boolean): {
277
351
  reset: string;
278
352
  bold: string;
@@ -285,11 +359,17 @@ export declare function getColors(useColor?: boolean): {
285
359
  cyan: string;
286
360
  gray: string;
287
361
  };
362
+ /** Formats a numeric diagnostic severity level into a colored badge. */
288
363
  export declare function formatSeverityBadge(severity: number, useColor?: boolean): string;
364
+ /** Formats a noun with its count and pluralizes if necessary. */
289
365
  export declare function pluralize(count: number, singular: string, plural?: string): string;
366
+ /** Formats the summary text detailing diagnostic counts and affected files. */
290
367
  export declare function formatProblemSummary(totalProblems: number, errors: number, warnings: number, files: number): string;
368
+ /** Formats check results into pretty human-readable terminal output. */
291
369
  export declare function formatPretty(result: CheckResult, cwd?: string, useColor?: boolean): string;
370
+ /** Formats check diagnostics into GitHub Actions workflow annotation commands. */
292
371
  export declare function formatGitHubAnnotations(result: CheckResult, cwd?: string): string;
372
+ /** Formats check results according to the chosen format (pretty, json, github). */
293
373
  export declare function formatReport(result: CheckResult, format?: "pretty" | "json" | "github", cwd?: string, useColor?: boolean): string;
294
374
  //#endregion
295
375
  //#region node_modules/env-paths/index.d.ts
@@ -367,11 +447,7 @@ export declare function getDirectorySize(targetPath: string): number;
367
447
  */
368
448
  export declare function formatBytes(bytes: number): string;
369
449
  //#endregion
370
- //#region src/annotations.d.ts
371
- export declare const DOCGEN_REPO = "nanos-world/vscode-extension";
372
- export declare const DOCGEN_BRANCH = "docgen-output";
373
- export declare const RAW_ANNOTATIONS_URL = "https://raw.githubusercontent.com/nanos-world/vscode-extension/refs/heads/docgen-output/annotations.lua";
374
- export declare const GITHUB_COMMITS_API = "https://api.github.com/repos/nanos-world/vscode-extension/commits/docgen-output";
450
+ //#region src/annotations-metadata.d.ts
375
451
  export interface AnnotationsDate {
376
452
  year: number;
377
453
  month: number;
@@ -384,32 +460,44 @@ export interface AnnotationsMetadata {
384
460
  }
385
461
  export declare const ANNOTATIONS_FILENAME = "annotations.lua";
386
462
  export declare const METADATA_FILENAME = "metadata.json";
463
+ export declare const MIN_ANNOTATIONS_SIZE_BYTES = 1000;
464
+ export declare const MAX_ANNOTATIONS_SIZE_BYTES: number;
465
+ export declare const MAX_COMMIT_JSON_SIZE_BYTES: number;
466
+ /** Returns current date string formatted as YYYY-MM-DD alongside a date components object. */
387
467
  export declare function getTodayDateString(d?: Date): {
388
468
  dateStr: string;
389
469
  dateObj: AnnotationsDate;
390
470
  };
471
+ /** Returns the system cache directory used for nanos world annotations. */
391
472
  export declare function getAnnotationsCacheDir(): string;
473
+ /** Returns the full path to the cached annotations.lua file. */
392
474
  export declare function getCachedAnnotationsFilePath(): string;
475
+ /** Returns the full path to the annotations metadata.json file. */
393
476
  export declare function getAnnotationsMetadataFilePath(): string;
477
+ /** Reads and parses annotations metadata.json, purging corrupt files automatically. */
394
478
  export declare function readAnnotationsMetadata(cacheDir?: string): AnnotationsMetadata | null;
395
- /**
396
- * Verifies that an annotations file exists, is a regular file, is of non-trivial size (>= 1000 bytes),
397
- * and begins with valid Lua comments or nanos world definitions.
398
- */
479
+ /** Verifies that an annotations file exists, is non-trivial in size, and contains valid header. */
399
480
  export declare function isAnnotationsValid(filePath: string): boolean;
400
- export declare function fetchLatestCommitId(): Promise<string | null>;
401
- export declare function fetchRawAnnotationsContent(): Promise<string>;
402
- /**
403
- * Updates the metadata lastChecked date atomically without modifying annotations.lua.
404
- */
481
+ /** Updates metadata lastChecked date atomically without modifying annotations.lua. */
405
482
  export declare function updateLastCheckedDate(commitId: string, cacheDir?: string): AnnotationsMetadata;
406
- /**
407
- * Downloads annotations.lua, writes it and the new metadata in a chained atomic transaction.
408
- * If any step fails, the previous cache state is reverted.
409
- */
483
+ //#endregion
484
+ //#region src/annotations-download.d.ts
485
+ export declare const DOCGEN_REPO = "nanos-world/vscode-extension";
486
+ export declare const DOCGEN_BRANCH = "docgen-output";
487
+ export declare const RAW_ANNOTATIONS_URL = "https://raw.githubusercontent.com/nanos-world/vscode-extension/refs/heads/docgen-output/annotations.lua";
488
+ export declare const GITHUB_COMMITS_API = "https://api.github.com/repos/nanos-world/vscode-extension/commits/docgen-output";
489
+ /** Fetches the latest commit SHA for the annotations branch from the GitHub API. */
490
+ export declare function fetchLatestCommitId(): Promise<string | null>;
491
+ /** Returns raw annotations URL, pinned to commit SHA if provided and valid. */
492
+ export declare function getRawAnnotationsUrl(commitSha?: string): string;
493
+ /** Downloads raw annotations.lua content from GitHub raw content endpoints. */
494
+ export declare function fetchRawAnnotationsContent(commitSha?: string): Promise<string>;
495
+ /** Downloads annotations.lua and writes metadata in a chained atomic transaction with rollback. */
410
496
  export declare function downloadAndCacheAnnotations(commitId: string, cacheDir?: string, options?: {
411
497
  quiet?: boolean;
412
498
  }): Promise<string>;
499
+ //#endregion
500
+ //#region src/annotations.d.ts
413
501
  export interface ResolveAnnotationsOptions {
414
502
  customPath?: string;
415
503
  cacheDir?: string;
@@ -430,19 +518,28 @@ export type LogLevel = "silent" | "error" | "warn" | "info" | "debug";
430
518
  export declare const LOG_LEVELS: ReadonlyArray<LogLevel>;
431
519
  export declare const LOG_LEVEL_PRIORITY: Record<LogLevel, number>;
432
520
  export declare const DEFAULT_LOG_LEVEL: LogLevel;
521
+ /** Validates whether a string corresponds to a recognized log level. */
433
522
  export declare function isValidLogLevel(level: string): level is LogLevel;
523
+ /** Parses a string into a valid LogLevel, defaulting to 'warn'. */
434
524
  export declare function parseLogLevel(raw?: string | null): LogLevel;
435
525
  export declare class Logger {
436
526
  private level;
437
527
  constructor(initialLevel?: LogLevel);
528
+ /** Sets the active minimum logging level. */
438
529
  setLevel(level: LogLevel): void;
530
+ /** Returns the current active log level. */
439
531
  getLevel(): LogLevel;
532
+ /** Checks if a message at the specified level should be emitted. */
440
533
  isEnabledFor(level: LogLevel): boolean;
441
534
  /** Whether command results should be written; only `silent` disables them. */
442
535
  isOutputEnabled(): boolean;
536
+ /** Logs an error-level message to stderr. */
443
537
  error(...args: unknown[]): void;
538
+ /** Logs a warning-level message to stderr. */
444
539
  warn(...args: unknown[]): void;
540
+ /** Logs an informational message to stdout. */
445
541
  info(...args: unknown[]): void;
542
+ /** Logs a debug-level diagnostic message to stdout. */
446
543
  debug(...args: unknown[]): void;
447
544
  }
448
545
  export declare const logger: Logger;
@@ -498,7 +595,9 @@ export interface CacheStatusReport {
498
595
  luals: LuaLSCacheStatus;
499
596
  annotations: AnnotationsCacheStatus;
500
597
  }
598
+ /** Collects detailed status and disk usage information for LuaLS and annotations caches. */
501
599
  export declare function getCacheStatus(baseCacheDir?: string): CacheStatusReport;
600
+ /** Formats a cache status report into human-readable terminal output. */
502
601
  export declare function formatCacheStatusPretty(report: CacheStatusReport): string;
503
602
  //#endregion
504
603
  export { CreateProgramOptions, collectIgnorePatterns, createProgram, isDirectExecution, runCLI };
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":[],"sources":["../src/types.ts","../src/config.ts","../src/luals/version.ts","../src/luals/platform.ts","../src/luals/cache.ts","../src/luals/validation.ts","../src/luals/download.ts","../src/luals/files.ts","../src/luals/runner.ts","../src/reporter.ts","../node_modules/env-paths/index.d.ts","../src/paths.ts","../src/annotations.ts","../src/logger.ts","../src/errors.ts","../src/cache-status.ts"],"x_google_ignoreList":[10],"mappings":";;YAGY;YACA;iBAEK;EACf;IACE;IACA;;EAEF;IACE;IACA;;;iBAIa;EACf,OAAO;EACP,UAAU;EACV;EACA;EACA;;YAGU,mBAAmB,eAAe;iBAE7B;EACf;EACA,aAAa;EACb;EACA;EACA;EACA;EACA;EACA;EACA;;iBAGe;EACf;EACA;EACA;EACA;EACA;EACA;EACA,aAAa;;iBAGE;EACf;EACA;IACE;IACA;IACA,UAAU;KACT;;EAEH;IACE;IACA;IACA;KACC;;EAEH;IACE;KACC;;EAEH;IACE;IACA;IACA;IACA,WAAW;IACX,mBAAmB;KAClB;;GAEF;;;;;;wBAOa,cAAc;;;;;;wBCnEd;wBAWA;;;;;wBAmBA;wBAIA;;;;wBAQA,kBAAkB;wBAKlB,WAAW,aAAa,eAAe;wBAavC,eAAe,mBAAmB;;;;;;;;;wBAgClC,qBAAqB;iBAQpB;EACf;;;;;;;;qBASW,8BAA8B;;;;;;;;;;;wBA2E3B,aACd,MAAM,aACN,WAAU,aACV,0BACA,UAAU,qBACT;iBAgJc;EACf;EACA;;;;;;wBAOc,uBACd,uBACA,2BACA,UAAU;EACP;EAAoB;;iBA6ER;EACf;EACA;;;;;wBAMc,cAAc,uBAAuB,UAAU;;;qBC5blD;qBACA;;;;;;;;;;;;;;wBA0BG,qBAAqB;;;;;wBAmCf,qCAAqC;;;;;wBAiCrC,6BAA6B;;;;;;wBAU7B,oBAAoB,mBAAmB;;;iBCxG5C;EACf;EACA;EACA;EACA;;wBAGc,gBAAgB,mBAA2C;;;wBCD3D;;;;;wBAQA,YACd,kBACA;;;;wBAQc,kBAAkB;qBAQrB;iBAEI;EACf;EACA;EACA;;;;;wBAMc,WAAW,IAAG;wBASd,qBAAqB;wBAIrB,kBAAkB,wBAAgD;wBAgClE,mBACd,UAAU,eACV;;;;;wBAec,2BAA2B;;;;;wBA2B3B,wBAAwB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AA,eAAe;EAYpB,SAAS,OAAO;EAMhB,YAAY;EAIZ,aAAa,OAAO;;EAKpB;EAIA,SAAS;EAMT,QAAQ;EAMR,QAAQ;EAMR,SAAS;;qBAOL,QAAM;;;qBCzFN,uBAAuB;WAKhB;WACA;WALO;EAGvB,YAAA,iBACgB,cACA,6BAChB;IAAY;;;qBAMH,oBAAoB;WACN;;qBAGd,mBAAmB;WACL;;qBAGd,yBAAyB;WACX;;qBAGd,mBAAmB;WACL;;;;iBCXV;EACf;EACA;EACA;EACA;EACA;;iBAGe;EACf;EACA;EACA;EACA,UAAU;;iBAGK;EACf;EACA;EACA;EACA;EACA;EACA;;iBAGe;EACf;EACA;EACA;EACA,OAAO;EACP,aAAa;;wBAGC,eAAe,wBAA2C;wBAyE1D,wBAAwB,QAAQ"}
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../src/types.ts","../src/config.ts","../src/luals/version.ts","../src/luals/platform.ts","../src/luals/cache.ts","../src/luals/validation.ts","../src/luals/download.ts","../src/luals/files.ts","../src/luals/runner.ts","../src/reporter.ts","../node_modules/env-paths/index.d.ts","../src/paths.ts","../src/annotations-metadata.ts","../src/annotations-download.ts","../src/annotations.ts","../src/logger.ts","../src/errors.ts","../src/cache-status.ts"],"x_google_ignoreList":[10],"mappings":";;YAGY;YACA;iBAEK;EACf;IACE;IACA;;EAEF;IACE;IACA;;;iBAIa;EACf,OAAO;EACP,UAAU;EACV;EACA;EACA;;YAGU,mBAAmB,eAAe;iBAE7B;EACf;EACA,aAAa;EACb;EACA;EACA;EACA;EACA;EACA;EACA;;iBAGe;EACf;EACA;EACA;EACA;EACA;EACA;EACA,aAAa;;iBAGE;EACf;EACA;IACE;IACA;IACA,UAAU;KACT;;EAEH;IACE;IACA;IACA;KACC;;EAEH;IACE;KACC;;EAEH;IACE;IACA;IACA;IACA,WAAW;IACX,mBAAmB;KAClB;;GAEF;;;;;;wBAOa,cAAc;;;;;;wBCnEd;;wBAYA;;;;;wBAmBA;;wBAKA;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L,QAAM;;;qBCjGN,uBAAuB;WAKhB;WACA;WALO;EAGvB,YAAA,iBACgB,cACA,6BAChB;IAAY;;;qBAMH,oBAAoB;WACN;;qBAGd,mBAAmB;WACL;;qBAGd,yBAAyB;WACX;;qBAGd,mBAAmB;WACL;;;;iBClBV;EACf;EACA;EACA;EACA;EACA;;iBAGe;EACf;EACA;EACA;EACA,UAAU;;iBAGK;EACf;EACA;EACA;EACA;EACA;EACA;;iBAGe;EACf;EACA;EACA;EACA,OAAO;EACP,aAAa;;;wBAIC,eAAe,wBAA2C;;wBA0E1D,wBAAwB,QAAQ"}
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
- import { $ as fetchLatestLuaLSVersionFromGitHub, A as pluralize, At as logger, B as getBaseLuaLSCacheDir, C as updateLastCheckedDate, Ct as systemPaths, D as formatReport, Dt as LOG_LEVEL_PRIORITY, E as formatProblemSummary, Et as LOG_LEVELS, F as downloadAndExtractLuaLS, G as listCachedLuaLSVersionDirs, H as getIsoWeek, I as escapePowerShellSingleQuote, J as writeLuaLSMetadata, K as listCachedLuaLSVersions, L as LUALS_METADATA_FILENAME, M as resolveLuaLSBinary, N as runLuaLSCheck, O as formatSeverityBadge, Ot as Logger, P as countCheckedFiles, Q as FALLBACK_LUALS_VERSION, R as cleanupOldCachedLuaLSVersions, S as resolveAnnotations, St as getDirectorySize, T as formatPretty, Tt as DEFAULT_LOG_LEVEL, U as getLegacyCacheDir, V as getCacheDir, W as getLuaLSMetadataPath, X as getPlatformInfo, Y as isBinaryValid, Z as DEFAULT_LUALS_VERSION, _ as getAnnotationsMetadataFilePath, _t as ConfigError, a as formatCacheStatusPretty, at as getDefaultTemplatePath, b as isAnnotationsValid, bt as cleanCache, c as DOCGEN_BRANCH, ct as initWorkspace, d as METADATA_FILENAME, dt as parseJsonc, et as resolveLatestLuaLSVersion, f as RAW_ANNOTATIONS_URL, ft as resolveWorkspaceConfig, g as getAnnotationsCacheDir, gt as CacheError, h as fetchRawAnnotationsContent, ht as AnnotationsError, i as runCLI, it as getDefaultAnnotationsPath, j as shouldEnableColor, jt as parseLogLevel, k as getColors, kt as isValidLogLevel, l as DOCGEN_REPO, lt as loadConfigFile, m as fetchLatestCommitId, mt as stripTrailingSlashes, n as createProgram, nt as sanitizeLuaLSVersion, o as getCacheStatus, ot as getDefinitionsDir, p as downloadAndCacheAnnotations, pt as stripJsonComments, q as readLuaLSMetadata, r as isDirectExecution, rt as VALID_LUALS_DIAGNOSTIC_CODES, s as ANNOTATIONS_FILENAME, st as getPackageRoot, t as collectIgnorePatterns, tt as resolveLuaLSVersion, u as GITHUB_COMMITS_API, ut as mergeConfigs, v as getCachedAnnotationsFilePath, vt as LuaLSError, w as formatGitHubAnnotations, wt as fileUriToPath, x as readAnnotationsMetadata, xt as formatBytes, y as getTodayDateString, yt as NanosLintError, z as findExistingLuaLSDir } from "./cli-DGez8MSI.js";
2
- export { ANNOTATIONS_FILENAME, AnnotationsError, CacheError, ConfigError, DEFAULT_LOG_LEVEL, DEFAULT_LUALS_VERSION, DOCGEN_BRANCH, DOCGEN_REPO, FALLBACK_LUALS_VERSION, GITHUB_COMMITS_API, LOG_LEVELS, LOG_LEVEL_PRIORITY, LUALS_METADATA_FILENAME, Logger, LuaLSError, METADATA_FILENAME, NanosLintError, RAW_ANNOTATIONS_URL, VALID_LUALS_DIAGNOSTIC_CODES, cleanCache, cleanupOldCachedLuaLSVersions, collectIgnorePatterns, countCheckedFiles, createProgram, downloadAndCacheAnnotations, downloadAndExtractLuaLS, escapePowerShellSingleQuote, fetchLatestCommitId, fetchLatestLuaLSVersionFromGitHub, fetchRawAnnotationsContent, fileUriToPath, findExistingLuaLSDir, formatBytes, formatCacheStatusPretty, formatGitHubAnnotations, formatPretty, formatProblemSummary, formatReport, formatSeverityBadge, getAnnotationsCacheDir, getAnnotationsMetadataFilePath, getBaseLuaLSCacheDir, getCacheDir, getCacheStatus, getCachedAnnotationsFilePath, getColors, getDefaultAnnotationsPath, getDefaultTemplatePath, getDefinitionsDir, getDirectorySize, getIsoWeek, getLegacyCacheDir, getLuaLSMetadataPath, getPackageRoot, getPlatformInfo, getTodayDateString, initWorkspace, isAnnotationsValid, isBinaryValid, isDirectExecution, isValidLogLevel, listCachedLuaLSVersionDirs, listCachedLuaLSVersions, loadConfigFile, logger, mergeConfigs, parseJsonc, parseLogLevel, pluralize, readAnnotationsMetadata, readLuaLSMetadata, resolveAnnotations, resolveLatestLuaLSVersion, resolveLuaLSBinary, resolveLuaLSVersion, resolveWorkspaceConfig, runCLI, runLuaLSCheck, sanitizeLuaLSVersion, shouldEnableColor, stripJsonComments, stripTrailingSlashes, systemPaths, updateLastCheckedDate, writeLuaLSMetadata };
1
+ import { $ as getLuaLSMetadataPath, A as formatProblemSummary, At as loadConfigFile, B as DOWNLOAD_TIMEOUT_MS, Bt as NanosLintError, C as getCachedAnnotationsFilePath, Ct as sanitizeLuaLSVersion, D as updateLastCheckedDate, Dt as getDefinitionsDir, E as readAnnotationsMetadata, Et as getDefaultTemplatePath, F as shouldEnableColor, Ft as stripTrailingSlashes, G as limitDownloadStream, Gt as fileUriToPath, H as computeFileSha256, Ht as formatBytes, I as resolveLuaLSBinary, It as AnnotationsError, J as findExistingLuaLSDir, Jt as LOG_LEVEL_PRIORITY, K as LUALS_METADATA_FILENAME, Kt as DEFAULT_LOG_LEVEL, L as runLuaLSCheck, Lt as CacheError, M as formatSeverityBadge, Mt as parseJsonc, N as getColors, Nt as resolveWorkspaceConfig, O as formatGitHubAnnotations, Ot as getPackageRoot, P as pluralize, Pt as stripJsonComments, Q as getLegacyCacheDir, Qt as parseLogLevel, R as countCheckedFiles, Rt as ConfigError, S as getAnnotationsMetadataFilePath, St as resolveLuaLSVersion, T as isAnnotationsValid, Tt as getDefaultAnnotationsPath, U as downloadAndExtractLuaLS, Ut as getDirectorySize, V as MAX_ARCHIVE_SIZE_BYTES, Vt as cleanCache, W as isAllowedDownloadUrl, Wt as systemPaths, X as getCacheDir, Xt as isValidLogLevel, Y as getBaseLuaLSCacheDir, Yt as Logger, Z as getIsoWeek, Zt as logger, _ as MAX_ANNOTATIONS_SIZE_BYTES, _t as getPlatformInfo, a as formatCacheStatusPretty, at as MAX_DECOMPRESSED_SIZE_BYTES, b as MIN_ANNOTATIONS_SIZE_BYTES, bt as fetchLatestLuaLSVersionFromGitHub, c as DOCGEN_BRANCH, ct as escapePowerShellSingleQuote, d as RAW_ANNOTATIONS_URL, dt as isBinaryRunnable, et as listCachedLuaLSVersionDirs, f as downloadAndCacheAnnotations, ft as isBinaryValid, g as ANNOTATIONS_FILENAME, gt as validateArchiveMembers, h as getRawAnnotationsUrl, ht as parseTarTvSize, i as runCLI, it as MAX_ARCHIVE_MEMBER_COUNT, j as formatReport, jt as mergeConfigs, k as formatPretty, kt as initWorkspace, l as DOCGEN_REPO, lt as getTarBinary, m as fetchRawAnnotationsContent, mt as isZipArchive, n as createProgram, nt as readLuaLSMetadata, o as getCacheStatus, ot as MIN_DOWNLOADED_BINARY_SIZE_BYTES, p as fetchLatestCommitId, pt as isGzipArchive, q as cleanupOldCachedLuaLSVersions, qt as LOG_LEVELS, r as isDirectExecution, rt as writeLuaLSMetadata, s as resolveAnnotations, st as assertValidLuaLSBinary, t as collectIgnorePatterns, tt as listCachedLuaLSVersions, u as GITHUB_COMMITS_API, ut as inspectZipMembers, v as MAX_COMMIT_JSON_SIZE_BYTES, vt as DEFAULT_LUALS_VERSION, w as getTodayDateString, wt as VALID_LUALS_DIAGNOSTIC_CODES, x as getAnnotationsCacheDir, xt as resolveLatestLuaLSVersion, y as METADATA_FILENAME, yt as FALLBACK_LUALS_VERSION, z as ALLOWED_DOWNLOAD_DOMAINS, zt as LuaLSError } from "./cli-BTHx4yp_.js";
2
+ export { ALLOWED_DOWNLOAD_DOMAINS, ANNOTATIONS_FILENAME, AnnotationsError, CacheError, ConfigError, DEFAULT_LOG_LEVEL, DEFAULT_LUALS_VERSION, DOCGEN_BRANCH, DOCGEN_REPO, DOWNLOAD_TIMEOUT_MS, FALLBACK_LUALS_VERSION, GITHUB_COMMITS_API, LOG_LEVELS, LOG_LEVEL_PRIORITY, LUALS_METADATA_FILENAME, Logger, LuaLSError, MAX_ANNOTATIONS_SIZE_BYTES, MAX_ARCHIVE_MEMBER_COUNT, MAX_ARCHIVE_SIZE_BYTES, MAX_COMMIT_JSON_SIZE_BYTES, MAX_DECOMPRESSED_SIZE_BYTES, METADATA_FILENAME, MIN_ANNOTATIONS_SIZE_BYTES, MIN_DOWNLOADED_BINARY_SIZE_BYTES, NanosLintError, RAW_ANNOTATIONS_URL, VALID_LUALS_DIAGNOSTIC_CODES, assertValidLuaLSBinary, cleanCache, cleanupOldCachedLuaLSVersions, collectIgnorePatterns, computeFileSha256, countCheckedFiles, createProgram, downloadAndCacheAnnotations, downloadAndExtractLuaLS, escapePowerShellSingleQuote, fetchLatestCommitId, fetchLatestLuaLSVersionFromGitHub, fetchRawAnnotationsContent, fileUriToPath, findExistingLuaLSDir, formatBytes, formatCacheStatusPretty, formatGitHubAnnotations, formatPretty, formatProblemSummary, formatReport, formatSeverityBadge, getAnnotationsCacheDir, getAnnotationsMetadataFilePath, getBaseLuaLSCacheDir, getCacheDir, getCacheStatus, getCachedAnnotationsFilePath, getColors, getDefaultAnnotationsPath, getDefaultTemplatePath, getDefinitionsDir, getDirectorySize, getIsoWeek, getLegacyCacheDir, getLuaLSMetadataPath, getPackageRoot, getPlatformInfo, getRawAnnotationsUrl, getTarBinary, getTodayDateString, initWorkspace, inspectZipMembers, isAllowedDownloadUrl, isAnnotationsValid, isBinaryRunnable, isBinaryValid, isDirectExecution, isGzipArchive, isValidLogLevel, isZipArchive, limitDownloadStream, listCachedLuaLSVersionDirs, listCachedLuaLSVersions, loadConfigFile, logger, mergeConfigs, parseJsonc, parseLogLevel, parseTarTvSize, pluralize, readAnnotationsMetadata, readLuaLSMetadata, resolveAnnotations, resolveLatestLuaLSVersion, resolveLuaLSBinary, resolveLuaLSVersion, resolveWorkspaceConfig, runCLI, runLuaLSCheck, sanitizeLuaLSVersion, shouldEnableColor, stripJsonComments, stripTrailingSlashes, systemPaths, updateLastCheckedDate, validateArchiveMembers, writeLuaLSMetadata };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nanos-lint",
3
- "version": "2.8.0",
3
+ "version": "2.8.2",
4
4
  "description": "Linter and type-checker for nanos world Lua scripts powered by LuaLS",
5
5
  "keywords": [
6
6
  "nanos-world",
@@ -38,11 +38,18 @@
38
38
  "scripts": {
39
39
  "build": "tsdown",
40
40
  "typecheck": "tsc --noEmit",
41
- "lint": "eslint \"src/**/*.ts\" \"tests/**/*.ts\" --max-warnings=0",
42
- "lint:fix": "eslint \"src/**/*.ts\" \"tests/**/*.ts\" --fix --max-warnings=0",
41
+ "format:check": "prettier --check .",
42
+ "format:fix": "prettier --write .",
43
+ "lint": "eslint \"src/**/*.ts\" \"tests/**/*.ts\" \"scripts/**/*.ts\" --max-warnings=0",
44
+ "lint:fix": "eslint \"src/**/*.ts\" \"tests/**/*.ts\" \"scripts/**/*.ts\" --fix --max-warnings=0",
45
+ "lint:deps": "depcruise --config .dependency-cruiser.cjs src tests",
46
+ "lint:comments": "tsx scripts/lint-comments.ts",
47
+ "lint:docstrings": "tsx scripts/lint-docstrings.ts",
43
48
  "test": "vitest run",
44
49
  "test:watch": "vitest",
45
50
  "test:coverage": "vitest run --coverage",
51
+ "gates": "npm run format:check && npm run lint && npm run lint:deps && npm run lint:comments && npm run lint:docstrings && npm run typecheck && npm run build && npm run test:coverage",
52
+ "check:all": "npm run gates",
46
53
  "prepare": "node -e \"try { require('node:child_process').execSync('git config core.hooksPath .githooks'); } catch {}\""
47
54
  },
48
55
  "devDependencies": {
@@ -52,9 +59,13 @@
52
59
  "@typescript-eslint/parser": "^8.70.1",
53
60
  "@vitest/coverage-v8": "^5.0.1",
54
61
  "commander": "^15.0.0",
62
+ "dependency-cruiser": "^18.4.0",
55
63
  "env-paths": "^4.0.0",
56
64
  "eslint": "^10.11.0",
65
+ "eslint-config-prettier": "^10.1.8",
66
+ "glob": "^13.0.6",
57
67
  "jsonc-parser": "^3.3.1",
68
+ "prettier": "^3.9.9",
58
69
  "tsdown": "^0.23.0",
59
70
  "tsx": "^4.23.15",
60
71
  "typescript": "^6.0.3",
@@ -2,12 +2,7 @@
2
2
  "$schema": "https://raw.githubusercontent.com/LuaLS/vscode-lua/master/setting/schema.json",
3
3
  "runtime": {
4
4
  "version": "Lua 5.4",
5
- "path": [
6
- "?.lua",
7
- "Shared/?.lua",
8
- "Client/?.lua",
9
- "Server/?.lua"
10
- ],
5
+ "path": ["?.lua", "Shared/?.lua", "Client/?.lua", "Server/?.lua"],
11
6
  "special": {
12
7
  "Package.Require": "require"
13
8
  }
@@ -30,9 +25,7 @@
30
25
  "library": []
31
26
  },
32
27
  "files": {
33
- "exclude": [
34
- ".nanos-lint/**"
35
- ]
28
+ "exclude": [".nanos-lint/**"]
36
29
  },
37
30
  "diagnostics": {
38
31
  "enable": true,