Skip to content

Commit 6c312b9

Browse files
feat: Add Support reading / writing bTrie files (#8204)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
1 parent c81097e commit 6c312b9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+1023
-164
lines changed

eslint.config.mjs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,6 @@ export default defineConfig(
180180
'packages/*/esm/**',
181181
'packages/*/fixtures/**',
182182
'packages/*/out/**',
183-
'packages/client/server/**',
184183
'test-fixtures/**',
185184
'test-packages/cspell-eslint-plugin/**',
186185
'test-packages/yarn/**',
@@ -224,7 +223,7 @@ export default defineConfig(
224223
},
225224
},
226225
{
227-
files: ['**/*.mts', '**/*.ts', '**/*.tsx', '**/*.cts'],
226+
files: ['**/*.{ts,mts,cts,tsx}'],
228227
rules: {
229228
'@typescript-eslint/no-import-type-side-effects': 'error',
230229
'@typescript-eslint/consistent-type-imports': [

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@
5757
"test-build-docs": "cd website && pnpm run build:site",
5858
"test-integrations": "cd ./integration-tests && pnpm run integration-tests",
5959
"test-schema": "node ./test-packages/cspell-types/validate-schema/validate-schema.mjs",
60+
"test:deno": "deno run -A ./bin.mjs lint rfc packages/cspell/src",
6061
"update-changelog": "node ./scripts/gen-release.mjs CHANGELOG.md packages/cspell/CHANGELOG.md",
6162
"update-packages": "pnpm run update-packages-src && pnpm run update-packages-docs && pnpm update-package-json",
6263
"update-packages-docs": "cd website && pnpm run update-packages",

packages/cspell-dictionary/src/SpellingDictionary/SpellingDictionaryFromTrie.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import type { Buffer } from 'node:buffer';
2-
31
import type {
42
FindFullResult,
53
FindWordOptions,
@@ -230,7 +228,7 @@ type FindAnyFormResult = FindFullResult;
230228
* @returns SpellingDictionary
231229
*/
232230
export function createSpellingDictionaryFromTrieFile(
233-
data: string | Buffer,
231+
data: string | Uint8Array,
234232
name: string,
235233
source: string,
236234
options: SpellingDictionaryOptionsRO,

packages/cspell-lib/api/api.d.ts

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/cspell-tools/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
fixtures/*/dict/**

packages/cspell-tools/bin.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import { CommanderError, program } from 'commander';
44

5-
import { run } from './dist/app.js';
5+
import { run } from './dist/app.mjs';
66

77
run(program, process.argv).catch((e) => {
88
if (!(e instanceof CommanderError)) {

packages/cspell-tools/cSpell.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
"language": "en",
44
"ignorePaths": ["__snapshots__", "*.aff", "*.dic", "coverage", "dist", "fixtures", "temp"],
55
"useGitignore": true,
6-
"words": ["COMPOUNDFLAG", "gensequence", "Gzipped", "lcov", "pnpm", "rxjs", "tsbuildinfo", "xregexp"]
6+
"words": ["btrie", "COMPOUNDFLAG", "gensequence", "Gzipped", "lcov", "pnpm", "rxjs", "tsbuildinfo", "xregexp"]
77
}

packages/cspell-tools/fixtures/build-multi-target/cspell-tools.config.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,15 @@ targets:
55
sources:
66
- ../dicts/colors.txt
77
format: plaintext
8+
targetDirectory: '${cwd}/dict'
89
- name: cities
910
sources:
1011
- ../dicts/cities.txt
1112
format: plaintext
13+
targetDirectory: '${cwd}/dict'
1214
- name: code
1315
sources:
1416
- filename: ../dicts/sampleCodeDic.txt
1517
keepRawCase: true
1618
format: plaintext
19+
targetDirectory: '${cwd}/dict'

packages/cspell-tools/package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,11 @@
1313
"cspell-tools-cli": "bin.mjs"
1414
},
1515
"scripts": {
16-
"build": "pnpm run build-schema && pnpm run compile",
16+
"build": "pnpm run build-schema && pnpm run compile && pnpm build:check",
1717
"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",
18-
"compile": "tsc -p tsconfig.esm.json",
19-
"watch": "tsc -p tsconfig.esm.json -w",
18+
"compile": "tsdown",
19+
"build:check": "tsc -p .",
20+
"watch": "tsdown -w",
2021
"clean-build": "pnpm run clean && pnpm run build",
2122
"clean": "shx rm -rf dist temp coverage \"*.tsbuildInfo\"",
2223
"coverage": "vitest run --coverage",
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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';
23
export { parseFlags } from './parseFlags.js';

0 commit comments

Comments
 (0)