Features
feat: Support languages without word breaks (Part 2) (#9133)
feat: Support languages without word breaks (Part 2) (#9133)
This pull request introduces support for locale-sensitive word segmentation, enabling better spell checking for languages such as Japanese, Chinese, Thai, Lao, Khmer, and Myanmar. The main changes add a new configuration option, useIntlWordSegmentation, to the schema and internal types, implement the corresponding text transformation logic, and update the document validation pipeline to use this feature. Additional test fixtures and tests are included to ensure correct behavior.
Support for locale-sensitive word segmentation:
- Added a new boolean configuration option,
useIntlWordSegmentation, to the JSON schema (cspell.schema.json) and internal TypeScript types (BaseSetting), allowing users to enable locale-aware text segmentation for supported languages. [1] [2] [3] [4] - Implemented the
IntlSegmentTextTransformerand a factory function,createIntlSegmentTextTransformer, to perform locale-sensitive segmentation using the specified language. - Introduced a new utility,
chainTransformers, and anIdentityTextTransformerto allow chaining multiple text transformers in the validation pipeline. - Updated the document validation logic (
docValidator.tsand related files) to use the new transformer whenuseIntlWordSegmentationis enabled, ensuring correct segmentation for complex scripts. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14]
Testing and fixtures:
- Added new test fixtures and a test document containing Thai text, as well as a corresponding dictionary file and configuration to verify correct segmentation and spell checking. [1] [2] [3]
- Extended the document validator tests to cover the new segmentation feature.
These changes collectively improve support for non-space-delimited languages and provide a more robust spell-checking experience for a wider range of languages.
feat: Support languages without word breaks (Part 1) (#9131)
feat: Support languages without word breaks (Part 1) (#9131)
This pull request introduces a new IntlSegmentTextTransformer for locale-aware text segmentation, refactors text transformation infrastructure for better composability, and improves locale normalization to BCP 47 standards. It also adds comprehensive tests for these new features and refactors existing transformers for consistency.
Locale normalization improvements
- Improved the
normalizeLocaleIntlfunction inLanguageSettings.tsto support BCP 47 language tag normalization, including script and region subtags, and added tests for these cases. [1] [2]
New locale-aware text transformer
- Added the
IntlSegmentTextTransformerclass for locale-aware word segmentation usingIntl.Segmenter, along with tests covering multiple locales (including Thai). [1] [2]
Transformer infrastructure and API improvements
- Introduced a generic
TextTransformerinterface and theEdittype inTransformer.tsto standardize text transformation operations. - Added utility functions
applyEditsToMappedTextandapplyEditsToTextinTextMapEdit.tsfor applying edits and maintaining source maps, used by all transformers.
Refactoring and consistency
- Refactored
SubstitutionTransformerto implement the newTextTransformerinterface and use the new edit application utilities, simplifying and unifying its implementation. [1] [2] [3]
These changes collectively improve the flexibility, correctness, and internationalization support of the text transformation pipeline.
feat: Add `--force-check` cli option (#9080)
feat: Add --force-check cli option (#9080)
This pull request introduces a new --force-check option to the CLI, allowing users to force specific files to be checked even if they would normally be excluded. It also standardizes dependency configuration naming, improves error handling and reporting for the CLI, and updates TypeScript target versions in config files. The most important changes are grouped below.
New CLI Feature: Force Check
- Added a
--force-checkoption to thelintcommand, allowing files specified with--file,--files, or--file-listto be checked even if they would normally be excluded. This includes updates to the CLI interface, validation logic, and documentation/help output. [1] [2] [3] [4] [5] - Implemented logic in the file determination and processing flow to honor the
forceCheckflag, ensuring excluded files can be checked when requested, and updated reporting of skipped files. [1] [2] [3] [4] [5] [6]
CLI Error Handling and Testing
- Improved error handling for invalid combinations of CLI options (e.g., using
--force-checkwithout specifying files, or mixing globs and--file), with corresponding error messages and test cases. [1] [2] - Enhanced test coverage for the new
--force-checkoption, including snapshot updates for help and error outputs. [1] [2] [3] [4] [5] [6] [7]
Dependency Configuration Standardization
- Renamed the dependency configuration property from
onlyAllowBundletoonlyBundleacross all relevant config files and documentation for consistency. [1] [2] [3] [4]
Other Improvements
- Updated TypeScript target version in default config from
Node20toNode22. - Improved CLI process exit code handling for error scenarios.
- Minor improvement to CLI reporter logic to avoid emitting empty results.
- Cleaned up and simplified the coverage collection script in
package.json.
Fixes
fix: Reduce the size of cspell types when bundled (#9119)
fix: Reduce the size of cspell types when bundled (#9119)
This pull request introduces a new test package, test-cspell-types-define-config, designed to verify the size and correct bundling of the defineConfig function from @cspell/cspell-types. It also includes minor internal refactoring in the mergeConfig logic. The main themes are the addition of the test package and improvements to configuration merging.
New test package: test-cspell-types-define-config
-
Added the
test-cspell-types-define-configpackage with configuration files (package.json,tsconfig.json,tsdown.config.ts) and a basic test harness to ensure thedefineConfigutility is small when bundled and functions as expected. The tests check that the output files remain below specified size thresholds and thatdefineConfigis a function returning the same config object when called twice. [1] [2] [3] [4] [5] [6] -
Updated
pnpm-lock.yamlto add the new test package to the workspace and ensure it depends on the local@cspell/cspell-typespackage.
Internal refactoring
- Moved the creation of the
mergeIndividualSettingsFnsarray inside themergeConfigfunction inmerge.tsto avoid unnecessary computation and improve encapsulation.
fix(ci): push release tag with GitHub App token so publish.yml triggers (#9097)
fix(ci): push release tag with GitHub App token so publish.yml triggers (#9097)
Summary
publish.yml (the NPM trusted-publishing workflow) is triggered by a push: tags: v* event, among other triggers. build-version-release.yml creates that tag via pnpm lerna version, but the tag was never actually triggering publish.yml.
Root cause: lerna version pushes the version commit/tag to the origin remote, and origin's credentials were still the default GITHUB_TOKEN persisted by actions/checkout (the Setup Git step's gh-token remote was unused — lerna pushes to origin, not gh-token — and was seeded before the GitHub App token even existed). GitHub explicitly does not trigger downstream workflow runs for pushes authenticated with the default GITHUB_TOKEN, to avoid recursive triggering. So the tag got created, but publish.yml never fired.
Changes
actions/checkout: setpersist-credentials: falseso the default token isn't left wired intoorigin.Setup Git: drop the unused/misconfiguredgh-tokenremote (it referenced the default token anyway, and nothing pushed to it).Push Version: before runninglerna version, pointoriginat the already-generated GitHub App installation token (x-access-token:${GITHUB_TOKEN}) so the resulting tag push is authenticated as the GitHub App and correctly triggerspublish.yml'spush: tags: v*trigger.
Test plan
- YAML validated (
python3 -c "import yaml; yaml.safe_load(open(...))"passes). - Run
build-version-release.ymlviaworkflow_dispatchwithdry_run: false(or the next real release) and confirmpublish.ymlfires automatically off the resulting tag push, without needing a manualworkflow_dispatch.
Generated by Claude Code
fix: Updated package.json exports (#8965)
fix: Updated package.json exports (#8965)
This fixes a few package exports that were wrong or inconsistent (e.g. exports["."] not the same path as main).
The pnpm test script was failing locally due to my ~/.npmrc having ignore-scripts=true, which prevented the preinstall script from running. I updated test:prep to call the preinstall script, which should be fast if you already have yarn installed.
Dictionary Updates
fix: Workflow Bot -- Update Dictionaries (main) (#9102)
fix: Workflow Bot -- Update Dictionaries (main) (#9102)
Update Dictionaries (main)
Summary
.../snapshots/gitbucket/gitbucket/report.yaml | 3 +-
.../snapshots/gitbucket/gitbucket/snapshot.txt | 3 +-
.../snapshots/neovim/nvim-lspconfig/report.yaml | 3 +-
.../snapshots/neovim/nvim-lspconfig/snapshot.txt | 5 +-
.../snapshots/wireapp/wire-webapp/report.yaml | 184 +--------------------
.../snapshots/wireapp/wire-webapp/snapshot.txt | 182 +-------------------
packages/cspell-bundled-dicts/package.json | 4 +-
pnpm-lock.yaml | 20 ++-
8 files changed, 26 insertions(+), 378 deletions(-)
fix: Workflow Bot -- Update Dictionaries (main) (#9067)
fix: Workflow Bot -- Update Dictionaries (main) (#9067)
Update Dictionaries (main)
Summary
.../snapshots/django/django/report.yaml | 82 ++++++++++------------
.../snapshots/django/django/snapshot.txt | 51 ++++++--------
packages/cspell-bundled-dicts/package.json | 6 +-
pnpm-lock.yaml | 30 +++++---
4 files changed, 84 insertions(+), 85 deletions(-)