Skip to content

Commit

Permalink
fix: Add dict-cspell-bundle (#3708)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jason3S authored Oct 20, 2024
1 parent 94bca80 commit feeb26f
Show file tree
Hide file tree
Showing 9 changed files with 422 additions and 10 deletions.
5 changes: 5 additions & 0 deletions dictionaries/cspell/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Change Log

## 1.0.0

- Initial Release
21 changes: 21 additions & 0 deletions dictionaries/cspell/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2023 Street Side Software <[email protected]>

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.
31 changes: 31 additions & 0 deletions dictionaries/cspell/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# CSpell Dictionary Bundle

Dictionaries included with the CSpell Command Line tool.

This is a pre-built dictionary for use with CSpell.

## Manual Installation

Manual installation is useful if you want to include this dictionary as part of your CI/CD lint process.

```sh
npm i -D @cspell/dict-cspell-bundle
```

The `cspell-ext.json` file in this package should be added to the import section in your `cspell.json` file.

```jsonc
{
//
"import": ["@cspell/dict-cspell-bundle/cspell-ext.json"],
//
}
```

## License

MIT

> Some packages may have other licenses included.
<!--- @@inject: ../../static/footer.md --->
61 changes: 61 additions & 0 deletions dictionaries/cspell/cspell-ext.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
{
"id": "cspell-bundle",
"version": "0.2",
"name": "CSpell Dictionaries Bundle",
"description": "Dictionaries included with the CSpell Command Line tool.",
"readonly": true,
"import": [
"@cspell/dict-ada/cspell-ext.json",
"@cspell/dict-aws/cspell-ext.json",
"@cspell/dict-bash/cspell-ext.json",
"@cspell/dict-companies/cspell-ext.json",
"@cspell/dict-cpp/cspell-ext.json",
"@cspell/dict-cryptocurrencies/cspell-ext.json",
"@cspell/dict-csharp/cspell-ext.json",
"@cspell/dict-css/cspell-ext.json",
"@cspell/dict-dart/cspell-ext.json",
"@cspell/dict-django/cspell-ext.json",
"@cspell/dict-docker/cspell-ext.json",
"@cspell/dict-dotnet/cspell-ext.json",
"@cspell/dict-elixir/cspell-ext.json",
"@cspell/dict-en-common-misspellings/cspell-ext.json",
"@cspell/dict-en_us/cspell-ext.json",
"@cspell/dict-filetypes/cspell-ext.json",
"@cspell/dict-flutter/cspell-ext.json",
"@cspell/dict-fonts/cspell-ext.json",
"@cspell/dict-fsharp/cspell-ext.json",
"@cspell/dict-fullstack/cspell-ext.json",
"@cspell/dict-gaming-terms/cspell-ext.json",
"@cspell/dict-git/cspell-ext.json",
"@cspell/dict-golang/cspell-ext.json",
"@cspell/dict-google/cspell-ext.json",
"@cspell/dict-haskell/cspell-ext.json",
"@cspell/dict-html-symbol-entities/cspell-ext.json",
"@cspell/dict-html/cspell-ext.json",
"@cspell/dict-java/cspell-ext.json",
"@cspell/dict-julia/cspell-ext.json",
"@cspell/dict-k8s/cspell-ext.json",
"@cspell/dict-latex/cspell-ext.json",
"@cspell/dict-lorem-ipsum/cspell-ext.json",
"@cspell/dict-lua/cspell-ext.json",
"@cspell/dict-makefile/cspell-ext.json",
"@cspell/dict-monkeyc/cspell-ext.json",
"@cspell/dict-node/cspell-ext.json",
"@cspell/dict-npm/cspell-ext.json",
"@cspell/dict-php/cspell-ext.json",
"@cspell/dict-powershell/cspell-ext.json",
"@cspell/dict-public-licenses/cspell-ext.json",
"@cspell/dict-python/cspell-ext.json",
"@cspell/dict-r/cspell-ext.json",
"@cspell/dict-ruby/cspell-ext.json",
"@cspell/dict-rust/cspell-ext.json",
"@cspell/dict-scala/cspell-ext.json",
"@cspell/dict-software-terms/cspell-ext.json",
"@cspell/dict-sql/cspell-ext.json",
"@cspell/dict-svelte/cspell-ext.json",
"@cspell/dict-swift/cspell-ext.json",
"@cspell/dict-terraform/cspell-ext.json",
"@cspell/dict-typescript/cspell-ext.json",
"@cspell/dict-vue/cspell-ext.json"
]
}
12 changes: 12 additions & 0 deletions dictionaries/cspell/cspell.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"version": "0.2",
"dictionaries": [
"cspell"
],
"import": [
"./cspell-ext.json"
],
"words": [
"monkeyc"
]
}
99 changes: 99 additions & 0 deletions dictionaries/cspell/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
{
"name": "@cspell/dict-cspell-bundle",
"version": "1.0.0",
"description": "Dictionaries included with the CSpell Command Line tool.",
"private": false,
"publishConfig": {
"access": "public",
"provenance": true
},
"exports": {
".": "./cspell-ext.json",
"./cspell": "./cspell-ext.json",
"./cspell-ext.json": "./cspell-ext.json"
},
"scripts": {
"build": "node ./scripts/build.mjs",
"test": "cspell --no-default-configuration .",
"prepublishOnly": "echo OK",
"prepare:dictionary": "pnpm run build"
},
"repository": {
"type": "git",
"url": "https://github.com/streetsidesoftware/cspell-dicts"
},
"keywords": [
"cspell",
"cspell-ext",
"CSpell Bundle",
"dictionary",
"spelling"
],
"author": "Street Side Software",
"contributors": [],
"license": "MIT",
"bugs": {
"url": "https://github.com/streetsidesoftware/cspell-dicts/issues"
},
"homepage": "https://github.com/streetsidesoftware/cspell-dicts/blob/main/dictionaries/cspell#readme",
"devDependencies": {},
"dependencies": {
"@cspell/dict-ada": "workspace:*",
"@cspell/dict-aws": "workspace:*",
"@cspell/dict-bash": "workspace:*",
"@cspell/dict-companies": "workspace:*",
"@cspell/dict-cpp": "workspace:*",
"@cspell/dict-cryptocurrencies": "workspace:*",
"@cspell/dict-csharp": "workspace:*",
"@cspell/dict-css": "workspace:*",
"@cspell/dict-dart": "workspace:*",
"@cspell/dict-django": "workspace:*",
"@cspell/dict-docker": "workspace:*",
"@cspell/dict-dotnet": "workspace:*",
"@cspell/dict-elixir": "workspace:*",
"@cspell/dict-en-common-misspellings": "workspace:*",
"@cspell/dict-en_us": "workspace:*",
"@cspell/dict-filetypes": "workspace:*",
"@cspell/dict-flutter": "workspace:*",
"@cspell/dict-fonts": "workspace:*",
"@cspell/dict-fsharp": "workspace:*",
"@cspell/dict-fullstack": "workspace:*",
"@cspell/dict-gaming-terms": "workspace:*",
"@cspell/dict-git": "workspace:*",
"@cspell/dict-golang": "workspace:*",
"@cspell/dict-google": "workspace:*",
"@cspell/dict-haskell": "workspace:*",
"@cspell/dict-html": "workspace:*",
"@cspell/dict-html-symbol-entities": "workspace:*",
"@cspell/dict-java": "workspace:*",
"@cspell/dict-julia": "workspace:*",
"@cspell/dict-k8s": "workspace:*",
"@cspell/dict-latex": "workspace:*",
"@cspell/dict-lorem-ipsum": "workspace:*",
"@cspell/dict-lua": "workspace:*",
"@cspell/dict-makefile": "workspace:*",
"@cspell/dict-monkeyc": "workspace:*",
"@cspell/dict-node": "workspace:*",
"@cspell/dict-npm": "workspace:*",
"@cspell/dict-php": "workspace:*",
"@cspell/dict-powershell": "workspace:*",
"@cspell/dict-public-licenses": "workspace:*",
"@cspell/dict-python": "workspace:*",
"@cspell/dict-r": "workspace:*",
"@cspell/dict-ruby": "workspace:*",
"@cspell/dict-rust": "workspace:*",
"@cspell/dict-scala": "workspace:*",
"@cspell/dict-software-terms": "workspace:*",
"@cspell/dict-sql": "workspace:*",
"@cspell/dict-svelte": "workspace:*",
"@cspell/dict-swift": "workspace:*",
"@cspell/dict-terraform": "workspace:*",
"@cspell/dict-typescript": "workspace:*",
"@cspell/dict-vue": "workspace:*"
},
"files": [
"cspell-ext.json",
"*.js",
"*.d.ts"
]
}
14 changes: 14 additions & 0 deletions dictionaries/cspell/scripts/build.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/usr/bin/env node

import fs from 'node:fs/promises';

async function main() {
const pkg = JSON.parse(await fs.readFile('package.json', 'utf8'));
const cspellExt = JSON.parse(await fs.readFile('cspell-ext.json', 'utf8'));

const dicts = Object.keys(pkg.dependencies).filter((dep) => dep.startsWith('@cspell/dict-'));
cspellExt.import = dicts.map((dict) => dict + `/cspell-ext.json`).sort();
await fs.writeFile('cspell-ext.json', JSON.stringify(cspellExt, null, 4) + '\n');
}

main();
8 changes: 8 additions & 0 deletions dictionaries/cspell/scripts/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"name": "@cspell/dict-cspell-scripts",
"private": true,
"bin": {
"build": "./build.mjs"
},
"scripts": {}
}
Loading

0 comments on commit feeb26f

Please sign in to comment.