@cspell/cspell-tools 10.0.0 → 10.0.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.
- package/dist/app.mjs +7 -2
- package/dist/{build-JrGA5AHH.mjs → build-C6ZfB6mS.mjs} +25 -50
- package/dist/index.mjs +1 -1
- package/package.json +7 -7
package/dist/app.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as reportCheckChecksumFile, c as toError,
|
|
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-C6ZfB6mS.mjs";
|
|
2
2
|
import { readFileSync } from "node:fs";
|
|
3
3
|
import { CommanderError, Option } from "commander";
|
|
4
4
|
import { writeFile } from "node:fs/promises";
|
|
@@ -31,6 +31,10 @@ function createCompileRequest(sourceFiles, options) {
|
|
|
31
31
|
targets: calcTargets([...sourceFiles, ...(options.listFile || []).map((listFile) => ({ listFile }))], options),
|
|
32
32
|
maxDepth: parseNumber(maxDepth),
|
|
33
33
|
split: useLegacySplitter ? "legacy" : split,
|
|
34
|
+
/**
|
|
35
|
+
* Do not generate lower case / accent free versions of words.
|
|
36
|
+
* @default false
|
|
37
|
+
*/
|
|
34
38
|
keepRawCase
|
|
35
39
|
};
|
|
36
40
|
}
|
|
@@ -160,6 +164,7 @@ var FeatureFlags = class FeatureFlags {
|
|
|
160
164
|
}
|
|
161
165
|
};
|
|
162
166
|
var UnknownFeatureFlagError = class extends Error {
|
|
167
|
+
flag;
|
|
163
168
|
constructor(flag) {
|
|
164
169
|
super(`Unknown feature flag: ${flag}`);
|
|
165
170
|
this.flag = flag;
|
|
@@ -250,7 +255,7 @@ function addCompileOptions(compileCommand) {
|
|
|
250
255
|
async function run(program, argv, flags) {
|
|
251
256
|
async function handleGzip(files) {
|
|
252
257
|
try {
|
|
253
|
-
await gzipFiles(files,
|
|
258
|
+
await gzipFiles(files, 3);
|
|
254
259
|
} catch (error) {
|
|
255
260
|
const err = toError(error);
|
|
256
261
|
program.error(err.message);
|
|
@@ -17,15 +17,6 @@ import { Buffer } from "node:buffer";
|
|
|
17
17
|
//#region src/gzip/compressFiles.ts
|
|
18
18
|
const gzip$1 = promisify(gzip);
|
|
19
19
|
const gunzip$1 = promisify(gunzip);
|
|
20
|
-
let OSFlags = /* @__PURE__ */ function(OSFlags) {
|
|
21
|
-
OSFlags[OSFlags["auto"] = -1] = "auto";
|
|
22
|
-
OSFlags[OSFlags["FAT"] = 0] = "FAT";
|
|
23
|
-
OSFlags[OSFlags["Unix"] = 3] = "Unix";
|
|
24
|
-
OSFlags[OSFlags["HPFS"] = 6] = "HPFS";
|
|
25
|
-
OSFlags[OSFlags["MACOS"] = 7] = "MACOS";
|
|
26
|
-
OSFlags[OSFlags["NTFS"] = 11] = "NTFS";
|
|
27
|
-
return OSFlags;
|
|
28
|
-
}({});
|
|
29
20
|
const OSSystemIDOffset = 9;
|
|
30
21
|
async function compressFile(file, os) {
|
|
31
22
|
if (file.endsWith(".gz")) return file;
|
|
@@ -53,8 +44,8 @@ function isGZipped(data) {
|
|
|
53
44
|
if (typeof data === "string") return false;
|
|
54
45
|
return data[0] === 31 && data[1] === 139;
|
|
55
46
|
}
|
|
56
|
-
function fixOSSystemID(zBuf, os =
|
|
57
|
-
zBuf[OSSystemIDOffset] = os ===
|
|
47
|
+
function fixOSSystemID(zBuf, os = 3) {
|
|
48
|
+
zBuf[OSSystemIDOffset] = os === -1 ? zBuf[OSSystemIDOffset] : os;
|
|
58
49
|
return zBuf;
|
|
59
50
|
}
|
|
60
51
|
async function decompress(buf, encoding) {
|
|
@@ -1009,37 +1000,21 @@ function* removeDuplicates(words) {
|
|
|
1009
1000
|
}
|
|
1010
1001
|
}
|
|
1011
1002
|
}
|
|
1012
|
-
/**
|
|
1013
|
-
* solo
|
|
1014
|
-
* optional_prefix*
|
|
1015
|
-
* optional_suffix*
|
|
1016
|
-
* required_prefix+
|
|
1017
|
-
* required_suffix+
|
|
1018
|
-
*/
|
|
1019
|
-
var Flags = /* @__PURE__ */ function(Flags) {
|
|
1020
|
-
Flags[Flags["base"] = 0] = "base";
|
|
1021
|
-
Flags[Flags["none"] = 1] = "none";
|
|
1022
|
-
Flags[Flags["both"] = 2] = "both";
|
|
1023
|
-
Flags[Flags["pfx"] = 4] = "pfx";
|
|
1024
|
-
Flags[Flags["sfx"] = 8] = "sfx";
|
|
1025
|
-
Flags[Flags["all"] = 15] = "all";
|
|
1026
|
-
return Flags;
|
|
1027
|
-
}(Flags || {});
|
|
1028
1003
|
function applyFlags(word, flags) {
|
|
1029
|
-
if (flags ===
|
|
1030
|
-
if (flags ===
|
|
1031
|
-
if (flags ===
|
|
1032
|
-
if (flags ===
|
|
1033
|
-
if (flags ===
|
|
1034
|
-
if (flags ===
|
|
1035
|
-
if (flags ===
|
|
1036
|
-
if (flags ===
|
|
1037
|
-
if (flags ===
|
|
1038
|
-
if (flags ===
|
|
1039
|
-
if (flags ===
|
|
1040
|
-
if (flags ===
|
|
1041
|
-
if (flags ===
|
|
1042
|
-
if (flags ===
|
|
1004
|
+
if (flags === 1) return [word];
|
|
1005
|
+
if (flags === 15) return ["*" + word + "*"];
|
|
1006
|
+
if (flags === 2) return ["+" + word + "+"];
|
|
1007
|
+
if (flags === 4) return [word + "+"];
|
|
1008
|
+
if (flags === 8) return ["+" + word];
|
|
1009
|
+
if (flags === 9) return ["*" + word];
|
|
1010
|
+
if (flags === 5) return [word + "*"];
|
|
1011
|
+
if (flags === 13) return [word + "*", "*" + word];
|
|
1012
|
+
if (flags === 3) return ["*" + word + "*"];
|
|
1013
|
+
if (flags === 11) return [word, "+" + word + "*"];
|
|
1014
|
+
if (flags === 7) return [word, "*" + word + "+"];
|
|
1015
|
+
if (flags === 6) return ["*" + word + "+"];
|
|
1016
|
+
if (flags === 10) return ["+" + word + "*"];
|
|
1017
|
+
if (flags === 14) return ["+" + word + "*", "*" + word + "+"];
|
|
1043
1018
|
return ["+" + word, word + "+"];
|
|
1044
1019
|
}
|
|
1045
1020
|
function removeDuplicateForms(forms) {
|
|
@@ -1050,13 +1025,13 @@ function removeDuplicateForms(forms) {
|
|
|
1050
1025
|
const canBeSuffix = word.startsWith("*");
|
|
1051
1026
|
const mustBeSuffix = !canBeSuffix && word.startsWith("+");
|
|
1052
1027
|
const isSuffix = canBeSuffix || mustBeSuffix;
|
|
1053
|
-
if (canBePrefix && canBeSuffix) return flag |
|
|
1054
|
-
if (mustBePrefix && mustBeSuffix) return flag |
|
|
1055
|
-
if (!isPrefix && !isSuffix) return flag |
|
|
1056
|
-
flag |= isPrefix && !isSuffix ?
|
|
1057
|
-
flag |= isSuffix && !isPrefix ?
|
|
1058
|
-
flag |= canBePrefix && !mustBeSuffix ?
|
|
1059
|
-
flag |= canBeSuffix && !mustBePrefix ?
|
|
1028
|
+
if (canBePrefix && canBeSuffix) return flag | 15;
|
|
1029
|
+
if (mustBePrefix && mustBeSuffix) return flag | 2;
|
|
1030
|
+
if (!isPrefix && !isSuffix) return flag | 1;
|
|
1031
|
+
flag |= isPrefix && !isSuffix ? 4 : 0;
|
|
1032
|
+
flag |= isSuffix && !isPrefix ? 8 : 0;
|
|
1033
|
+
flag |= canBePrefix && !mustBeSuffix ? 1 : 0;
|
|
1034
|
+
flag |= canBeSuffix && !mustBePrefix ? 1 : 0;
|
|
1060
1035
|
return flag;
|
|
1061
1036
|
}
|
|
1062
1037
|
const m = /* @__PURE__ */ new Map();
|
|
@@ -1399,6 +1374,6 @@ function normalizeRequest(buildInfo, root) {
|
|
|
1399
1374
|
};
|
|
1400
1375
|
}
|
|
1401
1376
|
//#endregion
|
|
1402
|
-
export { reportCheckChecksumFile as a, toError as c,
|
|
1377
|
+
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 };
|
|
1403
1378
|
|
|
1404
|
-
//# sourceMappingURL=build-
|
|
1379
|
+
//# sourceMappingURL=build-C6ZfB6mS.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-C6ZfB6mS.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.0.
|
|
3
|
+
"version": "10.0.1",
|
|
4
4
|
"description": "Tools to assist with the development of cSpell",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public",
|
|
@@ -64,21 +64,21 @@
|
|
|
64
64
|
},
|
|
65
65
|
"homepage": "https://github.com/streetsidesoftware/cspell/tree/main/packages/cspell-tools#readme",
|
|
66
66
|
"dependencies": {
|
|
67
|
-
"@cspell/cspell-pipe": "10.0.
|
|
67
|
+
"@cspell/cspell-pipe": "10.0.1",
|
|
68
68
|
"commander": "^14.0.3",
|
|
69
69
|
"cosmiconfig": "9.0.1",
|
|
70
|
-
"cspell-trie-lib": "10.0.
|
|
70
|
+
"cspell-trie-lib": "10.0.1",
|
|
71
71
|
"glob": "^13.0.6",
|
|
72
|
-
"hunspell-reader": "10.0.
|
|
73
|
-
"yaml": "^2.
|
|
72
|
+
"hunspell-reader": "10.0.1",
|
|
73
|
+
"yaml": "^2.9.0"
|
|
74
74
|
},
|
|
75
75
|
"engines": {
|
|
76
76
|
"node": ">=22.18.0"
|
|
77
77
|
},
|
|
78
78
|
"devDependencies": {
|
|
79
|
-
"lorem-ipsum": "^2.0.
|
|
79
|
+
"lorem-ipsum": "^2.0.10",
|
|
80
80
|
"ts-json-schema-generator": "2.9.0"
|
|
81
81
|
},
|
|
82
82
|
"module": "bin.mjs",
|
|
83
|
-
"gitHead": "
|
|
83
|
+
"gitHead": "0f43abf29e5da0ecbcb08214055cdc1e3267c3ea"
|
|
84
84
|
}
|