knip 2.41.2 → 2.41.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +131 -132
- package/dist/constants.js +1 -0
- package/dist/plugins/graphql-codegen/index.js +15 -2
- package/dist/plugins/vitest/index.js +3 -1
- package/dist/plugins/vitest/types.d.ts +1 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -31,51 +31,51 @@ The dots don't connect themselves. This is where Knip comes in:
|
|
|
31
31
|
|
|
32
32
|
Knip shines in both small and large projects. It's a fresh take on keeping your projects clean & tidy!
|
|
33
33
|
|
|
34
|
-
|
|
35
|
-
|
|
34
|
+
![An orange cow with scissors, Van Gogh style][9] <sup>_“An orange cow with scissors, Van Gogh style” - generated with
|
|
35
|
+
OpenAI_</sup>
|
|
36
36
|
|
|
37
|
-
For updates or questions, come hang out in [The Knip Barn (Discord)][
|
|
38
|
-
[@webpro (fosstodon.org)][
|
|
37
|
+
For updates or questions, come hang out in [The Knip Barn (Discord)][10], or follow [@webprolific (Twitter)][11] or
|
|
38
|
+
[@webpro (fosstodon.org)][12]. Please use GitHub to [report issues][13].
|
|
39
39
|
|
|
40
40
|
## Contents
|
|
41
41
|
|
|
42
|
-
- [Getting Started][
|
|
43
|
-
- [Installation][
|
|
44
|
-
- [Default Configuration][
|
|
45
|
-
- [Let's Go!][
|
|
46
|
-
- [Configuration][
|
|
47
|
-
- [Entry Files][
|
|
42
|
+
- [Getting Started][14]
|
|
43
|
+
- [Installation][15]
|
|
44
|
+
- [Default Configuration][16]
|
|
45
|
+
- [Let's Go!][17]
|
|
46
|
+
- [Configuration][18]
|
|
47
|
+
- [Entry Files][19]
|
|
48
48
|
- [Workspaces][1]
|
|
49
49
|
- [Plugins][2]
|
|
50
50
|
- [Compilers][3]
|
|
51
|
-
- [Ignore files, binaries, dependencies and workspaces][
|
|
52
|
-
- [Public exports][
|
|
53
|
-
- [Ignore exports used in file][
|
|
54
|
-
- [Include exports in entry files][
|
|
55
|
-
- [Paths][
|
|
51
|
+
- [Ignore files, binaries, dependencies and workspaces][20]
|
|
52
|
+
- [Public exports][21]
|
|
53
|
+
- [Ignore exports used in file][22]
|
|
54
|
+
- [Include exports in entry files][23]
|
|
55
|
+
- [Paths][24]
|
|
56
56
|
- [Production Mode][4]
|
|
57
|
-
- [Strict][
|
|
58
|
-
- [Ignore `@internal` exports][
|
|
59
|
-
- [Plugins][
|
|
60
|
-
- [Output][
|
|
61
|
-
- [Screenshots][
|
|
62
|
-
- [Reading the report][
|
|
63
|
-
- [Rules & Filters][
|
|
57
|
+
- [Strict][25]
|
|
58
|
+
- [Ignore `@internal` exports][26]
|
|
59
|
+
- [Plugins][27]
|
|
60
|
+
- [Output][28]
|
|
61
|
+
- [Screenshots][29]
|
|
62
|
+
- [Reading the report][30]
|
|
63
|
+
- [Rules & Filters][31]
|
|
64
64
|
- [Reporters][5]
|
|
65
|
-
- [Fixing Issues][
|
|
65
|
+
- [Fixing Issues][32]
|
|
66
66
|
- [JSDoc tags][8]
|
|
67
|
-
- [Command Line Options][
|
|
68
|
-
- [Potential boost with `--no-gitignore`][
|
|
69
|
-
- [Comparison & Migration][
|
|
70
|
-
- [depcheck][
|
|
71
|
-
- [unimported][
|
|
72
|
-
- [ts-unused-exports][
|
|
73
|
-
- [ts-prune][
|
|
74
|
-
- [Projects using Knip][
|
|
75
|
-
- [Articles, etc.][
|
|
76
|
-
- [Why "Knip"?][
|
|
77
|
-
- [Really, another unused file/dependency/export finder?][
|
|
78
|
-
- [Contributors][
|
|
67
|
+
- [Command Line Options][33]
|
|
68
|
+
- [Potential boost with `--no-gitignore`][34]
|
|
69
|
+
- [Comparison & Migration][35]
|
|
70
|
+
- [depcheck][36]
|
|
71
|
+
- [unimported][37]
|
|
72
|
+
- [ts-unused-exports][38]
|
|
73
|
+
- [ts-prune][39]
|
|
74
|
+
- [Projects using Knip][40]
|
|
75
|
+
- [Articles, etc.][41]
|
|
76
|
+
- [Why "Knip"?][42]
|
|
77
|
+
- [Really, another unused file/dependency/export finder?][43]
|
|
78
|
+
- [Contributors][44]
|
|
79
79
|
|
|
80
80
|
## Getting Started
|
|
81
81
|
|
|
@@ -100,7 +100,7 @@ Knip has good defaults and aims for no or little configuration. The (simplified)
|
|
|
100
100
|
}
|
|
101
101
|
```
|
|
102
102
|
|
|
103
|
-
There's more, jump to [Entry Files][
|
|
103
|
+
There's more, jump to [Entry Files][19] for details.
|
|
104
104
|
|
|
105
105
|
Knip looks for this configuration file (ordered by priority):
|
|
106
106
|
|
|
@@ -156,7 +156,7 @@ Then use `npm run knip` to analyze the project and output unused files, dependen
|
|
|
156
156
|
|
|
157
157
|
Knip works just fine with `yarn` or `pnpm` or `bun`.
|
|
158
158
|
|
|
159
|
-
See [Command Line Options][
|
|
159
|
+
See [Command Line Options][33] for an overview of available CLI options.
|
|
160
160
|
|
|
161
161
|
## Configuration
|
|
162
162
|
|
|
@@ -219,7 +219,7 @@ Here's an example `knip.json` configuration with some custom `entry` and `projec
|
|
|
219
219
|
```
|
|
220
220
|
|
|
221
221
|
It might be useful to run Knip first with no or little configuration to see where it needs custom `entry` and/or
|
|
222
|
-
`project` files. Each workspace has the same [default configuration][
|
|
222
|
+
`project` files. Each workspace has the same [default configuration][18].
|
|
223
223
|
|
|
224
224
|
The root workspace is named `"."` under `workspaces` (like in the example).
|
|
225
225
|
|
|
@@ -320,7 +320,7 @@ themselves and/or `entry` files for Knip to analyze.
|
|
|
320
320
|
|
|
321
321
|
See each plugin's documentation for its default values.
|
|
322
322
|
|
|
323
|
-
In an Astro, Svelte or Vue project? Make sure to see [compilers][
|
|
323
|
+
In an Astro, Svelte or Vue project? Make sure to see [compilers][45] and add some extra configuration.
|
|
324
324
|
|
|
325
325
|
#### `config`
|
|
326
326
|
|
|
@@ -359,7 +359,7 @@ level by setting it to `false` there, and vice versa.
|
|
|
359
359
|
#### Multi-project repositories
|
|
360
360
|
|
|
361
361
|
Some repositories have a single `package.json`, but consist of multiple projects with configuration files across the
|
|
362
|
-
repository (such as the [Nx "intregrated repo" style][
|
|
362
|
+
repository (such as the [Nx "intregrated repo" style][46]). Let's assume some of these projects are apps and have their
|
|
363
363
|
own Cypress configuration and test files. In that case, we could configure the Cypress plugin like this:
|
|
364
364
|
|
|
365
365
|
```json
|
|
@@ -372,7 +372,7 @@ own Cypress configuration and test files. In that case, we could configure the C
|
|
|
372
372
|
|
|
373
373
|
#### Create a new plugin
|
|
374
374
|
|
|
375
|
-
Getting false positives because a plugin is missing? Want to help out? Please read more at [writing a plugin][
|
|
375
|
+
Getting false positives because a plugin is missing? Want to help out? Please read more at [writing a plugin][47]. This
|
|
376
376
|
guide also contains more details if you want to learn more about plugins and why they are useful.
|
|
377
377
|
|
|
378
378
|
### Compilers
|
|
@@ -395,7 +395,7 @@ export default {
|
|
|
395
395
|
};
|
|
396
396
|
```
|
|
397
397
|
|
|
398
|
-
Read [Compilers][
|
|
398
|
+
Read [Compilers][45] for more details and examples.
|
|
399
399
|
|
|
400
400
|
### Ignore files, binaries, dependencies and workspaces
|
|
401
401
|
|
|
@@ -567,7 +567,7 @@ Note that `devDependencies` is covered within a single key for all `dependencies
|
|
|
567
567
|
|
|
568
568
|
When an issue type has zero issues, it is not shown.
|
|
569
569
|
|
|
570
|
-
Getting too many reported issues and false positives? Read more about [handling issues][
|
|
570
|
+
Getting too many reported issues and false positives? Read more about [handling issues][48].
|
|
571
571
|
|
|
572
572
|
### Rules & Filters
|
|
573
573
|
|
|
@@ -594,7 +594,7 @@ Example:
|
|
|
594
594
|
}
|
|
595
595
|
```
|
|
596
596
|
|
|
597
|
-
See [reading the report][
|
|
597
|
+
See [reading the report][30] for the list of issue types.
|
|
598
598
|
|
|
599
599
|
The rules are modeled after the ESLint `rules` configuration, and could be extended in the future. For instance, to
|
|
600
600
|
apply filters or configurations only to a specific issue type.
|
|
@@ -619,7 +619,7 @@ knip --include files --exclude classMembers,enumMembers
|
|
|
619
619
|
|
|
620
620
|
Use `--dependencies` or `--exports` as shortcuts to combine groups of related types.
|
|
621
621
|
|
|
622
|
-
See [reading the report][
|
|
622
|
+
See [reading the report][30] for the list of issue types.
|
|
623
623
|
|
|
624
624
|
#### When to use rules or filters
|
|
625
625
|
|
|
@@ -643,13 +643,13 @@ Knip provides the following built-in reporters:
|
|
|
643
643
|
|
|
644
644
|
When the provided built-in reporters are not sufficient, a custom reporter can be implemented.
|
|
645
645
|
|
|
646
|
-
Find more details in [reporters and preprocessors][
|
|
646
|
+
Find more details in [reporters and preprocessors][49].
|
|
647
647
|
|
|
648
648
|
#### Preprocessers
|
|
649
649
|
|
|
650
650
|
Use preprocessers to modify the results before they're passed to the reporter(s).
|
|
651
651
|
|
|
652
|
-
Find more details in [reporters and preprocessors][
|
|
652
|
+
Find more details in [reporters and preprocessors][49].
|
|
653
653
|
|
|
654
654
|
## Fixing Issues
|
|
655
655
|
|
|
@@ -667,7 +667,7 @@ Tip: back up files or use an VCS like Git before deleting files or making change
|
|
|
667
667
|
|
|
668
668
|
Repeat the process to reveal new unused files and exports. It's so liberating to remove unused things!
|
|
669
669
|
|
|
670
|
-
Getting too many reported issues and false positives? Read more about [handling issues][
|
|
670
|
+
Getting too many reported issues and false positives? Read more about [handling issues][48] describing potential causes
|
|
671
671
|
for false positives, and how to handle them.
|
|
672
672
|
|
|
673
673
|
## JSDoc tags
|
|
@@ -733,13 +733,13 @@ $ npx knip --help
|
|
|
733
733
|
|
|
734
734
|
## Potential boost with `--no-gitignore`
|
|
735
735
|
|
|
736
|
-
To increase performance in a large monorepo, check out [Potential boost with `--no-gitignore`][
|
|
736
|
+
To increase performance in a large monorepo, check out [Potential boost with `--no-gitignore`][50].
|
|
737
737
|
|
|
738
738
|
## Comparison & Migration
|
|
739
739
|
|
|
740
740
|
This table is an ongoing comparison. Based on their docs (please report any mistakes):
|
|
741
741
|
|
|
742
|
-
| Feature | **knip** | [depcheck][
|
|
742
|
+
| Feature | **knip** | [depcheck][51] | [unimported][52] | [ts-unused-exports][53] | [ts-prune][54] |
|
|
743
743
|
| :---------------------- | :------: | :------------: | :--------------: | :---------------------: | :------------: |
|
|
744
744
|
| Unused files | ✅ | - | ✅ | - | - |
|
|
745
745
|
| Unused dependencies | ✅ | ✅ | ✅ | - | - |
|
|
@@ -805,25 +805,25 @@ knip --exports # Adds unused exports/types in namespaces and unused enum/class
|
|
|
805
805
|
|
|
806
806
|
Many thanks to some of the early adopters of Knip:
|
|
807
807
|
|
|
808
|
-
- [Block Protocol][
|
|
809
|
-
- [DeepmergeTS][
|
|
810
|
-
- [eslint-plugin-functional][
|
|
811
|
-
- [freeCodeCamp.org][
|
|
812
|
-
- [is-immutable-type][
|
|
813
|
-
- [IsaacScript][
|
|
814
|
-
- [Nuxt][
|
|
815
|
-
- [Owncast][
|
|
816
|
-
- [release-it][
|
|
817
|
-
- [Template TypeScript Node Package][
|
|
818
|
-
- [Tipi][
|
|
808
|
+
- [Block Protocol][55]
|
|
809
|
+
- [DeepmergeTS][56]
|
|
810
|
+
- [eslint-plugin-functional][57]
|
|
811
|
+
- [freeCodeCamp.org][58]
|
|
812
|
+
- [is-immutable-type][59]
|
|
813
|
+
- [IsaacScript][60]
|
|
814
|
+
- [Nuxt][61]
|
|
815
|
+
- [Owncast][62]
|
|
816
|
+
- [release-it][63]
|
|
817
|
+
- [Template TypeScript Node Package][64]
|
|
818
|
+
- [Tipi][65]
|
|
819
819
|
|
|
820
820
|
## Articles, etc.
|
|
821
821
|
|
|
822
|
-
- Discord: hang out in [The Knip Barn][
|
|
823
|
-
- Ask your questions in the [Knip knowledge base][
|
|
824
|
-
- Smashing Magazine: [Knip: An Automated Tool For Finding Unused Files, Exports, And Dependencies][
|
|
825
|
-
- Effective TypeScript: [Recommendation Update: ✂️ Use knip to detect dead code and types][
|
|
826
|
-
- Josh Goldberg: [Speeding Up Centered Part 4: Unused Code Bloat][
|
|
822
|
+
- Discord: hang out in [The Knip Barn][10]
|
|
823
|
+
- Ask your questions in the [Knip knowledge base][66] (powered by OpenAI and [7-docs][67], experimental!)
|
|
824
|
+
- Smashing Magazine: [Knip: An Automated Tool For Finding Unused Files, Exports, And Dependencies][68]
|
|
825
|
+
- Effective TypeScript: [Recommendation Update: ✂️ Use knip to detect dead code and types][69]
|
|
826
|
+
- Josh Goldberg: [Speeding Up Centered Part 4: Unused Code Bloat][70]
|
|
827
827
|
|
|
828
828
|
## Why "Knip"?
|
|
829
829
|
|
|
@@ -841,7 +841,7 @@ each file, and traversing all of this, why not collect the various issues in one
|
|
|
841
841
|
|
|
842
842
|
Special thanks to the wonderful people who have contributed to this project:
|
|
843
843
|
|
|
844
|
-
[![Contributors][
|
|
844
|
+
[![Contributors][72]][71]
|
|
845
845
|
|
|
846
846
|
[1]: #workspaces
|
|
847
847
|
[2]: #plugins
|
|
@@ -851,71 +851,70 @@ Special thanks to the wonderful people who have contributed to this project:
|
|
|
851
851
|
[6]: #custom-reporters
|
|
852
852
|
[7]: #preprocessers
|
|
853
853
|
[8]: #jsdoc-tags
|
|
854
|
-
[9]:
|
|
855
|
-
[10]:
|
|
856
|
-
[11]: https://
|
|
857
|
-
[12]: https://
|
|
858
|
-
[13]: https://
|
|
859
|
-
[14]:
|
|
860
|
-
[15]: #
|
|
861
|
-
[16]: #
|
|
862
|
-
[17]: #
|
|
863
|
-
[18]: #
|
|
864
|
-
[19]: #
|
|
865
|
-
[20]: #
|
|
866
|
-
[21]: #
|
|
867
|
-
[22]: #
|
|
868
|
-
[23]: #
|
|
869
|
-
[24]: #
|
|
870
|
-
[25]: #
|
|
871
|
-
[26]: #
|
|
872
|
-
[27]: #
|
|
873
|
-
[28]: #
|
|
874
|
-
[29]: #
|
|
875
|
-
[30]: #
|
|
876
|
-
[31]: #
|
|
877
|
-
[32]: #
|
|
878
|
-
[33]: #
|
|
879
|
-
[34]: #
|
|
880
|
-
[35]: #
|
|
881
|
-
[36]: #
|
|
882
|
-
[37]: #
|
|
883
|
-
[38]: #
|
|
884
|
-
[39]: #ts-
|
|
885
|
-
[40]: #
|
|
886
|
-
[41]: #
|
|
887
|
-
[42]: #
|
|
888
|
-
[43]: #
|
|
889
|
-
[44]: #
|
|
890
|
-
[45]:
|
|
891
|
-
[46]:
|
|
892
|
-
[47]:
|
|
893
|
-
[48]: ./docs/
|
|
894
|
-
[49]: ./docs/
|
|
895
|
-
[50]: ./docs/
|
|
896
|
-
[51]:
|
|
897
|
-
[52]: https://github.com/
|
|
898
|
-
[53]: https://github.com/
|
|
899
|
-
[54]: https://github.com/
|
|
900
|
-
[55]: https://github.com/
|
|
901
|
-
[56]: https://github.com/
|
|
902
|
-
[57]: https://github.com/
|
|
903
|
-
[58]: https://github.com/
|
|
904
|
-
[59]: https://github.com/
|
|
905
|
-
[60]: https://github.com/
|
|
906
|
-
[61]: https://github.com/
|
|
907
|
-
[62]: https://github.com/
|
|
908
|
-
[63]: https://github.com/
|
|
909
|
-
[64]: https://github.com/
|
|
910
|
-
[65]: https://github.com/
|
|
911
|
-
[66]: https://
|
|
912
|
-
[67]: https://
|
|
913
|
-
[68]: https://
|
|
914
|
-
[69]: https://
|
|
915
|
-
[70]: https://
|
|
916
|
-
[71]: https://
|
|
917
|
-
[72]: https://
|
|
918
|
-
[73]: https://contrib.rocks/image?repo=webpro/knip
|
|
854
|
+
[9]: ./assets/cow-with-orange-scissors-van-gogh-style.webp
|
|
855
|
+
[10]: https://discord.gg/r5uXTtbTpc
|
|
856
|
+
[11]: https://twitter.com/webprolific
|
|
857
|
+
[12]: https://fosstodon.org/@webpro
|
|
858
|
+
[13]: https://github.com/webpro/knip/issues
|
|
859
|
+
[14]: #getting-started
|
|
860
|
+
[15]: #installation
|
|
861
|
+
[16]: #default-configuration
|
|
862
|
+
[17]: #lets-go
|
|
863
|
+
[18]: #configuration
|
|
864
|
+
[19]: #entry-files
|
|
865
|
+
[20]: #ignore-files-binaries-dependencies-and-workspaces
|
|
866
|
+
[21]: #public-exports
|
|
867
|
+
[22]: #ignore-exports-used-in-file
|
|
868
|
+
[23]: #include-exports-in-entry-files
|
|
869
|
+
[24]: #paths
|
|
870
|
+
[25]: #strict
|
|
871
|
+
[26]: #ignore-internal-exports
|
|
872
|
+
[27]: #plugins-1
|
|
873
|
+
[28]: #output
|
|
874
|
+
[29]: #screenshots
|
|
875
|
+
[30]: #reading-the-report
|
|
876
|
+
[31]: #rules--filters
|
|
877
|
+
[32]: #fixing-issues
|
|
878
|
+
[33]: #command-line-options
|
|
879
|
+
[34]: #potential-boost-with---no-gitignore
|
|
880
|
+
[35]: #comparison--migration
|
|
881
|
+
[36]: #depcheck
|
|
882
|
+
[37]: #unimported
|
|
883
|
+
[38]: #ts-unused-exports
|
|
884
|
+
[39]: #ts-prune
|
|
885
|
+
[40]: #projects-using-knip
|
|
886
|
+
[41]: #articles-etc
|
|
887
|
+
[42]: #why-knip
|
|
888
|
+
[43]: #really-another-unused-filedependencyexport-finder
|
|
889
|
+
[44]: #contributors
|
|
890
|
+
[45]: ./docs/compilers.md
|
|
891
|
+
[46]: https://nx.dev/concepts/integrated-vs-package-based
|
|
892
|
+
[47]: ./docs/writing-a-plugin.md
|
|
893
|
+
[48]: ./docs/handling-issues.md
|
|
894
|
+
[49]: ./docs/reporters-and-preprocessors.md
|
|
895
|
+
[50]: ./docs/perf-boost-with-no-gitignore.md
|
|
896
|
+
[51]: https://github.com/depcheck/depcheck
|
|
897
|
+
[52]: https://github.com/smeijer/unimported
|
|
898
|
+
[53]: https://github.com/pzavolinsky/ts-unused-exports
|
|
899
|
+
[54]: https://github.com/nadeesha/ts-prune
|
|
900
|
+
[55]: https://github.com/blockprotocol/blockprotocol
|
|
901
|
+
[56]: https://github.com/RebeccaStevens/deepmerge-ts
|
|
902
|
+
[57]: https://github.com/eslint-functional/eslint-plugin-functional
|
|
903
|
+
[58]: https://github.com/freeCodeCamp/freeCodeCamp
|
|
904
|
+
[59]: https://github.com/RebeccaStevens/is-immutable-type
|
|
905
|
+
[60]: https://github.com/IsaacScript/isaacscript
|
|
906
|
+
[61]: https://github.com/nuxt/nuxt
|
|
907
|
+
[62]: https://github.com/owncast/owncast
|
|
908
|
+
[63]: https://github.com/release-it/release-it
|
|
909
|
+
[64]: https://github.com/JoshuaKGoldberg/template-typescript-node-package
|
|
910
|
+
[65]: https://github.com/meienberger/runtipi
|
|
911
|
+
[66]: https://knip.deno.dev
|
|
912
|
+
[67]: https://github.com/7-docs/7-docs
|
|
913
|
+
[68]: https://www.smashingmagazine.com/2023/08/knip-automated-tool-find-unused-files-exports-dependencies/
|
|
914
|
+
[69]: https://effectivetypescript.com/2023/07/29/knip/
|
|
915
|
+
[70]: https://www.joshuakgoldberg.com/blog/speeding-up-centered-part-4-unused-code-bloat/
|
|
916
|
+
[71]: https://github.com/webpro/knip/graphs/contributors
|
|
917
|
+
[72]: https://contrib.rocks/image?repo=webpro/knip
|
|
919
918
|
[plugin-angular]: ./src/plugins/angular
|
|
920
919
|
[plugin-astro]: ./src/plugins/astro
|
|
921
920
|
[plugin-ava]: ./src/plugins/ava
|
package/dist/constants.js
CHANGED
|
@@ -1,11 +1,18 @@
|
|
|
1
|
+
import { isInternal } from '../../util/path.js';
|
|
1
2
|
import { timerify } from '../../util/Performance.js';
|
|
2
3
|
import { hasDependency, load } from '../../util/plugin.js';
|
|
4
|
+
import { toEntryPattern } from '../../util/protocols.js';
|
|
3
5
|
import { isConfigurationOutput } from './types.js';
|
|
4
6
|
export const NAME = 'GraphQL Codegen';
|
|
5
7
|
export const ENABLERS = [/^@graphql-codegen\//];
|
|
6
8
|
export const PACKAGE_JSON_PATH = 'codegen';
|
|
7
9
|
export const isEnabled = ({ dependencies }) => hasDependency(dependencies, ENABLERS);
|
|
8
|
-
export const CONFIG_FILE_PATTERNS = [
|
|
10
|
+
export const CONFIG_FILE_PATTERNS = [
|
|
11
|
+
'codegen.{json,yml,yaml,js,ts,mjs,cts}',
|
|
12
|
+
'.codegenrc.{json,yml,yaml,js,ts}',
|
|
13
|
+
'codegen.config.js',
|
|
14
|
+
'package.json',
|
|
15
|
+
];
|
|
9
16
|
const findPluginDependencies = async (configFilePath, options) => {
|
|
10
17
|
const { manifest, isProduction } = options;
|
|
11
18
|
if (isProduction)
|
|
@@ -27,7 +34,13 @@ const findPluginDependencies = async (configFilePath, options) => {
|
|
|
27
34
|
.map(plugin => `@graphql-codegen/${plugin}`);
|
|
28
35
|
const nestedPlugins = configurationOutput
|
|
29
36
|
.flatMap(configOutput => (configOutput.plugins ? configOutput.plugins : []))
|
|
30
|
-
.
|
|
37
|
+
.flatMap(plugin => {
|
|
38
|
+
if (typeof plugin !== 'string')
|
|
39
|
+
return [];
|
|
40
|
+
if (isInternal(plugin))
|
|
41
|
+
return [toEntryPattern(plugin)];
|
|
42
|
+
return [`@graphql-codegen/${plugin}`];
|
|
43
|
+
});
|
|
31
44
|
return [...presets, ...flatPlugins, ...nestedPlugins];
|
|
32
45
|
};
|
|
33
46
|
export const findDependencies = timerify(findPluginDependencies);
|
|
@@ -24,7 +24,9 @@ const findConfigDependencies = (configFilePath, localConfig, options) => {
|
|
|
24
24
|
return entryPatterns;
|
|
25
25
|
const environments = testConfig.environment ? [getEnvPackageName(testConfig.environment)] : [];
|
|
26
26
|
const reporters = getExternalReporters(testConfig.reporters);
|
|
27
|
-
const coverage = testConfig.coverage
|
|
27
|
+
const coverage = testConfig.coverage && testConfig.coverage.enabled !== false
|
|
28
|
+
? [`@vitest/coverage-${testConfig.coverage.provider ?? 'v8'}`]
|
|
29
|
+
: [];
|
|
28
30
|
const setupFiles = [testConfig.setupFiles ?? []].flat().map(v => resolveEntry(configFilePath, v));
|
|
29
31
|
const globalSetup = [testConfig.globalSetup ?? []].flat().map(v => resolveEntry(configFilePath, v));
|
|
30
32
|
return [...entryPatterns, ...environments, ...reporters, ...coverage, ...setupFiles, ...globalSetup];
|
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "2.41.
|
|
1
|
+
export declare const version = "2.41.3";
|
package/dist/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version = '2.41.
|
|
1
|
+
export const version = '2.41.3';
|
package/package.json
CHANGED