cspell 9.6.4 → 9.7.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.
@@ -1,3 +1,4 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
1
2
  let _cspell_cspell_types = require("@cspell/cspell-types");
2
3
 
3
4
  Object.defineProperty(exports, 'defineConfig', {
package/dist/esm/app.js CHANGED
@@ -1,4 +1,5 @@
1
- import { C as ApplicationError, S as width, T as console, _ as padLeft, a as parseApplicationFeatureFlags, b as pruneAnsiTextEnd, c as listDictionaries, d as validateUnitSize, f as unindent, g as tableToLines, i as lint, l as ReportChoicesAll, m as npmPackage, n as checkText, o as suggestions, p as DEFAULT_CACHE_LOCATION, r as createInit, s as trace, t as IncludeExcludeFlag, u as cvtLinterCliCommandOptionsToLinterCliOptions, v as padWidth, w as CheckFailed, x as pruneAnsiTextStart, y as ansiWidth } from "./application-DYABxs7R.js";
1
+ import { A as width, D as ansiWidth, E as padWidth, M as CheckFailed, N as console, O as pruneAnsiTextEnd, T as padLeft, i as cvtLinterCliCommandOptionsToLinterCliOptions, j as ApplicationError, k as pruneAnsiTextStart, l as validateUnitSize, p as DEFAULT_CACHE_LOCATION, r as ReportChoicesAll, t as listDictionaries, u as unindent, v as npmPackage, w as tableToLines } from "./listDictionaries-DRQ2BGn_.js";
2
+ import { IncludeExcludeFlag, checkText, createInit, lint, parseApplicationFeatureFlags, suggestions, trace } from "./application.js";
2
3
  import { Link } from "cspell-lib";
3
4
  import chalk from "chalk";
4
5
  import * as iPath from "node:path";
@@ -1,3 +1,17 @@
1
- import "./options-CeDseSxu.js";
2
- import { a as checkText, c as parseApplicationFeatureFlags, d as listDictionaries, i as TraceResult, l as suggestions, n as CheckTextResult, o as createInit, r as IncludeExcludeFlag, s as lint, t as AppError, u as trace } from "./application-i4vvz7Jf.js";
3
- export { AppError, CheckTextResult, IncludeExcludeFlag, TraceResult, checkText, createInit, lint, listDictionaries, parseApplicationFeatureFlags, suggestions, trace };
1
+ import { a as SuggestionOptions, i as LinterCliOptions, o as TraceOptions, r as LegacyOptions, t as BaseOptions } from "./options-CeDseSxu.js";
2
+ import { n as TimedSuggestionsForWordResult, r as InitOptions, t as listDictionaries } from "./index-BObT-HkR.js";
3
+ import { CheckTextInfo, FeatureFlags, IncludeExcludeFlag, TraceResult, TraceWordResult } from "cspell-lib";
4
+ import { CSpellReporter, RunResult } from "@cspell/cspell-types";
5
+
6
+ //#region src/application.d.mts
7
+ type AppError = NodeJS.ErrnoException;
8
+ declare function lint(fileGlobs: string[], options: LinterCliOptions, reporter?: CSpellReporter): Promise<RunResult>;
9
+ declare function trace(words: string[], options: TraceOptions): AsyncIterableIterator<TraceWordResult>;
10
+ type CheckTextResult = CheckTextInfo;
11
+ declare function checkText(filename: string, options: BaseOptions & LegacyOptions): Promise<CheckTextResult>;
12
+ declare function suggestions(words: string[], options: SuggestionOptions): AsyncIterable<TimedSuggestionsForWordResult>;
13
+ declare function createInit(options: InitOptions): Promise<void>;
14
+ declare function parseApplicationFeatureFlags(flags: string[] | undefined): FeatureFlags;
15
+ //#endregion
16
+ export { AppError, CheckTextResult, IncludeExcludeFlag, type TraceResult, checkText, createInit, lint, listDictionaries, parseApplicationFeatureFlags, suggestions, trace };
17
+ //# sourceMappingURL=application.d.ts.map
@@ -1,3 +1,97 @@
1
- import { a as parseApplicationFeatureFlags, c as listDictionaries, i as lint, n as checkText, o as suggestions, r as createInit, s as trace, t as IncludeExcludeFlag } from "./application-DYABxs7R.js";
1
+ import { C as clean, N as console, S as getReporter, _ as finalizeReporter, a as fixLegacy, b as parseFeatureFlags, c as runLint, d as getTimeMeasurer, f as readConfig, g as readStdin, h as readFileInfo, m as fileInfoToDocument, n as simpleRepl, o as LintRequest, s as extractUnknownWordsConfig, t as listDictionaries, x as configInit, y as getFeatureFlags } from "./listDictionaries-DRQ2BGn_.js";
2
+ import { opMap, opTap, pipeAsync, toAsyncIterable } from "@cspell/cspell-pipe";
3
+ import { IncludeExcludeFlag, SuggestionError, checkTextDocument, getDefaultSettings, getGlobalSettingsAsync, mergeSettings, suggestionsForWords, traceWordsAsync } from "cspell-lib";
2
4
 
3
- export { IncludeExcludeFlag, checkText, createInit, lint, listDictionaries, parseApplicationFeatureFlags, suggestions, trace };
5
+ //#region src/application.mts
6
+ function lint(fileGlobs, options, reporter) {
7
+ options = fixLegacy(options);
8
+ const unknownWordsConfig = extractUnknownWordsConfig(options);
9
+ const useOptions = {
10
+ ...options,
11
+ ...unknownWordsConfig
12
+ };
13
+ const reporterOptions = {
14
+ ...useOptions,
15
+ console
16
+ };
17
+ return runLint(new LintRequest(fileGlobs, useOptions, finalizeReporter(reporter) ?? getReporter({
18
+ ...useOptions,
19
+ fileGlobs
20
+ }, reporterOptions)));
21
+ }
22
+ async function* trace(words, options) {
23
+ options = fixLegacy(options);
24
+ const iWords = options.stdin ? toAsyncIterable(words, readStdin()) : words;
25
+ const { languageId, locale, allowCompoundWords, ignoreCase } = options;
26
+ const configFile = await readConfig(options.config, void 0);
27
+ const loadDefault = options.defaultConfiguration ?? configFile.config.loadDefaultConfiguration ?? true;
28
+ const additionalSettings = {};
29
+ if (options.dictionary) additionalSettings.dictionaries = options.dictionary;
30
+ yield* traceWordsAsync(iWords, mergeSettings(await getDefaultSettings(loadDefault), await getGlobalSettingsAsync(), configFile.config, additionalSettings), clean({
31
+ languageId,
32
+ locale,
33
+ ignoreCase,
34
+ allowCompoundWords
35
+ }));
36
+ }
37
+ async function checkText(filename, options) {
38
+ options = fixLegacy(options);
39
+ const fileInfo = await readFileInfo(filename);
40
+ const { locale, languageId, validateDirectives } = options;
41
+ const doc = fileInfoToDocument(fileInfo, languageId, locale);
42
+ const checkOptions = {
43
+ configFile: options.config,
44
+ validateDirectives
45
+ };
46
+ const settingsFromCommandLine = clean({
47
+ languageId,
48
+ language: locale,
49
+ loadDefaultConfiguration: options.defaultConfiguration
50
+ });
51
+ return checkTextDocument(doc, clean({ ...checkOptions }), settingsFromCommandLine);
52
+ }
53
+ async function* suggestions(words, options) {
54
+ options = fixLegacy(options);
55
+ const configFile = await readConfig(options.config, void 0);
56
+ let timer;
57
+ function tapStart() {
58
+ timer = getTimeMeasurer();
59
+ }
60
+ function mapStart(v) {
61
+ tapStart();
62
+ return v;
63
+ }
64
+ function mapEnd(v) {
65
+ const elapsedTimeMs = timer?.();
66
+ return elapsedTimeMs ? {
67
+ ...v,
68
+ elapsedTimeMs
69
+ } : v;
70
+ }
71
+ const iWords = options.repl ? pipeAsync(toAsyncIterable(words, simpleRepl()), opTap(tapStart)) : options.useStdin ? pipeAsync(toAsyncIterable(words, readStdin()), opTap(tapStart)) : words.map(mapStart);
72
+ try {
73
+ yield* pipeAsync(suggestionsForWords(iWords, clean({ ...options }), configFile.config), opMap(mapEnd));
74
+ } catch (e) {
75
+ if (!(e instanceof SuggestionError)) throw e;
76
+ console.error(e.message);
77
+ process.exitCode = 1;
78
+ }
79
+ }
80
+ function createInit(options) {
81
+ return configInit(options);
82
+ }
83
+ function registerApplicationFeatureFlags() {
84
+ const ff = getFeatureFlags();
85
+ [{
86
+ name: "timer",
87
+ description: "Display elapsed time for command."
88
+ }].forEach((flag) => ff.register(flag));
89
+ return ff;
90
+ }
91
+ function parseApplicationFeatureFlags(flags) {
92
+ return parseFeatureFlags(flags, registerApplicationFeatureFlags());
93
+ }
94
+
95
+ //#endregion
96
+ export { IncludeExcludeFlag, checkText, createInit, lint, listDictionaries, parseApplicationFeatureFlags, suggestions, trace };
97
+ //# sourceMappingURL=application.js.map
@@ -1,6 +1,5 @@
1
- import { a as SuggestionOptions, i as LinterCliOptions, n as DictionariesOptions, o as TraceOptions, r as LegacyOptions, t as BaseOptions } from "./options-CeDseSxu.js";
2
- import { CheckTextInfo, FeatureFlags, IncludeExcludeFlag, SuggestionsForWordResult, TraceResult, TraceWordResult } from "cspell-lib";
3
- import { CSpellReporter, RunResult } from "@cspell/cspell-types";
1
+ import { n as DictionariesOptions } from "./options-CeDseSxu.js";
2
+ import { SuggestionsForWordResult } from "cspell-lib";
4
3
 
5
4
  //#region src/config/options.d.ts
6
5
  interface BaseConfigOptions {
@@ -106,15 +105,5 @@ interface ListDictionariesResult {
106
105
  }
107
106
  declare function listDictionaries(options: DictionariesOptions): Promise<ListDictionariesResult[]>;
108
107
  //#endregion
109
- //#region src/application.d.mts
110
- type AppError = NodeJS.ErrnoException;
111
- declare function lint(fileGlobs: string[], options: LinterCliOptions, reporter?: CSpellReporter): Promise<RunResult>;
112
- declare function trace(words: string[], options: TraceOptions): AsyncIterableIterator<TraceWordResult>;
113
- type CheckTextResult = CheckTextInfo;
114
- declare function checkText(filename: string, options: BaseOptions & LegacyOptions): Promise<CheckTextResult>;
115
- declare function suggestions(words: string[], options: SuggestionOptions): AsyncIterable<TimedSuggestionsForWordResult>;
116
- declare function createInit(options: InitOptions): Promise<void>;
117
- declare function parseApplicationFeatureFlags(flags: string[] | undefined): FeatureFlags;
118
- //#endregion
119
- export { checkText as a, parseApplicationFeatureFlags as c, listDictionaries as d, TraceResult as i, suggestions as l, CheckTextResult as n, createInit as o, IncludeExcludeFlag as r, lint as s, AppError as t, trace as u };
120
- //# sourceMappingURL=application-i4vvz7Jf.d.ts.map
108
+ export { TimedSuggestionsForWordResult as n, InitOptions as r, listDictionaries as t };
109
+ //# sourceMappingURL=index-BObT-HkR.d.ts.map
@@ -1,5 +1,6 @@
1
1
  import { i as LinterCliOptions, o as TraceOptions, s as FinalizedReporter, t as BaseOptions } from "./options-CeDseSxu.js";
2
- import { a as checkText, c as parseApplicationFeatureFlags, d as listDictionaries, i as TraceResult, l as suggestions, n as CheckTextResult, o as createInit, r as IncludeExcludeFlag, s as lint, t as AppError, u as trace } from "./application-i4vvz7Jf.js";
2
+ import { t as listDictionaries } from "./index-BObT-HkR.js";
3
+ import { AppError, CheckTextResult, IncludeExcludeFlag, TraceResult, checkText, createInit, lint, parseApplicationFeatureFlags, suggestions, trace } from "./application.js";
3
4
  import "chalk";
4
5
  import { CSpellReporter, ReporterConfiguration } from "@cspell/cspell-types";
5
6
  import { WriteStream } from "node:tty";
package/dist/esm/index.js CHANGED
@@ -1,4 +1,5 @@
1
- import { a as parseApplicationFeatureFlags, c as listDictionaries, h as getReporter, i as lint, n as checkText, o as suggestions, r as createInit, s as trace, t as IncludeExcludeFlag } from "./application-DYABxs7R.js";
1
+ import { S as getReporter, t as listDictionaries } from "./listDictionaries-DRQ2BGn_.js";
2
+ import { IncludeExcludeFlag, checkText, createInit, lint, parseApplicationFeatureFlags, suggestions, trace } from "./application.js";
2
3
 
3
4
  export * from "@cspell/cspell-types"
4
5
 
@@ -1,7 +1,7 @@
1
1
  import { createRequire } from "node:module";
2
- import { isAsyncIterable, opFilter, opMap, opTap, operators, pipeAsync, pipeAsync as asyncPipe, toAsyncIterable, toAsyncIterable as mergeAsyncIterables } from "@cspell/cspell-pipe";
2
+ import { isAsyncIterable, opFilter, operators, pipeAsync, pipeAsync as asyncPipe, toAsyncIterable as mergeAsyncIterables } from "@cspell/cspell-pipe";
3
3
  import * as cspell from "cspell-lib";
4
- import { ENV_CSPELL_GLOB_ROOT, IncludeExcludeFlag, MessageTypes, SuggestionError, Text, checkTextDocument, combineTextAndLanguageSettings, createDictionaryReferenceCollection, createPerfTimer, extractDependencies, extractImportErrors, fileToDocument, getDefaultSettings, getGlobalSettingsAsync, getSystemFeatureFlags, isBinaryFile, isSpellingDictionaryLoadError, mergeSettings, setLogger, shouldCheckDocument, spellCheckDocument, suggestionsForWords, traceWordsAsync } from "cspell-lib";
4
+ import { ENV_CSPELL_GLOB_ROOT, MessageTypes, Text, combineTextAndLanguageSettings, createDictionaryReferenceCollection, createPerfTimer, extractDependencies, extractImportErrors, fileToDocument, getDefaultSettings, getGlobalSettingsAsync, getSystemFeatureFlags, isBinaryFile, isSpellingDictionaryLoadError, mergeSettings, setLogger, shouldCheckDocument, spellCheckDocument } from "cspell-lib";
5
5
  import assert from "node:assert";
6
6
  import { format, formatWithOptions, stripVTControlCharacters } from "node:util";
7
7
  import { isUrlLike, toFileDirURL, toFilePathOrHref, toFileURL, urlRelative } from "@cspell/url";
@@ -1201,7 +1201,7 @@ const pkgDir = _dirname;
1201
1201
  //#endregion
1202
1202
  //#region src/pkgInfo.ts
1203
1203
  const name = "cspell";
1204
- const version$1 = "9.6.4";
1204
+ const version$1 = "9.7.0";
1205
1205
  const engines = { node: ">=20.18" };
1206
1206
  const npmPackage = {
1207
1207
  name,
@@ -2831,7 +2831,7 @@ function runResult(init = {}) {
2831
2831
  }
2832
2832
 
2833
2833
  //#endregion
2834
- //#region \0@oxc-project+runtime@0.110.0/helpers/usingCtx.js
2834
+ //#region \0@oxc-project+runtime@0.112.0/helpers/usingCtx.js
2835
2835
  function _usingCtx() {
2836
2836
  var r = "function" == typeof SuppressedError ? SuppressedError : function(r, e) {
2837
2837
  var n = Error();
@@ -3401,96 +3401,5 @@ async function listDictionaries(options) {
3401
3401
  }
3402
3402
 
3403
3403
  //#endregion
3404
- //#region src/application.mts
3405
- function lint(fileGlobs, options, reporter) {
3406
- options = fixLegacy(options);
3407
- const unknownWordsConfig = extractUnknownWordsConfig(options);
3408
- const useOptions = {
3409
- ...options,
3410
- ...unknownWordsConfig
3411
- };
3412
- const reporterOptions = {
3413
- ...useOptions,
3414
- console
3415
- };
3416
- return runLint(new LintRequest(fileGlobs, useOptions, finalizeReporter(reporter) ?? getReporter({
3417
- ...useOptions,
3418
- fileGlobs
3419
- }, reporterOptions)));
3420
- }
3421
- async function* trace(words, options) {
3422
- options = fixLegacy(options);
3423
- const iWords = options.stdin ? toAsyncIterable(words, readStdin()) : words;
3424
- const { languageId, locale, allowCompoundWords, ignoreCase } = options;
3425
- const configFile = await readConfig(options.config, void 0);
3426
- const loadDefault = options.defaultConfiguration ?? configFile.config.loadDefaultConfiguration ?? true;
3427
- const additionalSettings = {};
3428
- if (options.dictionary) additionalSettings.dictionaries = options.dictionary;
3429
- yield* traceWordsAsync(iWords, mergeSettings(await getDefaultSettings(loadDefault), await getGlobalSettingsAsync(), configFile.config, additionalSettings), clean({
3430
- languageId,
3431
- locale,
3432
- ignoreCase,
3433
- allowCompoundWords
3434
- }));
3435
- }
3436
- async function checkText(filename, options) {
3437
- options = fixLegacy(options);
3438
- const fileInfo = await readFileInfo(filename);
3439
- const { locale, languageId, validateDirectives } = options;
3440
- const doc = fileInfoToDocument(fileInfo, languageId, locale);
3441
- const checkOptions = {
3442
- configFile: options.config,
3443
- validateDirectives
3444
- };
3445
- const settingsFromCommandLine = clean({
3446
- languageId,
3447
- language: locale,
3448
- loadDefaultConfiguration: options.defaultConfiguration
3449
- });
3450
- return checkTextDocument(doc, clean({ ...checkOptions }), settingsFromCommandLine);
3451
- }
3452
- async function* suggestions(words, options) {
3453
- options = fixLegacy(options);
3454
- const configFile = await readConfig(options.config, void 0);
3455
- let timer;
3456
- function tapStart() {
3457
- timer = getTimeMeasurer();
3458
- }
3459
- function mapStart(v) {
3460
- tapStart();
3461
- return v;
3462
- }
3463
- function mapEnd(v) {
3464
- const elapsedTimeMs = timer?.();
3465
- return elapsedTimeMs ? {
3466
- ...v,
3467
- elapsedTimeMs
3468
- } : v;
3469
- }
3470
- const iWords = options.repl ? pipeAsync(toAsyncIterable(words, simpleRepl()), opTap(tapStart)) : options.useStdin ? pipeAsync(toAsyncIterable(words, readStdin()), opTap(tapStart)) : words.map(mapStart);
3471
- try {
3472
- yield* pipeAsync(suggestionsForWords(iWords, clean({ ...options }), configFile.config), opMap(mapEnd));
3473
- } catch (e) {
3474
- if (!(e instanceof SuggestionError)) throw e;
3475
- console.error(e.message);
3476
- process.exitCode = 1;
3477
- }
3478
- }
3479
- function createInit(options) {
3480
- return configInit(options);
3481
- }
3482
- function registerApplicationFeatureFlags() {
3483
- const ff = getFeatureFlags();
3484
- [{
3485
- name: "timer",
3486
- description: "Display elapsed time for command."
3487
- }].forEach((flag) => ff.register(flag));
3488
- return ff;
3489
- }
3490
- function parseApplicationFeatureFlags(flags) {
3491
- return parseFeatureFlags(flags, registerApplicationFeatureFlags());
3492
- }
3493
-
3494
- //#endregion
3495
- export { ApplicationError as C, width as S, console as T, padLeft as _, parseApplicationFeatureFlags as a, pruneAnsiTextEnd as b, listDictionaries as c, validateUnitSize as d, unindent as f, tableToLines as g, getReporter as h, lint as i, ReportChoicesAll as l, npmPackage as m, checkText as n, suggestions as o, DEFAULT_CACHE_LOCATION as p, createInit as r, trace as s, IncludeExcludeFlag as t, cvtLinterCliCommandOptionsToLinterCliOptions as u, padWidth as v, CheckFailed as w, pruneAnsiTextStart as x, ansiWidth as y };
3496
- //# sourceMappingURL=application-DYABxs7R.js.map
3404
+ export { width as A, clean as C, ansiWidth as D, padWidth as E, CheckFailed as M, console as N, pruneAnsiTextEnd as O, getReporter as S, padLeft as T, finalizeReporter as _, fixLegacy as a, parseFeatureFlags as b, runLint as c, getTimeMeasurer as d, readConfig as f, readStdin as g, readFileInfo as h, cvtLinterCliCommandOptionsToLinterCliOptions as i, ApplicationError as j, pruneAnsiTextStart as k, validateUnitSize as l, fileInfoToDocument as m, simpleRepl as n, LintRequest as o, DEFAULT_CACHE_LOCATION as p, ReportChoicesAll as r, extractUnknownWordsConfig as s, listDictionaries as t, unindent as u, npmPackage as v, tableToLines as w, configInit as x, getFeatureFlags as y };
3405
+ //# sourceMappingURL=listDictionaries-DRQ2BGn_.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cspell",
3
- "version": "9.6.4",
3
+ "version": "9.7.0",
4
4
  "description": "A Spelling Checker for Code!",
5
5
  "funding": "https://github.com/streetsidesoftware/cspell?sponsor=1",
6
6
  "bin": {
@@ -86,26 +86,26 @@
86
86
  },
87
87
  "homepage": "https://cspell.org/",
88
88
  "dependencies": {
89
- "@cspell/cspell-json-reporter": "9.6.4",
90
- "@cspell/cspell-performance-monitor": "9.6.4",
91
- "@cspell/cspell-pipe": "9.6.4",
92
- "@cspell/cspell-types": "9.6.4",
93
- "@cspell/cspell-worker": "9.6.4",
94
- "@cspell/dynamic-import": "9.6.4",
95
- "@cspell/url": "9.6.4",
89
+ "@cspell/cspell-json-reporter": "9.7.0",
90
+ "@cspell/cspell-performance-monitor": "9.7.0",
91
+ "@cspell/cspell-pipe": "9.7.0",
92
+ "@cspell/cspell-types": "9.7.0",
93
+ "@cspell/cspell-worker": "9.7.0",
94
+ "@cspell/dynamic-import": "9.7.0",
95
+ "@cspell/url": "9.7.0",
96
96
  "ansi-regex": "^6.2.2",
97
97
  "chalk": "^5.6.2",
98
98
  "chalk-template": "^1.1.2",
99
99
  "commander": "^14.0.3",
100
- "cspell-config-lib": "9.6.4",
101
- "cspell-dictionary": "9.6.4",
102
- "cspell-gitignore": "9.6.4",
103
- "cspell-glob": "9.6.4",
104
- "cspell-io": "9.6.4",
105
- "cspell-lib": "9.6.4",
100
+ "cspell-config-lib": "9.7.0",
101
+ "cspell-dictionary": "9.7.0",
102
+ "cspell-gitignore": "9.7.0",
103
+ "cspell-glob": "9.7.0",
104
+ "cspell-io": "9.7.0",
105
+ "cspell-lib": "9.7.0",
106
106
  "fast-json-stable-stringify": "^2.1.0",
107
107
  "flatted": "^3.3.3",
108
- "semver": "^7.7.3",
108
+ "semver": "^7.7.4",
109
109
  "tinyglobby": "^0.2.15"
110
110
  },
111
111
  "engines": {
@@ -115,7 +115,7 @@
115
115
  "@types/micromatch": "^4.0.10",
116
116
  "@types/semver": "^7.7.1",
117
117
  "micromatch": "^4.0.8",
118
- "minimatch": "^9.0.5"
118
+ "minimatch": "^9.0.6"
119
119
  },
120
- "gitHead": "e126c7f5708d4258ada35ba1d29d18952d7f0886"
120
+ "gitHead": "48f64e0bd95b39011af6dc80cd8ae4d519511f73"
121
121
  }