@cspell/cspell-tools 10.3.0 → 10.3.1-alpha.1
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.
|
@@ -7,14 +7,17 @@
|
|
|
7
7
|
"properties": {
|
|
8
8
|
"compress": {
|
|
9
9
|
"description": "compress the resulting file",
|
|
10
|
+
"markdownDescription": "compress the resulting file",
|
|
10
11
|
"type": "boolean"
|
|
11
12
|
},
|
|
12
13
|
"optimize": {
|
|
13
14
|
"description": "optimize the trie into a DAWG",
|
|
15
|
+
"markdownDescription": "optimize the trie into a DAWG",
|
|
14
16
|
"type": "boolean"
|
|
15
17
|
},
|
|
16
18
|
"useStringTable": {
|
|
17
19
|
"description": "use a string table to reduce size",
|
|
20
|
+
"markdownDescription": "use a string table to reduce size",
|
|
18
21
|
"type": "boolean"
|
|
19
22
|
}
|
|
20
23
|
},
|
|
@@ -47,11 +50,13 @@
|
|
|
47
50
|
"properties": {
|
|
48
51
|
"allowedSplitWords": {
|
|
49
52
|
"$ref": "#/definitions/FilePathOrFilePathArray",
|
|
50
|
-
"description": "Words in the `allowedSplitWords` are considered correct and can be used as a basis for splitting compound words.\n\nIf entries can be split so that all the words in the entry are allowed, then only the individual words are added, otherwise the entire entry is added. This is to prevent misspellings in CamelCase words from being introduced into the dictionary."
|
|
53
|
+
"description": "Words in the `allowedSplitWords` are considered correct and can be used as a basis for splitting compound words.\n\nIf entries can be split so that all the words in the entry are allowed, then only the individual words are added, otherwise the entire entry is added. This is to prevent misspellings in CamelCase words from being introduced into the dictionary.",
|
|
54
|
+
"markdownDescription": "Words in the `allowedSplitWords` are considered correct and can be used\nas a basis for splitting compound words.\n\nIf entries can be split so that all the words in the entry are allowed,\nthen only the individual words are added, otherwise the entire entry is added.\nThis is to prevent misspellings in CamelCase words from being introduced into the\ndictionary."
|
|
51
55
|
},
|
|
52
56
|
"keepRawCase": {
|
|
53
57
|
"default": false,
|
|
54
58
|
"description": "Do not generate lower case / accent free versions of words.",
|
|
59
|
+
"markdownDescription": "Do not generate lower case / accent free versions of words.",
|
|
55
60
|
"type": "boolean"
|
|
56
61
|
},
|
|
57
62
|
"listFile": {
|
|
@@ -59,11 +64,13 @@
|
|
|
59
64
|
},
|
|
60
65
|
"maxDepth": {
|
|
61
66
|
"description": "Maximum number of nested Hunspell Rules to apply. This is needed for recursive dictionaries like Hebrew.",
|
|
67
|
+
"markdownDescription": "Maximum number of nested Hunspell Rules to apply.\nThis is needed for recursive dictionaries like Hebrew.",
|
|
62
68
|
"type": "number"
|
|
63
69
|
},
|
|
64
70
|
"minCompoundLength": {
|
|
65
71
|
"default": 4,
|
|
66
72
|
"description": "Controls the minimum length of a compound word when storing words using `storeSplitWordsAsCompounds`. The compound words are prefixed / suffixed with `*`, to allow them to be combined with other compound words. If the length is too low, then the dictionary will consider many misspelled words as correct.",
|
|
73
|
+
"markdownDescription": "Controls the minimum length of a compound word when storing words using `storeSplitWordsAsCompounds`.\nThe compound words are prefixed / suffixed with `*`, to allow them to be combined with other compound words.\nIf the length is too low, then the dictionary will consider many misspelled words as correct.",
|
|
67
74
|
"type": "number"
|
|
68
75
|
},
|
|
69
76
|
"split": {
|
|
@@ -77,11 +84,13 @@
|
|
|
77
84
|
}
|
|
78
85
|
],
|
|
79
86
|
"default": false,
|
|
80
|
-
"description": "Split lines into words."
|
|
87
|
+
"description": "Split lines into words.",
|
|
88
|
+
"markdownDescription": "Split lines into words."
|
|
81
89
|
},
|
|
82
90
|
"storeSplitWordsAsCompounds": {
|
|
83
91
|
"default": false,
|
|
84
92
|
"description": "Camel case words that have been split using the `allowedSplitWords` are added to the dictionary as compoundable words. These words are prefixed / suffixed with `*`.",
|
|
93
|
+
"markdownDescription": "Camel case words that have been split using the `allowedSplitWords` are added to the dictionary as compoundable words.\nThese words are prefixed / suffixed with `*`.",
|
|
85
94
|
"type": "boolean"
|
|
86
95
|
}
|
|
87
96
|
},
|
|
@@ -92,6 +101,7 @@
|
|
|
92
101
|
},
|
|
93
102
|
"FilePath": {
|
|
94
103
|
"description": "Note: All relative paths are relative to the config file location.",
|
|
104
|
+
"markdownDescription": "Note: All relative paths are relative to the config file location.",
|
|
95
105
|
"type": "string"
|
|
96
106
|
},
|
|
97
107
|
"FilePathOrFilePathArray": {
|
|
@@ -112,7 +122,8 @@
|
|
|
112
122
|
"properties": {
|
|
113
123
|
"allowedSplitWords": {
|
|
114
124
|
"$ref": "#/definitions/FilePathOrFilePathArray",
|
|
115
|
-
"description": "Words in the `allowedSplitWords` are considered correct and can be used as a basis for splitting compound words.\n\nIf entries can be split so that all the words in the entry are allowed, then only the individual words are added, otherwise the entire entry is added. This is to prevent misspellings in CamelCase words from being introduced into the dictionary."
|
|
125
|
+
"description": "Words in the `allowedSplitWords` are considered correct and can be used as a basis for splitting compound words.\n\nIf entries can be split so that all the words in the entry are allowed, then only the individual words are added, otherwise the entire entry is added. This is to prevent misspellings in CamelCase words from being introduced into the dictionary.",
|
|
126
|
+
"markdownDescription": "Words in the `allowedSplitWords` are considered correct and can be used\nas a basis for splitting compound words.\n\nIf entries can be split so that all the words in the entry are allowed,\nthen only the individual words are added, otherwise the entire entry is added.\nThis is to prevent misspellings in CamelCase words from being introduced into the\ndictionary."
|
|
116
127
|
},
|
|
117
128
|
"filename": {
|
|
118
129
|
"$ref": "#/definitions/FilePath"
|
|
@@ -120,15 +131,18 @@
|
|
|
120
131
|
"keepRawCase": {
|
|
121
132
|
"default": false,
|
|
122
133
|
"description": "Do not generate lower case / accent free versions of words.",
|
|
134
|
+
"markdownDescription": "Do not generate lower case / accent free versions of words.",
|
|
123
135
|
"type": "boolean"
|
|
124
136
|
},
|
|
125
137
|
"maxDepth": {
|
|
126
138
|
"description": "Maximum number of nested Hunspell Rules to apply. This is needed for recursive dictionaries like Hebrew.",
|
|
139
|
+
"markdownDescription": "Maximum number of nested Hunspell Rules to apply.\nThis is needed for recursive dictionaries like Hebrew.",
|
|
127
140
|
"type": "number"
|
|
128
141
|
},
|
|
129
142
|
"minCompoundLength": {
|
|
130
143
|
"default": 4,
|
|
131
144
|
"description": "Controls the minimum length of a compound word when storing words using `storeSplitWordsAsCompounds`. The compound words are prefixed / suffixed with `*`, to allow them to be combined with other compound words. If the length is too low, then the dictionary will consider many misspelled words as correct.",
|
|
145
|
+
"markdownDescription": "Controls the minimum length of a compound word when storing words using `storeSplitWordsAsCompounds`.\nThe compound words are prefixed / suffixed with `*`, to allow them to be combined with other compound words.\nIf the length is too low, then the dictionary will consider many misspelled words as correct.",
|
|
132
146
|
"type": "number"
|
|
133
147
|
},
|
|
134
148
|
"split": {
|
|
@@ -142,11 +156,13 @@
|
|
|
142
156
|
}
|
|
143
157
|
],
|
|
144
158
|
"default": false,
|
|
145
|
-
"description": "Split lines into words."
|
|
159
|
+
"description": "Split lines into words.",
|
|
160
|
+
"markdownDescription": "Split lines into words."
|
|
146
161
|
},
|
|
147
162
|
"storeSplitWordsAsCompounds": {
|
|
148
163
|
"default": false,
|
|
149
164
|
"description": "Camel case words that have been split using the `allowedSplitWords` are added to the dictionary as compoundable words. These words are prefixed / suffixed with `*`.",
|
|
165
|
+
"markdownDescription": "Camel case words that have been split using the `allowedSplitWords` are added to the dictionary as compoundable words.\nThese words are prefixed / suffixed with `*`.",
|
|
150
166
|
"type": "boolean"
|
|
151
167
|
}
|
|
152
168
|
},
|
|
@@ -155,6 +171,21 @@
|
|
|
155
171
|
],
|
|
156
172
|
"type": "object"
|
|
157
173
|
},
|
|
174
|
+
"ReplaceWith": {
|
|
175
|
+
"type": "string"
|
|
176
|
+
},
|
|
177
|
+
"Replacements": {
|
|
178
|
+
"additionalProperties": {
|
|
179
|
+
"$ref": "#/definitions/ReplaceWith"
|
|
180
|
+
},
|
|
181
|
+
"description": "Replacement rules to apply to the words in the dictionary. The key is the pattern to match, and the value is the replacement string. Note: Multiple patterns can be separated by the `|` character.\n\n- ``'|‘|`|’`` - with match all the single quotes.\n\nNote: the pattern is treated like a regular expression using the JavaScript `RegExp` constructor with the `g` and `v` flags.\n\nNote: replacements are applied in the order they are defined.",
|
|
182
|
+
"markdownDescription": "Replacement rules to apply to the words in the dictionary.\nThe key is the pattern to match, and the value is the replacement string.\nNote: Multiple patterns can be separated by the `|` character.\n\n- ``'|‘|`|’`` - with match all the single quotes.\n\nNote: the pattern is treated like a regular expression using the JavaScript `RegExp` constructor with the `g` and `v` flags.\n\nNote: replacements are applied in the order they are defined.",
|
|
183
|
+
"propertyNames": {
|
|
184
|
+
"description": "Pattern to match in the replacement rules. Multiple patterns can be separated by the `|` character.\n\n- ``'|‘|`|’`` - with match all the single quotes.",
|
|
185
|
+
"markdownDescription": "Pattern to match in the replacement rules. Multiple patterns can be separated by the `|` character.\n\n- ``'|‘|`|’`` - with match all the single quotes."
|
|
186
|
+
},
|
|
187
|
+
"type": "object"
|
|
188
|
+
},
|
|
158
189
|
"Target": {
|
|
159
190
|
"additionalProperties": false,
|
|
160
191
|
"properties": {
|
|
@@ -170,7 +201,8 @@
|
|
|
170
201
|
"type": "array"
|
|
171
202
|
}
|
|
172
203
|
],
|
|
173
|
-
"description": "Words in the `allowedSplitWords` are considered correct and can be used as a basis for splitting compound words.\n\nIf entries can be split so that all the words in the entry are allowed, then only the individual words are added, otherwise the entire entry is added. This is to prevent misspellings in CamelCase words from being introduced into the dictionary."
|
|
204
|
+
"description": "Words in the `allowedSplitWords` are considered correct and can be used as a basis for splitting compound words.\n\nIf entries can be split so that all the words in the entry are allowed, then only the individual words are added, otherwise the entire entry is added. This is to prevent misspellings in CamelCase words from being introduced into the dictionary.",
|
|
205
|
+
"markdownDescription": "Words in the `allowedSplitWords` are considered correct and can be used\nas a basis for splitting compound words.\n\nIf entries can be split so that all the words in the entry are allowed,\nthen only the individual words are added, otherwise the entire entry is added.\nThis is to prevent misspellings in CamelCase words from being introduced into the\ndictionary."
|
|
174
206
|
},
|
|
175
207
|
"bTrie": {
|
|
176
208
|
"anyOf": [
|
|
@@ -181,11 +213,13 @@
|
|
|
181
213
|
"$ref": "#/definitions/BTrieOptions"
|
|
182
214
|
}
|
|
183
215
|
],
|
|
184
|
-
"description": "Generate a `.btrie.gz` for the target."
|
|
216
|
+
"description": "Generate a `.btrie.gz` for the target.",
|
|
217
|
+
"markdownDescription": "Generate a `.btrie.gz` for the target."
|
|
185
218
|
},
|
|
186
219
|
"compress": {
|
|
187
220
|
"default": false,
|
|
188
221
|
"description": "Setting this value to true will create a `.gz` dictionary file. Use `keepUncompressed` to also keep an uncompressed version.",
|
|
222
|
+
"markdownDescription": "Setting this value to true will create a `.gz` dictionary file.\nUse `keepUncompressed` to also keep an uncompressed version.",
|
|
189
223
|
"type": "boolean"
|
|
190
224
|
},
|
|
191
225
|
"dictionaryDirectives": {
|
|
@@ -193,6 +227,7 @@
|
|
|
193
227
|
"items": {
|
|
194
228
|
"type": "string"
|
|
195
229
|
},
|
|
230
|
+
"markdownDescription": "Injects `cspell-dictionary` directives into the dictionary header.\n\nExample:\n\n```ini\n# cspell-dictionary: no-generate-alternatives\n```\n\nKnown Directives:\n```yaml\n- split # Tell the dictionary loader to split words\n- no-split # Tell the dictionary loader to not split words (default)\n- generate-alternatives # Tell the dictionary loader to generate alternate spellings (default)\n- no-generate-alternatives # Tell the dictionary loader to not generate alternate spellings\n```",
|
|
196
231
|
"type": "array"
|
|
197
232
|
},
|
|
198
233
|
"excludeWordsFrom": {
|
|
@@ -200,6 +235,7 @@
|
|
|
200
235
|
"items": {
|
|
201
236
|
"$ref": "#/definitions/FilePath"
|
|
202
237
|
},
|
|
238
|
+
"markdownDescription": "Words from the sources that are found in `excludeWordsFrom` files\nwill NOT be added to the dictionary.",
|
|
203
239
|
"type": "array"
|
|
204
240
|
},
|
|
205
241
|
"excludeWordsMatchingRegex": {
|
|
@@ -207,6 +243,7 @@
|
|
|
207
243
|
"items": {
|
|
208
244
|
"type": "string"
|
|
209
245
|
},
|
|
246
|
+
"markdownDescription": "Words from the sources that match the regex in `excludeWordsMatchingRegex`\nwill NOT be added to the dictionary.\n\nNote: The regex must be a valid JavaScript literal regex expression including the `/` delimiters.",
|
|
210
247
|
"type": "array"
|
|
211
248
|
},
|
|
212
249
|
"excludeWordsNotFoundIn": {
|
|
@@ -214,33 +251,45 @@
|
|
|
214
251
|
"items": {
|
|
215
252
|
"$ref": "#/definitions/FilePath"
|
|
216
253
|
},
|
|
254
|
+
"markdownDescription": "Words from the sources that are NOT found in `excludeWordsNotFoundIn` files\nwill NOT be added to the dictionary.",
|
|
217
255
|
"type": "array"
|
|
218
256
|
},
|
|
219
257
|
"format": {
|
|
220
258
|
"$ref": "#/definitions/DictionaryFormats",
|
|
221
|
-
"description": "Format of the dictionary."
|
|
259
|
+
"description": "Format of the dictionary.",
|
|
260
|
+
"markdownDescription": "Format of the dictionary."
|
|
222
261
|
},
|
|
223
262
|
"generateNonStrict": {
|
|
224
263
|
"default": false,
|
|
225
264
|
"description": "Generate lower case / accent free versions of words.",
|
|
265
|
+
"markdownDescription": "Generate lower case / accent free versions of words.",
|
|
226
266
|
"type": "boolean"
|
|
227
267
|
},
|
|
228
268
|
"keepUncompressed": {
|
|
229
269
|
"description": "If `compress` is true, setting this value to true will also keep an uncompressed version of the dictionary.",
|
|
270
|
+
"markdownDescription": "If `compress` is true, setting this value to true will also keep an uncompressed version of the dictionary.",
|
|
230
271
|
"type": "boolean"
|
|
231
272
|
},
|
|
232
273
|
"name": {
|
|
233
274
|
"description": "Name of target, used as the basis of target file name.",
|
|
275
|
+
"markdownDescription": "Name of target, used as the basis of target file name.",
|
|
234
276
|
"type": "string"
|
|
235
277
|
},
|
|
236
278
|
"removeDuplicates": {
|
|
237
279
|
"default": false,
|
|
238
280
|
"description": "Remove duplicate words, favor lower case words over mixed case words. Combine compound prefixes where possible.",
|
|
281
|
+
"markdownDescription": "Remove duplicate words, favor lower case words over mixed case words.\nCombine compound prefixes where possible.",
|
|
239
282
|
"type": "boolean"
|
|
240
283
|
},
|
|
284
|
+
"replacements": {
|
|
285
|
+
"$ref": "#/definitions/Replacements",
|
|
286
|
+
"description": "Replacement rules to apply to the words in the dictionary. The key is the pattern to match, and the value is the replacement string.",
|
|
287
|
+
"markdownDescription": "Replacement rules to apply to the words in the dictionary.\nThe key is the pattern to match, and the value is the replacement string."
|
|
288
|
+
},
|
|
241
289
|
"sort": {
|
|
242
290
|
"default": true,
|
|
243
291
|
"description": "Sort the words in the resulting dictionary. Does not apply to `trie` based formats.",
|
|
292
|
+
"markdownDescription": "Sort the words in the resulting dictionary.\nDoes not apply to `trie` based formats.",
|
|
244
293
|
"type": "boolean"
|
|
245
294
|
},
|
|
246
295
|
"sources": {
|
|
@@ -248,15 +297,18 @@
|
|
|
248
297
|
"items": {
|
|
249
298
|
"$ref": "#/definitions/DictionarySource"
|
|
250
299
|
},
|
|
300
|
+
"markdownDescription": "File sources used to build the dictionary.",
|
|
251
301
|
"type": "array"
|
|
252
302
|
},
|
|
253
303
|
"targetDirectory": {
|
|
254
304
|
"$ref": "#/definitions/FilePath",
|
|
255
305
|
"default": "current directory",
|
|
256
|
-
"description": "The target directory"
|
|
306
|
+
"description": "The target directory",
|
|
307
|
+
"markdownDescription": "The target directory"
|
|
257
308
|
},
|
|
258
309
|
"trieBase": {
|
|
259
310
|
"description": "Advanced: Set the trie base number. A value between 10 and 36 Set numeric base to use. 10 is the easiest to read. 16 is common hex format. 36 is the most compact.",
|
|
311
|
+
"markdownDescription": "Advanced: Set the trie base number. A value between 10 and 36\nSet numeric base to use.\n10 is the easiest to read.\n16 is common hex format.\n36 is the most compact.",
|
|
260
312
|
"type": "number"
|
|
261
313
|
}
|
|
262
314
|
},
|
|
@@ -272,6 +324,7 @@
|
|
|
272
324
|
"$schema": {
|
|
273
325
|
"default": "https://raw.githubusercontent.com/streetsidesoftware/cspell/main/packages/cspell-tools/cspell-tools.config.schema.json",
|
|
274
326
|
"description": "Url to JSON Schema",
|
|
327
|
+
"markdownDescription": "Url to JSON Schema",
|
|
275
328
|
"type": "string"
|
|
276
329
|
},
|
|
277
330
|
"allowedSplitWords": {
|
|
@@ -286,10 +339,12 @@
|
|
|
286
339
|
"type": "array"
|
|
287
340
|
}
|
|
288
341
|
],
|
|
289
|
-
"description": "Words in the `allowedSplitWords` are considered correct and can be used as a basis for splitting compound words.\n\nIf entries can be split so that all the words in the entry are allowed, then only the individual words are added, otherwise the entire entry is added. This is to prevent misspellings in CamelCase words from being introduced into the dictionary."
|
|
342
|
+
"description": "Words in the `allowedSplitWords` are considered correct and can be used as a basis for splitting compound words.\n\nIf entries can be split so that all the words in the entry are allowed, then only the individual words are added, otherwise the entire entry is added. This is to prevent misspellings in CamelCase words from being introduced into the dictionary.",
|
|
343
|
+
"markdownDescription": "Words in the `allowedSplitWords` are considered correct and can be used\nas a basis for splitting compound words.\n\nIf entries can be split so that all the words in the entry are allowed,\nthen only the individual words are added, otherwise the entire entry is added.\nThis is to prevent misspellings in CamelCase words from being introduced into the\ndictionary."
|
|
290
344
|
},
|
|
291
345
|
"checksumFile": {
|
|
292
346
|
"description": "Path to checksum file. `true` - defaults to `./checksum.txt`.",
|
|
347
|
+
"markdownDescription": "Path to checksum file. `true` - defaults to `./checksum.txt`.",
|
|
293
348
|
"type": [
|
|
294
349
|
"string",
|
|
295
350
|
"boolean"
|
|
@@ -300,39 +355,47 @@
|
|
|
300
355
|
"items": {
|
|
301
356
|
"type": "string"
|
|
302
357
|
},
|
|
358
|
+
"markdownDescription": "Injects `cspell-dictionary` directives into the dictionary header.\n\nExample:\n\n```ini\n# cspell-dictionary: no-generate-alternatives\n```\n\nKnown Directives:\n```yaml\n- split # Tell the dictionary loader to split words\n- no-split # Tell the dictionary loader to not split words (default)\n- generate-alternatives # Tell the dictionary loader to generate alternate spellings (default)\n- no-generate-alternatives # Tell the dictionary loader to not generate alternate spellings\n```",
|
|
303
359
|
"type": "array"
|
|
304
360
|
},
|
|
305
361
|
"generateNonStrict": {
|
|
306
362
|
"default": false,
|
|
307
363
|
"description": "Generate lower case / accent free versions of words.",
|
|
364
|
+
"markdownDescription": "Generate lower case / accent free versions of words.",
|
|
308
365
|
"type": "boolean"
|
|
309
366
|
},
|
|
310
367
|
"keepRawCase": {
|
|
311
368
|
"default": false,
|
|
312
369
|
"description": "Do not generate lower case / accent free versions of words.",
|
|
370
|
+
"markdownDescription": "Do not generate lower case / accent free versions of words.",
|
|
313
371
|
"type": "boolean"
|
|
314
372
|
},
|
|
315
373
|
"maxDepth": {
|
|
316
374
|
"description": "Maximum number of nested Hunspell Rules to apply. This is needed for recursive dictionaries like Hebrew.",
|
|
375
|
+
"markdownDescription": "Maximum number of nested Hunspell Rules to apply.\nThis is needed for recursive dictionaries like Hebrew.",
|
|
317
376
|
"type": "number"
|
|
318
377
|
},
|
|
319
378
|
"minCompoundLength": {
|
|
320
379
|
"default": 4,
|
|
321
380
|
"description": "Controls the minimum length of a compound word when storing words using `storeSplitWordsAsCompounds`. The compound words are prefixed / suffixed with `*`, to allow them to be combined with other compound words. If the length is too low, then the dictionary will consider many misspelled words as correct.",
|
|
381
|
+
"markdownDescription": "Controls the minimum length of a compound word when storing words using `storeSplitWordsAsCompounds`.\nThe compound words are prefixed / suffixed with `*`, to allow them to be combined with other compound words.\nIf the length is too low, then the dictionary will consider many misspelled words as correct.",
|
|
322
382
|
"type": "number"
|
|
323
383
|
},
|
|
324
384
|
"removeDuplicates": {
|
|
325
385
|
"default": false,
|
|
326
386
|
"description": "Remove duplicate words, favor lower case words over mixed case words. Combine compound prefixes where possible.",
|
|
387
|
+
"markdownDescription": "Remove duplicate words, favor lower case words over mixed case words.\nCombine compound prefixes where possible.",
|
|
327
388
|
"type": "boolean"
|
|
328
389
|
},
|
|
329
390
|
"rootDir": {
|
|
330
391
|
"description": "Specify the directory where all relative paths will resolved against. By default, all relative paths are relative to the location of the config file.",
|
|
392
|
+
"markdownDescription": "Specify the directory where all relative paths will resolved against.\nBy default, all relative paths are relative to the location of the\nconfig file.",
|
|
331
393
|
"type": "string"
|
|
332
394
|
},
|
|
333
395
|
"sort": {
|
|
334
396
|
"default": true,
|
|
335
397
|
"description": "Sort the words in the resulting dictionary. Does not apply to `trie` based formats.",
|
|
398
|
+
"markdownDescription": "Sort the words in the resulting dictionary.\nDoes not apply to `trie` based formats.",
|
|
336
399
|
"type": "boolean"
|
|
337
400
|
},
|
|
338
401
|
"split": {
|
|
@@ -346,11 +409,13 @@
|
|
|
346
409
|
}
|
|
347
410
|
],
|
|
348
411
|
"default": false,
|
|
349
|
-
"description": "Split lines into words."
|
|
412
|
+
"description": "Split lines into words.",
|
|
413
|
+
"markdownDescription": "Split lines into words."
|
|
350
414
|
},
|
|
351
415
|
"storeSplitWordsAsCompounds": {
|
|
352
416
|
"default": false,
|
|
353
417
|
"description": "Camel case words that have been split using the `allowedSplitWords` are added to the dictionary as compoundable words. These words are prefixed / suffixed with `*`.",
|
|
418
|
+
"markdownDescription": "Camel case words that have been split using the `allowedSplitWords` are added to the dictionary as compoundable words.\nThese words are prefixed / suffixed with `*`.",
|
|
354
419
|
"type": "boolean"
|
|
355
420
|
},
|
|
356
421
|
"targets": {
|
|
@@ -358,6 +423,7 @@
|
|
|
358
423
|
"items": {
|
|
359
424
|
"$ref": "#/definitions/Target"
|
|
360
425
|
},
|
|
426
|
+
"markdownDescription": "Optional Target Dictionaries to create.",
|
|
361
427
|
"type": "array"
|
|
362
428
|
}
|
|
363
429
|
},
|
package/dist/app.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as reportCheckChecksumFile, c as toError, i as logWithTimestamp, l as generateBTrie, n as compile, o as reportChecksumForFiles, r as setLogger, s as updateChecksumForFiles, t as build, u as compressFile } from "./build-
|
|
1
|
+
import { a as reportCheckChecksumFile, c as toError, i as logWithTimestamp, l as generateBTrie, n as compile, o as reportChecksumForFiles, r as setLogger, s as updateChecksumForFiles, t as build, u as compressFile } from "./build-Fod7lDHd.mjs";
|
|
2
2
|
import { readFileSync } from "node:fs";
|
|
3
3
|
import { CommanderError, Option } from "commander";
|
|
4
4
|
import { writeFile } from "node:fs/promises";
|
|
@@ -52,7 +52,8 @@ function calcTargets(sources, options) {
|
|
|
52
52
|
sources: sources.map(normalizeSource),
|
|
53
53
|
sort,
|
|
54
54
|
trieBase: parseNumber(options.trieBase),
|
|
55
|
-
generateNonStrict
|
|
55
|
+
generateNonStrict,
|
|
56
|
+
replacements: void 0
|
|
56
57
|
}];
|
|
57
58
|
return sources.map((source) => {
|
|
58
59
|
return {
|
|
@@ -63,7 +64,8 @@ function calcTargets(sources, options) {
|
|
|
63
64
|
sources: [normalizeSource(source)],
|
|
64
65
|
sort: options.sort,
|
|
65
66
|
trieBase: parseNumber(options.trieBase),
|
|
66
|
-
generateNonStrict
|
|
67
|
+
generateNonStrict,
|
|
68
|
+
replacements: void 0
|
|
67
69
|
};
|
|
68
70
|
});
|
|
69
71
|
}
|
|
@@ -736,7 +736,8 @@ function normalizeTargetWords(options) {
|
|
|
736
736
|
lineParser,
|
|
737
737
|
options.sort ? createInlineBufferedSort(1e4) : void 0,
|
|
738
738
|
opFilter(uniqueFilter(1e4)),
|
|
739
|
-
options.filter ? opFilter(options.filter) : void 0
|
|
739
|
+
options.filter ? opFilter(options.filter) : void 0,
|
|
740
|
+
replacementsToMapOperator(options.replacements)
|
|
740
741
|
].filter(isDefined);
|
|
741
742
|
return opCombine(...operations);
|
|
742
743
|
}
|
|
@@ -879,6 +880,16 @@ function createParseFileLineMapper(options) {
|
|
|
879
880
|
function parseFileLines(lines, options) {
|
|
880
881
|
return createParseFileLineMapper(options)(typeof lines === "string" ? [lines] : lines);
|
|
881
882
|
}
|
|
883
|
+
function replacementsToMapOperator(replacements) {
|
|
884
|
+
if (!replacements) return void 0;
|
|
885
|
+
return opMap((word) => {
|
|
886
|
+
for (const [pattern, replacement] of Object.entries(replacements)) {
|
|
887
|
+
const r = new RegExp(pattern, "gv");
|
|
888
|
+
word = word.replaceAll(r, replacement);
|
|
889
|
+
}
|
|
890
|
+
return word;
|
|
891
|
+
});
|
|
892
|
+
}
|
|
882
893
|
//#endregion
|
|
883
894
|
//#region src/compiler/SourceReader.ts
|
|
884
895
|
async function createSourceReader(filename, options) {
|
|
@@ -1082,7 +1093,8 @@ async function compile(request, options) {
|
|
|
1082
1093
|
const targetOptions = {
|
|
1083
1094
|
sort: request.sort,
|
|
1084
1095
|
generateNonStrict: request.generateNonStrict,
|
|
1085
|
-
removeDuplicates: request.removeDuplicates
|
|
1096
|
+
removeDuplicates: request.removeDuplicates,
|
|
1097
|
+
replacements: void 0
|
|
1086
1098
|
};
|
|
1087
1099
|
const conditional = options?.conditionalBuild || false;
|
|
1088
1100
|
const checksumFile = resolveChecksumFile(request.checksumFile || conditional, rootDir);
|
|
@@ -1141,7 +1153,7 @@ function genBuildTargetDictionaryOptions(target, compileOptions) {
|
|
|
1141
1153
|
}
|
|
1142
1154
|
async function buildTargetDictionary(target, options, compileOptions, buildOptions) {
|
|
1143
1155
|
const { rootDir, checksumFile, conditional } = compileOptions;
|
|
1144
|
-
const { format, sources, trieBase, sort = true, generateNonStrict = false, excludeWordsFrom = [], excludeWordsNotFoundIn = [], excludeWordsMatchingRegex } = target;
|
|
1156
|
+
const { format, sources, trieBase, sort = true, generateNonStrict = false, excludeWordsFrom = [], excludeWordsNotFoundIn = [], excludeWordsMatchingRegex, replacements } = target;
|
|
1145
1157
|
const { filename, useTrie, generateOnlyCompressedDictionary, checksumRoot } = buildOptions;
|
|
1146
1158
|
const dictionaryDirectives = target.dictionaryDirectives ?? compileOptions.dictionaryDirectives;
|
|
1147
1159
|
const removeDuplicates = target.removeDuplicates ?? false;
|
|
@@ -1158,7 +1170,8 @@ async function buildTargetDictionary(target, options, compileOptions, buildOptio
|
|
|
1158
1170
|
sort: useTrie || sort,
|
|
1159
1171
|
generateNonStrict,
|
|
1160
1172
|
filter: excludeFilter,
|
|
1161
|
-
dictionaryDirectives
|
|
1173
|
+
dictionaryDirectives,
|
|
1174
|
+
replacements
|
|
1162
1175
|
});
|
|
1163
1176
|
const deps = [...calculateDependencies(filename + (compress ? ".gz" : ""), filesToProcess, [...excludeWordsFrom, ...excludeWordsNotFoundIn], checksumRoot)];
|
|
1164
1177
|
if (conditional && checksumFile) {
|
|
@@ -1176,7 +1189,8 @@ async function buildTargetDictionary(target, options, compileOptions, buildOptio
|
|
|
1176
1189
|
sort,
|
|
1177
1190
|
generateNonStrict,
|
|
1178
1191
|
dictionaryDirectives,
|
|
1179
|
-
removeDuplicates
|
|
1192
|
+
removeDuplicates,
|
|
1193
|
+
replacements
|
|
1180
1194
|
});
|
|
1181
1195
|
await createTargetFile(dst, iterableToString(pipe(words, normalizer, compiler)), compress);
|
|
1182
1196
|
}
|
|
@@ -1385,4 +1399,4 @@ function normalizeRequest(buildInfo, root) {
|
|
|
1385
1399
|
//#endregion
|
|
1386
1400
|
export { reportCheckChecksumFile as a, toError as c, logWithTimestamp as i, generateBTrie as l, compile as n, reportChecksumForFiles as o, setLogger as r, updateChecksumForFiles as s, build as t, compressFile as u };
|
|
1387
1401
|
|
|
1388
|
-
//# sourceMappingURL=build-
|
|
1402
|
+
//# sourceMappingURL=build-Fod7lDHd.mjs.map
|
package/dist/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { l as generateBTrie, t as build } from "./build-
|
|
1
|
+
import { l as generateBTrie, t as build } from "./build-Fod7lDHd.mjs";
|
|
2
2
|
export { build, generateBTrie };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cspell/cspell-tools",
|
|
3
|
-
"version": "10.3.
|
|
3
|
+
"version": "10.3.1-alpha.1",
|
|
4
4
|
"description": "Tools to assist with the development of cSpell",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
},
|
|
15
15
|
"scripts": {
|
|
16
16
|
"build": "pnpm run build-schema && pnpm run compile && pnpm build:check",
|
|
17
|
-
"build-schema": "ts-json-schema-generator --no-top-ref --path src/config/config.ts --type RunConfig --validation-keywords deprecated -o ./cspell-tools.config.schema.json",
|
|
17
|
+
"build-schema": "ts-json-schema-generator --no-top-ref --path src/config/config.ts --type RunConfig --validation-keywords deprecated --markdown-description -o ./cspell-tools.config.schema.json",
|
|
18
18
|
"compile": "tsdown",
|
|
19
19
|
"build:check": "tsc -p .",
|
|
20
20
|
"watch": "tsdown -w",
|
|
@@ -65,12 +65,12 @@
|
|
|
65
65
|
},
|
|
66
66
|
"homepage": "https://github.com/streetsidesoftware/cspell/tree/main/packages/cspell-tools#readme",
|
|
67
67
|
"dependencies": {
|
|
68
|
-
"@cspell/cspell-pipe": "10.3.
|
|
68
|
+
"@cspell/cspell-pipe": "10.3.1-alpha.1",
|
|
69
69
|
"commander": "^15.0.0",
|
|
70
70
|
"cosmiconfig": "10.0.1",
|
|
71
|
-
"cspell-trie-lib": "10.3.
|
|
71
|
+
"cspell-trie-lib": "10.3.1-alpha.1",
|
|
72
72
|
"glob": "^13.0.6",
|
|
73
|
-
"hunspell-reader": "10.3.
|
|
73
|
+
"hunspell-reader": "10.3.1-alpha.1",
|
|
74
74
|
"yaml": "^2.9.0"
|
|
75
75
|
},
|
|
76
76
|
"engines": {
|
|
@@ -80,5 +80,5 @@
|
|
|
80
80
|
"lorem-ipsum": "^3.0.0",
|
|
81
81
|
"ts-json-schema-generator": "2.9.0"
|
|
82
82
|
},
|
|
83
|
-
"gitHead": "
|
|
83
|
+
"gitHead": "aa0576e5b7e666a7e8645939871bcfe4fa2a7eb5"
|
|
84
84
|
}
|