Skip to content

Commit

Permalink
feat: support .pnp.js when loading configurations. (#1307)
Browse files Browse the repository at this point in the history
* feat: support `.pnp.js` when loading configurations.
* dev: be able to specify the list of .pnp files to search for
* dev: Add PnPSettings definitions
* dev: enable support for PnP
  • Loading branch information
Jason3S authored Jun 5, 2021
1 parent 0113d17 commit 76da68c
Show file tree
Hide file tree
Showing 60 changed files with 2,754 additions and 94 deletions.
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@
**/[Tt]emp
**/[Ss]amples
integration-tests/repositories
test-packages/yarn2
coverage
2 changes: 1 addition & 1 deletion .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
uses: actions/[email protected]

- run: npm ci

- run: npm run build
- run: npm run coverage

- name: Upload coverage Coveralls
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/cspell-action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- run: npm run prepare-cspell-action
- uses: streetsidesoftware/[email protected]
1 change: 1 addition & 0 deletions .github/workflows/cspell-cli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- run: npm run prepare-cspell-action
- run: npx cspell@latest "**/*"
1 change: 1 addition & 0 deletions .github/workflows/integration-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ jobs:
node-version: ${{ matrix.node-version }}

- run: npm ci
- run: npm run build
- name: Run Integration Tests ${{ matrix.repo }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ jobs:
- uses: actions/[email protected]
- uses: actions/[email protected]
- run: npm ci
- run: npm run build
- run: npm run lint-ci
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
node-version: ${{ matrix.node-version }}

- run: npm ci

- run: npm run build
- run: npm test

- name: verify trace command
Expand Down Expand Up @@ -66,7 +66,7 @@ jobs:
node-version: ${{ matrix.node-version }}

- run: npm ci

- run: npm run build
- run: npm test

- name: verify trace command
Expand Down
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ lerna.json
tsconfig*.json
packages/*/dist/
**/package-lock.json
coverage
2 changes: 2 additions & 0 deletions cspell-dict.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ liberapay
licia
liriliri
macos
medicalterms
megistos
micromatch
monorepo
Expand All @@ -47,6 +48,7 @@ streetsidesoftware
submodule
tidelift
tsdk
untrusted
webdeveric
wireapp
xregexp
75 changes: 39 additions & 36 deletions cspell.code-workspace
Original file line number Diff line number Diff line change
@@ -1,38 +1,41 @@
{
"folders": [
{
"name": "cspell-monorepo",
"path": "."
},
{
"path": "./integration-tests"
},
{
"path": "./packages/cspell-glob"
},
{
"path": "./packages/cspell-lib"
},
{
"path": "./packages/cspell-tools"
},
{
"path": "./packages/cspell-trie-lib"
},
{
"path": "./packages/cspell-trie"
},
{
"path": "./packages/cspell-trie2-lib"
},
{
"path": "./packages/cspell"
}
],
"settings": {
"typescript.tsdk": "cspell-monorepo/node_modules/typescript/lib",
"cSpell.customWorkspaceDictionaries": [
"workspace"
]
}
"folders": [
{
"name": "cspell-monorepo",
"path": "."
},
{
"path": "./integration-tests"
},
{
"path": "./packages/cspell-glob"
},
{
"path": "./packages/cspell-lib"
},
{
"path": "./packages/cspell-tools"
},
{
"path": "./packages/cspell-trie-lib"
},
{
"path": "./packages/cspell-trie"
},
{
"path": "./packages/cspell-trie2-lib"
},
{
"path": "./packages/cspell-types"
},
{
"path": "./packages/cspell"
}
],
"settings": {
"typescript.tsdk": "cspell-monorepo/node_modules/typescript/lib",
"cSpell.customWorkspaceDictionaries": [
"workspace"
]
}
}
5 changes: 5 additions & 0 deletions cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
"**/tsconfig.json",
"test-packages/test-cspell-tools/src/*.txt",
"cspell.json",
".yarn",
".pnp.{js,cjs}",
"integration-tests/config/config.json",
"integration-tests/config/repositories/**",
"integration-tests/repositories/**",
Expand All @@ -44,5 +46,8 @@
],
"ignoreWords": [
"commitcomment"
],
"words": [
"medicalterms"
]
}
32 changes: 32 additions & 0 deletions cspell.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,22 @@
},
"type": "array"
},
"pnpFiles": {
"default": [
".pnp.js",
".pnp.cjs"
],
"description": "The PnP files to search for. Note: `.mjs` files are not currently supported.",
"items": {
"type": "string"
},
"type": "array"
},
"usePnP": {
"default": false,
"description": "Packages managers like Yarn 2 use a `.pnp.cjs` file to assist in loading packages stored in the repository.\n\nWhen true, the spell checker will search up the directory structure for the existence of a PnP file and load it.",
"type": "boolean"
},
"words": {
"description": "list of words to be always considered correct",
"items": {
Expand Down Expand Up @@ -744,6 +760,17 @@
},
"type": "array"
},
"pnpFiles": {
"default": [
".pnp.js",
".pnp.cjs"
],
"description": "The PnP files to search for. Note: `.mjs` files are not currently supported.",
"items": {
"type": "string"
},
"type": "array"
},
"showStatus": {
"description": "Show status",
"type": "boolean"
Expand All @@ -752,6 +779,11 @@
"description": "Delay in ms after a document has changed before checking it for spelling errors.",
"type": "number"
},
"usePnP": {
"default": false,
"description": "Packages managers like Yarn 2 use a `.pnp.cjs` file to assist in loading packages stored in the repository.\n\nWhen true, the spell checker will search up the directory structure for the existence of a PnP file and load it.",
"type": "boolean"
},
"userWords": {
"description": "Words to add to global dictionary -- should only be in the user config file.",
"items": {
Expand Down
Loading

0 comments on commit 76da68c

Please sign in to comment.