@cspell/cspell-tools 9.0.2 → 9.1.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.
@@ -1,24 +1,24 @@
1
1
  export interface CompileCommonAppOptions {
2
- output?: string;
2
+ output?: string | undefined;
3
3
  compress: boolean;
4
4
  /**
5
5
  * @deprecated Use maxDepth
6
6
  */
7
- max_depth?: string;
8
- maxDepth?: string;
9
- merge?: string;
10
- experimental?: string[];
11
- split?: boolean;
12
- sort?: boolean;
13
- keepRawCase?: boolean;
14
- trie?: boolean;
15
- trie3?: boolean;
16
- trie4?: boolean;
17
- trieBase?: string;
18
- listFile?: string[];
19
- useLegacySplitter?: boolean;
7
+ max_depth?: string | undefined;
8
+ maxDepth?: string | undefined;
9
+ merge?: string | undefined;
10
+ experimental?: string[] | undefined;
11
+ split?: boolean | undefined;
12
+ sort?: boolean | undefined;
13
+ keepRawCase?: boolean | undefined;
14
+ trie?: boolean | undefined;
15
+ trie3?: boolean | undefined;
16
+ trie4?: boolean | undefined;
17
+ trieBase?: string | undefined;
18
+ listFile?: string[] | undefined;
19
+ useLegacySplitter?: boolean | undefined;
20
20
  /** Indicate that a config file should be created instead of building. */
21
- init?: boolean;
21
+ init?: boolean | undefined;
22
22
  }
