Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@sanity/plugin-kit

sanity-io9.6kMIT4.0.19TypeScript support: included

Enhanced Sanity.io plugin development experience

sanity-io, sanity, plugin, development, typescript, bootstrap

readme

@sanity/plugin-kit

What is it?

@sanity/plugin-kit is an opinionated, enhanced Sanity plugin development experience.

It provides a set of CLI commands for initializing, verifying and testing a Sanity plugin for Sanity Studio.

# Initialize a new Sanity plugin project
npx @sanity/plugin-kit@latest init my-sanity-plugin
# Verify your plugin package.
# This command can also be used when upgrading plugins from Sanity Studio v2 → v3.
npx @sanity/plugin-kit@latest verify-package
# Get help upgrading from Sanity Studio v2 → v3.
npx @sanity/plugin-kit@latest verify-studio

@sanity/plugin-kit assumes and recommends @sanity/pkg-utils for building, and Yalc with watch for testing the plugin in Sanity Studio. Check the FAQ fro more on these.

Table of contents

Installation

npm install --save-dev @sanity/plugin-kit

Install build tool

@sanity/plugin-kit assumes the plugin will use @sanity/pkg-utils for build and watch:

npm install --save-dev @sanity/pkg-utils

Initialize a new plugin

Quickstart

First, run the init command:

# Initialize a new plugin (outside of your Sanity studio folder)
npx @sanity/plugin-kit@latest init sanity-plugin-testing-it-out

# Make your plugin linkable, and compile an initial version
cd sanity-plugin-testing-it-out
npm run link-watch

# In another shell
cd /path/to/my-studio
# now link the plugin to your Sanity studio using the command indicated by link-watch output (see below)

Run ONE of the below commands, based on the package manager used in your studio:

# studio uses yarn
cd /path/to/my-studio
yalc add --link sanity-plugin-testing-it-out && yarn install
# studio uses npm
cd /path/to/my-studio
npx yalc add sanity-plugin-testing-it-out && npx yalc link sanity-plugin-testing-it-out && npm install

Now, configure the plugin in sanity.config.ts (or .js) in Sanity Studio:

import {defineConfig} from 'sanity'
import {myPlugin} from 'sanity-plugin-testing-it-out'

export default defineConfig({
  //...
  plugins: [myPlugin({})],
})

Start the Sanity Studio development server:

sanity dev

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@latest init --help

for up-to-date specifics.

Verify plugin package

Verify that the plugin package is configured correctly by running:

npx @sanity/plugin-kit@latest verify-package

What does it do?

  • Check package.json for:
    • recommended script commands
    • recommended cjs and esm configuration
    • sanity dependency compatibility
    • @sanity/pkg-utils devDependency
    • recommended usage of devDependencies/peerDependencies/dependencies for certain packages
  • Check for redundant v2 config:
    • babel
    • sanity.json
  • Check for sanity imports that has changed in v3, using eslint
  • Check tsconfig.json settings
  • Check for SPDX compatible license definition
  • If the package uses TypeScript, this will also run tsc --build when all other checks have passed

Each check will explain why it is needed, steps to fix it and how it can be individually disabled.

What it is not

verify-package is not a codemod tool. It will only check files and recommended settings: it will not change any files.

Consider using npx @sanity/plugin-kit@latest inject if you want to add recommended V3 plugin configuration automatically. See the Inject docs for more on this.

Upgrading a v2 plugin

Simply use the verify-package command in a v2 plugin package, and it will notify you about steps you need to take to upgrade the plugin to v3.

npx @sanity/plugin-kit@latest verify-package

Upgrade help in V2 Studio

You can use the verify-studio command in a v2 Sanity Studio to get some of the same validation there, to help in the upgrade from v2 to v3.

npx @sanity/plugin-kit@latest verify-studio

This will:

  • Check for sanity.json, sanity.config.(ts|js) and sanity.cli.(ts|js) and advice on how to convert the former to the latter two.
  • Check for sanity dependencies that has changed in v3
  • Check for sanity imports that has changed in v3, using ESlint

Fail fast mode

## for plugins
npx @sanity/plugin-kit@latest verify-package --single

## for studio
npx @sanity/plugin-kit@latest 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 package

npx @sanity/plugin-kit@latest inject

