Skip to content

Commit

Permalink
Added cspell to the codebase and ci (#765)
Browse files Browse the repository at this point in the history
* feat(*): added cspell to the codebase and ci

* revert(docs): removed content dir versioned unintentionally

* refactor(github actions): replaced cspell action with local version

* fix(web-ui-sdk): fixed eslint tsconfig for cspell

* ci(web-ui-sdk): added cspell config to eslint ignore

* feat(*): added cspell as a pre-commit hook and fixed found typos
  • Loading branch information
Omri-Levy authored Aug 13, 2023
1 parent 863273a commit 6522b1a
Show file tree
Hide file tree
Showing 40 changed files with 2,308 additions and 2,047 deletions.
39 changes: 39 additions & 0 deletions .github/actions/spell-check-action/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Spellcheck
description: Spellcheck the project

runs:
using: composite
steps:
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 18.12.1

- name: Install pnpm
uses: pnpm/action-setup@v2
id: pnpm-install
with:
version: 8
run_install: false

- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
shell: bash
run: pnpm install

- name: Spellcheck
shell: bash
run: pnpm spellcheck
11 changes: 11 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ jobs:

- name: Format
uses: ./.github/actions/format-action

build:
strategy:
matrix:
Expand All @@ -45,6 +46,16 @@ jobs:
- name: Build
uses: ./.github/actions/build-action

spell_check:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Spellcheck
uses: ./.github/actions/spell-check-action

test_linux:
runs-on: ubuntu-latest
timeout-minutes: 60
Expand Down
3 changes: 2 additions & 1 deletion .lintstagedrc.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{
"*.{js,cjs,mjs,jsx,ts,tsx,json,css,svelte}": "pnpm format"
"*.{js,cjs,mjs,jsx,ts,tsx,json,css,svelte}": "pnpm format",
"*": "pnpm spellcheck"
}
3 changes: 2 additions & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"statelyai.stately-vscode",
"prisma.prisma",
"bradlc.vscode-tailwindcss",
"github.vscode-github-actions"
"github.vscode-github-actions",
"streetsidesoftware.code-spell-checker"
]
}
2 changes: 2 additions & 0 deletions apps/backoffice-v2/cspell.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/** @type { import("@cspell/cspell-types").CSpellUserSettings } */
module.exports = require('../../packages/config/cspell.base.cjs');
3 changes: 3 additions & 0 deletions apps/backoffice-v2/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
"pnpm": ">=8.0.0"
},
"scripts": {
"spellcheck": "cspell \"*\"",
"format": "prettier --plugin-search-dir=. --write .",
"format:check": "prettier --plugin-search-dir=. --check .",
"lint": "eslint . --fix",
Expand Down Expand Up @@ -119,6 +120,8 @@
"@typescript-eslint/parser": "^5.30.0",
"@vitejs/plugin-react-swc": "^3.0.1",
"autoprefixer": "^10.4.7",
"cspell": "^6.31.2",
"@cspell/cspell-types": "^6.31.1",
"daisyui": "^2.46.1",
"eslint": "8.22.0",
"eslint-config-prettier": "^8.5.0",
Expand Down
2 changes: 2 additions & 0 deletions apps/workflows-dashboard/cspell.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/** @type { import("@cspell/cspell-types").CSpellUserSettings } */
module.exports = require('../../packages/config/cspell.base.cjs');
3 changes: 3 additions & 0 deletions apps/workflows-dashboard/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"version": "0.0.7",
"type": "module",
"scripts": {
"spellcheck": "cspell \"*\"",
"dev": "vite --host",
"build": "tsc && vite build",
"lint": "eslint src --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
Expand Down Expand Up @@ -64,6 +65,8 @@
"@typescript-eslint/parser": "^5.59.0",
"@vitejs/plugin-react": "^4.0.0",
"autoprefixer": "^10.4.14",
"cspell": "^6.31.2",
"@cspell/cspell-types": "^6.31.1",
"eslint": "^8.38.0",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-refresh": "^0.3.4",
Expand Down
2 changes: 2 additions & 0 deletions examples/headless-example/cspell.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/** @type { import("@cspell/cspell-types").CSpellUserSettings } */
module.exports = require('../../packages/config/cspell.base.cjs');
3 changes: 3 additions & 0 deletions examples/headless-example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"version": "0.0.13",
"type": "module",
"scripts": {
"spellcheck": "cspell \"*\"",
"format": "prettier --plugin-search-dir=. --write .",
"format:check": "prettier --plugin-search-dir=. --check .",
"dev": "vite",
Expand All @@ -20,6 +21,8 @@
"@types/node": "^20.3.2",
"@xstate/inspect": "^0.7.1",
"autoprefixer": "^10.4.7",
"cspell": "^6.31.2",
"@cspell/cspell-types": "^6.31.1",
"postcss": "^8.4.21",
"prettier": "^2.8.8",
"prettier-plugin-svelte": "^2.8.0",
Expand Down
2 changes: 2 additions & 0 deletions examples/web-ui-sdk/sdk-react/cspell.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/** @type { import("@cspell/cspell-types").CSpellUserSettings } */
module.exports = require('../../packages/config/cspell.base.cjs');
1 change: 1 addition & 0 deletions examples/web-ui-sdk/sdk-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"version": "0.4.1",
"type": "module",
"scripts": {
"spellcheck": "cspell \"*\"",
"dev": "vite",
"build": "tsc && vite build",
"preview": "vite preview"
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"kyb"
],
"scripts": {
"spellcheck": "nx run-many --target=spellcheck",
"monorepo:init": "node ./scripts/init.js",
"kyc-manual-review-example": "nx run @ballerine/common:build && nx run @ballerine/workflows-service:setup && cross-env ENV_FILE_NAME=.env.example VITE_POLLING_INTERVAL=3 VITE_EXAMPLE_TYPE=kyc VITE_API_KEY=secret concurrently \"nx run @ballerine/workflows-service:dev\" \"wait-on http://localhost:3000/api/v1/_health/ready && nx run-many --target=dev --projects=@ballerine/headless-example,@ballerine/backoffice-v2\"",
"kyc-manual-review-example-no-poll": "nx run @ballerine/common:build && nx run @ballerine/workflows-service:setup && cross-env ENV_FILE_NAME=.env.example VITE_POLLING_INTERVAL=false VITE_EXAMPLE_TYPE=kyc VITE_API_KEY=secret concurrently \"nx run @ballerine/workflows-service:dev\" \"wait-on http://localhost:3000/api/v1/_health/ready && nx run-many --target=dev --projects=@ballerine/headless-example,@ballerine/backoffice-v2\"",
Expand Down
2 changes: 2 additions & 0 deletions packages/common/cspell.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/** @type { import("@cspell/cspell-types").CSpellUserSettings } */
module.exports = require('../../packages/config/cspell.base.cjs');
3 changes: 3 additions & 0 deletions packages/common/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"license": "Apache-2.0",
"keywords": [],
"scripts": {
"spellcheck": "cspell \"*\"",
"build": "rollup --config rollup.config.js",
"watch": "concurrently --kill-others \"rollup --config rollup.config.js -w\" \"tsc -b --watch\"",
"test": "vitest",
Expand Down Expand Up @@ -49,6 +50,8 @@
"@typescript-eslint/parser": "^5.48.1",
"@vitest/coverage-istanbul": "^0.28.4",
"concurrently": "^7.6.0",
"cspell": "^6.31.2",
"@cspell/cspell-types": "^6.31.1",
"cz-conventional-changelog": "^3.3.0",
"eslint": "^8.32.0",
"eslint-config-prettier": "^6.11.0",
Expand Down
108 changes: 108 additions & 0 deletions packages/config/cspell.base.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
/** @type { import("@cspell/cspell-types").CSpellUserSettings } */
module.exports = {
version: '0.2',
id: 'cspell-project-config',
name: 'cspell Project Config',
language: 'en',
ignoreRegExpList: [
'c[0-9a-z]{24}',
'[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}',
'[a-zA-Z0-9+/]{2,}={0,2}',
],
words: [
'Lilyan',
'Brockside',
'buhgdawe',
'clhz',
'lhxy',
'lhzd',
'ajduq',
'UBOs',
'Ballerine',
"Ballerine's",
'ballerine',
'blrn',
'xstate',
'Typecheck',
'typecheck',
'Astro',
'astro',
'astrojs',
'shiki',
'docsearch',
'Cheatsheet',
'frontmatter',
'Encabezado',
'sección',
'Introducción',
'Aglolia',
'tsconfigs',
'BACKOFFICE',
'Backoffice',
'backoffice',
'commitlint',
'VITE',
'MXTSHOTA',
'vite',
'formkit',
'hookform',
'lukemorales',
'tanstack',
'clsx',
'tailwindcss',
'languagedetector',
'lucide',
'daisyui',
'viewports',
'msedge',
'felte',
'fontsource',
'nestjs',
'websockets',
'Kamil',
'Myśliwiec',
'nestframework',
'fintech',
'jslib',
'zerodevx',
'compressorjs',
'deepmerge',
'mjpeg',
'Prefs',
'gstreamer',
'sessionstore',
'firstrun',
'embeddable',
'gzipped',
'jsfiddle',
'ekyc',
'ICSS',
'jmespath',
'sibedge',
'healthcheck',
'isready',
'intg',
'accesscontrol',
'testcontainers',
],
maxNumberOfProblems: 1000,
ignorePaths: [
'*.snap',
'node_modules',
'package-lock.json',
'coverage/**',
'dist/**',
'dist.*/**',
'temp/**',
'CHANGELOG.md',
'package.json',
'.cspell.json',
'cspell.json',
'.vscode/**',
'tsconfig.tsbuildinfo',
'stats.html',
],
flagWords: [],
dictionaries: ['workspace'],
ignoreWords: [],
};
2 changes: 2 additions & 0 deletions packages/rules-engine/cspell.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/** @type { import("@cspell/cspell-types").CSpellUserSettings } */
module.exports = require('../../packages/config/cspell.base.cjs');
3 changes: 3 additions & 0 deletions packages/rules-engine/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"license": "Apache-2.0",
"keywords": [],
"scripts": {
"spellcheck": "cspell \"*\"",
"build": "rollup --config rollup.config.js",
"watch": "concurrently --kill-others \"rollup --config rollup.config.js -w\" \"tsc -b --watch\"",
"test": "vitest run",
Expand Down Expand Up @@ -42,6 +43,8 @@
"@typescript-eslint/parser": "^5.48.1",
"@vitest/coverage-istanbul": "^0.28.4",
"concurrently": "^7.6.0",
"cspell": "^6.31.2",
"@cspell/cspell-types": "^6.31.1",
"cz-conventional-changelog": "^3.3.0",
"eslint": "^8.32.0",
"eslint-config-prettier": "^6.11.0",
Expand Down
2 changes: 2 additions & 0 deletions packages/ui/cspell.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/** @type { import("@cspell/cspell-types").CSpellUserSettings } */
module.exports = require('../../packages/config/cspell.base.cjs');
3 changes: 3 additions & 0 deletions packages/ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"./dist/style.css": "./dist/style.css"
},
"scripts": {
"spellcheck": "cspell \"*\"",
"dev": "vite build --watch",
"build": "tsc && vite build",
"lint": "eslint src --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
Expand Down Expand Up @@ -60,6 +61,8 @@
"@typescript-eslint/parser": "^5.61.0",
"@vitejs/plugin-react": "^4.0.1",
"autoprefixer": "10.4.14",
"cspell": "^6.31.2",
"@cspell/cspell-types": "^6.31.1",
"eslint": "^8.44.0",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-refresh": "^0.4.1",
Expand Down
2 changes: 2 additions & 0 deletions packages/workflow-core/cspell.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/** @type { import("@cspell/cspell-types").CSpellUserSettings } */
module.exports = require('../../packages/config/cspell.base.cjs');
3 changes: 3 additions & 0 deletions packages/workflow-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"license": "Apache-2.0",
"keywords": [],
"scripts": {
"spellcheck": "cspell \"*\"",
"clean": "rimraf ./dist",
"build": "pnpm clean && rollup --config rollup.config.js",
"watch": "tsc -w",
Expand Down Expand Up @@ -55,6 +56,8 @@
"@typescript-eslint/parser": "^5.48.1",
"@vitest/coverage-istanbul": "^0.28.4",
"concurrently": "^7.6.0",
"cspell": "^6.31.2",
"@cspell/cspell-types": "^6.31.1",
"cz-conventional-changelog": "^3.3.0",
"eslint": "^8.32.0",
"eslint-config-prettier": "^6.11.0",
Expand Down
Loading

0 comments on commit 6522b1a

Please sign in to comment.