cspell-lib 6.20.1 → 6.22.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.
@@ -67,6 +67,8 @@ function normalizeReporters(settings, pathToSettingsFile) {
67
67
  return {};
68
68
  const folder = path.dirname(pathToSettingsFile);
69
69
  function resolve(s) {
70
+ if (s === 'default')
71
+ return s;
70
72
  const r = (0, resolveFile_1.resolveFile)(s, folder);
71
73
  if (!r.found) {
72
74
  throw new Error(`Not found: "${s}"`);
@@ -0,0 +1,2 @@
1
+ export declare function clearCachedFiles(): Promise<void>;
2
+ //# sourceMappingURL=clearCachedFiles.d.ts.map
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.clearCachedFiles = void 0;
4
+ const Settings_1 = require("./Settings");
5
+ const SpellingDictionary_1 = require("./SpellingDictionary");
6
+ async function clearCachedFiles() {
7
+ await Promise.all([(0, Settings_1.clearCachedSettingsFiles)(), (0, SpellingDictionary_1.refreshDictionaryCache)(0)]);
8
+ }
9
+ exports.clearCachedFiles = clearCachedFiles;
10
+ //# sourceMappingURL=clearCachedFiles.js.map
@@ -0,0 +1,9 @@
1
+ import type { CSpellUserSettings } from '@cspell/cspell-types';
2
+ import type { SpellingDictionaryCollection } from './SpellingDictionary';
3
+ /**
4
+ * Load a dictionary collection defined by the settings.
5
+ * @param settings - that defines the dictionaries and the ones to load.
6
+ * @returns a dictionary collection that represents all the enabled dictionaries.
7
+ */
8
+ export declare function getDictionary(settings: CSpellUserSettings): Promise<SpellingDictionaryCollection>;
9
+ //# sourceMappingURL=getDictionary.d.ts.map
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getDictionary = void 0;
4
+ const CSpellSettingsServer_1 = require("./Settings/CSpellSettingsServer");
5
+ const SpellingDictionary_1 = require("./SpellingDictionary");
6
+ /**
7
+ * Load a dictionary collection defined by the settings.
8
+ * @param settings - that defines the dictionaries and the ones to load.
9
+ * @returns a dictionary collection that represents all the enabled dictionaries.
10
+ */
11
+ function getDictionary(settings) {
12
+ return (0, SpellingDictionary_1.getDictionaryInternal)((0, CSpellSettingsServer_1.toInternalSettings)(settings));
13
+ }
14
+ exports.getDictionary = getDictionary;
15
+ //# sourceMappingURL=getDictionary.js.map
package/dist/index.d.ts CHANGED
@@ -1,7 +1,5 @@
1
- import type { CSpellUserSettings } from '@cspell/cspell-types';
2
1
  import * as ExclusionHelper from './exclusionHelper';
3
2
  import * as Link from './Settings/index.link';
4
- import type { SpellingDictionaryCollection } from './SpellingDictionary';
5
3
  import * as Text from './util/text';
6
4
  export type { Document } from './Document';
7
5
  export { fileToDocument, fileToTextDocument, isBinaryFile } from './Document';
@@ -10,7 +8,7 @@ export { FeatureFlag, FeatureFlags, getSystemFeatureFlags, UnknownFeatureFlagErr
10
8
  export { getLanguagesForBasename as getLanguageIdsForBaseFilename, getLanguagesForExt } from './LanguageIds';
11
9
  export type { CreateTextDocumentParams, TextDocument, TextDocumentLine } from './Models/TextDocument';
12
10
  export { createTextDocument, updateTextDocument } from './Models/TextDocument';
13
- export * from './Settings';
11
+ export { calcOverrideSettings, checkFilenameMatchesGlob, clearCachedSettingsFiles, type ConfigurationDependencies, currentSettingsFileVersion, defaultConfigFilenames, defaultFileName, ENV_CSPELL_GLOB_ROOT, extractDependencies, extractImportErrors, finalizeSettings, getCachedFileSize, getDefaultBundledSettings, getDefaultSettings, getGlobalSettings, getSources, ImportError, type ImportFileRefWithError, loadConfig, loadPnP, loadPnPSync, mergeInDocSettings, mergeSettings, readRawSettings, readSettings, readSettingsFiles, searchForConfig, sectionCSpell, } from './Settings';
14
12
  export { defaultFileName as defaultSettingsFilename } from './Settings';
15
13
  export { combineTextAndLanguageSettings, combineTextAndLanguageSettings as constructSettingsForText, } from './Settings/TextDocumentSettings';
16
14
  export { determineFinalDocumentSettings, DetermineFinalDocumentSettingsResult, spellCheckDocument, spellCheckFile, SpellCheckFileOptions, SpellCheckFileResult, } from './spellCheckFile';
@@ -27,6 +25,6 @@ export * from '@cspell/cspell-types';
27
25
  export { asyncIterableToArray, readFile, readFileSync, writeToFile, writeToFileIterable, writeToFileIterableP, } from 'cspell-io';
28
26
  export { Link, Text };
29
27
  export { ExclusionHelper };
30
- export declare function clearCachedFiles(): Promise<void>;
31
- export declare function getDictionary(settings: CSpellUserSettings): Promise<SpellingDictionaryCollection>;
28
+ export { clearCachedFiles } from './clearCachedFiles';
29
+ export { getDictionary } from './getDictionary';
32
30
  //# sourceMappingURL=index.d.ts.map
package/dist/index.js CHANGED
@@ -26,14 +26,12 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
26
26
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
27
27
  };
28
28
  Object.defineProperty(exports, "__esModule", { value: true });
29
- exports.getDictionary = exports.clearCachedFiles = exports.ExclusionHelper = exports.Text = exports.Link = exports.writeToFileIterableP = exports.writeToFileIterable = exports.writeToFile = exports.readFileSync = exports.readFile = exports.asyncIterableToArray = exports.validateText = exports.IncludeExcludeFlag = exports.checkTextDocument = exports.checkText = exports.resolveFile = exports.setLogger = exports.getLogger = exports.traceWordsAsync = exports.traceWords = exports.DocumentValidator = exports.suggestionsForWords = exports.suggestionsForWord = exports.SuggestionError = exports.SpellingDictionaryLoadError = exports.refreshDictionaryCache = exports.isSpellingDictionaryLoadError = exports.createSpellingDictionaryCollection = exports.createSpellingDictionary = exports.CompoundWordsMethod = exports.spellCheckFile = exports.spellCheckDocument = exports.determineFinalDocumentSettings = exports.constructSettingsForText = exports.combineTextAndLanguageSettings = exports.defaultSettingsFilename = exports.updateTextDocument = exports.createTextDocument = exports.getLanguagesForExt = exports.getLanguageIdsForBaseFilename = exports.UnknownFeatureFlagError = exports.getSystemFeatureFlags = exports.FeatureFlags = exports.isBinaryFile = exports.fileToTextDocument = exports.fileToDocument = void 0;
29
+ exports.suggestionsForWord = exports.SuggestionError = exports.SpellingDictionaryLoadError = exports.refreshDictionaryCache = exports.isSpellingDictionaryLoadError = exports.createSpellingDictionaryCollection = exports.createSpellingDictionary = exports.CompoundWordsMethod = exports.spellCheckFile = exports.spellCheckDocument = exports.determineFinalDocumentSettings = exports.constructSettingsForText = exports.combineTextAndLanguageSettings = exports.defaultSettingsFilename = exports.sectionCSpell = exports.searchForConfig = exports.readSettingsFiles = exports.readSettings = exports.readRawSettings = exports.mergeSettings = exports.mergeInDocSettings = exports.loadPnPSync = exports.loadPnP = exports.loadConfig = exports.ImportError = exports.getSources = exports.getGlobalSettings = exports.getDefaultSettings = exports.getDefaultBundledSettings = exports.getCachedFileSize = exports.finalizeSettings = exports.extractImportErrors = exports.extractDependencies = exports.ENV_CSPELL_GLOB_ROOT = exports.defaultFileName = exports.defaultConfigFilenames = exports.currentSettingsFileVersion = exports.clearCachedSettingsFiles = exports.checkFilenameMatchesGlob = exports.calcOverrideSettings = exports.updateTextDocument = exports.createTextDocument = exports.getLanguagesForExt = exports.getLanguageIdsForBaseFilename = exports.UnknownFeatureFlagError = exports.getSystemFeatureFlags = exports.FeatureFlags = exports.isBinaryFile = exports.fileToTextDocument = exports.fileToDocument = void 0;
30
+ exports.getDictionary = exports.clearCachedFiles = exports.ExclusionHelper = exports.Text = exports.Link = exports.writeToFileIterableP = exports.writeToFileIterable = exports.writeToFile = exports.readFileSync = exports.readFile = exports.asyncIterableToArray = exports.validateText = exports.IncludeExcludeFlag = exports.checkTextDocument = exports.checkText = exports.resolveFile = exports.setLogger = exports.getLogger = exports.traceWordsAsync = exports.traceWords = exports.DocumentValidator = exports.suggestionsForWords = void 0;
30
31
  const ExclusionHelper = __importStar(require("./exclusionHelper"));
31
32
  exports.ExclusionHelper = ExclusionHelper;
32
- const Settings_1 = require("./Settings");
33
- const CSpellSettingsServer_1 = require("./Settings/CSpellSettingsServer");
34
33
  const Link = __importStar(require("./Settings/index.link"));
35
34
  exports.Link = Link;
36
- const SpellingDictionary_1 = require("./SpellingDictionary");
37
35
  const Text = __importStar(require("./util/text"));
38
36
  exports.Text = Text;
39
37
  var Document_1 = require("./Document");
@@ -50,7 +48,33 @@ Object.defineProperty(exports, "getLanguagesForExt", { enumerable: true, get: fu
50
48
  var TextDocument_1 = require("./Models/TextDocument");
51
49
  Object.defineProperty(exports, "createTextDocument", { enumerable: true, get: function () { return TextDocument_1.createTextDocument; } });
52
50
  Object.defineProperty(exports, "updateTextDocument", { enumerable: true, get: function () { return TextDocument_1.updateTextDocument; } });
53
- __exportStar(require("./Settings"), exports);
51
+ var Settings_1 = require("./Settings");
52
+ Object.defineProperty(exports, "calcOverrideSettings", { enumerable: true, get: function () { return Settings_1.calcOverrideSettings; } });
53
+ Object.defineProperty(exports, "checkFilenameMatchesGlob", { enumerable: true, get: function () { return Settings_1.checkFilenameMatchesGlob; } });
54
+ Object.defineProperty(exports, "clearCachedSettingsFiles", { enumerable: true, get: function () { return Settings_1.clearCachedSettingsFiles; } });
55
+ Object.defineProperty(exports, "currentSettingsFileVersion", { enumerable: true, get: function () { return Settings_1.currentSettingsFileVersion; } });
56
+ Object.defineProperty(exports, "defaultConfigFilenames", { enumerable: true, get: function () { return Settings_1.defaultConfigFilenames; } });
57
+ Object.defineProperty(exports, "defaultFileName", { enumerable: true, get: function () { return Settings_1.defaultFileName; } });
58
+ Object.defineProperty(exports, "ENV_CSPELL_GLOB_ROOT", { enumerable: true, get: function () { return Settings_1.ENV_CSPELL_GLOB_ROOT; } });
59
+ Object.defineProperty(exports, "extractDependencies", { enumerable: true, get: function () { return Settings_1.extractDependencies; } });
60
+ Object.defineProperty(exports, "extractImportErrors", { enumerable: true, get: function () { return Settings_1.extractImportErrors; } });
61
+ Object.defineProperty(exports, "finalizeSettings", { enumerable: true, get: function () { return Settings_1.finalizeSettings; } });
62
+ Object.defineProperty(exports, "getCachedFileSize", { enumerable: true, get: function () { return Settings_1.getCachedFileSize; } });
63
+ Object.defineProperty(exports, "getDefaultBundledSettings", { enumerable: true, get: function () { return Settings_1.getDefaultBundledSettings; } });
64
+ Object.defineProperty(exports, "getDefaultSettings", { enumerable: true, get: function () { return Settings_1.getDefaultSettings; } });
65
+ Object.defineProperty(exports, "getGlobalSettings", { enumerable: true, get: function () { return Settings_1.getGlobalSettings; } });
66
+ Object.defineProperty(exports, "getSources", { enumerable: true, get: function () { return Settings_1.getSources; } });
67
+ Object.defineProperty(exports, "ImportError", { enumerable: true, get: function () { return Settings_1.ImportError; } });
68
+ Object.defineProperty(exports, "loadConfig", { enumerable: true, get: function () { return Settings_1.loadConfig; } });
69
+ Object.defineProperty(exports, "loadPnP", { enumerable: true, get: function () { return Settings_1.loadPnP; } });
70
+ Object.defineProperty(exports, "loadPnPSync", { enumerable: true, get: function () { return Settings_1.loadPnPSync; } });
71
+ Object.defineProperty(exports, "mergeInDocSettings", { enumerable: true, get: function () { return Settings_1.mergeInDocSettings; } });
72
+ Object.defineProperty(exports, "mergeSettings", { enumerable: true, get: function () { return Settings_1.mergeSettings; } });
73
+ Object.defineProperty(exports, "readRawSettings", { enumerable: true, get: function () { return Settings_1.readRawSettings; } });
74
+ Object.defineProperty(exports, "readSettings", { enumerable: true, get: function () { return Settings_1.readSettings; } });
75
+ Object.defineProperty(exports, "readSettingsFiles", { enumerable: true, get: function () { return Settings_1.readSettingsFiles; } });
76
+ Object.defineProperty(exports, "searchForConfig", { enumerable: true, get: function () { return Settings_1.searchForConfig; } });
77
+ Object.defineProperty(exports, "sectionCSpell", { enumerable: true, get: function () { return Settings_1.sectionCSpell; } });
54
78
  var Settings_2 = require("./Settings");
55
79
  Object.defineProperty(exports, "defaultSettingsFilename", { enumerable: true, get: function () { return Settings_2.defaultFileName; } });
56
80
  var TextDocumentSettings_1 = require("./Settings/TextDocumentSettings");
@@ -60,13 +84,13 @@ var spellCheckFile_1 = require("./spellCheckFile");
60
84
  Object.defineProperty(exports, "determineFinalDocumentSettings", { enumerable: true, get: function () { return spellCheckFile_1.determineFinalDocumentSettings; } });
61
85
  Object.defineProperty(exports, "spellCheckDocument", { enumerable: true, get: function () { return spellCheckFile_1.spellCheckDocument; } });
62
86
  Object.defineProperty(exports, "spellCheckFile", { enumerable: true, get: function () { return spellCheckFile_1.spellCheckFile; } });
63
- var SpellingDictionary_2 = require("./SpellingDictionary");
64
- Object.defineProperty(exports, "CompoundWordsMethod", { enumerable: true, get: function () { return SpellingDictionary_2.CompoundWordsMethod; } });
65
- Object.defineProperty(exports, "createSpellingDictionary", { enumerable: true, get: function () { return SpellingDictionary_2.createSpellingDictionary; } });
66
- Object.defineProperty(exports, "createSpellingDictionaryCollection", { enumerable: true, get: function () { return SpellingDictionary_2.createCollection; } });
67
- Object.defineProperty(exports, "isSpellingDictionaryLoadError", { enumerable: true, get: function () { return SpellingDictionary_2.isSpellingDictionaryLoadError; } });
68
- Object.defineProperty(exports, "refreshDictionaryCache", { enumerable: true, get: function () { return SpellingDictionary_2.refreshDictionaryCache; } });
69
- Object.defineProperty(exports, "SpellingDictionaryLoadError", { enumerable: true, get: function () { return SpellingDictionary_2.SpellingDictionaryLoadError; } });
87
+ var SpellingDictionary_1 = require("./SpellingDictionary");
88
+ Object.defineProperty(exports, "CompoundWordsMethod", { enumerable: true, get: function () { return SpellingDictionary_1.CompoundWordsMethod; } });
89
+ Object.defineProperty(exports, "createSpellingDictionary", { enumerable: true, get: function () { return SpellingDictionary_1.createSpellingDictionary; } });
90
+ Object.defineProperty(exports, "createSpellingDictionaryCollection", { enumerable: true, get: function () { return SpellingDictionary_1.createCollection; } });
91
+ Object.defineProperty(exports, "isSpellingDictionaryLoadError", { enumerable: true, get: function () { return SpellingDictionary_1.isSpellingDictionaryLoadError; } });
92
+ Object.defineProperty(exports, "refreshDictionaryCache", { enumerable: true, get: function () { return SpellingDictionary_1.refreshDictionaryCache; } });
93
+ Object.defineProperty(exports, "SpellingDictionaryLoadError", { enumerable: true, get: function () { return SpellingDictionary_1.SpellingDictionaryLoadError; } });
70
94
  var suggestions_1 = require("./suggestions");
71
95
  Object.defineProperty(exports, "SuggestionError", { enumerable: true, get: function () { return suggestions_1.SuggestionError; } });
72
96
  Object.defineProperty(exports, "suggestionsForWord", { enumerable: true, get: function () { return suggestions_1.suggestionsForWord; } });
@@ -94,12 +118,8 @@ Object.defineProperty(exports, "readFileSync", { enumerable: true, get: function
94
118
  Object.defineProperty(exports, "writeToFile", { enumerable: true, get: function () { return cspell_io_1.writeToFile; } });
95
119
  Object.defineProperty(exports, "writeToFileIterable", { enumerable: true, get: function () { return cspell_io_1.writeToFileIterable; } });
96
120
  Object.defineProperty(exports, "writeToFileIterableP", { enumerable: true, get: function () { return cspell_io_1.writeToFileIterableP; } });
97
- async function clearCachedFiles() {
98
- await Promise.all([(0, Settings_1.clearCachedSettingsFiles)(), (0, SpellingDictionary_1.refreshDictionaryCache)(0)]);
99
- }
100
- exports.clearCachedFiles = clearCachedFiles;
101
- function getDictionary(settings) {
102
- return (0, SpellingDictionary_1.getDictionaryInternal)((0, CSpellSettingsServer_1.toInternalSettings)(settings));
103
- }
104
- exports.getDictionary = getDictionary;
121
+ var clearCachedFiles_1 = require("./clearCachedFiles");
122
+ Object.defineProperty(exports, "clearCachedFiles", { enumerable: true, get: function () { return clearCachedFiles_1.clearCachedFiles; } });
123
+ var getDictionary_1 = require("./getDictionary");
124
+ Object.defineProperty(exports, "getDictionary", { enumerable: true, get: function () { return getDictionary_1.getDictionary; } });
105
125
  //# sourceMappingURL=index.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cspell-lib",
3
- "version": "6.20.1",
3
+ "version": "6.22.0",
4
4
  "description": "A library of useful functions used across various cspell tools.",
5
5
  "main": "dist/index.js",
6
6
  "typings": "dist/index.d.ts",
@@ -48,19 +48,19 @@
48
48
  },
49
49
  "homepage": "https://github.com/streetsidesoftware/cspell#readme",
50
50
  "dependencies": {
51
- "@cspell/cspell-bundled-dicts": "6.20.1",
52
- "@cspell/cspell-pipe": "6.20.1",
53
- "@cspell/cspell-types": "6.20.1",
54
- "@cspell/strong-weak-map": "6.20.1",
51
+ "@cspell/cspell-bundled-dicts": "6.22.0",
52
+ "@cspell/cspell-pipe": "6.22.0",
53
+ "@cspell/cspell-types": "6.22.0",
54
+ "@cspell/strong-weak-map": "6.22.0",
55
55
  "clear-module": "^4.1.2",
56
56
  "comment-json": "^4.2.3",
57
57
  "configstore": "^5.0.1",
58
58
  "cosmiconfig": "^8.0.0",
59
- "cspell-dictionary": "6.20.1",
60
- "cspell-glob": "6.20.1",
61
- "cspell-grammar": "6.20.1",
62
- "cspell-io": "6.20.1",
63
- "cspell-trie-lib": "6.20.1",
59
+ "cspell-dictionary": "6.22.0",
60
+ "cspell-glob": "6.22.0",
61
+ "cspell-grammar": "6.22.0",
62
+ "cspell-io": "6.22.0",
63
+ "cspell-trie-lib": "6.22.0",
64
64
  "fast-equals": "^4.0.3",
65
65
  "find-up": "^5.0.0",
66
66
  "gensequence": "^4.0.3",
@@ -84,13 +84,13 @@
84
84
  "@cspell/dict-python": "^4.0.1",
85
85
  "@types/configstore": "^5.0.1",
86
86
  "@types/jest": "^29.4.0",
87
- "@types/node": "^18.11.18",
87
+ "@types/node": "^18.11.19",
88
88
  "cspell-dict-nl-nl": "^1.1.2",
89
89
  "jest": "^29.4.1",
90
90
  "lorem-ipsum": "^2.0.8",
91
- "rollup": "^3.12.1",
91
+ "rollup": "^3.14.0",
92
92
  "rollup-plugin-dts": "^5.1.1",
93
93
  "ts-jest": "^29.0.5"
94
94
  },
95
- "gitHead": "508a06d32dd59d881d07cb60fe8c0a7c0bddf8eb"
95
+ "gitHead": "a133874ed7590cbe140f5067cfa80db84b644a5d"
96
96
  }