will inject recommended V3 plugin package boilerplate into an existing plugin. Be sure to commit any local changes before running this command, so you can easily revert anything you dont want.

Consult the inject command CLI help:

npx @sanity/plugin-kit@latest inject --help

for up-to-date specifics.

Presets

The inject command can do more work by adding presets. Consult the individual preset docs for details:

Testing a plugin in Sanity Studio

Ensure you have the following script setup in package.json:

{
  "scripts": {
    "link-watch": "plugin-kit link-watch"
  }
}

Then, in a shell, run:

npm run link-watch

This will publish the plugin to a local yalc registry.

In another shell, in your test Sanity Studio directory, run:

npx yalc add <your-plugin-package> && npx yalc add <your-plugin-package> --link && npm install

You can now change your plugin code, which will:

  1. Trigger a rebuild using your watch task
  2. Update the files in the plugin output directory
  3. Trigger a yalc publish --push
  4. Update the files in your Sanity Studio
  5. Trigger hot-reload; you should see changes in the Studio

Note: Yalc will modify your studio package.json when linking; remember to revert it when you are done testing. You should also put .yalc and yalc.lock into .gitignore.

When you are done testing, you can run

npx yalc remove <your-plugin-package> && yarn install

to restore the version in package.json.

This command can be configured using sanityPlugin.linkWatch in package.json:

{
  sanityPlugin: {
    linkWatch: {
      // command to run when content in linkWatch.folder changes
      command: 'npm run watch',
      // file extensions to watch for changes in the linkWatch.folder
      extensions: 'js,png,svg,gif,jpeg,css',
    },
  },
}

Why use yalc?

See the FAQ.

Publishing a plugin

Note: If you're writing a plugin that is only useful for yourself or your company, you might want to develop the plugin directly in the Studio (saves you from having to publish at all, and has improved hot-reload dev experience).

If the plugin is shared across multiple "private" studios: register an organization on npm and make sure your module is prefixed with the organization scope, eg @your-company/plugin-name.

Also; you cannot easily remove modules/versions from npm once published. Take a good look at your package.json to see that the fields in there makes sense to you, and make sure there are no "secrets" (authorization tokens, API keys or similar) in the plugin directory - any files within folders defined in the files field inside package.json will be included with your module.

When you're ready to publish, run npm publish (or yarn publish if you prefer). The prepublishOnly task should kick in and compile the source files, then verify the built output to ensure it looks good.

If you have not published any modules to npm before, you will be asked to create a user first.

For an opinionated template for publication based on semantic-release, see semver-workflow preset

Upgrade from v1.x to v2

To upgrade a plugin that already uses @sanity/plugin-kit 1.x:

  • Update @sanity/plugin-kit to version to 2.x in package.json
  • Run: npx @sanity/plugin-kit@latest inject
    • This will update package.json with new defaults
    • Feel free to answer no to any file-overwrite prompts
  • Inspect git diff to see what was changed
  • Run: npm install
  • Run: npm run build
  • Fix any outstanding issues, if any

FAQ

Q: Do I have to use this for developing Sanity plugins?

A: Absolutely not! Make sure your Sanity plugin is ES6-compatible. This package was created to make it easier to set up the build toolchain and prevent common mistakes.

If you know what you're doing and don't like any magic, roll your own thing! :)

Q: Why use yalc?

npm link & yarn link unfortunately can easily break the rules of hooks due to the way packages are resolved using symlinks.

Yalc bypass this problem as it more closely resembles installing a dependency as normal.

Q: Do I have to use yalc?

A: No!

Feel free to use any variation of npm link or yarn link alongside npm run watch for testing, but beware that if you get errors from React along the lines of

Error: Invalid hook call. Hooks can only be called inside of the body of a function component.
This could happen for one of the following reasons:
- You might have mismatching versions of React and the renderer (such as React DOM)
- You might be breaking the Rules of Hooks
- You might have more than one copy of React in the same app
See https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.

you probably have to revert to using yalc, or use npm pack + and install the resulting tzg-file.

Q: What appended with the Parcel recommendation?

At the time of writing (Nov 2022) the latest version of parcel (2.7) failed to build Sanity plugins. The previous version (2.6) did not work with the latest version of TypeScript. Pinning these versions was confusing and caused issues.

We also saw issues with modules using nested async imports.

