cspell-lib 9.1.5 → 9.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.
package/dist/api.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ export * from './lib/index.js';
2
+ //# sourceMappingURL=api.d.ts.map
package/dist/api.js ADDED
@@ -0,0 +1,2 @@
1
+ export * from './lib/index.js';
2
+ //# sourceMappingURL=api.js.map
@@ -1,2 +1,3 @@
1
- export { FeatureFlag, FeatureFlags, getSystemFeatureFlags, UnknownFeatureFlagError } from './FeatureFlags.js';
1
+ export type { FeatureFlag } from './FeatureFlags.js';
2
+ export { FeatureFlags, getSystemFeatureFlags, UnknownFeatureFlagError } from './FeatureFlags.js';
2
3
  //# sourceMappingURL=index.d.ts.map
@@ -1,7 +1,7 @@
1
- import type { CSpellUserSettings, ImportFileRef } from '@cspell/cspell-types';
1
+ import type { CSpellSettings, CSpellUserSettings, ImportFileRef } from '@cspell/cspell-types';
2
2
  import { CSpellConfigFile, CSpellConfigFileReaderWriter, ICSpellConfigFile } from 'cspell-config-lib';
3
3
  import type { VFileSystem } from '../../../fileSystem.js';
4
- import { AutoResolveCache } from '../../../util/AutoResolve.js';
4
+ import { AutoResolveCache, CacheStats } from '../../../util/AutoResolve.js';
5
5
  import { FileResolver } from '../../../util/resolveFile.js';
6
6
  import type { LoaderResult } from '../pnpLoader.js';
7
7
  import { ConfigSearch } from './configSearch.js';
