From c87125ea4f75af24cba42ad49d311c1ccb3c3ec6 Mon Sep 17 00:00:00 2001 From: Jason Dent Date: Thu, 5 Jan 2023 20:06:19 +0100 Subject: [PATCH] chore: Prepare Basque for publishing --- dictionaries/eu/README.md | 6 +++-- dictionaries/eu/checksum.txt | 5 ++++ dictionaries/eu/cspell-ext.json | 25 +------------------ dictionaries/eu/cspell-tools.config.yaml | 5 ++-- dictionaries/eu/cspell.json | 4 +++ dictionaries/eu/package.json | 13 +++++++--- dictionaries/eu/source-dependencies.txt | 5 ++++ dictionaries/eu/src/additional_words.txt | 4 +++ .../eu/src/{ => basque_hunspell}/eu.aff | 0 .../eu/src/{ => basque_hunspell}/eu.dic | 0 yarn.lock | 4 +++ 11 files changed, 39 insertions(+), 32 deletions(-) create mode 100644 dictionaries/eu/checksum.txt create mode 100644 dictionaries/eu/source-dependencies.txt create mode 100644 dictionaries/eu/src/additional_words.txt rename dictionaries/eu/src/{ => basque_hunspell}/eu.aff (100%) rename dictionaries/eu/src/{ => basque_hunspell}/eu.dic (100%) diff --git a/dictionaries/eu/README.md b/dictionaries/eu/README.md index d06b4a33d9a..ddbbc9fdbf2 100644 --- a/dictionaries/eu/README.md +++ b/dictionaries/eu/README.md @@ -37,12 +37,14 @@ The `cspell-ext.json` file in this package should be added to the import section } ``` -# Dictionary Development +## References -See: [How to Create a New Dictionary](https://github.com/streetsidesoftware/cspell-dicts#how-to-create-a-new-dictionary) +- Source: [jmigartua/basque_hunspell](https://github.com/jmigartua/basque_hunspell) ## License MIT > Some packages may have other licenses included. + + diff --git a/dictionaries/eu/checksum.txt b/dictionaries/eu/checksum.txt new file mode 100644 index 00000000000..9124798b991 --- /dev/null +++ b/dictionaries/eu/checksum.txt @@ -0,0 +1,5 @@ +39f476f4f3066e89a62691f4ddc5f53d10a6a547 ./dict/eu.trie +a343188908a556fa1966f5c5a8ddcb6ae23d77ca ./source-dependencies.txt +95d2cab01a57cd837dbdb3f902fd3537a4985662 ./src/additional_words.txt +86de662e617f7a45e2deacca0b725ce6312c40d2 ./src/basque_hunspell/eu.aff +88f3524a0516c8a97fd06c591758efff787fcd72 ./src/basque_hunspell/eu.dic diff --git a/dictionaries/eu/cspell-ext.json b/dictionaries/eu/cspell-ext.json index c2433d3f369..3b0c11f4ea6 100644 --- a/dictionaries/eu/cspell-ext.json +++ b/dictionaries/eu/cspell-ext.json @@ -1,11 +1,9 @@ -// cSpell Settings { "id": "eu", "version": "0.2", "name": "Basque", "description": "Basque dictionary for cspell.", "readonly": true, - // List of dictionary files to add to the global list of dictionaries "dictionaryDefinitions": [ { "name": "eu", @@ -13,32 +11,11 @@ "description": "Basque dictionary for cspell." } ], - // 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": "eu", - // 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": ["eu"], - // Dictionary definitions can also be supplied here. They are only used iff "languageId" and "locale" match. - "dictionaryDefinitions": [] + "dictionaries": ["eu"] } ] } diff --git a/dictionaries/eu/cspell-tools.config.yaml b/dictionaries/eu/cspell-tools.config.yaml index dd4ea93cc08..d7e16a9a927 100644 --- a/dictionaries/eu/cspell-tools.config.yaml +++ b/dictionaries/eu/cspell-tools.config.yaml @@ -3,8 +3,9 @@ targets: - name: "eu" sources: - - filename: "src/eu.dic" - maxDepth: 1 + - filename: "src/basque_hunspell/eu.dic" + maxDepth: 1 # This is set to 1 so it will build. + - src/additional_words.txt format: "trie3" targetDirectory: "./dict" generateNonStrict: true diff --git a/dictionaries/eu/cspell.json b/dictionaries/eu/cspell.json index 465fef71282..425ea201dce 100644 --- a/dictionaries/eu/cspell.json +++ b/dictionaries/eu/cspell.json @@ -3,6 +3,10 @@ "files": [ "**/*.{md,txt}" ], + "ignorePaths": [ + "src/**", + "*.trie" + ], "dictionaries": [ "eu" ], diff --git a/dictionaries/eu/package.json b/dictionaries/eu/package.json index a2d721ed469..8ce0f8bc32d 100644 --- a/dictionaries/eu/package.json +++ b/dictionaries/eu/package.json @@ -1,8 +1,7 @@ { "name": "@cspell/dict-eu", "version": "1.0.0", - "description": "Basque dictionary for cspell. -- Private until verified", - "private": true, + "description": "Basque dictionary for cspell.", "publishConfig": { "access": "public" }, @@ -12,8 +11,12 @@ "./cspell-ext.json": "./cspell-ext.json" }, "scripts": { - "build": "cross-env NODE_OPTIONS=--max_old_space_size=8192 cspell-tools-cli build", + "build": "cross-env NODE_OPTIONS=--max_old_space_size=8192 cspell-tools-cli build && yarn run gen-checksum", + "checksum": "shasum -c checksum.txt", + "conditional-build": "yarn run sync && yarn run --silent checksum || yarn run build", + "sync": "yarn cpy \"../../node_modules/basque_hunspell/eu.*\" \"src/basque_hunspell\" --flat", "test": "hunspell-reader words -n 1000 -m 1\"src/eu.dic\" | cspell -v -c ./cspell-ext.json \"--local=eu\" \"--languageId=*\" stdin", + "gen-checksum": "cat source-dependencies.txt | sort -u | xargs shasum > checksum.txt", "prepublishOnly": "echo OK", "prepare": "echo OK" }, @@ -35,7 +38,9 @@ "url": "https://github.com/streetsidesoftware/cspell-dicts/issues" }, "homepage": "https://github.com/streetsidesoftware/cspell-dicts/blob/main/dictionaries/eu#readme", - "devDependencies": {}, + "devDependencies": { + "basque_hunspell": "https://github.com/jmigartua/basque_hunspell" + }, "dependencies": {}, "files": [ "dict/eu.trie", diff --git a/dictionaries/eu/source-dependencies.txt b/dictionaries/eu/source-dependencies.txt new file mode 100644 index 00000000000..0419763c714 --- /dev/null +++ b/dictionaries/eu/source-dependencies.txt @@ -0,0 +1,5 @@ +./dict/eu.trie +./source-dependencies.txt +./src/additional_words.txt +./src/basque_hunspell/eu.aff +./src/basque_hunspell/eu.dic diff --git a/dictionaries/eu/src/additional_words.txt b/dictionaries/eu/src/additional_words.txt new file mode 100644 index 00000000000..23246fe1882 --- /dev/null +++ b/dictionaries/eu/src/additional_words.txt @@ -0,0 +1,4 @@ +# Additionally, CSpell adds some extra words to that dictionary that are very common. +# +# There should be one entry per line. +# Consider adding words to ./shared-additional-words.txt if they are used by all flavors of English. diff --git a/dictionaries/eu/src/eu.aff b/dictionaries/eu/src/basque_hunspell/eu.aff similarity index 100% rename from dictionaries/eu/src/eu.aff rename to dictionaries/eu/src/basque_hunspell/eu.aff diff --git a/dictionaries/eu/src/eu.dic b/dictionaries/eu/src/basque_hunspell/eu.dic similarity index 100% rename from dictionaries/eu/src/eu.dic rename to dictionaries/eu/src/basque_hunspell/eu.dic diff --git a/yarn.lock b/yarn.lock index c49ca82883a..d9efc58bf9d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1354,6 +1354,10 @@ base64-js@^1.3.1: resolved "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz#1b1b440160a5bf7ad40b650f095963481903930a" integrity sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA== +"basque_hunspell@https://github.com/jmigartua/basque_hunspell": + version "0.0.0" + resolved "https://github.com/jmigartua/basque_hunspell#e9d9af129654466423480d1b4c38b06f6171ac5d" + before-after-hook@^2.2.0: version "2.2.3" resolved "https://registry.npmjs.org/before-after-hook/-/before-after-hook-2.2.3.tgz#c51e809c81a4e354084422b9b26bad88249c517c"