As such, we decided to standardize plugins on the same build-tool used by Sanity studio, @sanity/pkg-utils.

Q: Why use @sanity/pkg-utils?

@sanity/pkg-utils is the build tool used to build the sanity package. It is based on esbuild and rollup and sports an array of validation to ensure that package.json can build both commonjs and ems packages that can be used in a variety of js runtimes.

Using this internal tool for plugins allows Sanity to more quickly address common build-related issues with plugins, and aims to standardize how this is done thought the community.

Q: Can I use another build tool or change @sanity/pkg-utils configuration?

A: Yes!

Feel free to make any changes to package.config.ts as is needed. @sanity/plugin-sdk verify-package output is only recommendations for defaults that has been tested to work in Sanity Studio. Your plugin may have other needs.

You are also free to not use @sanity/pkg-utils at all; simply change your package.json build script, and disable any verification-steps you don't care for with sanityPlugin.verifyPackage.

Q: Why multiple tsconfig*.json files?

After running plugin-kit init you will get these tsconfig files:

  • tsconfig.json used by the IDE (this typically includes test files)
  • tsconfig.dist.json used by the build system, and ignores test files
  • tsconfig.settings.json with shared settings between tsconfig.json and tsconfig.dist.json

This configuration allows for type-checking you scripts and tests, and not only the distribution files. When building the scripts and test files will not be included in the npm package distribution.

CLI Help

$ npx @sanity/plugin-kit@latest --help

Usage
  $ plugin-kit [--help] [--debug] <command> [<args>]

  These are common commands used in various situations:

    init            Create a new Sanity plugin
    verify-package  Verify that a Sanity plugin follows plugin-kit conventions
    inject          Inject plugin-kit compatible 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

  Options
    --silent      Do not print info and warning messages
    --verbose     Log everything. This option conflicts with --silent
    --debug       Print stack trace on errors
    --version     Output the version number
    --help        Output usage information

  Examples
    # Init a new plugin
    $ plugin-kit init

    # Verify that a Sanity plugin follows plugin-kit conventions
    $ plugin-kit verify-package

Configuration reference

Provide a sanityPlugin config in package.json (defaults shown):

{
  "sanityPlugin": {
    "linkWatch": {
      "command": "npm run watch",
      "extensions": "js,png,svg,gif,jpeg,css"
    }
  },
  "verifyPackage": {
    "packageName": true,
    "module": true,
    "tsconfig": true,
    "tsc": true,
    "dependencies": true,
    "rollupConfig": true,
    "babelConfig": true,
    "sanityV2Json": true,
    "eslintImports": true,
    "scripts": true,
    "pkg-utils": true,
    "nodeEngine": true
  }
}

License

MIT © Espen Hovlandsdal and Sanity.io

Development

Test in another package

In one shell, run

npm link
npm run watch

In the package where you want to test plugin kit, run:

npm link @sanity/plugin-kit

Now you can run commands:

npx @sanity/plugin-kit@latest verify-package

or use them in package.json scripts:

"verify": "plugin-kit verify-package"

Integration tests

npm run test

Run a single test-file

npm run test -- test/verify-package.test.ts

Update snapshots for a test

npm run test -- test/verify-package.test.ts --snapshot

Develop plugin-kit

Release new version

Run the "CI & Release" workflow. Make sure to select the main branch and check "Release new version".

Semantic release will only release on configured branches, so it is safe to run release on any branch.

changelog

📓 Changelog

All notable changes to this project will be documented in this file. See Conventional Commits for commit guidelines.

4.0.19 (2024-12-18)