@@ -111,7 +111,7 @@ export declare class ConfigLoader implements IConfigLoader {
111
111
  protected cachedConfigFiles: Map<string, CSpellConfigFile>;
112
112
  protected cachedPendingConfigFile: AutoResolveCache<string, Promise<Error | CSpellConfigFile>>;
113
113
  protected cachedMergedConfig: WeakMap<CSpellConfigFile, CacheMergeConfigFileWithImports>;
114
- protected cachedCSpellConfigFileInMemory: WeakMap<import("@cspell/cspell-types").CSpellSettings, Map<string, CSpellConfigFile>>;
114
+ protected cachedCSpellConfigFileInMemory: WeakMap<CSpellSettings, Map<string, CSpellConfigFile>>;
115
115
  protected globalSettings: CSpellSettingsI | undefined;
116
116
  protected cspellConfigFileReaderWriter: CSpellConfigFileReaderWriter;
117
117
  protected configSearch: ConfigSearch;
@@ -156,8 +156,8 @@ export declare class ConfigLoader implements IConfigLoader {
156
156
  toCSpellConfigFile(cfg: ICSpellConfigFile): CSpellConfigFile;
157
157
  dispose(): void;
158
158
  getStats(): {
159
- cacheMergeListUnique: Readonly<import("../../../util/AutoResolve.js").CacheStats>;
160
- cacheMergeLists: Readonly<import("../../../util/AutoResolve.js").CacheStats>;
159
+ cacheMergeListUnique: Readonly<CacheStats>;
160
+ cacheMergeLists: Readonly<CacheStats>;
161
161
  };
162
162
  resolveConfigFileLocation(filenameOrURL: string | URL, relativeTo: string | URL): Promise<URL | undefined>;
163
163
  private resolveFilename;
@@ -175,8 +175,8 @@ export declare function createConfigLoader(fs?: VFileSystem): IConfigLoader;
175
175
  export declare function getDefaultConfigLoaderInternal(): ConfigLoaderInternal;
176
176
  export declare class ConfigurationLoaderError extends Error {
177
177
  readonly configurationFile?: string | undefined;
178
- readonly relativeTo?: (string | URL) | undefined;
179
- constructor(message: string, configurationFile?: string | undefined, relativeTo?: (string | URL) | undefined, cause?: unknown);
178
+ readonly relativeTo?: string | URL | undefined;
179
+ constructor(message: string, configurationFile?: string | undefined, relativeTo?: string | URL | undefined, cause?: unknown);
180
180
  }
181
181
  export declare class ConfigurationLoaderFailedToResolveError extends ConfigurationLoaderError {
182
182
  readonly configurationFile: string;
@@ -2,7 +2,7 @@ export { __testing__, ConfigLoader, createConfigLoader, defaultFileName, loadPnP
2
2
  export { defaultConfigFilenames } from './configLocations.js';
3
3
  export type { CSpellConfigFile, ICSpellConfigFile } from './defaultConfigLoader.js';
4
4
  export { clearCachedSettingsFiles, getCachedFileSize, getDefaultConfigLoader, getGlobalSettings, getGlobalSettingsAsync, loadConfig, readConfigFile, readRawSettings, resolveConfigFileImports, resolveSettingsImports, searchForConfig, } from './defaultConfigLoader.js';
5
- export { extractImportErrors, ImportFileRefWithError } from './extractImportErrors.js';
5
+ export { extractImportErrors, type ImportFileRefWithError } from './extractImportErrors.js';
6
6
  export { readSettings } from './readSettings.js';
7
7
  export { readSettingsFiles } from './readSettingsFiles.js';
8
8
  //# sourceMappingURL=index.d.ts.map
@@ -1,37 +1,12 @@
1
1
  import type { CSpellUserSettings, GlobDef, LanguageSetting } from '@cspell/cspell-types';
2
- import type { OptionalOrUndefined } from '../../../util/types.js';
2
+ import type { OptionalOrUndefined, RemoveUndefined } from '../../../util/types.js';
3
3
  interface NormalizableFields {
4
4
  version?: string | number;
5
5
  import?: string | string[];
6
6
  }
7
7
  export declare function normalizeRawConfig(config: CSpellUserSettings | NormalizableFields): void;
8
8
  type NormalizeDictionaryDefsParams = OptionalOrUndefined<Pick<CSpellUserSettings, 'dictionaryDefinitions' | 'languageSettings'>>;
9
- export declare function normalizeDictionaryDefs(settings: NormalizeDictionaryDefsParams, settingsFileUrl: URL): import("../../../util/types.js").RemoveUndefined<{
10
- dictionaryDefinitions: import("../../../Models/CSpellSettingsInternalDef.js").DictionaryDefinitionInternalWithSource[] | undefined;
11
- languageSettings: import("../../../util/types.js").RemoveUndefined<{
12
- dictionaryDefinitions: import("../../../Models/CSpellSettingsInternalDef.js").DictionaryDefinitionInternalWithSource[] | undefined;
13
- languageId: import("@cspell/cspell-types").MatchingFileType;
14
- locale?: import("@cspell/cspell-types").LocaleId | import("@cspell/cspell-types").LocaleId[];
15
- local?: import("@cspell/cspell-types").LocaleId | import("@cspell/cspell-types").LocaleId[];
16
- id?: string;
17
- name?: string;
18
- description?: string;
19
- enabled?: boolean;
20
- allowCompoundWords?: boolean;
21
- caseSensitive?: boolean;
22
- dictionaries?: import("@cspell/cspell-types").DictionaryReference[];
23
- noSuggestDictionaries?: import("@cspell/cspell-types").DictionaryReference[];
24
- ignoreRegExpList?: import("@cspell/cspell-types").RegExpPatternList;
25
- includeRegExpList?: import("@cspell/cspell-types").RegExpPatternList;
26
- patterns?: import("@cspell/cspell-types").RegExpPatternDefinition[];
27
- words?: string[];
28
- flagWords?: string[];
29
- ignoreWords?: string[];
30
- suggestWords?: string[];
31
- parser?: import("@cspell/cspell-types").ParserName;
32
- unknownWords?: import("@cspell/cspell-types").UnknownWordsChoices | undefined;
33
- }>[] | undefined;
34
- }>;
9
+ export declare function normalizeDictionaryDefs(settings: NormalizeDictionaryDefsParams, settingsFileUrl: URL): RemoveUndefined<NormalizeDictionaryDefsParams>;
35
10
  type NormalizeOverrides = Pick<CSpellUserSettings, 'globRoot' | 'overrides'>;
36
11
  type NormalizeOverridesResult = Pick<CSpellUserSettings, 'overrides'>;
37
12
  export declare function normalizeOverrides(settings: NormalizeOverrides, pathToSettingsFile: URL): NormalizeOverridesResult;
@@ -1,6 +1,6 @@
1
1
  export declare const configSettingsFileVersion0_1 = "0.1";
2
2
  export declare const configSettingsFileVersion0_2 = "0.2";
3
- export declare const currentSettingsFileVersion = "0.2";
3
+ export declare const currentSettingsFileVersion: typeof configSettingsFileVersion0_2;
4
4
  export declare const ENV_CSPELL_GLOB_ROOT = "CSPELL_GLOB_ROOT";
5
5
  export declare const defaultConfigFileModuleRef = "@cspell/cspell-bundled-dicts/cspell-default.json";
6
6
  //# sourceMappingURL=constants.d.ts.map
@@ -1,3 +1,4 @@
1
+ import { CacheStats } from '../util/AutoResolve.js';
1
2
  interface IDisposable {
2
3
  dispose(): void;
3
4
  }
@@ -8,7 +9,7 @@ export declare class CalcLeftRightResultWeakCache<TL extends object, TR extends
8
9
  get(left: TL, right: TR, calc: (left: TL, right: TR) => R): R;
9
10
  clear(): void;
10
11
  dispose(): void;
11
- stats(): Readonly<import("../util/AutoResolve.js").CacheStats>;
12
+ stats(): Readonly<CacheStats>;
12
13
  }
13
14
  export {};
14
15
  //# sourceMappingURL=mergeCache.d.ts.map
@@ -1,3 +1,4 @@
1
+ import { CacheStats } from '../util/AutoResolve.js';
1
2
  /**
2
3
  * Merges two lists and removes duplicates. Order is NOT preserved.
3
4
  */
@@ -16,7 +17,7 @@ export declare function mergeList<T>(left: undefined, right: T[]): T[];
16
17
  export declare function mergeList<T>(left: T[], right: undefined): T[];
17
18
  export declare function mergeList<T>(left: T[] | undefined, right: T[] | undefined): T[] | undefined;
18
19
  export declare function stats(): {
19
- cacheMergeListUnique: Readonly<import("../util/AutoResolve.js").CacheStats>;
20
- cacheMergeLists: Readonly<import("../util/AutoResolve.js").CacheStats>;
20
+ cacheMergeListUnique: Readonly<CacheStats>;
21
+ cacheMergeLists: Readonly<CacheStats>;
21
22
  };
22
23
  //# sourceMappingURL=mergeList.d.ts.map
@@ -1,8 +1,8 @@
1
- import type { TextEncoding, VFileSystemProvider } from 'cspell-io';
1
+ import type { TextEncoding, VFileSystem, VFileSystemProvider, VirtualFS } from 'cspell-io';
2
2
  export type { VFileSystemProvider, VfsDirEntry, VirtualFS } from 'cspell-io';
3
3
  export { FSCapabilityFlags, VFileSystem } from 'cspell-io';
4
- export declare function getVirtualFS(): import("cspell-io").VirtualFS;
5
- export declare function getFileSystem(): Required<import("cspell-io").VFileSystem>;
4
+ export declare function getVirtualFS(): VirtualFS;
5
+ export declare function getFileSystem(): Required<VFileSystem>;
6
6
  export declare function registerCSpell(fsp: VFileSystemProvider): void;
7
7
  export declare function readTextFile(url: URL, encoding?: TextEncoding): Promise<string>;
8
8
  //# sourceMappingURL=fileSystem.d.ts.map
@@ -1,9 +1,9 @@
1
1
  export { clearCachedFiles, clearCaches } from './clearCachedFiles.js';
2
2
  export type { Document } from './Document/index.js';
3
3
  export { fileToDocument, fileToTextDocument, isBinaryFile } from './Document/index.js';
4
- export { ExcludeFilesGlobMap, ExclusionFunction } from './exclusionHelper.js';
4
+ export type { ExcludeFilesGlobMap, ExclusionFunction } from './exclusionHelper.js';
5
5
  export * as ExclusionHelper from './exclusionHelper.js';
6
- export { FeatureFlag, FeatureFlags, getSystemFeatureFlags, UnknownFeatureFlagError } from './FeatureFlags/index.js';
6
+ export { type FeatureFlag, FeatureFlags, getSystemFeatureFlags, UnknownFeatureFlagError, } from './FeatureFlags/index.js';
7
7
  export type { VFileSystemProvider, VirtualFS } from './fileSystem.js';
8
8
  export { FSCapabilityFlags, getVirtualFS } from './fileSystem.js';
9
9
  export { getLanguagesForBasename as getLanguageIdsForBaseFilename, getLanguagesForExt } from './fileTypes.js';
@@ -17,17 +17,17 @@ export { calcOverrideSettings, checkFilenameMatchesGlob, createConfigLoader, cur
17
17
  export { defaultFileName as defaultSettingsFilename } from './Settings/index.js';
18
18
  export * as Link from './Settings/index.link.js';
19
19
  export { combineTextAndLanguageSettings, combineTextAndLanguageSettings as constructSettingsForText, } from './Settings/TextDocumentSettings.js';
20
- export { determineFinalDocumentSettings, DetermineFinalDocumentSettingsResult, spellCheckDocument, spellCheckFile, SpellCheckFileOptions, SpellCheckFilePerf, SpellCheckFileResult, } from './spellCheckFile.js';
21
- export { CompoundWordsMethod, createSpellingDictionary, createCollection as createSpellingDictionaryCollection, isSpellingDictionaryLoadError, refreshDictionaryCache, SpellingDictionary, SpellingDictionaryCollection, SpellingDictionaryLoadError, SuggestionCollector, SuggestionResult, SuggestOptions, } from './SpellingDictionary/index.js';
20
+ export { determineFinalDocumentSettings, type DetermineFinalDocumentSettingsResult, spellCheckDocument, spellCheckFile, type SpellCheckFileOptions, type SpellCheckFilePerf, type SpellCheckFileResult, } from './spellCheckFile.js';
21
+ export { CompoundWordsMethod, createSpellingDictionary, createCollection as createSpellingDictionaryCollection, isSpellingDictionaryLoadError, refreshDictionaryCache, type SpellingDictionary, type SpellingDictionaryCollection, SpellingDictionaryLoadError, type SuggestionCollector, type SuggestionResult, type SuggestOptions, } from './SpellingDictionary/index.js';
22
22
  export type { SuggestedWord, SuggestionOptions, SuggestionsForWordResult } from './suggestions.js';
23
23
  export { SuggestionError, suggestionsForWord, suggestionsForWords } from './suggestions.js';
24
- export { DocumentValidator, DocumentValidatorOptions, shouldCheckDocument } from './textValidation/index.js';
24
+ export { DocumentValidator, type DocumentValidatorOptions, shouldCheckDocument } from './textValidation/index.js';
25
25
  export type { TraceOptions, TraceResult, TraceWordResult } from './trace.js';
26
26
  export { traceWords, traceWordsAsync } from './trace.js';
27
- export { getLogger, Logger, setLogger } from './util/logger.js';
27
+ export { getLogger, type Logger, setLogger } from './util/logger.js';
28
28
  export { resolveFile } from './util/resolveFile.js';
29
29
  export * as Text from './util/textApi.js';
30
- export { checkText, checkTextDocument, CheckTextInfo, IncludeExcludeFlag, IncludeExcludeOptions, TextInfoItem, validateText, ValidationIssue, } from './validator.js';
30
+ export { checkText, checkTextDocument, type CheckTextInfo, IncludeExcludeFlag, type IncludeExcludeOptions, type TextInfoItem, validateText, type ValidationIssue, } from './validator.js';
31
31
  export * from '@cspell/cspell-types';
32
32
  export { asyncIterableToArray, readFileText as readFile, readFileTextSync as readFileSync, writeToFile, writeToFileIterable, writeToFileIterableP, } from 'cspell-io';
33
33
  //# sourceMappingURL=index.d.ts.map
package/dist/lib/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  export { clearCachedFiles, clearCaches } from './clearCachedFiles.js';
2
2
  export { fileToDocument, fileToTextDocument, isBinaryFile } from './Document/index.js';
3
3
  export * as ExclusionHelper from './exclusionHelper.js';
4
- export { FeatureFlags, getSystemFeatureFlags, UnknownFeatureFlagError } from './FeatureFlags/index.js';
4
+ export { FeatureFlags, getSystemFeatureFlags, UnknownFeatureFlagError, } from './FeatureFlags/index.js';
5
5
  export { FSCapabilityFlags, getVirtualFS } from './fileSystem.js';
6
6
  export { getLanguagesForBasename as getLanguageIdsForBaseFilename, getLanguagesForExt } from './fileTypes.js';
7
7
  export { getDictionary } from './getDictionary.js';
@@ -9,6 +9,7 @@ import type { WordSuggestion } from '../suggestions.js';
9
9
  import type { MatchRange } from '../util/TextRange.js';
10
10
  import type { TextValidator } from './lineValidatorFactory.js';
11
11
  import type { SimpleRange } from './parsedText.js';
12
+ import { TraceResult } from './traceWord.js';
12
13
  import type { ValidateTextOptions } from './ValidateTextOptions.js';
13
14
  import type { ValidationOptions } from './ValidationTypes.js';
14
15
  export interface DocumentValidatorOptions extends ValidateTextOptions {
@@ -91,7 +92,7 @@ export declare class DocumentValidator {
91
92
  * @returns MatchRanges of text to include.
92
93
  */
93
94
  getCheckedTextRanges(): MatchRange[];
94
- traceWord(word: string): import("./traceWord.js").TraceResult;
95
+ traceWord(word: string): TraceResult;
95
96
  private defaultParser;
96
97
  private _checkParsedText;
97
98
  private addPossibleError;
@@ -1,4 +1,4 @@
1
- declare function getTypeOf(t: unknown): "string" | "number" | "bigint" | "boolean" | "symbol" | "undefined" | "object" | "function";
1
+ declare function getTypeOf(t: unknown): 'string' | 'number' | 'bigint' | 'boolean' | 'symbol' | 'undefined' | 'object' | 'function';
2
2
  export declare function isErrnoException(e: unknown): e is NodeJS.ErrnoException;
3
3
  export declare function isError(e: unknown): e is Error;
4
4
  export declare function toError(e: unknown, errorFactory?: UnknownErrorConstructor): Error;
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "access": "public",
5
5
  "provenance": true
6
6
  },
7
- "version": "9.1.5",
7
+ "version": "9.2.0",
8
8
  "description": "A library of useful functions used across various cspell tools.",
9
9
  "type": "module",
10
10
  "sideEffects": false,
@@ -29,7 +29,7 @@
29
29
  "clean": "shx rm -rf dist temp coverage \"*.tsbuildInfo\"",
30
30
  "clean-build": "pnpm clean && pnpm build",
31
31
  "build": "tsc -p . && pnpm run build:api",
32
- "build:api": "rollup -c api/rollup.config.mjs",
32
+ "build:api": "tsdown",
33
33
  "watch": "tsc -p . --watch",
34
34
  "coverage": "vitest run --coverage --pool=forks",
35
35
  "test-watch": "vitest",
@@ -64,22 +64,22 @@
64
64
  },
65
65
  "homepage": "https://github.com/streetsidesoftware/cspell/tree/main/packages/cspell-lib#readme",
66
66
  "dependencies": {
67
- "@cspell/cspell-bundled-dicts": "9.1.5",
68
- "@cspell/cspell-pipe": "9.1.5",
69
- "@cspell/cspell-resolver": "9.1.5",
70
- "@cspell/cspell-types": "9.1.5",
71
- "@cspell/dynamic-import": "9.1.5",
72
- "@cspell/filetypes": "9.1.5",
73
- "@cspell/strong-weak-map": "9.1.5",
74
- "@cspell/url": "9.1.5",
67
+ "@cspell/cspell-bundled-dicts": "9.2.0",
68
+ "@cspell/cspell-pipe": "9.2.0",
69
+ "@cspell/cspell-resolver": "9.2.0",
70
+ "@cspell/cspell-types": "9.2.0",
71
+ "@cspell/dynamic-import": "9.2.0",
72
+ "@cspell/filetypes": "9.2.0",
73
+ "@cspell/strong-weak-map": "9.2.0",
74
+ "@cspell/url": "9.2.0",
75
75
  "clear-module": "^4.1.2",
76
76
  "comment-json": "^4.2.5",
77
- "cspell-config-lib": "9.1.5",
78
- "cspell-dictionary": "9.1.5",
79
- "cspell-glob": "9.1.5",
80
- "cspell-grammar": "9.1.5",
81
- "cspell-io": "9.1.5",
82
- "cspell-trie-lib": "9.1.5",
77
+ "cspell-config-lib": "9.2.0",
78
+ "cspell-dictionary": "9.2.0",
79
+ "cspell-glob": "9.2.0",
80
+ "cspell-grammar": "9.2.0",
81
+ "cspell-io": "9.2.0",
82
+ "cspell-trie-lib": "9.2.0",
83
83
  "env-paths": "^3.0.0",
84
84
  "fast-equals": "^5.2.2",
85
85
  "gensequence": "^7.0.0",
@@ -108,5 +108,5 @@
108
108
  "lorem-ipsum": "^2.0.8",
109
109
  "perf-insight": "^1.2.0"
110
110
  },
111
- "gitHead": "6303813cb5da37e88b3ccab7ce5bcf09373f5cf2"
111
+ "gitHead": "6004e6a19e11985bc61e6578846195be07365049"
112
112
  }