From d96351ac841625139b8c5895fadb523b55af018b Mon Sep 17 00:00:00 2001 From: Jason Dent Date: Thu, 29 Dec 2022 06:32:56 +0100 Subject: [PATCH] fix: Add sample usage for cspell-lib:spellCheckDocument (#3941) --- cspell.json | 1 + pnpm-lock.yaml | 6 + .../CHANGELOG.md | 728 ++++++++++++++++++ .../example-cspell-lib-single-doc/README.md | 5 + .../example-cspell-lib-single-doc/bin.js | 5 + .../example-cspell-lib-single-doc/cspell.json | 1 + .../package.json | 30 + .../samples/witherrors.md | 3 + .../src/index.ts | 24 + .../tsconfig.dev.json | 7 + .../tsconfig.json | 9 + test-packages/test-cspell-lib/package.json | 2 +- test-packages/test-cspell-lib/src/index.ts | 33 +- 13 files changed, 833 insertions(+), 21 deletions(-) create mode 100644 test-packages/example-cspell-lib-single-doc/CHANGELOG.md create mode 100644 test-packages/example-cspell-lib-single-doc/README.md create mode 100755 test-packages/example-cspell-lib-single-doc/bin.js create mode 100644 test-packages/example-cspell-lib-single-doc/cspell.json create mode 100644 test-packages/example-cspell-lib-single-doc/package.json create mode 100644 test-packages/example-cspell-lib-single-doc/samples/witherrors.md create mode 100644 test-packages/example-cspell-lib-single-doc/src/index.ts create mode 100644 test-packages/example-cspell-lib-single-doc/tsconfig.dev.json create mode 100644 test-packages/example-cspell-lib-single-doc/tsconfig.json diff --git a/cspell.json b/cspell.json index 99d23646986..3d428e73447 100644 --- a/cspell.json +++ b/cspell.json @@ -66,6 +66,7 @@ "temp", "test-fixtures/**", "test-packages/test-cspell-eslint-plugin/**", + "test-packages/example-cspell-lib-single-doc/samples/**", "test-packages/test-cspell-tools/src/*.txt" ], "useGitignore": true, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 3e0a5ecb8ef..4cbae3b17a8 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -728,6 +728,12 @@ importers: '@cspell/cspell-tools': link:../../../packages/cspell-tools cspell: link:../../../packages/cspell + test-packages/example-cspell-lib-single-doc: + specifiers: + cspell-lib: workspace:* + dependencies: + cspell-lib: link:../../packages/cspell-lib + test-packages/test-cspell: specifiers: '@cspell/cspell-types': workspace:* diff --git a/test-packages/example-cspell-lib-single-doc/CHANGELOG.md b/test-packages/example-cspell-lib-single-doc/CHANGELOG.md new file mode 100644 index 00000000000..524df49847d --- /dev/null +++ b/test-packages/example-cspell-lib-single-doc/CHANGELOG.md @@ -0,0 +1,728 @@ +# Change Log + +All notable changes to this project will be documented in this file. +See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. + +# 6.18.0 (2022-12-21) + +**Note:** Version bump only for package test-cspell-lib + +# 6.17.0 (2022-12-05) + +**Note:** Version bump only for package test-cspell-lib + +# 6.16.0 (2022-12-02) + +**Note:** Version bump only for package test-cspell-lib + +## 6.15.1 (2022-11-30) + +**Note:** Version bump only for package test-cspell-lib + +# 6.15.0 (2022-11-25) + +### Features + +* Preferred suggestions are listed first ([#3869](https://github.com/streetsidesoftware/cspell/issues/3869)) ([1b7a65d](https://github.com/streetsidesoftware/cspell/commit/1b7a65d6ec851b78e1cc27c56f32b77adfba36e5)) + +## 6.14.3 (2022-11-17) + +### Bug Fixes + +* trie-lib - fix issue with reference radix. ([#3849](https://github.com/streetsidesoftware/cspell/issues/3849)) ([73af697](https://github.com/streetsidesoftware/cspell/commit/73af6978c53f2fd1f4cd528fd84e9d52a4149d5b)) + +## 6.14.2 (2022-11-11) + +**Note:** Version bump only for package test-cspell-lib + +## 6.14.1 (2022-11-07) + +**Note:** Version bump only for package test-cspell-lib + +# 6.14.0 (2022-11-03) + +**Note:** Version bump only for package test-cspell-lib + +## 6.13.3 (2022-10-31) + +### Bug Fixes + +* Update dictionaries ([#3795](https://github.com/streetsidesoftware/cspell/issues/3795)) ([ae8de27](https://github.com/streetsidesoftware/cspell/commit/ae8de2754daafcdeb7e187a80e27b6f6c09dc1d7)) + +## 6.13.2 (2022-10-31) + +### Bug Fixes + +* Do not generate duplicate entries by default ([#3793](https://github.com/streetsidesoftware/cspell/issues/3793)) ([f27d3c6](https://github.com/streetsidesoftware/cspell/commit/f27d3c68ad454719d71724f92693db57270827b9)) + +## 6.13.1 (2022-10-28) + +**Note:** Version bump only for package test-cspell-lib + +# 6.13.0 (2022-10-28) + +### Bug Fixes + +* make sure all forms are generated. ([#3783](https://github.com/streetsidesoftware/cspell/issues/3783)) ([70949a5](https://github.com/streetsidesoftware/cspell/commit/70949a5823f7c58052f9627c9455dcaa3496e8fb)) + +# 6.12.0 (2022-09-30) + +### Features + +* Use cspell-dictionary Module ([#3686](https://github.com/streetsidesoftware/cspell/issues/3686)) ([6441f4b](https://github.com/streetsidesoftware/cspell/commit/6441f4b41fe0e8b8188fa4c08999450c8958b6f0)) + +## 6.11.1 (2022-09-30) + +### Bug Fixes + +* Fix export of SpellingDictionaryCollection ([#3683](https://github.com/streetsidesoftware/cspell/issues/3683)) ([7665cdb](https://github.com/streetsidesoftware/cspell/commit/7665cdba702ebf9517a3c1c1008193e239a829d4)) + +# 6.11.0 (2022-09-30) + +**Note:** Version bump only for package test-cspell-lib + +## 6.10.1 (2022-09-20) + +**Note:** Version bump only for package test-cspell-lib + +# 6.10.0 (2022-09-19) + +**Note:** Version bump only for package test-cspell-lib + +## 6.9.1 (2022-09-18) + +**Note:** Version bump only for package test-cspell-lib + +# 6.9.0 (2022-09-15) + +**Note:** Version bump only for package test-cspell-lib + +## 6.8.2 (2022-09-12) + +**Note:** Version bump only for package test-cspell-lib + +## 6.8.1 (2022-08-26) + +**Note:** Version bump only for package test-cspell-lib + +# 6.8.0 (2022-08-21) + +### Bug Fixes + +* Enable cli option `--validate-directives` ([#3461](https://github.com/streetsidesoftware/cspell/issues/3461)) ([52a5337](https://github.com/streetsidesoftware/cspell/commit/52a5337fb4090394342b45e31423752cda268559)) + +# 6.7.0 (2022-08-18) + +### Features + +* Adjust `.trie` formatting ([e2643c0](https://github.com/streetsidesoftware/cspell/commit/e2643c0bf508aa566823d2c697e5b94c77e6b874)), closes [#3443](https://github.com/streetsidesoftware/cspell/issues/3443) [#3430](https://github.com/streetsidesoftware/cspell/issues/3430) + +## 6.6.1 (2022-08-10) + +**Note:** Version bump only for package test-cspell-lib + +## 6.6.1-alpha.9 (2022-08-10) + +**Note:** Version bump only for package test-cspell-lib + +## 6.6.1-alpha.8 (2022-08-10) + +**Note:** Version bump only for package test-cspell-lib + +## 6.6.1-alpha.7 (2022-08-10) + +**Note:** Version bump only for package test-cspell-lib + +## 6.6.1-alpha.6 (2022-08-10) + +**Note:** Version bump only for package test-cspell-lib + +## 6.6.1-alpha.5 (2022-08-10) + +**Note:** Version bump only for package test-cspell-lib + +## 6.6.1-alpha.4 (2022-08-10) + +**Note:** Version bump only for package test-cspell-lib + +## 6.6.1-alpha.3 (2022-08-10) + +**Note:** Version bump only for package test-cspell-lib + +## 6.6.1-alpha.2 (2022-08-10) + +**Note:** Version bump only for package test-cspell-lib + +## [6.6.1-alpha.1](https://github.com/streetsidesoftware/cspell/compare/v6.6.1-alpha.0...v6.6.1-alpha.1) (2022-08-10) + +**Note:** Version bump only for package test-cspell-lib + +## [6.6.1-alpha.0](https://github.com/streetsidesoftware/cspell/compare/v6.6.0...v6.6.1-alpha.0) (2022-08-10) + +**Note:** Version bump only for package test-cspell-lib + +# [6.6.0](https://github.com/streetsidesoftware/cspell/compare/v6.5.0...v6.6.0) (2022-08-08) + +**Note:** Version bump only for package test-cspell-lib + +# [6.5.0](https://github.com/streetsidesoftware/cspell/compare/v6.4.2...v6.5.0) (2022-07-29) + +**Note:** Version bump only for package test-cspell-lib + +## [6.4.2](https://github.com/streetsidesoftware/cspell/compare/v6.4.1...v6.4.2) (2022-07-26) + +**Note:** Version bump only for package test-cspell-lib + +## [6.4.1](https://github.com/streetsidesoftware/cspell/compare/v6.4.0...v6.4.1) (2022-07-23) + +**Note:** Version bump only for package test-cspell-lib + +# [6.4.0](https://github.com/streetsidesoftware/cspell/compare/v6.4.0-alpha.0...v6.4.0) (2022-07-19) + +**Note:** Version bump only for package test-cspell-lib + +# [6.4.0-alpha.0](https://github.com/streetsidesoftware/cspell/compare/v6.3.0...v6.4.0-alpha.0) (2022-07-18) + +**Note:** Version bump only for package test-cspell-lib + +# [6.3.0](https://github.com/streetsidesoftware/cspell/compare/v6.2.4-alpha.0...v6.3.0) (2022-07-17) + +**Note:** Version bump only for package test-cspell-lib + +## [6.2.4-alpha.0](https://github.com/streetsidesoftware/cspell/compare/v6.2.3...v6.2.4-alpha.0) (2022-07-13) + +**Note:** Version bump only for package test-cspell-lib + +## [6.2.3](https://github.com/streetsidesoftware/cspell/compare/v6.2.2...v6.2.3) (2022-07-07) + +**Note:** Version bump only for package test-cspell-lib + +## [6.2.2](https://github.com/streetsidesoftware/cspell/compare/v6.2.1...v6.2.2) (2022-07-01) + +**Note:** Version bump only for package test-cspell-lib + +## [6.2.1](https://github.com/streetsidesoftware/cspell/compare/v6.2.0...v6.2.1) (2022-07-01) + +**Note:** Version bump only for package test-cspell-lib + +# [6.2.0](https://github.com/streetsidesoftware/cspell/compare/v6.2.0-alpha.1...v6.2.0) (2022-06-30) + +**Note:** Version bump only for package test-cspell-lib + +# [6.2.0-alpha.1](https://github.com/streetsidesoftware/cspell/compare/v6.2.0-alpha.0...v6.2.0-alpha.1) (2022-06-29) + +**Note:** Version bump only for package test-cspell-lib + +# [6.2.0-alpha.0](https://github.com/streetsidesoftware/cspell/compare/v6.1.3...v6.2.0-alpha.0) (2022-06-28) + +**Note:** Version bump only for package test-cspell-lib + +## [6.1.3](https://github.com/streetsidesoftware/cspell/compare/v6.1.3-alpha.1...v6.1.3) (2022-06-28) + +**Note:** Version bump only for package test-cspell-lib + +## [6.1.3-alpha.1](https://github.com/streetsidesoftware/cspell/compare/v6.1.3-alpha.0...v6.1.3-alpha.1) (2022-06-15) + +**Note:** Version bump only for package test-cspell-lib + +## [6.1.3-alpha.0](https://github.com/streetsidesoftware/cspell/compare/v6.1.2...v6.1.3-alpha.0) (2022-06-15) + +**Note:** Version bump only for package test-cspell-lib + +## [6.1.2](https://github.com/streetsidesoftware/cspell/compare/v6.1.1...v6.1.2) (2022-06-09) + +**Note:** Version bump only for package test-cspell-lib + +## [6.1.1](https://github.com/streetsidesoftware/cspell/compare/v6.1.0...v6.1.1) (2022-06-02) + +**Note:** Version bump only for package test-cspell-lib + +# [6.1.0](https://github.com/streetsidesoftware/cspell/compare/v6.1.0-alpha.0...v6.1.0) (2022-05-31) + +**Note:** Version bump only for package test-cspell-lib + +# [6.1.0-alpha.0](https://github.com/streetsidesoftware/cspell/compare/v6.0.0...v6.1.0-alpha.0) (2022-05-28) + +**Note:** Version bump only for package test-cspell-lib + +# [6.0.0](https://github.com/streetsidesoftware/cspell/compare/v6.0.0-alpha.0...v6.0.0) (2022-05-21) + +**Note:** Version bump only for package test-cspell-lib + +# [6.0.0-alpha.0](https://github.com/streetsidesoftware/cspell/compare/v5.21.1...v6.0.0-alpha.0) (2022-05-20) + +**Note:** Version bump only for package test-cspell-lib + +## [5.21.1](https://github.com/streetsidesoftware/cspell/compare/v5.21.0...v5.21.1) (2022-05-20) + +**Note:** Version bump only for package test-cspell-lib + +# [5.21.0](https://github.com/streetsidesoftware/cspell/compare/v5.20.0...v5.21.0) (2022-05-17) + +**Note:** Version bump only for package test-cspell-lib + +# [5.20.0](https://github.com/streetsidesoftware/cspell/compare/v5.19.7...v5.20.0) (2022-05-02) + +**Note:** Version bump only for package test-cspell-lib + +## [5.19.7](https://github.com/streetsidesoftware/cspell/compare/v5.19.6...v5.19.7) (2022-04-09) + +**Note:** Version bump only for package test-cspell-lib + +## [5.19.6](https://github.com/streetsidesoftware/cspell/compare/v5.19.5...v5.19.6) (2022-04-08) + +**Note:** Version bump only for package test-cspell-lib + +## [5.19.5](https://github.com/streetsidesoftware/cspell/compare/v5.19.4...v5.19.5) (2022-04-01) + +**Note:** Version bump only for package test-cspell-lib + +## [5.19.4](https://github.com/streetsidesoftware/cspell/compare/v5.19.3...v5.19.4) (2022-04-01) + +**Note:** Version bump only for package test-cspell-lib + +## [5.19.3](https://github.com/streetsidesoftware/cspell/compare/v5.19.2...v5.19.3) (2022-03-24) + +**Note:** Version bump only for package test-cspell-lib + +## [5.19.2](https://github.com/streetsidesoftware/cspell/compare/v5.19.1...v5.19.2) (2022-03-14) + +**Note:** Version bump only for package test-cspell-lib + +## [5.19.1](https://github.com/streetsidesoftware/cspell/compare/v5.19.0...v5.19.1) (2022-03-13) + +**Note:** Version bump only for package test-cspell-lib + +# [5.19.0](https://github.com/streetsidesoftware/cspell/compare/v5.18.5...v5.19.0) (2022-03-12) + +**Note:** Version bump only for package test-cspell-lib + +## [5.18.5](https://github.com/streetsidesoftware/cspell/compare/v5.18.4...v5.18.5) (2022-02-15) + +**Note:** Version bump only for package test-cspell-lib + +## [5.18.4](https://github.com/streetsidesoftware/cspell/compare/v5.18.3...v5.18.4) (2022-02-07) + +**Note:** Version bump only for package test-cspell-lib + +## [5.18.3](https://github.com/streetsidesoftware/cspell/compare/v5.18.2...v5.18.3) (2022-02-04) + +**Note:** Version bump only for package test-cspell-lib + +## [5.18.2](https://github.com/streetsidesoftware/cspell/compare/v5.18.1...v5.18.2) (2022-02-03) + +### Reverts + +* Revert "ci: Workflow Bot -- Update ALL Dependencies (#2388)" (#2391) ([7f093f9](https://github.com/streetsidesoftware/cspell/commit/7f093f9429cb7b755392996d54449f29f46f138a)), closes [#2388](https://github.com/streetsidesoftware/cspell/issues/2388) [#2391](https://github.com/streetsidesoftware/cspell/issues/2391) + +## [5.18.1](https://github.com/streetsidesoftware/cspell/compare/v5.18.0...v5.18.1) (2022-02-03) + +**Note:** Version bump only for package test-cspell-lib + +# [5.18.0](https://github.com/streetsidesoftware/cspell/compare/v5.18.0-alpha.0...v5.18.0) (2022-01-31) + +**Note:** Version bump only for package test-cspell-lib + +# [5.18.0-alpha.0](https://github.com/streetsidesoftware/cspell/compare/v5.17.0...v5.18.0-alpha.0) (2022-01-30) + +**Note:** Version bump only for package test-cspell-lib + +# [5.17.0](https://github.com/streetsidesoftware/cspell/compare/v5.17.0-alpha.0...v5.17.0) (2022-01-26) + +**Note:** Version bump only for package test-cspell-lib + +# [5.17.0-alpha.0](https://github.com/streetsidesoftware/cspell/compare/v5.16.0...v5.17.0-alpha.0) (2022-01-26) + +**Note:** Version bump only for package test-cspell-lib + +# [5.16.0](https://github.com/streetsidesoftware/cspell/compare/v5.15.3...v5.16.0) (2022-01-20) + +**Note:** Version bump only for package test-cspell-lib + +## [5.15.3](https://github.com/streetsidesoftware/cspell/compare/v5.15.2...v5.15.3) (2022-01-20) + +**Note:** Version bump only for package test-cspell-lib + +## [5.15.2](https://github.com/streetsidesoftware/cspell/compare/v5.15.1...v5.15.2) (2022-01-11) + +**Note:** Version bump only for package test-cspell-lib + +## [5.15.1](https://github.com/streetsidesoftware/cspell/compare/v5.15.0...v5.15.1) (2022-01-07) + +**Note:** Version bump only for package test-cspell-lib + +# [5.15.0](https://github.com/streetsidesoftware/cspell/compare/v5.14.0...v5.15.0) (2022-01-07) + +**Note:** Version bump only for package test-cspell-lib + +# [5.14.0](https://github.com/streetsidesoftware/cspell/compare/v5.14.0-alpha.0...v5.14.0) (2021-12-29) + +**Note:** Version bump only for package test-cspell-lib + +# [5.14.0-alpha.0](https://github.com/streetsidesoftware/cspell/compare/v5.13.4...v5.14.0-alpha.0) (2021-12-29) + +**Note:** Version bump only for package test-cspell-lib + +## [5.13.4](https://github.com/streetsidesoftware/cspell/compare/v5.13.3...v5.13.4) (2021-12-18) + +**Note:** Version bump only for package test-cspell-lib + +## [5.13.3](https://github.com/streetsidesoftware/cspell/compare/v5.13.2...v5.13.3) (2021-12-11) + +**Note:** Version bump only for package test-cspell-lib + +## [5.13.2](https://github.com/streetsidesoftware/cspell/compare/v5.13.1...v5.13.2) (2021-12-07) + +**Note:** Version bump only for package test-cspell-lib + +## [5.13.1](https://github.com/streetsidesoftware/cspell/compare/v5.13.0...v5.13.1) (2021-11-24) + +**Note:** Version bump only for package test-cspell-lib + +# [5.13.0](https://github.com/streetsidesoftware/cspell/compare/v5.12.6...v5.13.0) (2021-11-17) + +**Note:** Version bump only for package test-cspell-lib + +## [5.12.6](https://github.com/streetsidesoftware/cspell/compare/v5.12.5...v5.12.6) (2021-11-04) + +**Note:** Version bump only for package test-cspell-lib + +## [5.12.5](https://github.com/streetsidesoftware/cspell/compare/v5.12.4...v5.12.5) (2021-11-02) + +### Bug Fixes + +* Fix reading dictionary test to use `path` ([#1938](https://github.com/streetsidesoftware/cspell/issues/1938)) ([fa4ea3f](https://github.com/streetsidesoftware/cspell/commit/fa4ea3f0a379c5175fe3e930e1915f4521295583)) + +## [5.12.4](https://github.com/streetsidesoftware/cspell/compare/v5.12.3...v5.12.4) (2021-10-31) + +**Note:** Version bump only for package test-cspell-lib + +## [5.12.3](https://github.com/streetsidesoftware/cspell/compare/v5.12.2...v5.12.3) (2021-10-08) + +**Note:** Version bump only for package test-cspell-lib + +## [5.12.2](https://github.com/streetsidesoftware/cspell/compare/v5.12.1...v5.12.2) (2021-10-06) + +**Note:** Version bump only for package test-cspell-lib + +## [5.12.1](https://github.com/streetsidesoftware/cspell/compare/v5.12.0...v5.12.1) (2021-10-06) + +**Note:** Version bump only for package test-cspell-lib + +# [5.12.0](https://github.com/streetsidesoftware/cspell/compare/v5.12.0-alpha.0...v5.12.0) (2021-10-05) + +**Note:** Version bump only for package test-cspell-lib + +# [5.12.0-alpha.0](https://github.com/streetsidesoftware/cspell/compare/v5.11.1...v5.12.0-alpha.0) (2021-10-05) + +**Note:** Version bump only for package test-cspell-lib + +## [5.11.1](https://github.com/streetsidesoftware/cspell/compare/v5.11.0...v5.11.1) (2021-09-29) + +**Note:** Version bump only for package test-cspell-lib + +# [5.11.0](https://github.com/streetsidesoftware/cspell/compare/v5.11.0-alpha.0...v5.11.0) (2021-09-28) + +**Note:** Version bump only for package test-cspell-lib + +# [5.11.0-alpha.0](https://github.com/streetsidesoftware/cspell/compare/v5.10.1...v5.11.0-alpha.0) (2021-09-28) + +**Note:** Version bump only for package test-cspell-lib + +## [5.10.1](https://github.com/streetsidesoftware/cspell/compare/v5.10.0...v5.10.1) (2021-09-17) + +**Note:** Version bump only for package test-cspell-lib + +# [5.10.0](https://github.com/streetsidesoftware/cspell/compare/v5.10.0-alpha.6...v5.10.0) (2021-09-17) + +**Note:** Version bump only for package test-cspell-lib + +# [5.10.0-alpha.6](https://github.com/streetsidesoftware/cspell/compare/v5.10.0-alpha.5...v5.10.0-alpha.6) (2021-09-17) + +**Note:** Version bump only for package test-cspell-lib + +# [5.10.0-alpha.5](https://github.com/streetsidesoftware/cspell/compare/v5.10.0-alpha.4...v5.10.0-alpha.5) (2021-09-16) + +**Note:** Version bump only for package test-cspell-lib + +# [5.10.0-alpha.4](https://github.com/streetsidesoftware/cspell/compare/v5.10.0-alpha.3...v5.10.0-alpha.4) (2021-09-16) + +**Note:** Version bump only for package test-cspell-lib + +# [5.10.0-alpha.3](https://github.com/streetsidesoftware/cspell/compare/v5.10.0-alpha.2...v5.10.0-alpha.3) (2021-09-16) + +**Note:** Version bump only for package test-cspell-lib + +# [5.10.0-alpha.2](https://github.com/streetsidesoftware/cspell/compare/v5.10.0-alpha.0...v5.10.0-alpha.2) (2021-09-13) + +**Note:** Version bump only for package test-cspell-lib + +# [5.10.0-alpha.0](https://github.com/streetsidesoftware/cspell/compare/v5.9.1...v5.10.0-alpha.0) (2021-09-13) + +**Note:** Version bump only for package test-cspell-lib + +## [5.9.1](https://github.com/streetsidesoftware/cspell/compare/v5.9.1-alpha.1...v5.9.1) (2021-09-12) + +**Note:** Version bump only for package test-cspell-lib + +## [5.9.1-alpha.1](https://github.com/streetsidesoftware/cspell/compare/v5.9.1-alpha.0...v5.9.1-alpha.1) (2021-09-12) + +### Reverts + +* Revert "enable incremental typescript builds (#1671)" ([65664b2](https://github.com/streetsidesoftware/cspell/commit/65664b213e67a4108a2d38692f8fbd471b00afb7)), closes [#1671](https://github.com/streetsidesoftware/cspell/issues/1671) + +## [5.9.1-alpha.0](https://github.com/streetsidesoftware/cspell/compare/v5.9.0...v5.9.1-alpha.0) (2021-09-11) + +**Note:** Version bump only for package test-cspell-lib + +# [5.9.0](https://github.com/streetsidesoftware/cspell/compare/v5.9.0-alpha.0...v5.9.0) (2021-08-31) + +**Note:** Version bump only for package test-cspell-lib + +# [5.9.0-alpha.0](https://github.com/streetsidesoftware/cspell/compare/v5.8.2...v5.9.0-alpha.0) (2021-08-31) + +**Note:** Version bump only for package test-cspell-lib + +## [5.8.2](https://github.com/streetsidesoftware/cspell/compare/v5.8.1...v5.8.2) (2021-08-25) + +**Note:** Version bump only for package test-cspell-lib + +## [5.8.1](https://github.com/streetsidesoftware/cspell/compare/v5.8.0...v5.8.1) (2021-08-24) + +**Note:** Version bump only for package test-cspell-lib + +# [5.8.0](https://github.com/streetsidesoftware/cspell/compare/v5.7.2...v5.8.0) (2021-08-21) + +**Note:** Version bump only for package test-cspell-lib + +## [5.7.2](https://github.com/streetsidesoftware/cspell/compare/v5.7.1...v5.7.2) (2021-08-16) + +**Note:** Version bump only for package test-cspell-lib + +## [5.7.1](https://github.com/streetsidesoftware/cspell/compare/v5.7.0...v5.7.1) (2021-08-14) + +**Note:** Version bump only for package test-cspell-lib + +# [5.7.0](https://github.com/streetsidesoftware/cspell/compare/v5.7.0-alpha.0...v5.7.0) (2021-08-14) + +**Note:** Version bump only for package test-cspell-lib + +# [5.7.0-alpha.0](https://github.com/streetsidesoftware/cspell/compare/v5.6.7...v5.7.0-alpha.0) (2021-08-14) + +**Note:** Version bump only for package test-cspell-lib + +## [5.6.7](https://github.com/streetsidesoftware/cspell/compare/v5.6.6...v5.6.7) (2021-08-13) + +**Note:** Version bump only for package test-cspell-lib + +## [5.6.6](https://github.com/streetsidesoftware/cspell/compare/v5.6.5...v5.6.6) (2021-06-18) + +**Note:** Version bump only for package test-cspell-lib + +## [5.6.5](https://github.com/streetsidesoftware/cspell/compare/v5.6.4...v5.6.5) (2021-06-18) + +**Note:** Version bump only for package test-cspell-lib + +## [5.6.4](https://github.com/streetsidesoftware/cspell/compare/v5.6.3...v5.6.4) (2021-06-15) + +**Note:** Version bump only for package test-cspell-lib + +## [5.6.3](https://github.com/streetsidesoftware/cspell/compare/v5.6.2...v5.6.3) (2021-06-11) + +**Note:** Version bump only for package test-cspell-lib + +## [5.6.2](https://github.com/streetsidesoftware/cspell/compare/v5.6.1...v5.6.2) (2021-06-10) + +**Note:** Version bump only for package test-cspell-lib + +## [5.6.1](https://github.com/streetsidesoftware/cspell/compare/v5.6.0...v5.6.1) (2021-06-09) + +**Note:** Version bump only for package test-cspell-lib + +# [5.6.0](https://github.com/streetsidesoftware/cspell/compare/v5.5.2...v5.6.0) (2021-06-05) + +**Note:** Version bump only for package test-cspell-lib + +## [5.5.2](https://github.com/streetsidesoftware/cspell/compare/v5.5.1...v5.5.2) (2021-05-30) + +**Note:** Version bump only for package test-cspell-lib + +## [5.5.1](https://github.com/streetsidesoftware/cspell/compare/v5.5.0...v5.5.1) (2021-05-29) + +**Note:** Version bump only for package test-cspell-lib + +# [5.5.0](https://github.com/streetsidesoftware/cspell/compare/v5.4.1...v5.5.0) (2021-05-29) + +**Note:** Version bump only for package test-cspell-lib + +## [5.4.1](https://github.com/streetsidesoftware/cspell/compare/v5.4.0...v5.4.1) (2021-05-11) + +**Note:** Version bump only for package test-cspell-lib + +# [5.4.0](https://github.com/streetsidesoftware/cspell/compare/v5.3.12...v5.4.0) (2021-05-05) + +**Note:** Version bump only for package test-cspell-lib + +## [5.3.12](https://github.com/streetsidesoftware/cspell/compare/v5.3.11...v5.3.12) (2021-04-06) + +### Bug Fixes + +* Update dictionaries ([#1136](https://github.com/streetsidesoftware/cspell/issues/1136)) ([64eba51](https://github.com/streetsidesoftware/cspell/commit/64eba51b75e0e2dde0568f46b4312c949b884a73)) + +## [5.3.11](https://github.com/streetsidesoftware/cspell/compare/v5.3.10...v5.3.11) (2021-04-03) + +**Note:** Version bump only for package test-cspell-lib + +## [5.3.10](https://github.com/streetsidesoftware/cspell/compare/v5.3.9...v5.3.10) (2021-04-02) + +**Note:** Version bump only for package test-cspell-lib + +## [5.3.9](https://github.com/streetsidesoftware/cspell/compare/v5.3.8...v5.3.9) (2021-03-19) + +**Note:** Version bump only for package test-cspell-lib + +## [5.3.8](https://github.com/streetsidesoftware/cspell/compare/v5.3.7...v5.3.8) (2021-03-17) + +**Note:** Version bump only for package test-cspell-lib + +## [5.3.7](https://github.com/streetsidesoftware/cspell/compare/v5.3.7-alpha.3...v5.3.7) (2021-03-05) + +**Note:** Version bump only for package test-cspell-lib + +## [5.3.7-alpha.3](https://github.com/streetsidesoftware/cspell/compare/v5.3.7-alpha.2...v5.3.7-alpha.3) (2021-03-05) + +**Note:** Version bump only for package test-cspell-lib + +## [5.3.7-alpha.2](https://github.com/streetsidesoftware/cspell/compare/v5.3.7-alpha.1...v5.3.7-alpha.2) (2021-03-05) + +**Note:** Version bump only for package test-cspell-lib + +## [5.3.7-alpha.0](https://github.com/streetsidesoftware/cspell/compare/v5.3.6...v5.3.7-alpha.0) (2021-03-05) + +**Note:** Version bump only for package test-cspell-lib + +## [5.3.6](https://github.com/streetsidesoftware/cspell/compare/v5.3.5...v5.3.6) (2021-03-05) + +**Note:** Version bump only for package test-cspell-lib + +## [5.3.5](https://github.com/streetsidesoftware/cspell/compare/v5.3.4...v5.3.5) (2021-03-05) + +**Note:** Version bump only for package test-cspell-lib + +## [5.3.4](https://github.com/streetsidesoftware/cspell/compare/v5.3.3...v5.3.4) (2021-03-01) + +**Note:** Version bump only for package test-cspell-lib + +## [5.3.3](https://github.com/streetsidesoftware/cspell/compare/v5.3.2...v5.3.3) (2021-02-26) + +**Note:** Version bump only for package test-cspell-lib + +## [5.3.2](https://github.com/streetsidesoftware/cspell/compare/v5.3.1...v5.3.2) (2021-02-26) + +**Note:** Version bump only for package test-cspell-lib + +## [5.3.1](https://github.com/streetsidesoftware/cspell/compare/v5.3.0...v5.3.1) (2021-02-25) + +**Note:** Version bump only for package test-cspell-lib + +# [5.3.0](https://github.com/streetsidesoftware/cspell/compare/v5.3.0-alpha.4...v5.3.0) (2021-02-25) + +**Note:** Version bump only for package test-cspell-lib + +# [5.3.0-alpha.4](https://github.com/streetsidesoftware/cspell/compare/v5.3.0-alpha.3...v5.3.0-alpha.4) (2021-02-25) + +**Note:** Version bump only for package test-cspell-lib + +# [5.3.0-alpha.3](https://github.com/streetsidesoftware/cspell/compare/v5.3.0-alpha.2...v5.3.0-alpha.3) (2021-02-23) + +**Note:** Version bump only for package test-cspell-lib + +# [5.3.0-alpha.2](https://github.com/streetsidesoftware/cspell/compare/v5.3.0-alpha.1...v5.3.0-alpha.2) (2021-02-22) + +**Note:** Version bump only for package test-cspell-lib + +# [5.3.0-alpha.1](https://github.com/streetsidesoftware/cspell/compare/v5.3.0-alpha.0...v5.3.0-alpha.1) (2021-02-19) + +**Note:** Version bump only for package test-cspell-lib + +# [5.3.0-alpha.0](https://github.com/streetsidesoftware/cspell/compare/v5.2.4...v5.3.0-alpha.0) (2021-02-18) + +### Features + +* Part 1 - glob patterns are relative to the config file. ([#921](https://github.com/streetsidesoftware/cspell/issues/921)) ([a250448](https://github.com/streetsidesoftware/cspell/commit/a2504484ec38f15804cc0a203317266f83566b7c)) + +## [5.2.4](https://github.com/streetsidesoftware/cspell/compare/v5.2.3...v5.2.4) (2021-01-28) + +**Note:** Version bump only for package test-cspell-lib + +## [5.2.3](https://github.com/streetsidesoftware/cspell/compare/v5.2.2...v5.2.3) (2021-01-27) + +**Note:** Version bump only for package test-cspell-lib + +## [5.2.2](https://github.com/streetsidesoftware/cspell/compare/v5.2.1...v5.2.2) (2021-01-26) + +**Note:** Version bump only for package test-cspell-lib + +## [5.2.1](https://github.com/streetsidesoftware/cspell/compare/v5.2.0...v5.2.1) (2021-01-23) + +**Note:** Version bump only for package test-cspell-lib + +# [5.2.0](https://github.com/streetsidesoftware/cspell/compare/v5.1.3...v5.2.0) (2021-01-23) + +**Note:** Version bump only for package test-cspell-lib + +## [5.1.3](https://github.com/streetsidesoftware/cspell/compare/v5.1.2...v5.1.3) (2021-01-05) + +**Note:** Version bump only for package test-cspell-lib + +## [5.1.2](https://github.com/streetsidesoftware/cspell/compare/v5.1.1...v5.1.2) (2020-12-31) + +**Note:** Version bump only for package test-cspell-lib + +## [5.1.1](https://github.com/streetsidesoftware/cspell/compare/v5.1.0...v5.1.1) (2020-12-28) + +**Note:** Version bump only for package test-cspell-lib + +# [5.1.0](https://github.com/streetsidesoftware/cspell/compare/v5.0.8...v5.1.0) (2020-12-27) + +**Note:** Version bump only for package test-cspell-lib + +## [5.0.8](https://github.com/streetsidesoftware/cspell/compare/v5.0.7...v5.0.8) (2020-12-17) + +**Note:** Version bump only for package test-cspell-lib + +## [5.0.7](https://github.com/streetsidesoftware/cspell/compare/v5.0.6...v5.0.7) (2020-12-16) + +**Note:** Version bump only for package test-cspell-lib + +## [5.0.6](https://github.com/streetsidesoftware/cspell/compare/v5.0.5...v5.0.6) (2020-12-15) + +**Note:** Version bump only for package test-cspell-lib + +## [5.0.5](https://github.com/streetsidesoftware/cspell/compare/v5.0.4...v5.0.5) (2020-12-15) + +**Note:** Version bump only for package test-cspell-lib + +## [5.0.4](https://github.com/streetsidesoftware/cspell/compare/v5.0.3...v5.0.4) (2020-12-15) + +**Note:** Version bump only for package test-cspell-lib + +## [5.0.3](https://github.com/streetsidesoftware/cspell/compare/v5.0.2...v5.0.3) (2020-12-04) + +**Note:** Version bump only for package test-cspell-lib + +## [5.0.2](https://github.com/streetsidesoftware/cspell/compare/v5.0.2-alpha.1...v5.0.2) (2020-11-26) + +**Note:** Version bump only for package test-cspell-lib + +## [5.0.1](https://github.com/streetsidesoftware/cspell/compare/v5.0.1-alpha.15...v5.0.1) (2020-11-20) + +**Note:** Version bump only for package test-cspell-lib + +## [5.0.1-alpha.15](https://github.com/streetsidesoftware/cspell/compare/v5.0.1-alpha.14...v5.0.1-alpha.15) (2020-11-18) + +**Note:** Version bump only for package test-cspell-lib + +## 5.0.1-alpha.14 (2020-11-17) + +**Note:** Version bump only for package test-cspell-lib diff --git a/test-packages/example-cspell-lib-single-doc/README.md b/test-packages/example-cspell-lib-single-doc/README.md new file mode 100644 index 00000000000..01acf269885 --- /dev/null +++ b/test-packages/example-cspell-lib-single-doc/README.md @@ -0,0 +1,5 @@ +# External Dependency Test + +This package is NOT to be published. + +External dependency test of `cspell-lib`. diff --git a/test-packages/example-cspell-lib-single-doc/bin.js b/test-packages/example-cspell-lib-single-doc/bin.js new file mode 100755 index 00000000000..68e9e6990ea --- /dev/null +++ b/test-packages/example-cspell-lib-single-doc/bin.js @@ -0,0 +1,5 @@ +#!/usr/bin/env node + +const { run } = require('./dist/index'); + +run(); diff --git a/test-packages/example-cspell-lib-single-doc/cspell.json b/test-packages/example-cspell-lib-single-doc/cspell.json new file mode 100644 index 00000000000..0967ef424bc --- /dev/null +++ b/test-packages/example-cspell-lib-single-doc/cspell.json @@ -0,0 +1 @@ +{} diff --git a/test-packages/example-cspell-lib-single-doc/package.json b/test-packages/example-cspell-lib-single-doc/package.json new file mode 100644 index 00000000000..de5b491b668 --- /dev/null +++ b/test-packages/example-cspell-lib-single-doc/package.json @@ -0,0 +1,30 @@ +{ + "name": "example-cspell-lib-single-doc", + "version": "6.18.0", + "description": "Pure testing package for cspell-io. It purpose is to verify cspell-io dependencies.", + "private": true, + "bin": "bin.js", + "scripts": { + "clean": "rimraf dist .tsbuildinfo", + "build": "pnpm run compile", + "build-dev": "tsc -p tsconfig.dev.json", + "watch": "tsc -p tsconfig.dev.json --watch", + "clean-build": "pnpm run clean && pnpm run build", + "compile": "tsc -p .", + "test": "node bin src/index.ts" + }, + "author": "", + "license": "MIT", + "dependencies": { + "cspell-lib": "workspace:*" + }, + "main": "index.js", + "engines": { + "node": ">=14" + }, + "files": [ + "bin.js", + "dist/**/*.js" + ], + "keywords": [] +} diff --git a/test-packages/example-cspell-lib-single-doc/samples/witherrors.md b/test-packages/example-cspell-lib-single-doc/samples/witherrors.md new file mode 100644 index 00000000000..295395831bc --- /dev/null +++ b/test-packages/example-cspell-lib-single-doc/samples/witherrors.md @@ -0,0 +1,3 @@ +# A File with Spelling Errors + +Thisss is a fiile with some spellling errors. diff --git a/test-packages/example-cspell-lib-single-doc/src/index.ts b/test-packages/example-cspell-lib-single-doc/src/index.ts new file mode 100644 index 00000000000..865fc35a58c --- /dev/null +++ b/test-packages/example-cspell-lib-single-doc/src/index.ts @@ -0,0 +1,24 @@ +import { spellCheckDocument } from 'cspell-lib'; +import * as path from 'path'; + +export async function run() { + const app = path.relative(process.cwd(), process.argv[1]); + const file = process.argv[2]; + + console.log(`\ +Example of how to spell check a document in node and get the results. + +Usage ${app} + +`); + if (!file) { + console.log('Missing file.'); + process.exitCode = 1; + return; + } + + const results = await spellCheckDocument({ uri: path.resolve(file) }, {}, {}); + + const { checked, issues, errors } = results; + console.log('%o', { checked, issues, errors }); +} diff --git a/test-packages/example-cspell-lib-single-doc/tsconfig.dev.json b/test-packages/example-cspell-lib-single-doc/tsconfig.dev.json new file mode 100644 index 00000000000..9bc0084662d --- /dev/null +++ b/test-packages/example-cspell-lib-single-doc/tsconfig.dev.json @@ -0,0 +1,7 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "incremental": true, + "tsBuildInfoFile": ".tsbuildinfo" + } +} diff --git a/test-packages/example-cspell-lib-single-doc/tsconfig.json b/test-packages/example-cspell-lib-single-doc/tsconfig.json new file mode 100644 index 00000000000..d11ecf39ed1 --- /dev/null +++ b/test-packages/example-cspell-lib-single-doc/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "outDir": "dist" + }, + "include": [ + "src" + ] +} diff --git a/test-packages/test-cspell-lib/package.json b/test-packages/test-cspell-lib/package.json index 421924413fc..25ba57d9bbe 100644 --- a/test-packages/test-cspell-lib/package.json +++ b/test-packages/test-cspell-lib/package.json @@ -1,7 +1,7 @@ { "name": "test-cspell-lib", "version": "6.18.0", - "description": "Pure testing package for cspell-io. It purpose is to verify cspell-io dependencies.", + "description": "Pure testing package for cspell-lib.", "private": true, "scripts": { "clean": "rimraf dist .tsbuildinfo", diff --git a/test-packages/test-cspell-lib/src/index.ts b/test-packages/test-cspell-lib/src/index.ts index 63ceed8ceee..253941abf62 100644 --- a/test-packages/test-cspell-lib/src/index.ts +++ b/test-packages/test-cspell-lib/src/index.ts @@ -1,33 +1,26 @@ -import { assert } from 'console'; -import { validateText, combineTextAndLanguageSettings, finalizeSettings, getDefaultSettings } from 'cspell-lib'; +import assert from 'assert'; +import { spellCheckDocument } from 'cspell-lib'; // cspell:ignore wordz coztom clockz cuztom const customWords = ['wordz', 'cuztom', 'clockz']; -async function spellcheckerFactory(customWords: string[] = []) { - const settings = { - ...getDefaultSettings(), - words: customWords, - }; - - const fileSettings = combineTextAndLanguageSettings(settings, '', ['plaintext']); - const finalSettings = finalizeSettings(fileSettings); - - return (phrase: string) => { - return validateText(phrase, finalSettings, { generateSuggestions: true }); - }; +async function checkSpelling(phrase: string) { + const result = await spellCheckDocument( + { uri: 'text.txt', text: phrase, languageId: 'plaintext', locale: 'en' }, + { generateSuggestions: true, noConfigSearch: true }, + { words: customWords, suggestionsTimeout: 2000 } + ); + return result.issues; } -const checkSpelling = async (phrase: string) => { - const spellChecker = await spellcheckerFactory(customWords); - return spellChecker(phrase); -}; - async function run() { + console.log(`Start: ${new Date().toISOString()}`); const r = await checkSpelling('These are my coztom wordz.'); + console.log(`End: ${new Date().toISOString()}`); + console.log(r); assert(r.length === 1, 'Make sure we got 1 spelling issue back.'); assert(r[0].text === 'coztom'); - assert(r[0].suggestions?.[0] === 'cuztom'); + assert(r[0].suggestions?.includes('cuztom')); // console.log('%o', r); }