Skip to content

Commit 68dd65e

Browse files
authored
dev: Use cspell-tools-cli to build dictionaries (streetsidesoftware#710)
Related to streetsidesoftware#705
1 parent 5ce7e14 commit 68dd65e

File tree

8 files changed

+35
-78
lines changed

8 files changed

+35
-78
lines changed

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ Various [cspell](https://github.com/streetsidesoftware/cspell) dictionaries. Eac
8484
| [@cspell/dict-es-es](./dictionaries/es_ES#readme) | Spanish Dictionary (Spain) | \* | es, es_ES | Spanish Dictionary (Spain) |
8585
| [@cspell/dict-et-ee](./dictionaries/et-EE#readme) | Estonian | \* | et, et-EE | Estonian dictionary for cspell. |
8686
| [@cspell/dict-fa-ir](./dictionaries/fa_IR#readme) | Persian Dictionary | \* | fa, fa-IR | Persian Dictionary |
87-
| [@cspell/dict-filetypes](./dictionaries/filetypes#readme) | filetypes | \* | \* | Filetypes dictionary for cspell. |
87+
| [@cspell/dict-filetypes](./dictionaries/filetypes#readme) | filetypes | | | Filetypes dictionary for cspell. |
8888
| [@cspell/dict-fonts](./dictionaries/fonts#readme) | font names | | | Font names dictionary for cspell. |
8989
| [@cspell/dict-fr-fr](./dictionaries/fr_FR#readme) | French Dictionary (France) | \* | fr, fr_FR | French Dictionary (France) |
9090
| [@cspell/dict-fr-reforme](./dictionaries/fr_FR_90#readme) | Français Réforme 1990 | \* | fr, fr-fr, fr-90 | Français Réforme 1990 dictionary for cspell. |
@@ -119,13 +119,14 @@ Various [cspell](https://github.com/streetsidesoftware/cspell) dictionaries. Eac
119119
| [@cspell/dict-rust](./dictionaries/rust#readme) | Rust Dictionary | rust | \* | Rust Keyword Dictionary |
120120
| [@cspell/dict-scala](./dictionaries/scala#readme) | Scala | scala | \* | Scala dictionary for cspell. |
121121
| [@cspell/dict-scientific-terms-us](./dictionaries/scientific_terms_US#readme) | Scientific Terms US | \* | \* | Scientific Terms US dictionary for cspell. |
122-
| [@cspell/dict-software-terms](./dictionaries/software-terms#readme) | software terms | \* | \* | Software terms dictionary for cspell. |
122+
| [@cspell/dict-software-terms](./dictionaries/software-terms#readme) | Software Terms | | | Software terms dictionary for cspell. |
123123
| [@cspell/dict-sv](./dictionaries/sv#readme) | Swedish Dictionary | \* | sv, sv_SE | Swedish Dictionary |
124124
| [@cspell/dict-swift](./dictionaries/swift#readme) | Swift | swift | \* | Swift dictionary for cspell. |
125125
| [@cspell/dict-tr-tr](./dictionaries/tr_TR#readme) | Turkish | \* | tr, tr-TR | Turkish dictionary for cspell. |
126126
| [@cspell/dict-typescript](./dictionaries/typescript#readme) | TypeScript | typescript, javascript, typescriptreact, javascriptreact | \* | TypeScript and JavaScript dictionary for cspell. |
127127
| [@cspell/dict-uk-ua](./dictionaries/uk_UA#readme) | Ukrainian Dictionary | \* | uk | Ukrainian Dictionary |
128128
| [@cspell/dict-vi-vn](./dictionaries/vi_VN#readme) | Vietnamese | \* | vi | Vietnamese dictionary for cspell. |
129+
| [@cspell/dict-win32](./dictionaries/win32#readme) | Win32 | c, cpp | \* | Win32 dictionary for cspell. |
129130

130131
## Contributing
131132

dictionaries.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
| [@cspell/dict-es-es](./dictionaries/es_ES#readme) | Spanish Dictionary (Spain) | \* | es, es_ES | Spanish Dictionary (Spain) |
3030
| [@cspell/dict-et-ee](./dictionaries/et-EE#readme) | Estonian | \* | et, et-EE | Estonian dictionary for cspell. |
3131
| [@cspell/dict-fa-ir](./dictionaries/fa_IR#readme) | Persian Dictionary | \* | fa, fa-IR | Persian Dictionary |
32-
| [@cspell/dict-filetypes](./dictionaries/filetypes#readme) | filetypes | \* | \* | Filetypes dictionary for cspell. |
32+
| [@cspell/dict-filetypes](./dictionaries/filetypes#readme) | filetypes | | | Filetypes dictionary for cspell. |
3333
| [@cspell/dict-fonts](./dictionaries/fonts#readme) | font names | | | Font names dictionary for cspell. |
3434
| [@cspell/dict-fr-fr](./dictionaries/fr_FR#readme) | French Dictionary (France) | \* | fr, fr_FR | French Dictionary (France) |
3535
| [@cspell/dict-fr-reforme](./dictionaries/fr_FR_90#readme) | Français Réforme 1990 | \* | fr, fr-fr, fr-90 | Français Réforme 1990 dictionary for cspell. |
@@ -64,7 +64,7 @@
6464
| [@cspell/dict-rust](./dictionaries/rust#readme) | Rust Dictionary | rust | \* | Rust Keyword Dictionary |
6565
| [@cspell/dict-scala](./dictionaries/scala#readme) | Scala | scala | \* | Scala dictionary for cspell. |
6666
| [@cspell/dict-scientific-terms-us](./dictionaries/scientific_terms_US#readme) | Scientific Terms US | \* | \* | Scientific Terms US dictionary for cspell. |
67-
| [@cspell/dict-software-terms](./dictionaries/software-terms#readme) | software terms | \* | \* | Software terms dictionary for cspell. |
67+
| [@cspell/dict-software-terms](./dictionaries/software-terms#readme) | Software Terms | | | Software terms dictionary for cspell. |
6868
| [@cspell/dict-sv](./dictionaries/sv#readme) | Swedish Dictionary | \* | sv, sv_SE | Swedish Dictionary |
6969
| [@cspell/dict-swift](./dictionaries/swift#readme) | Swift | swift | \* | Swift dictionary for cspell. |
7070
| [@cspell/dict-tr-tr](./dictionaries/tr_TR#readme) | Turkish | \* | tr, tr-TR | Turkish dictionary for cspell. |

dictionaries/filetypes/cspell-ext.json

Lines changed: 4 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -2,41 +2,17 @@
22
{
33
"id": "filetypes",
44
"name": "filetypes",
5+
"readonly": true,
56
"description": "Filetypes dictionary for cspell.",
67
// List of dictionary files to add to the global list of dictionaries
78
"dictionaryDefinitions": [
89
{
910
"name": "filetypes",
10-
"file": "./filetypes.txt.gz",
11+
"path": "./filetypes.txt.gz",
1112
"description": "Filetypes dictionary for cspell."
1213
}
1314
],
1415
// Dictionaries to always be used.
15-
// Generally left empty
16-
"dictionaries": [],
17-
// Language Rules to apply to matching files.
18-
// Files are matched on `languageId` and `local`
19-
"languageSettings": [
20-
{
21-
// VSCode languageId. i.e. typescript, java, go, cpp, javascript, markdown, latex
22-
// * will match against any file type.
23-
"languageId": "*",
24-
// Language local. i.e. en-US, de-AT, or ru. * will match all locals.
25-
// Multiple locals can be specified like: "en, en-US" to match both English and English US.
26-
"local": "*",
27-
// By default the whole text of a file is included for spell checking
28-
// Adding patterns to the "includeRegExpList" to only include matching patterns
29-
"includeRegExpList": [],
30-
// To exclude patterns, add them to "ignoreRegExpList"
31-
"ignoreRegExpList": [],
32-
// regex patterns than can be used with ignoreRegExpList or includeRegExpList
33-
// Example: "pattern": [{ "name": "mdash", "pattern": "—" }]
34-
// This could be included in "ignoreRegExpList": ["mdash"]
35-
"patterns": [],
36-
// List of dictionaries to enable by name in `dictionaryDefinitions`
37-
"dictionaries": ["filetypes"],
38-
// Dictionary definitions can also be supplied here. They are only used iff "languageId" and "local" match.
39-
"dictionaryDefinitions": []
40-
}
41-
]
16+
// Enable `filetypes` by default if this extension is imported.
17+
"dictionaries": ["filetypes"]
4218
}

dictionaries/filetypes/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@cspell/dict-filetypes",
3-
"version": "1.1.8",
3+
"version": "2.0.0",
44
"description": "Filetypes dictionary for cspell.",
55
"publishConfig": {
66
"access": "public"
@@ -11,8 +11,8 @@
1111
"./cspell-ext.json": "./cspell-ext.json"
1212
},
1313
"scripts": {
14-
"build": "cspell-tools compile \"filetypes.txt\" -o .",
15-
"test": "head -n 100 \"filetypes.txt\" | cspell -v -c ./cspell-ext.json \"--local=*\" \"--languageId=*\" stdin",
14+
"build": "cspell-tools-cli compile \"filetypes.txt\" -o .",
15+
"test": "cat \"filetypes.txt\" | cspell -v -c ./cspell-ext.json \"--local=*\" \"--languageId=*\" stdin",
1616
"prepublishOnly": "yarn test",
1717
"prepare": "yarn run build"
1818
},
Lines changed: 5 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,17 @@
11
// cSpell Settings
22
{
33
"id": "software-terms",
4-
"name": "software terms",
4+
"name": "Software Terms",
5+
"readonly": true,
56
"description": "Software terms dictionary for cspell.",
67
// List of dictionary files to add to the global list of dictionaries
78
"dictionaryDefinitions": [
89
{
910
"name": "softwareTerms",
10-
"file": "./softwareTerms.txt.gz",
11+
"path": "./softwareTerms.txt.gz",
1112
"description": "Software terms dictionary for cspell."
1213
}
1314
],
14-
// Dictionaries to always be used.
15-
// Generally left empty
16-
"dictionaries": [],
17-
// Language Rules to apply to matching files.
18-
// Files are matched on `languageId` and `local`
19-
"languageSettings": [
20-
{
21-
// VSCode languageId. i.e. typescript, java, go, cpp, javascript, markdown, latex
22-
// * will match against any file type.
23-
"languageId": "*",
24-
// Language local. i.e. en-US, de-AT, or ru. * will match all locals.
25-
// Multiple locals can be specified like: "en, en-US" to match both English and English US.
26-
"local": "*",
27-
// By default the whole text of a file is included for spell checking
28-
// Adding patterns to the "includeRegExpList" to only include matching patterns
29-
"includeRegExpList": [],
30-
// To exclude patterns, add them to "ignoreRegExpList"
31-
"ignoreRegExpList": [],
32-
// regex patterns than can be used with ignoreRegExpList or includeRegExpList
33-
// Example: "pattern": [{ "name": "mdash", "pattern": "—" }]
34-
// This could be included in "ignoreRegExpList": ["mdash"]
35-
"patterns": [],
36-
// This can be removed once cspell-tools are upgraded to @cspell/cspell-tools.
37-
"words": [
38-
"ddmmyyyy",
39-
"mmddyyyy",
40-
"mmyyyy",
41-
"yyyy",
42-
"yyyymm",
43-
"yyyymmdd",
44-
"yyyymmddhhmmss",
45-
"yyyymmddhhmmssz"
46-
],
47-
// List of dictionaries to enable by name in `dictionaryDefinitions`
48-
"dictionaries": ["softwareTerms"],
49-
// Dictionary definitions can also be supplied here. They are only used iff "languageId" and "local" match.
50-
"dictionaryDefinitions": []
51-
}
52-
]
15+
// Enable `softwareTerms` by default if this extension is imported.
16+
"dictionaries": ["softwareTerms"]
5317
}

dictionaries/software-terms/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@cspell/dict-software-terms",
3-
"version": "1.0.48",
3+
"version": "2.0.0",
44
"description": "Software terms dictionary for cspell.",
55
"publishConfig": {
66
"access": "public"
@@ -11,7 +11,7 @@
1111
"./cspell-ext.json": "./cspell-ext.json"
1212
},
1313
"scripts": {
14-
"build": "cat source-files.txt | xargs cspell-tools compile -o . -M softwareTerms.txt",
14+
"build": "cat source-files.txt | xargs cspell-tools-cli compile --split -o . -M softwareTerms.txt",
1515
"test": "cat \"src/software-terms.txt\" | cspell -v -c ./cspell-ext.json \"--local=*\" \"--languageId=*\" stdin",
1616
"prepublishOnly": "yarn test",
1717
"prepare": "yarn run build"

dictionaries/software-terms/src/software-terms.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,7 @@ dataset
239239
datasets
240240
dcopy
241241
DDMMYY
242+
ddmmyyyy
242243
DDMMYYYY
243244
DDoS
244245
debianrcd
@@ -821,8 +822,10 @@ mixins
821822
mkfs
822823
mkswap
823824
MMDDYY
825+
mmddyyyy
824826
MMDDYYYY
825827
mmistakes
828+
mmyyyy
826829
mocha
827830
modinfo
828831
modprobe
@@ -1533,7 +1536,10 @@ yaml
15331536
ymd
15341537
yymmdd
15351538
yyyy
1539+
yyyymm
15361540
yyyymmdd
1541+
yyyymmddhhmmss
1542+
yyyymmddhhmmssz
15371543
Zend
15381544
Zendesk
15391545
Zenoss

yarn.lock

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,16 @@
9999
resolved "https://registry.npmjs.org/@cspell/dict-en-gb/-/dict-en-gb-1.1.33.tgz#7f1fd90fc364a5cb77111b5438fc9fcf9cc6da0e"
100100
integrity sha512-tKSSUf9BJEV+GJQAYGw5e+ouhEe2ZXE620S7BLKe3ZmpnjlNG9JqlnaBhkIMxKnNFkLY2BP/EARzw31AZnOv4g==
101101

102+
"@cspell/dict-filetypes@^1.1.8":
103+
version "1.1.8"
104+
resolved "https://registry.npmjs.org/@cspell/dict-filetypes/-/dict-filetypes-1.1.8.tgz#c161ab48667b6539cbc91a70ff0b037fa436a64e"
105+
integrity sha512-EllahNkhzvLWo0ptwu0l3oEeAJOQSUpZnDfnKRIh6mJVehuSovNHwA9vrdZ8jBUjuqcfaN2e7c32zN0D/qvWJQ==
106+
107+
"@cspell/dict-software-terms@^1.0.47":
108+
version "1.0.48"
109+
resolved "https://registry.npmjs.org/@cspell/dict-software-terms/-/dict-software-terms-1.0.48.tgz#dc45a91c64f9f86df3a047879d9f34aa17435bd0"
110+
integrity sha512-pfF3Ys2gRffu5ElqkH7FQMDMi/iZMyOzpGMb3FSH0PJ2AnRQ5rRNWght1h2L36YxvXl0mWVaFrrfwiOyRIc8ZQ==
111+
102112
"@eslint/eslintrc@^1.0.3":
103113
version "1.0.3"
104114
resolved "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.0.3.tgz#41f08c597025605f672251dcc4e8be66b5ed7366"

0 commit comments

Comments
 (0)