@sanity/plugin-kit 2.1.14 → 2.1.15
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
CHANGED
|
@@ -26,12 +26,12 @@ Check the [FAQ](#faq) fro more on these.
|
|
|
26
26
|
- [Verify plugin package](#verify-plugin-package)
|
|
27
27
|
- [Upgrading a v2 plugin](#upgrading-a-v2-plugin)
|
|
28
28
|
- [Upgrade help in v2 Studio](#upgrade-help-in-v2-studio)
|
|
29
|
-
- [Inject config into existing v3 plugin](#inject-config-into-existing-
|
|
29
|
+
- [Inject config into existing v3 plugin](#inject-config-into-existing-package)
|
|
30
30
|
- [Testing a plugin in Sanity Studio](#testing-a-plugin-in-sanity-studio)
|
|
31
31
|
- [Upgrading from plugin-kit 1.x](#upgrade-from-v1x-to-v2)
|
|
32
32
|
- [FAQ](#faq) aka "Do I _have_ to use this plugin-kit?" aka No
|
|
33
33
|
- [Configuration reference](#configuration-reference)
|
|
34
|
-
- [Developing plugin-kit](#
|
|
34
|
+
- [Developing plugin-kit](#develop-plugin-kit)
|
|
35
35
|
|
|
36
36
|
## Installation
|
|
37
37
|
|
|
@@ -140,7 +140,10 @@ Each check will explain why it is needed, steps to fix it and how it can be indi
|
|
|
140
140
|
|
|
141
141
|
### What it is _not_
|
|
142
142
|
|
|
143
|
-
`verify-package` is _not_ a codemod tool
|
|
143
|
+
`verify-package` is _not_ a codemod tool. It will only check files and recommended settings: it will not change any files.
|
|
144
|
+
|
|
145
|
+
Consider using `npx @sanity/plugin-kit inject` if you want to add recommended V3 plugin configuration automatically.
|
|
146
|
+
See the [Inject docs](#inject-config-into-existing-package) for more on this.
|
|
144
147
|
|
|
145
148
|
### Upgrading a v2 plugin
|
|
146
149
|
|
|
@@ -178,16 +181,29 @@ npx @sanity/plugin-kit verify-package --studio --single
|
|
|
178
181
|
|
|
179
182
|
This will only output the first validation that fails. Useful when working through the list of issues by fixing and rerunning the command.
|
|
180
183
|
|
|
181
|
-
|
|
184
|
+
## Inject config into existing package
|
|
182
185
|
|
|
183
|
-
|
|
186
|
+
```
|
|
187
|
+
npx @sanity/plugin-kit inject
|
|
188
|
+
```
|
|
189
|
+
will inject recommended V3 plugin package boilerplate into an existing plugin.
|
|
190
|
+
Be sure to commit any local changes before running this command, so you can easily revert anything
|
|
191
|
+
you dont want.
|
|
184
192
|
|
|
193
|
+
Consult the inject command CLI help:
|
|
185
194
|
```
|
|
186
195
|
npx @sanity/plugin-kit inject --help
|
|
187
196
|
```
|
|
188
197
|
|
|
189
198
|
for up-to-date specifics.
|
|
190
199
|
|
|
200
|
+
### Presets
|
|
201
|
+
|
|
202
|
+
The inject command can do more work by adding presets. Consult the individual preset docs for details:
|
|
203
|
+
|
|
204
|
+
* [semver-workflow](./docs/semver-workflow.md) - Add an opinionated Github workflow to automate NPM releases
|
|
205
|
+
* [renovatebot](./docs/renovatebot.md) - Add opinionated Renovatebot config to make dependency management a breeze
|
|
206
|
+
|
|
191
207
|
## Testing a plugin in Sanity Studio
|
|
192
208
|
|
|
193
209
|
Ensure you have the following script setup in package.json:
|
|
@@ -465,7 +481,7 @@ npm run test -- test/verify-package.test.ts
|
|
|
465
481
|
npm run test -- test/verify-package.test.ts --snapshot
|
|
466
482
|
```
|
|
467
483
|
|
|
468
|
-
##
|
|
484
|
+
## Develop plugin-kit
|
|
469
485
|
|
|
470
486
|
### Release new version
|
|
471
487
|
|
package/lib/package.json
CHANGED
|
@@ -60,7 +60,7 @@ function addDevDependencies(options) {
|
|
|
60
60
|
semantic-release preset injected.
|
|
61
61
|
|
|
62
62
|
Please confer
|
|
63
|
-
https://github.com/sanity-io/plugin-kit/blob/main/docs/semver-workflow.md
|
|
63
|
+
https://github.com/sanity-io/plugin-kit/blob/main/docs/semver-workflow.md#manual-steps-after-inject
|
|
64
64
|
to finalize configuration for this preset.
|
|
65
65
|
`.trim()));
|
|
66
66
|
});
|
package/package.json
CHANGED
|
@@ -65,7 +65,7 @@ async function addDevDependencies(options: InjectOptions) {
|
|
|
65
65
|
semantic-release preset injected.
|
|
66
66
|
|
|
67
67
|
Please confer
|
|
68
|
-
https://github.com/sanity-io/plugin-kit/blob/main/docs/semver-workflow.md
|
|
68
|
+
https://github.com/sanity-io/plugin-kit/blob/main/docs/semver-workflow.md#manual-steps-after-inject
|
|
69
69
|
to finalize configuration for this preset.
|
|
70
70
|
`.trim()
|
|
71
71
|
)
|