Skip to content

Commit

Permalink
feat: added inject command and support for --preset
Browse files Browse the repository at this point in the history
  • Loading branch information
snorrees committed Oct 31, 2022
1 parent 3e19cec commit b5f5377
Show file tree
Hide file tree
Showing 48 changed files with 864 additions and 412 deletions.
21 changes: 20 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ Check the [FAQ](#faq) fro more on these.
* [Verify plugin package](#verify-plugin-package)
* [Upgrading a v2 plugin](#upgrading-a-v2-plugin)
* [Upgrade help in v2 Studio](#upgrade-help-in-v2-studio)
* [Inject config into existing v3 plugin](#inject-config-into-existing-v3)
* [Testing a plugin in Sanity Studio](#testing-a-plugin-in-sanity-studio)
* [FAQ](#faq) aka "Do I _have_ to use this plugin-kit?" aka No
* [Configuration reference](#configuration-reference)
Expand Down Expand Up @@ -83,6 +84,15 @@ sanity start
Check browser console: the plugin should have logged `"hello from my-sanity-plugin"`.
Since the plugin is running in watch mode, any changes you make to the plugin code will be reloaded in the studio.

### Init options

The init commands has several config flags, run
```
npx @sanity/plugin-kit init --help
```

for up-to-date specifics.

## Verify plugin package

Verify that the plugin package is configured correctly by running:
Expand Down Expand Up @@ -147,6 +157,15 @@ npx @sanity/plugin-kit verify-package --studio --single

This will only output the first validation that fails. Useful when working through the list of issues by fixing and rerunning the command.

### Inject config into existing v3

Consult the inject command CLI help:
```
npx @sanity/plugin-kit inject --help
```

for up-to-date specifics.

## Testing a plugin in Sanity Studio

Ensure you have the following script setup in package.json:
Expand Down Expand Up @@ -299,7 +318,7 @@ Usage

init Create a new Sanity plugin
verify-package Verify that a Sanity plugin follows plugin-kit conventions
splat Inject plugin-kit complatible package config into an existing plugin directory
inject Inject plugin-kit complatible package config into an existing plugin directory
link-watch Recompile plugin automatically on changes and push to yalc
version Show the version of ${cliName} currently installed

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
7 changes: 7 additions & 0 deletions assets/inject/semver-workflow/renovate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"github>sanity-io/renovate-presets//ecosystem/auto",
"github>sanity-io/renovate-presets//ecosystem/studio-v3"
]
}
File renamed without changes.
File renamed without changes.
5 changes: 0 additions & 5 deletions assets/splat/eslint.config.js

This file was deleted.

Loading

0 comments on commit b5f5377

Please sign in to comment.