├── src ├── index.ts ├── configs │ ├── buildExtensions.ts │ ├── forced-package-versions.ts │ ├── prettier.ts │ ├── uselessFiles.ts │ ├── banned-packages.ts │ ├── pkg-config.ts │ ├── eslint.ts │ ├── git.ts │ ├── default-source.ts │ └── tsconfig.ts ├── util │ ├── errorToUndefined.ts │ ├── request.ts │ ├── ts.ts │ ├── command-parser.ts │ ├── log.ts │ ├── prompt.ts │ ├── readme.ts │ ├── user.ts │ └── files.ts ├── sharedFlags.ts ├── npm │ ├── publish.ts │ ├── resolveLatestVersions.ts │ └── manager.ts ├── presets │ ├── renovatebot.ts │ ├── presets.ts │ ├── ui.ts │ ├── ui-workshop.ts │ └── semver-workflow.ts ├── constants.ts ├── cmds │ ├── index.ts │ ├── verify-studio.ts │ ├── verify-package.ts │ ├── link-watch.ts │ ├── version.ts │ ├── inject.ts │ └── init.ts ├── actions │ ├── verify │ │ ├── types.ts │ │ └── verify-common.ts │ ├── verify-studio.ts │ ├── init.ts │ ├── link-watch.ts │ └── verify-package.ts ├── cli.ts └── dependencies │ ├── import-linter.ts │ └── find.ts ├── test ├── fixtures │ ├── init │ │ └── empty │ │ │ └── .gitkeep │ ├── build │ │ ├── ts │ │ │ ├── .eslintignore │ │ │ ├── README.md │ │ │ ├── src │ │ │ │ ├── styles │ │ │ │ │ └── one.css │ │ │ │ ├── two.ts │ │ │ │ └── one.tsx │ │ │ ├── sanity.json │ │ │ └── package.json │ │ ├── plain │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── src │ │ │ │ └── schemaType.js │ │ │ ├── sanity.json │ │ │ └── package.json │ │ ├── valid-js │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── src │ │ │ │ ├── styles │ │ │ │ │ └── one.css │ │ │ │ ├── two.js │ │ │ │ └── index.js │ │ │ ├── sanity.json │ │ │ └── package.json │ │ └── folder-sanity-json │ │ │ ├── sanity.json │ │ │ └── .gitkeep │ │ │ ├── src │ │ │ └── one.js │ │ │ └── package.json │ ├── verify-package │ │ ├── every-failure-possible │ │ │ ├── .gitkeep │ │ │ ├── .eslintignore │ │ │ ├── babel.config.js │ │ │ ├── rollup.config.js │ │ │ ├── tsconfig.json │ │ │ ├── .prettierrc │ │ │ ├── .eslintrc │ │ │ ├── .eslintrc.json │ │ │ ├── sanity.json │ │ │ ├── src │ │ │ │ └── index.tsx │ │ │ ├── README.md │ │ │ ├── package.json │ │ │ ├── .gitignore │ │ │ └── LICENSE │ │ ├── fresh-v2-movie-studio │ │ │ ├── plugins │ │ │ │ └── .gitkeep │ │ │ ├── config │ │ │ │ ├── @sanity │ │ │ │ │ ├── data-aspects.json │ │ │ │ │ ├── vision.json │ │ │ │ │ ├── form-builder.json │ │ │ │ │ ├── default-layout.json │ │ │ │ │ ├── default-login.json │ │ │ │ │ └── google-maps-input.json │ │ │ │ └── .checksums │ │ │ ├── static │ │ │ │ ├── .gitkeep │ │ │ │ └── favicon.ico │ │ │ ├── .eslintrc │ │ │ ├── tsconfig.json │ │ │ ├── schemas │ │ │ │ ├── plotSummaries.js │ │ │ │ ├── plotSummary.js │ │ │ │ ├── castMember.js │ │ │ │ ├── person.js │ │ │ │ ├── crewMember.js │ │ │ │ ├── schema.js │ │ │ │ ├── movie.js │ │ │ │ ├── screening.js │ │ │ │ └── blockContent.js │ │ │ ├── sanity.json │ │ │ ├── package.json │ │ │ └── README.md │ │ ├── valid │ │ │ ├── .prettierrc.json │ │ │ ├── package.config.ts │ │ │ ├── sanity.json │ │ │ ├── .eslintrc │ │ │ ├── .editorconfig │ │ │ ├── v2-incompatible.js │ │ │ ├── README.md │ │ │ ├── src │ │ │ │ └── index.ts │ │ │ ├── tsconfig.json │ │ │ ├── .gitignore │ │ │ ├── LICENSE │ │ │ └── package.json │ │ └── invalid-eslint │ │ │ ├── .prettierrc.json │ │ │ ├── .eslintrc │ │ │ ├── sanity.json │ │ │ ├── .editorconfig │ │ │ ├── v2-incompatible.js │ │ │ ├── README.md │ │ │ ├── src │ │ │ └── index.ts │ │ │ ├── tsconfig.json │ │ │ ├── .gitignore │ │ │ ├── LICENSE │ │ │ └── package.json │ └── inject │ │ └── valid │ │ ├── .prettierrc.json │ │ ├── sanity.json │ │ ├── .eslintrc │ │ ├── .editorconfig │ │ ├── v2-incompatible.js │ │ ├── README.md │ │ ├── src │ │ └── index.ts │ │ ├── tsconfig.json │ │ ├── .gitignore │ │ ├── LICENSE │ │ └── package.json ├── run-test-command.ts ├── version.test.ts ├── cli.test.ts ├── fixture-utils.ts ├── semver-workflow.test.ts ├── init-verify-build.test.ts ├── inject.test.ts ├── verify-package.test.ts └── init.test.ts ├── .github ├── CODEOWNERS ├── renovate.json └── workflows │ ├── format-if-needed.yml │ └── main.yml ├── assets └── inject │ ├── semver-workflow │ ├── .husky │ │ ├── pre-commit │ │ └── commit-msg │ ├── commitlint.template.js │ ├── .releaserc.json │ ├── lint-staged.template.js │ ├── renovate.json │ └── .github │ │ └── workflows │ │ └── main.yml │ ├── prettierrc.json │ ├── ui-workshop │ ├── workshop.config.ts │ └── src │ │ ├── __workshop__ │ │ ├── index.tsx │ │ └── props.tsx │ │ └── CustomField.tsx │ ├── sanity.json │ ├── renovatebot │ └── renovate.json │ ├── editorconfig │ ├── v2-incompatible.js.template │ └── LICENSE ├── bin └── plugin-kit.js ├── .prettierignore ├── .husky ├── pre-commit └── commit-msg ├── commitlint.config.js ├── .releaserc.json ├── docs ├── assets │ └── semver-workflow-example.png ├── ui.md ├── renovatebot.md ├── ui-workshop.md └── semver-workflow.md ├── lint-staged.config.js ├── tsconfig.dist.json ├── .prettierrc.json ├── .eslintignore ├── package.config.ts ├── .editorconfig ├── tsconfig.json ├── tsconfig.settings.json ├── LICENSE ├── .gitignore ├── eslint.config.mjs └── package.json /src/index.ts: -------------------------------------------------------------------------------- 1 | export {} 2 | -------------------------------------------------------------------------------- /test/fixtures/init/empty/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | * @sanity-io/ecosystem 2 | -------------------------------------------------------------------------------- /test/fixtures/build/ts/.eslintignore: -------------------------------------------------------------------------------- 1 | test 2 | -------------------------------------------------------------------------------- /test/fixtures/build/plain/LICENSE: -------------------------------------------------------------------------------- 1 | some license 2 | -------------------------------------------------------------------------------- /test/fixtures/build/plain/README.md: -------------------------------------------------------------------------------- 1 | # some cool 2 | -------------------------------------------------------------------------------- /test/fixtures/build/ts/README.md: -------------------------------------------------------------------------------- 1 | # just a readme 2 | -------------------------------------------------------------------------------- /test/fixtures/build/valid-js/LICENSE: -------------------------------------------------------------------------------- 1 | some license 2 | -------------------------------------------------------------------------------- /test/fixtures/build/valid-js/README.md: -------------------------------------------------------------------------------- 1 | # some cool 2 | -------------------------------------------------------------------------------- /test/fixtures/verify-package/every-failure-possible/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /assets/inject/semver-workflow/.husky/pre-commit: -------------------------------------------------------------------------------- 1 | npx lint-staged 2 | -------------------------------------------------------------------------------- /test/fixtures/verify-package/every-failure-possible/.eslintignore: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/fixtures/verify-package/every-failure-possible/babel.config.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/fixtures/verify-package/every-failure-possible/rollup.config.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/fixtures/build/folder-sanity-json/sanity.json/.gitkeep: -------------------------------------------------------------------------------- 1 | Keep me 2 | -------------------------------------------------------------------------------- /test/fixtures/verify-package/every-failure-possible/tsconfig.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /bin/plugin-kit.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | require('../dist/cli').cliEntry() 3 | -------------------------------------------------------------------------------- /test/fixtures/build/folder-sanity-json/src/one.js: -------------------------------------------------------------------------------- 1 | export default () => 'one' 2 | -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | assets 2 | build 3 | coverage 4 | tap-snapshots 5 | test/fixtures 6 | -------------------------------------------------------------------------------- /assets/inject/semver-workflow/.husky/commit-msg: -------------------------------------------------------------------------------- 1 | npx --no -- commitlint --edit "" 2 | -------------------------------------------------------------------------------- /test/fixtures/build/ts/src/styles/one.css: -------------------------------------------------------------------------------- 1 | .button { 2 | background: #bf1942; 3 | } 4 | -------------------------------------------------------------------------------- /.husky/pre-commit: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | . "$(dirname "$0")/_/husky.sh" 3 | 4 | npx lint-staged 5 | -------------------------------------------------------------------------------- /test/fixtures/build/valid-js/src/styles/one.css: -------------------------------------------------------------------------------- 1 | .button { 2 | background: #bf1942; 3 | } 4 | -------------------------------------------------------------------------------- /commitlint.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | extends: ['@commitlint/config-conventional'], 3 | } 4 | -------------------------------------------------------------------------------- /.husky/commit-msg: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | . "$(dirname "$0")/_/husky.sh" 3 | 4 | npx --no -- commitlint --edit "" 5 | -------------------------------------------------------------------------------- /.releaserc.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "@sanity/semantic-release-preset", 3 | "branches": ["main"] 4 | } 5 | -------------------------------------------------------------------------------- /test/fixtures/build/ts/src/two.ts: -------------------------------------------------------------------------------- 1 | export default function two() { 2 | // do something important 3 | } 4 | -------------------------------------------------------------------------------- /test/fixtures/verify-package/fresh-v2-movie-studio/plugins/.gitkeep: -------------------------------------------------------------------------------- 1 | User-specific packages can be placed here 2 | -------------------------------------------------------------------------------- /src/configs/buildExtensions.ts: -------------------------------------------------------------------------------- 1 | export const buildExtensions = ['.js', '.jsx', '.es6', '.es', '.mjs', '.ts', '.tsx'] 2 | -------------------------------------------------------------------------------- /test/fixtures/verify-package/fresh-v2-movie-studio/config/@sanity/data-aspects.json: -------------------------------------------------------------------------------- 1 | { 2 | "listOptions": {} 3 | } 4 | -------------------------------------------------------------------------------- /assets/inject/semver-workflow/commitlint.template.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | extends: ['@commitlint/config-conventional'], 3 | } 4 | -------------------------------------------------------------------------------- /test/fixtures/verify-package/fresh-v2-movie-studio/config/@sanity/vision.json: -------------------------------------------------------------------------------- 1 | { 2 | "defaultApiVersion": "2021-10-21" 3 | } 4 | -------------------------------------------------------------------------------- /assets/inject/semver-workflow/.releaserc.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "@sanity/semantic-release-preset", 3 | "branches": ["main"] 4 | } 5 | -------------------------------------------------------------------------------- /docs/assets/semver-workflow-example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sanity-io/plugin-kit/HEAD/docs/assets/semver-workflow-example.png -------------------------------------------------------------------------------- /lint-staged.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | '**/*.{js,jsx}': ['eslint'], 3 | '**/*.{ts,tsx}': ['eslint', () => 'tsc --build'], 4 | } 5 | -------------------------------------------------------------------------------- /test/fixtures/build/plain/src/schemaType.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | name: 'markdown', 3 | title: 'Markdown', 4 | type: 'string', 5 | } 6 | -------------------------------------------------------------------------------- /assets/inject/prettierrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "semi": false, 3 | "printWidth": 100, 4 | "bracketSpacing": false, 5 | "singleQuote": true 6 | } 7 | -------------------------------------------------------------------------------- /tsconfig.dist.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.settings.json", 3 | // Only use the src dir during build 4 | "include": ["./src"] 5 | } 6 | -------------------------------------------------------------------------------- /test/fixtures/build/valid-js/src/two.js: -------------------------------------------------------------------------------- 1 | export default function two() { 2 | // do something important 3 | console.log('Important stuff') 4 | } 5 | -------------------------------------------------------------------------------- /test/fixtures/verify-package/fresh-v2-movie-studio/config/@sanity/form-builder.json: -------------------------------------------------------------------------------- 1 | { 2 | "images": { 3 | "directUploads": true 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /test/fixtures/verify-package/fresh-v2-movie-studio/static/.gitkeep: -------------------------------------------------------------------------------- 1 | Files placed here will be served by the Sanity server under the `/static`-prefix 2 | -------------------------------------------------------------------------------- /test/fixtures/inject/valid/.prettierrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "semi": false, 3 | "printWidth": 100, 4 | "bracketSpacing": false, 5 | "singleQuote": true 6 | } 7 | -------------------------------------------------------------------------------- /test/fixtures/verify-package/valid/.prettierrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "semi": false, 3 | "printWidth": 100, 4 | "bracketSpacing": false, 5 | "singleQuote": true 6 | } 7 | -------------------------------------------------------------------------------- /assets/inject/semver-workflow/lint-staged.template.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | '**/*.{js,jsx}': ['eslint'], 3 | '**/*.{ts,tsx}': ['eslint', () => 'tsc --build'], 4 | } 5 | -------------------------------------------------------------------------------- /test/fixtures/verify-package/fresh-v2-movie-studio/config/@sanity/default-layout.json: -------------------------------------------------------------------------------- 1 | { 2 | "toolSwitcher": { 3 | "order": [], 4 | "hidden": [] 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /test/fixtures/verify-package/valid/package.config.ts: -------------------------------------------------------------------------------- 1 | import {defineConfig} from '@sanity/pkg-utils' 2 | 3 | export default defineConfig({ 4 | dist: 'dist', 5 | }) 6 | -------------------------------------------------------------------------------- /assets/inject/ui-workshop/workshop.config.ts: -------------------------------------------------------------------------------- 1 | import {defineConfig} from '@sanity/ui-workshop' 2 | 3 | export default defineConfig({ 4 | title: 'Workshop Starter', 5 | }) 6 | -------------------------------------------------------------------------------- /src/util/errorToUndefined.ts: -------------------------------------------------------------------------------- 1 | export function errorToUndefined(err: any) { 2 | if (err instanceof TypeError) { 3 | throw err 4 | } 5 | 6 | return undefined 7 | } 8 | -------------------------------------------------------------------------------- /test/fixtures/verify-package/every-failure-possible/.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "semi": false, 3 | "printWidth": 100, 4 | "bracketSpacing": false, 5 | "singleQuote": true 6 | } 7 | -------------------------------------------------------------------------------- /test/fixtures/verify-package/invalid-eslint/.prettierrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "semi": false, 3 | "printWidth": 100, 4 | "bracketSpacing": false, 5 | "singleQuote": true 6 | } 7 | -------------------------------------------------------------------------------- /.prettierrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "semi": false, 3 | "printWidth": 100, 4 | "bracketSpacing": false, 5 | "singleQuote": true, 6 | "plugins": ["prettier-plugin-packagejson"] 7 | } 8 | -------------------------------------------------------------------------------- /assets/inject/sanity.json: -------------------------------------------------------------------------------- 1 | { 2 | "parts": [ 3 | { 4 | "implements": "part:@sanity/base/sanity-root", 5 | "path": "./v2-incompatible.js" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /test/fixtures/build/plain/sanity.json: -------------------------------------------------------------------------------- 1 | { 2 | "parts": [ 3 | { 4 | "implements": "part:@sanity/base/schema-type", 5 | "path": "./src/schemaType.js" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /test/fixtures/inject/valid/sanity.json: -------------------------------------------------------------------------------- 1 | { 2 | "parts": [ 3 | { 4 | "implements": "part:@sanity/base/sanity-root", 5 | "path": "./v2-incompatible.js" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /test/fixtures/verify-package/every-failure-possible/.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "root": true, 3 | "env": { 4 | "node": true, 5 | "browser": true 6 | }, 7 | "extends": ["sanity"] 8 | } 9 | -------------------------------------------------------------------------------- /test/fixtures/verify-package/every-failure-possible/.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "root": true, 3 | "env": { 4 | "node": true, 5 | "browser": true 6 | }, 7 | "extends": ["sanity"] 8 | } 9 | -------------------------------------------------------------------------------- /test/fixtures/verify-package/fresh-v2-movie-studio/static/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sanity-io/plugin-kit/HEAD/test/fixtures/verify-package/fresh-v2-movie-studio/static/favicon.ico -------------------------------------------------------------------------------- /test/fixtures/verify-package/valid/sanity.json: -------------------------------------------------------------------------------- 1 | { 2 | "parts": [ 3 | { 4 | "implements": "part:@sanity/base/sanity-root", 5 | "path": "./v2-incompatible.js" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /test/fixtures/verify-package/invalid-eslint/.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "root": true, 3 | "env": { 4 | "node": true, 5 | "browser": true 6 | }, 7 | "extends": ["sanity", "this-does-not-exist"] 8 | } 9 | -------------------------------------------------------------------------------- /test/fixtures/verify-package/every-failure-possible/sanity.json: -------------------------------------------------------------------------------- 1 | { 2 | "parts": [ 3 | { 4 | "implements": "part:@sanity/base/schema-type", 5 | "path": "./src/index.js" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /test/fixtures/verify-package/fresh-v2-movie-studio/.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "root": true, 3 | "env": { 4 | "node": true, 5 | "browser": true 6 | }, 7 | "extends": ["sanity", "sanity/typescript"] 8 | } 9 | -------------------------------------------------------------------------------- /test/fixtures/verify-package/invalid-eslint/sanity.json: -------------------------------------------------------------------------------- 1 | { 2 | "parts": [ 3 | { 4 | "implements": "part:@sanity/base/sanity-root", 5 | "path": "./v2-incompatible.js" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /test/fixtures/inject/valid/.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "root": true, 3 | "env": { 4 | "node": true, 5 | "browser": true 6 | }, 7 | "extends": ["sanity", "sanity/typescript", "plugin:prettier/recommended"] 8 | } 9 | -------------------------------------------------------------------------------- /test/run-test-command.ts: -------------------------------------------------------------------------------- 1 | import {cliEntry} from '../src/cli' 2 | 3 | // ts-node