From 02ed0d4b10ccc377ea0d134505122a6551e3b123 Mon Sep 17 00:00:00 2001 From: Jason Dent Date: Sun, 25 Dec 2022 08:28:24 +0100 Subject: [PATCH] fix: move share English words into their own package. --- dictionaries/en_GB-MIT/package.json | 3 ++ .../en_GB-MIT/src/shared-additional-words.txt | 2 +- dictionaries/en_GB/package.json | 3 +- .../en_GB/src/shared-additional-words.txt | 2 +- dictionaries/en_US/package.json | 3 +- .../en_US/src/shared-additional-words.txt | 2 +- dictionaries/en_shared/CHANGELOG.md | 5 ++ dictionaries/en_shared/LICENSE | 21 +++++++++ dictionaries/en_shared/README.md | 5 ++ dictionaries/en_shared/cspell-ext.json | 44 +++++++++++++++++ .../en_shared/cspell-tools.config.yaml | 10 ++++ dictionaries/en_shared/cspell.json | 12 +++++ dictionaries/en_shared/dict/README.md | 3 ++ dictionaries/en_shared/dict/en-shared.txt | 38 +++++++++++++++ dictionaries/en_shared/package.json | 47 +++++++++++++++++++ dictionaries/en_shared/src/README.md | 3 ++ .../src}/shared-additional-words.txt | 0 17 files changed, 198 insertions(+), 5 deletions(-) create mode 100644 dictionaries/en_shared/CHANGELOG.md create mode 100644 dictionaries/en_shared/LICENSE create mode 100644 dictionaries/en_shared/README.md create mode 100644 dictionaries/en_shared/cspell-ext.json create mode 100644 dictionaries/en_shared/cspell-tools.config.yaml create mode 100644 dictionaries/en_shared/cspell.json create mode 100644 dictionaries/en_shared/dict/README.md create mode 100644 dictionaries/en_shared/dict/en-shared.txt create mode 100644 dictionaries/en_shared/package.json create mode 100644 dictionaries/en_shared/src/README.md rename {shared-sources/en => dictionaries/en_shared/src}/shared-additional-words.txt (100%) diff --git a/dictionaries/en_GB-MIT/package.json b/dictionaries/en_GB-MIT/package.json index 709e03d8fbd..08edd3458ce 100644 --- a/dictionaries/en_GB-MIT/package.json +++ b/dictionaries/en_GB-MIT/package.json @@ -45,5 +45,8 @@ ], "directories": { "test": "tests" + }, + "devDependencies": { + "@cspell/dict-en-shared": "1.0.0" } } diff --git a/dictionaries/en_GB-MIT/src/shared-additional-words.txt b/dictionaries/en_GB-MIT/src/shared-additional-words.txt index 951f2c437c0..7e5b78e6f82 120000 --- a/dictionaries/en_GB-MIT/src/shared-additional-words.txt +++ b/dictionaries/en_GB-MIT/src/shared-additional-words.txt @@ -1 +1 @@ -../../../shared-sources/en/shared-additional-words.txt \ No newline at end of file +../../en_shared/src/shared-additional-words.txt \ No newline at end of file diff --git a/dictionaries/en_GB/package.json b/dictionaries/en_GB/package.json index f79eb6464c0..d5b10d9898e 100644 --- a/dictionaries/en_GB/package.json +++ b/dictionaries/en_GB/package.json @@ -50,6 +50,7 @@ "test": "tests" }, "devDependencies": { - "aoo-mozilla-en-dict": "https://github.com/marcoagpinto/aoo-mozilla-en-dict" + "aoo-mozilla-en-dict": "https://github.com/marcoagpinto/aoo-mozilla-en-dict", + "@cspell/dict-en-shared": "1.0.0" } } diff --git a/dictionaries/en_GB/src/shared-additional-words.txt b/dictionaries/en_GB/src/shared-additional-words.txt index 951f2c437c0..7e5b78e6f82 120000 --- a/dictionaries/en_GB/src/shared-additional-words.txt +++ b/dictionaries/en_GB/src/shared-additional-words.txt @@ -1 +1 @@ -../../../shared-sources/en/shared-additional-words.txt \ No newline at end of file +../../en_shared/src/shared-additional-words.txt \ No newline at end of file diff --git a/dictionaries/en_US/package.json b/dictionaries/en_US/package.json index 7025a8b5859..7b8ccc686f4 100644 --- a/dictionaries/en_US/package.json +++ b/dictionaries/en_US/package.json @@ -54,6 +54,7 @@ "test": "tests" }, "devDependencies": { - "aoo-mozilla-en-dict": "https://github.com/marcoagpinto/aoo-mozilla-en-dict" + "aoo-mozilla-en-dict": "https://github.com/marcoagpinto/aoo-mozilla-en-dict", + "@cspell/dict-en-shared": "1.0.0" } } diff --git a/dictionaries/en_US/src/shared-additional-words.txt b/dictionaries/en_US/src/shared-additional-words.txt index 951f2c437c0..7e5b78e6f82 120000 --- a/dictionaries/en_US/src/shared-additional-words.txt +++ b/dictionaries/en_US/src/shared-additional-words.txt @@ -1 +1 @@ -../../../shared-sources/en/shared-additional-words.txt \ No newline at end of file +../../en_shared/src/shared-additional-words.txt \ No newline at end of file diff --git a/dictionaries/en_shared/CHANGELOG.md b/dictionaries/en_shared/CHANGELOG.md new file mode 100644 index 00000000000..6762832021b --- /dev/null +++ b/dictionaries/en_shared/CHANGELOG.md @@ -0,0 +1,5 @@ +# Change Log + +## 1.0.0 + +- Initial Release diff --git a/dictionaries/en_shared/LICENSE b/dictionaries/en_shared/LICENSE new file mode 100644 index 00000000000..58d55ba5b2f --- /dev/null +++ b/dictionaries/en_shared/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2017-2022 Street Side Software + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/dictionaries/en_shared/README.md b/dictionaries/en_shared/README.md new file mode 100644 index 00000000000..6a772c48c4f --- /dev/null +++ b/dictionaries/en_shared/README.md @@ -0,0 +1,5 @@ +# CSpell Shared English Words Dictionary + +Note this is a private package used to store and track changes to the shared English words. + +It not designed to be published. diff --git a/dictionaries/en_shared/cspell-ext.json b/dictionaries/en_shared/cspell-ext.json new file mode 100644 index 00000000000..e3cefb0cb4c --- /dev/null +++ b/dictionaries/en_shared/cspell-ext.json @@ -0,0 +1,44 @@ +// cSpell Settings +{ + "id": "en-shared", + "version": "0.2", + "name": "en_shared", + "description": "English words shared between the various English dictionaries.", + "readonly": true, + // List of dictionary files to add to the global list of dictionaries + "dictionaryDefinitions": [ + { + "name": "en-shared", + "path": "./dict/en-shared.txt", + "description": "English words shared between the various English dictionaries." + } + ], + // Dictionaries to always be used. + // Generally left empty + "dictionaries": [], + // Language Rules to apply to matching files. + // Files are matched on `languageId` and `local` + "languageSettings": [ + { + // VSCode languageId. i.e. typescript, java, go, cpp, javascript, markdown, latex + // * will match against any file type. + "languageId": "*", + // Language locale. i.e. en-US, de-AT, or ru. * will match all locales. + // Multiple locales can be specified like: "en, en-US" to match both English and English US. + "locale": "en", + // By default the whole text of a file is included for spell checking + // Adding patterns to the "includeRegExpList" to only include matching patterns + "includeRegExpList": [], + // To exclude patterns, add them to "ignoreRegExpList" + "ignoreRegExpList": [], + // regex patterns than can be used with ignoreRegExpList or includeRegExpList + // Example: "pattern": [{ "name": "mdash", "pattern": "—" }] + // This could be included in "ignoreRegExpList": ["mdash"] + "patterns": [], + // List of dictionaries to enable by name in `dictionaryDefinitions` + "dictionaries": ["en-shared"], + // Dictionary definitions can also be supplied here. They are only used iff "languageId" and "locale" match. + "dictionaryDefinitions": [] + } + ] +} diff --git a/dictionaries/en_shared/cspell-tools.config.yaml b/dictionaries/en_shared/cspell-tools.config.yaml new file mode 100644 index 00000000000..d80750ffd95 --- /dev/null +++ b/dictionaries/en_shared/cspell-tools.config.yaml @@ -0,0 +1,10 @@ +# yaml-language-server: $schema=https://raw.githubusercontent.com/streetsidesoftware/cspell/main/packages/cspell-tools/cspell-tools.config.schema.json + +targets: + - name: "en-shared" + sources: + - "src/shared-additional-words.txt" + format: "plaintext" + targetDirectory: "./dict" + generateNonStrict: false + compress: false diff --git a/dictionaries/en_shared/cspell.json b/dictionaries/en_shared/cspell.json new file mode 100644 index 00000000000..2ec9f83bd66 --- /dev/null +++ b/dictionaries/en_shared/cspell.json @@ -0,0 +1,12 @@ +{ + "version": "0.2", + "files": [ + "**/*.{md,txt}" + ], + "dictionaries": [ + "en-shared" + ], + "import": [ + "./cspell-ext.json" + ] +} diff --git a/dictionaries/en_shared/dict/README.md b/dictionaries/en_shared/dict/README.md new file mode 100644 index 00000000000..ce67123010f --- /dev/null +++ b/dictionaries/en_shared/dict/README.md @@ -0,0 +1,3 @@ +# Dict Directory + +NOTE: This directory contains generated content. Please edit [src](../src/README.md) files. diff --git a/dictionaries/en_shared/dict/en-shared.txt b/dictionaries/en_shared/dict/en-shared.txt new file mode 100644 index 00000000000..2bcf0e60145 --- /dev/null +++ b/dictionaries/en_shared/dict/en-shared.txt @@ -0,0 +1,38 @@ + +# cspell-tools: keep-case no-split + +Alpha +Aruban +Arubans +Bonanno +COVID +Centauri +Christoph +Premonstratensians +aesthetical +amphitheatre +anthropomorphization +bicep +cellpadding +conformant +dropshipper +dropshippers +dropshipping +drumless +dryas +eligibilities +endoliths +futhorc +guillemet +heatmap +hmmm +hydrophile +hydrophobe +hyponym +hyponyms +iPads +prepend +reauthenticate +tricep +unintuitive +unplated diff --git a/dictionaries/en_shared/package.json b/dictionaries/en_shared/package.json new file mode 100644 index 00000000000..ab718852435 --- /dev/null +++ b/dictionaries/en_shared/package.json @@ -0,0 +1,47 @@ +{ + "name": "@cspell/dict-en-shared", + "version": "1.0.0", + "description": "English words shared between the various English dictionaries. -- Private until verified", + "private": true, + "publishConfig": { + "access": "public" + }, + "exports": { + ".": "./cspell-ext.json", + "./cspell": "./cspell-ext.json", + "./cspell-ext.json": "./cspell-ext.json" + }, + "scripts": { + "build": "cross-env NODE_OPTIONS=--max_old_space_size=8192 cspell-tools-cli build", + "test": "head -n 1000 \"src/shared-additional-words.txt\" | cspell -v -c ./cspell-ext.json \"--local=en\" \"--languageId=*\" stdin", + "prepublishOnly": "echo OK", + "zip": "gzip -k -f dict/en-shared.txt", + "prepare": "yarn run build" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/streetsidesoftware/cspell-dicts.git" + }, + "keywords": [ + "cspell", + "cspell-ext", + "en_shared", + "en_shared", + "dictionary", + "spelling" + ], + "author": "Jason Dent", + "license": "MIT", + "bugs": { + "url": "https://github.com/streetsidesoftware/cspell-dicts/issues" + }, + "homepage": "https://github.com/streetsidesoftware/cspell-dicts/blob/main/dictionaries/en_shared#readme", + "devDependencies": {}, + "dependencies": {}, + "files": [ + "dict/en-shared.txt", + "cspell-ext.json", + "*.js", + "*.d.ts" + ] +} diff --git a/dictionaries/en_shared/src/README.md b/dictionaries/en_shared/src/README.md new file mode 100644 index 00000000000..5ac40a8e845 --- /dev/null +++ b/dictionaries/en_shared/src/README.md @@ -0,0 +1,3 @@ +# Source Directory + +All source files used to generate the dictionary should be stored in this directory. diff --git a/shared-sources/en/shared-additional-words.txt b/dictionaries/en_shared/src/shared-additional-words.txt similarity index 100% rename from shared-sources/en/shared-additional-words.txt rename to dictionaries/en_shared/src/shared-additional-words.txt