23
23
  export interface CompileAppOptions extends CompileCommonAppOptions {
24
24
  sort: boolean;
package/dist/compile.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import type { CompileCommonAppOptions } from './AppOptions.js';
2
2
  import type { FeatureFlags } from './FeatureFlags/index.js';
3
- export declare const configFileHeader = "# yaml-language-server: $schema=https://raw.githubusercontent.com/streetsidesoftware/cspell/main/packages/cspell-tools/cspell-tools.config.schema.json\n\n";
3
+ export declare const configFileHeader: string;
4
4
  export declare function processCompileAction(src: string[], options: CompileCommonAppOptions, featureFlags: FeatureFlags | undefined): Promise<void>;
5
5
  //# sourceMappingURL=compile.d.ts.map
@@ -13,7 +13,7 @@ export interface CompileOptions {
13
13
  * @param word the word to test
14
14
  * @returns `true` to keep the word, `false` to exclude it.
15
15
  */
16
- filter?: (word: string) => boolean;
16
+ filter?: ((word: string) => boolean) | undefined;
17
17
  /**
18
18
  * Injects `cspell-dictionary` directives into the dictionary header.
19
19
  *
@@ -30,6 +30,6 @@ export interface CompileOptions {
30
30
  * Combine compound prefixes where possible.
31
31
  * @default false
32
32
  */
33
- removeDuplicates?: boolean;
33
+ removeDuplicates?: boolean | undefined;
34
34
  }
35
35
  //# sourceMappingURL=CompileOptions.d.ts.map
@@ -3,7 +3,7 @@ export interface SourceReaderOptions {
3
3
  /**
4
4
  * Max Hunspell recursive depth.
5
5
  */
6
- maxDepth?: number;
6
+ maxDepth?: number | undefined;
7
7
  /**
8
8
  * split words if necessary.
9
9
  */
@@ -13,8 +13,8 @@ export interface SourceReaderOptions {
13
13
  * before processing. Applies only to text file sources.
14
14
  * @default false
15
15
  */
16
- legacy?: boolean;
17
- keepCase?: boolean;
16
+ legacy?: boolean | undefined;
17
+ keepCase?: boolean | undefined;
18
18
  allowedSplitWords: AllowedSplitWordsCollection;
19
19
  storeSplitWordsAsCompounds: boolean | undefined;
20
20
  minCompoundLength?: number | undefined;
@@ -3,11 +3,11 @@ interface CompileOptions {
3
3
  /**
4
4
  * Optional filter function to filter targets.
5
5
  */
6
- filter?: (target: Target) => boolean;
6
+ filter?: ((target: Target) => boolean) | undefined;
7
7
  /**
8
8
  * The current working directory. Defaults to process.cwd()
9
9
  */
10
- cwd?: string;
10
+ cwd?: string | undefined;
11
11
  /**
12
12
  * `true` - only build if files do not match checksum.
13
13
  */
@@ -2,7 +2,7 @@ export interface ReaderOptions {
2
2
  /**
3
3
  * Max Hunspell recursive depth.
4
4
  */
5
- maxDepth?: number;
5
+ maxDepth?: number | undefined;
6
6
  }
7
7
  export type AnnotatedWord = string;
8
8
  export interface BaseReader {
@@ -2,9 +2,9 @@ import type { CompileOptions } from './CompileOptions.js';
2
2
  export declare function compileWordList(lines: Iterable<string>, destFilename: string, options: CompileOptions): Promise<void>;
3
3
  declare function removeDuplicates(words: Iterable<string>): Iterable<string>;
4
4
  export interface TrieOptions {
5
- base?: number;
6
- trie3?: boolean;
7
- trie4?: boolean;
5
+ base?: number | undefined;
6
+ trie3?: boolean | undefined;
7
+ trie4?: boolean | undefined;
8
8
  }
9
9
  export interface CompileTrieOptions extends CompileOptions, TrieOptions {
10
10
  }
@@ -7,7 +7,7 @@ export interface ParseFileOptions {
7
7
  * Preserve case
8
8
  * @default true
9
9
  */
10
- keepCase?: boolean;
10
+ keepCase?: boolean | undefined;
11
11
  /**
12
12
  * Tell the parser to split into words along spaces.
13
13
  * @default false
@@ -22,7 +22,7 @@ export interface ParseFileOptions {
22
22
  * Use legacy splitting.
23
23
  * @default false
24
24
  */
25
- legacy?: boolean;
25
+ legacy?: boolean | undefined;
26
26
  allowedSplitWords: AllowedSplitWordsCollection;
27
27
  /**
28
28
  * Words that have been split using the `allowedSplitWords` are added to the dictionary as compoundable words.
@@ -1,26 +1,26 @@
1
- export interface RunConfig extends Partial<CompileRequest> {
1
+ export interface RunConfig extends Partial<Omit<CompileRequest, 'targets'>> {
2
2
  /**
3
3
  * Url to JSON Schema
4
4
  * @default "https://raw.githubusercontent.com/streetsidesoftware/cspell/main/packages/cspell-tools/cspell-tools.config.schema.json"
5
5
  */
6
- $schema?: string;
6
+ $schema?: string | undefined;
7
7
  /**
8
8
  * Optional Target Dictionaries to create.
9
9
  */
10
- targets?: Target[];
10
+ targets?: Target[] | undefined;
11
11
  /**
12
12
  * Specify the directory where all relative paths will resolved against.
13
13
  * By default, all relative paths are relative to the location of the
14
14
  * config file.
15
15
  */
16
- rootDir?: string;
16
+ rootDir?: string | undefined;
17
17
  }
18
18
  export interface CompileRequest extends CompileTargetOptions, CompileSourceOptions {
19
19
  /**
20
20
  * Specify the directory where all relative paths will resolved against.
21
21
  * By default, all relative paths are relative to the current directory.
22
22
  */
23
- rootDir?: string;
23
+ rootDir?: string | undefined;
24
24
  /**
25
25
  * Target Dictionaries to create.
26
26
  */
@@ -28,7 +28,7 @@ export interface CompileRequest extends CompileTargetOptions, CompileSourceOptio
28
28
  /**
29
29
  * Path to checksum file. `true` - defaults to `./checksum.txt`.
30
30
  */
31
- checksumFile?: string | boolean;
31
+ checksumFile?: string | boolean | undefined;
32
32
  }
33
33
  export interface Experimental {
34
34
  /**
@@ -28,7 +28,7 @@ interface ReportResult {
28
28
  }
29
29
  interface ReportOptions {
30
30
  root?: string | undefined;
31
- listFile?: string[];
31
+ listFile?: string[] | undefined;
32
32
  }
33
33
  export declare function reportChecksumForFiles(files: string[], options: ReportOptions): Promise<ReportResult>;
34
34
  export declare function reportCheckChecksumFile(filename: string, files: string[] | undefined, options: ReportOptions): Promise<ReportResult>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cspell/cspell-tools",
3
- "version": "9.0.2",
3
+ "version": "9.1.0",
4
4
  "description": "Tools to assist with the development of cSpell",
5
5
  "publishConfig": {
6
6
  "access": "public",
@@ -15,8 +15,8 @@
15
15
  "scripts": {
16
16
  "build": "pnpm run build-schema && pnpm run compile",
17
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",
18
- "compile": "tsc -p .",
19
- "watch": "tsc -p . -w",
18
+ "compile": "tsc -p tsconfig.esm.json",
19
+ "watch": "tsc -p tsconfig.esm.json -w",
20
20
  "clean-build": "pnpm run clean && pnpm run build",
21
21
  "clean": "shx rm -rf dist temp coverage \"*.tsbuildInfo\"",
22
22
  "coverage": "vitest run --coverage",
@@ -63,12 +63,12 @@
63
63
  },
64
64
  "homepage": "https://github.com/streetsidesoftware/cspell/tree/main/packages/cspell-tools#readme",
65
65
  "dependencies": {
66
- "@cspell/cspell-pipe": "9.0.2",
66
+ "@cspell/cspell-pipe": "9.1.0",
67
67
  "commander": "^14.0.0",
68
68
  "cosmiconfig": "9.0.0",
69
- "cspell-trie-lib": "9.0.2",
69
+ "cspell-trie-lib": "9.1.0",
70
70
  "glob": "^10.4.5",
71
- "hunspell-reader": "9.0.2",
71
+ "hunspell-reader": "9.1.0",
72
72
  "yaml": "^2.8.0"
73
73
  },
74
74
  "engines": {
@@ -79,5 +79,5 @@
79
79
  "ts-json-schema-generator": "^2.4.0"
80
80
  },
81
81
  "module": "bin.mjs",
82
- "gitHead": "39dbd9ab9b8943a023d9eda7f65f81e822f939b5"
82
+ "gitHead": "a7ed42a31debbc86faa4a4ac2c686bdffe5b26b6"
83
83
  }