@cspell/cspell-tools 7.0.1-alpha.8 → 7.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/cspell-tools.config.schema.json +5 -0
- package/dist/compile.d.ts +1 -1
- package/dist/compile.js +6 -3
- package/dist/config/config.d.ts +6 -0
- package/dist/config/config.js +1 -1
- package/package.json +7 -10
|
@@ -195,6 +195,11 @@
|
|
|
195
195
|
}
|
|
196
196
|
},
|
|
197
197
|
"properties": {
|
|
198
|
+
"$schema": {
|
|
199
|
+
"default": "https://raw.githubusercontent.com/streetsidesoftware/cspell/main/packages/cspell-tools/cspell-tools.config.schema.json",
|
|
200
|
+
"description": "Url to JSON Schema",
|
|
201
|
+
"type": "string"
|
|
202
|
+
},
|
|
198
203
|
"allowedSplitWords": {
|
|
199
204
|
"anyOf": [
|
|
200
205
|
{
|
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
|
|
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
|
package/dist/compile.js
CHANGED
|
@@ -3,11 +3,12 @@ import { opConcatMap, pipe } from '@cspell/cspell-pipe/sync';
|
|
|
3
3
|
import YAML from 'yaml';
|
|
4
4
|
import { compile } from './compiler/compile.js';
|
|
5
5
|
import { createCompileRequest } from './compiler/createCompileRequest.js';
|
|
6
|
+
import { configFileSchemaURL } from './config/config.js';
|
|
6
7
|
import { getSystemFeatureFlags, parseFlags } from './FeatureFlags/index.js';
|
|
7
8
|
import { globP } from './util/globP.js';
|
|
8
9
|
getSystemFeatureFlags().register('compound', 'Enable compound dictionary sources.');
|
|
9
10
|
const defaultConfigFile = 'cspell-tools.config.yaml';
|
|
10
|
-
export const configFileHeader =
|
|
11
|
+
export const configFileHeader = `# yaml-language-server: $schema=${configFileSchemaURL}\n\n`;
|
|
11
12
|
export async function processCompileAction(src, options, featureFlags) {
|
|
12
13
|
const ff = featureFlags || getSystemFeatureFlags();
|
|
13
14
|
parseFlags(ff, options.experimental || []);
|
|
@@ -26,8 +27,10 @@ async function useCompile(src, options) {
|
|
|
26
27
|
const request = createCompileRequest(sources, options);
|
|
27
28
|
return options.init ? initConfig(request) : compile(request);
|
|
28
29
|
}
|
|
29
|
-
async function initConfig(
|
|
30
|
-
const
|
|
30
|
+
async function initConfig(runConfig) {
|
|
31
|
+
const { $schema = configFileSchemaURL, ...cfg } = runConfig;
|
|
32
|
+
const config = { $schema, ...cfg };
|
|
33
|
+
const content = configFileHeader + YAML.stringify(config, null, 2);
|
|
31
34
|
console.log('Writing config file: %s', defaultConfigFile);
|
|
32
35
|
await writeFile(defaultConfigFile, content);
|
|
33
36
|
console.log(`Init complete.
|
package/dist/config/config.d.ts
CHANGED
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
export interface RunConfig extends Partial<CompileRequest> {
|
|
2
|
+
/**
|
|
3
|
+
* Url to JSON Schema
|
|
4
|
+
* @default "https://raw.githubusercontent.com/streetsidesoftware/cspell/main/packages/cspell-tools/cspell-tools.config.schema.json"
|
|
5
|
+
*/
|
|
6
|
+
$schema?: string;
|
|
2
7
|
/**
|
|
3
8
|
* Optional Target Dictionaries to create.
|
|
4
9
|
*/
|
|
@@ -123,4 +128,5 @@ export interface CompileSourceOptions {
|
|
|
123
128
|
keepRawCase?: boolean | undefined;
|
|
124
129
|
allowedSplitWords?: FilePath | FilePath[] | undefined;
|
|
125
130
|
}
|
|
131
|
+
export declare const configFileSchemaURL = "https://raw.githubusercontent.com/streetsidesoftware/cspell/main/packages/cspell-tools/cspell-tools.config.schema.json";
|
|
126
132
|
//# sourceMappingURL=config.d.ts.map
|
package/dist/config/config.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export
|
|
1
|
+
export const configFileSchemaURL = 'https://raw.githubusercontent.com/streetsidesoftware/cspell/main/packages/cspell-tools/cspell-tools.config.schema.json';
|
|
2
2
|
//# sourceMappingURL=config.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cspell/cspell-tools",
|
|
3
|
-
"version": "7.0.1
|
|
3
|
+
"version": "7.0.1",
|
|
4
4
|
"description": "Tools to assist with the development of cSpell",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -16,8 +16,7 @@
|
|
|
16
16
|
"watch": "tsc -p . -w",
|
|
17
17
|
"clean-build": "pnpm run clean && pnpm run build",
|
|
18
18
|
"clean": "shx rm -rf dist temp coverage \"*.tsbuildInfo\"",
|
|
19
|
-
"coverage": "
|
|
20
|
-
"coverage:vitest": "vitest run --coverage",
|
|
19
|
+
"coverage": "vitest run --coverage",
|
|
21
20
|
"test:watch": "vitest",
|
|
22
21
|
"test": "vitest run",
|
|
23
22
|
"update-snapshot": "vitest run -u"
|
|
@@ -49,13 +48,13 @@
|
|
|
49
48
|
},
|
|
50
49
|
"homepage": "https://github.com/streetsidesoftware/cspell#readme",
|
|
51
50
|
"dependencies": {
|
|
52
|
-
"@cspell/cspell-pipe": "7.0.1
|
|
51
|
+
"@cspell/cspell-pipe": "7.0.1",
|
|
53
52
|
"commander": "^11.0.0",
|
|
54
53
|
"cosmiconfig": "8.0.0",
|
|
55
|
-
"cspell-trie-lib": "7.0.1
|
|
54
|
+
"cspell-trie-lib": "7.0.1",
|
|
56
55
|
"gensequence": "^5.0.2",
|
|
57
56
|
"glob": "^10.3.3",
|
|
58
|
-
"hunspell-reader": "7.0.1
|
|
57
|
+
"hunspell-reader": "7.0.1",
|
|
59
58
|
"yaml": "^2.3.1"
|
|
60
59
|
},
|
|
61
60
|
"engines": {
|
|
@@ -63,13 +62,11 @@
|
|
|
63
62
|
},
|
|
64
63
|
"devDependencies": {
|
|
65
64
|
"@types/glob": "^8.1.0",
|
|
66
|
-
"@types/jest": "^29.5.3",
|
|
67
65
|
"@types/shelljs": "^0.8.12",
|
|
68
|
-
"jest": "^29.6.1",
|
|
69
66
|
"lorem-ipsum": "^2.0.8",
|
|
70
67
|
"shelljs": "^0.8.5",
|
|
71
|
-
"ts-json-schema-generator": "^1.
|
|
68
|
+
"ts-json-schema-generator": "^1.3.0"
|
|
72
69
|
},
|
|
73
70
|
"main": "bin.js",
|
|
74
|
-
"gitHead": "
|
|
71
|
+
"gitHead": "124eea257b724b8354d3bc38f48fe9529cf6f7be"
|
|
75
72
|
}
|