Bug Fixes

  • deps: Update dependency @sanity/pkg-utils to v6.10.9 (#272) (5025a0a)
  • deps: Update dependency @sanity/pkg-utils to v6.11.2 (#276) (d09ca13)
  • deps: Update dependency @sanity/pkg-utils to v6.12.1 (#279) (c5c4405)

4.0.18 (2024-08-01)

Bug Fixes

  • adjust locked styled-components version (06cd611)
  • deps: Update dependency @sanity/pkg-utils to v6.10.0 (#251) (44a11e2)
  • deps: Update dependency @sanity/pkg-utils to v6.10.1 (#256) (49174b7)
  • deps: Update dependency @sanity/pkg-utils to v6.10.6 (51491a2)
  • deps: Update dependency @sanity/pkg-utils to v6.10.7 (#268) (a276906)
  • deps: Update dependency @sanity/pkg-utils to v6.9.3 (#242) (faa349a)
  • deps: Update dependency get-it to v8.6.0 (#244) (b50622d)
  • deps: Update dependency get-it to v8.6.1 (#248) (723d07b)
  • deps: Update dependency get-it to v8.6.2 (#252) (0bfa52e)
  • deps: Update dependency get-it to v8.6.3 (#265) (9823bcc)
  • deps: Update dependency postcss to v8.4.39 (#253) (aba41cd)
  • deps: Update dependency postcss to v8.4.40 (#266) (1d6615d)
  • migrate husky setup (3a38d28)
  • pin eslint version (ca6ca8a)

4.0.17 (2024-06-04)

Bug Fixes

  • deps: Update dependency @sanity/pkg-utils to v6.8.19 (#237) (3fcbcc1)
  • deps: Update dependency @sanity/pkg-utils to v6.9.0 (#239) (1501aa1)

4.0.16 (2024-05-24)

Bug Fixes

  • deps: Update dependency concurrently to v8.2.2 (#224) (4826b88)
  • deps: Update dependency get-it to v8.5.0 (#226) (12fcb23)
  • deps: Update dependency spdx-license-ids to v3.0.18 (#225) (39d0fb6)

4.0.15 (2024-05-23)

Bug Fixes

  • deps: Update dependency @sanity/pkg-utils to v6.8.18 (#222) (183a4b1)

4.0.14 (2024-05-21)

Bug Fixes

  • deps: Update dependency @sanity/pkg-utils to v6.8.17 (#221) (0f5031d)

4.0.13 (2024-05-16)

Bug Fixes

  • deps: Update dependency @sanity/pkg-utils to v6.8.15 (#216) (c98b3a1)
  • deps: Update dependency @sanity/pkg-utils to v6.8.16 (#219) (826414d)
  • deps: Update dependency get-it to v8.4.30 (#217) (7568240)

4.0.12 (2024-05-13)

Bug Fixes

  • deps: Update dependency @sanity/pkg-utils to v6.8.14 (#213) (30a9b85)

4.0.11 (2024-05-07)

Bug Fixes

  • deps: Update dependency @sanity/pkg-utils to v6.8.13 (#209) (837388d)
  • deps: Update dependency get-it to v8.4.29 (#210) (b0ff6ae)

4.0.10 (2024-05-05)

Bug Fixes

  • deps: Update dependency @sanity/pkg-utils to v6.8.11 (#206) (f0770d5)
  • deps: Update dependency get-it to v8.4.28 (#207) (753d533)

4.0.9 (2024-05-02)

Bug Fixes

  • deps: Update dependency @sanity/pkg-utils to v6.8.10 (#204) (1f65956)
  • deps: Update dependency @sanity/pkg-utils to v6.8.9 (#202) (11527de)

4.0.8 (2024-04-29)

Bug Fixes

  • deps: Update dependency @sanity/pkg-utils to v6.8.7 (#197) (5483253)
  • deps: Update dependency @sanity/pkg-utils to v6.8.8 (#200) (b91042b)

4.0.7 (2024-04-25)

Bug Fixes

  • deps: Update dependency @sanity/pkg-utils to v6.8.6 (#194) (5c94dd7)

4.0.6 (2024-04-23)

Bug Fixes

  • deps: Update dependency @sanity/pkg-utils to v6.8.1 (#187) (6e2c3e9)
  • deps: Update dependency @sanity/pkg-utils to v6.8.3 (#190) (965c2eb)
  • deps: Update dependency @sanity/pkg-utils to v6.8.4 (#193) (80070dd)
  • deps: Update dependency get-it to v8.4.27 (#188) (126dd57)

4.0.5 (2024-04-18)

Bug Fixes

  • deps: Update dependency @sanity/pkg-utils to v6.7.0 (#185) (f19fedc)
  • deps: Update dependency get-it to v8.4.24 (#183) (f2e9b61)
  • deps: Update dependency get-it to v8.4.26 (#184) (3510a84)

4.0.4 (2024-04-16)

Bug Fixes

  • deps: Update dependency @sanity/pkg-utils to v6.6.6 (#180) (a7f1277)
  • deps: Update dependency get-it to v8.4.23 (#177) (19ff4eb)

4.0.3 (2024-04-13)

Bug Fixes

  • deps: Update dependency @sanity/pkg-utils to v6.6.3 (#173) (7986a96)
  • deps: Update dependency @sanity/pkg-utils to v6.6.4 (#174) (ec8d7f9)
  • deps: Update dependency @sanity/pkg-utils to v6.6.5 (#175) (90db0a6)

4.0.2 (2024-04-13)

Bug Fixes

  • deps: Update dependency @sanity/pkg-utils to v6.6.2 (#172) (9597b4f)

4.0.1 (2024-04-12)

Bug Fixes

  • deps: Update dependency @sanity/pkg-utils to v6.6.1 (#169) (0b8f0ac)

4.0.0 (2024-04-11)

⚠ BREAKING CHANGES

  • deps: Update dependency @sanity/pkg-utils to v6.6.0 (#168)
  • pkg-utils validates if exports are missing (#167)

Bug Fixes

  • deps: Update dependency @sanity/pkg-utils to v3.3.8 (#152) (0fb9424)
  • deps: Update dependency @sanity/pkg-utils to v6 (#161) (7ae5bd3)
  • deps: Update dependency @sanity/pkg-utils to v6.6.0 (#168) (b3d525b)
  • deps: Update dependency get-it to v8.4.19 (#149) (4a06208)
  • deps: Update dependency get-it to v8.4.20 (#163) (9535972)
  • deps: Update dependency get-it to v8.4.21 (#164) (d3ee8a3)
  • deps: Update dependency nodemon to v3.1.0 (#153) (34fb024)
  • deps: Update dependency npm-packlist to v8 (#127) (1c09909)
  • deps: Update dependency postcss to v8.4.38 (#150) (289a700)
  • deps: Update dependency spdx-license-ids to v3.0.17 (#151) (af392af)
  • pin dependencies (#141) (167f801)
  • pkg-utils validates if exports are missing (#167) (3daaa3d)

3.1.12 (2024-04-11)

Bug Fixes

  • use a more secure release pipeline (f5569c0)

3.1.11 (2024-04-11)

Bug Fixes

  • change ordering for import and require (88bf94f)
  • docs: fix command to install build tool (cf131ba)
  • enable provenance on the CI (d7d69cb)

3.1.10 (2023-08-11)

Bug Fixes

3.1.9 (2023-08-11)

Bug Fixes

  • pin styled-components to ^5.2 (10922da)

3.1.8 (2023-08-11)

Bug Fixes

  • add npm provenance support (adb4b09)
  • deps: update dependencies (non-major) (#77) (7ab69eb)
  • deps: update dependency concurrently to v8 (#87) (ccb1668)

3.1.7 (2023-02-20)

Bug Fixes

3.1.6 (2023-02-14)

Bug Fixes

  • no longer log workflow inputs (25f248c)
  • update template to use tagged versions (90b98b1)

3.1.5 (2023-02-14)

Bug Fixes

  • deps: update dependencies (non-major) (#50) (50bcd91)
  • deps: update dependency get-it to v8 (#62) (d4df7ee)
  • deps: update dependency get-latest-version to v5 (#67) (ee37311)
  • remove .npmrc and legacy-peer-deps (#68) (f352624)

3.1.4 (2023-01-13)

Bug Fixes

  • removed incorrect eslint instructions when eslint fails with an unknown error (932afd2)

3.1.3 (2023-01-13)

Bug Fixes

  • changed order of import and require (2e341d2)

3.1.2 (2023-01-05)

Bug Fixes

  • no longer depends on find-babel-config (838fe42)

3.1.1 (2023-01-04)

Bug Fixes

  • check for .prettierrc.json (5669a52)
  • inject dist in pkg-config.ts so it works for packages with lib outDir (b94700c)

3.1.0 (2023-01-04)

Features

  • verify that no duplicate prettier or eslint config exits (78eb114)

3.0.0 (2023-01-02)

⚠ BREAKING CHANGES

  • emitDeclarationOnly is now a required compiler option. Run plugin-kit verify-package to get hints about how to apply required changes.
  • rootDir is now expected to be set to the root directory of the project. Run plugin-kit verify-package to get hints about how to apply required changes.
  • outDir is now required in tsconfig.json. Run plugin-kit verify-package to get hints about how to apply required changes.

Features

  • add a ui preset (776950e)
  • initialize with format script (9d753c2)
  • optional outDir directory (13ef06e)
  • run pkg-utils in strict mode (4ec8613)
  • validate emitDeclarationOnly compiler option (d60d46e)
  • validate presence of outDir in tsconfig (89d0978)

Bug Fixes

  • correct typos and formatting (6dc04be)
  • deps: install latest dependencies (819efff)
  • deps: upgrade to @sanity/pkg-utils@2 (7d1d7e6)
  • final newline (2109f76)
  • format comment in .gitignore (9dae13d)
  • format readmes and examples (6d26a0c)
  • install styled-components (446bf14)
  • remove jsx validation (6617a04)

Code Refactoring

  • expect rootDir to be set to root directory (41cd4ef)

2.2.0 (2022-12-07)

Features

  • added ui-workshop preset (d9a1ec5)

2.1.19 (2022-12-01)

Bug Fixes

  • docs: sanity dev instead of sanity start (f068ad8)

2.1.18 (2022-11-30)

Bug Fixes

  • use sanity ^3.0.0 and @sanity/ui ^1.0.0 for plugins (9f2c6c6)

2.1.17 (2022-11-22)

Bug Fixes

  • workflow manual trigger now includes branch name om run-name (0596fdf)

2.1.16 (2022-11-16)

Bug Fixes

  • docs: quickstart correction (02a0fa4)

2.1.15 (2022-11-16)

Bug Fixes

  • docs: added more details on inject command (9f0d3ae)

2.1.14 (2022-11-15)

Bug Fixes

  • deps: update dependency get-it to v7 (#28) (9928b10)
  • deps: update dependency git-user-info to v2 (#20) (71ea801)
  • deps: update dependency npm-packlist to v7 (#33) (bb883c8)
  • deps: update dependency postcss to ^8.4.19 (#45) (21a7c0c)
  • deps: update dependency validate-npm-package-name to v5 (#37) (4005536)
  • show correct yalc command for both npm and yarn (47ac2a0)
  • support how renovatebot generate lockfiles (#47) (160e64b)

2.1.13 (2022-11-15)

Bug Fixes

  • shortened the V3 banner and added it to init readme (31757d7)

2.1.12 (2022-11-14)

Bug Fixes

  • docs: made check secrets an explicit step in semver-workflow readme (9315e14)
  • semver-workflow readme link (f454246)

2.1.11 (2022-11-14)

Bug Fixes

  • made inject readme consider more things as matching (33acfff)

2.1.10 (2022-11-14)

Bug Fixes

  • link-watch now works when the watch directory does not exist on startup (a4acd54)

2.1.9 (2022-11-14)

Bug Fixes

  • semver-workflow readme is now compatible with init (95e8cba)

2.1.8 (2022-11-07)

Bug Fixes

2.1.7 (2022-11-04)

Bug Fixes

  • workflow name based on inputs (75c8932)

2.1.6 (2022-11-04)

Bug Fixes

  • package.json is now part of exports (9e0631a)

2.1.5 (2022-11-04)

Bug Fixes

  • no longer includes tag in sanity devDependency range (bd33294)

2.1.4 (2022-11-04)

Bug Fixes

  • test --if-present in workflow (f243753)

2.1.3 (2022-11-04)

Bug Fixes

2.1.2 (2022-11-04)

Bug Fixes

  • removed duplicated release.needs in workflow (9ba8356)

2.1.1 (2022-11-04)

Bug Fixes

  • if the build step fails release should halt (a1bb635)

2.1.0 (2022-11-04)

Features

  • add prettier-plugin-packagejson (937f4bc)

Bug Fixes

  • @sanity/ui@v1 is a prerelease and must be exact (e8641b9)
  • node validation only checks for starts with >=14 now (2a77c61)
  • only peer deps should use || semver ranges (9869feb)
  • polyfill String.replaceAll for Node v14 (33e4deb)
  • remove purple-unicorn references (34c745a)
  • replaceAll -> replace (e2f574c)
  • shorter version numbers are better (b860b9c)
  • update semver main.yaml template (82d72e6)
  • use .prettierrc.json instead of .js (39a2a52)
  • use latest @sanity/ui exact version (c5e8643)
  • use main as default branch in workflow and releaserc (4d06bb3)

2.0.9 (2022-11-03)

Bug Fixes

  • also link-watch ts files by default (07f07fc)

2.0.8 (2022-11-03)

Bug Fixes

  • deps: update dependencies (non-major) (#27) (6753319)
  • npmignore not needed as we use pkg.files (28a085d)

2.0.7 (2022-11-02)

Bug Fixes

  • added parcel to deprecated dependencies check (6172dcb)

2.0.6 (2022-11-02)

Bug Fixes

  • added yalc files to gitignore template (1442bbd)

2.0.5 (2022-11-02)

Bug Fixes

  • require index.js or index.ts as entrypoint for the plugin (7c25507)

2.0.4 (2022-11-02)

Bug Fixes

  • use .esm.js for default (4b63b88)

2.0.3 (2022-11-02)

Bug Fixes

  • added package.config.ts to eslintignore (2d20f01)

2.0.2 (2022-11-02)

Bug Fixes

  • now uses defineConfig and definePlugin in templates (a678d6d)

2.0.1 (2022-11-02)

Bug Fixes

  • pins sanity to dev-preview || 3.0.0-rc.0 (cb46dd9)

2.0.0 (2022-11-02)

⚠ BREAKING CHANGES

  • @sanity/pkg-utils is now the recommended build tool for Sanity plugins

Features

  • replaced parcel with @sanity/pkg-utils for builds (7cd554f)

Bug Fixes

  • use jsx suffix if source already has it (3f1a266)

1.1.0 (2022-10-31)

Features

  • added --ecosystem-preset to init (219561b)
  • added inject command and support for --preset (b5f5377)
  • build related package.json entries are overridden instead of retained (deb87b0)
  • force package versions and made stricter verifications (9d030fb)
  • inject adds the same dependencies as init now (dd30373)
  • preset semantic-release now updates README.md when it exists (naively) (0a33a25)
  • semver-workflow now injects .npmrc with legacy-peer-deps=true (7c53c7a)

Bug Fixes

  • add missing lint-staged config (071a01d)
  • added --dry-run flag to release job for safety (c09c4f3)
  • forced dependencies now works correctly (9b520f7)
  • imports in studio config example (a6a5b2e)
  • readme newlines (8be3aca)
  • semantic-workflow: filter out README sections that exists "close enough" (04a8b8a)
  • semantic-workflow: npmrc bundling (31c0e77)
  • show note about manual config steps in semver-workflow (f36fc55)
  • url readme url (c8730da)
  • use correct @sanity/ui package name (1f224a9)

1.0.2 (2022-09-27)

Bug Fixes

  • deps: update dependencies (non-major) (#10) (25deacd)
  • deps: update dependency get-latest-version to v4 (86cbf08)
  • deps: version bumps and updated dependent code (d9cb8b0)
  • verify-studio config file detection support for tsx and jsx (73e27bc)

1.0.1 (2022-08-24)

Bug Fixes

  • setup semantic-release (e091626)
  • use dev-preview tag as sanity peer dependency (2b3e312)

1.0.0 (2022-08-17)

Bug Fixes

  • build: allow filenames with multiple dots (e577652), closes #4
  • changed recommended link command to work with npm (a204163)
  • eslint: add lib (compiled output) to ignorePatterns, drop prettier/react extension (f9fab24)
  • npm: lock eslint to ^7.0.0 (dda5eb1)
  • npm: use semver range for dependencies (30768d2)
  • setup @sanity/semantic-release-preset (751bdbc)
  • spawning child process on windows (#7) (f82bd4d)
  • tap.includes -> tap.match (a9b58d7)
  • test full absolute path before trying alternatives (dacf59e)
  • tests: normalize npm-packlist paths (60812c2)
  • tests: normalize path in cli.test.js (c2bc162)
  • tests: replace doesNotHave with notMatch (b8bcf94)
  • verify: allow query parameters on imports (raw css etc) (51339b1)

chore

  • drop support for node 10 (cfd00b1)

Features

  • assert @sanity/ui + @sanity/icons are dependencies if used (1b5a3f1)
  • initial version (7c2569a)
  • npm: add lint task to scripts (33823a7)

BREAKING CHANGES

  • We no longer support node 10, because it is out of LTS