Skip to content

Commit

Permalink
feat: add prettier-plugin-packagejson
Browse files Browse the repository at this point in the history
  • Loading branch information
stipsan authored and snorrees committed Nov 4, 2022
1 parent a47063e commit 937f4bc
Show file tree
Hide file tree
Showing 13 changed files with 339 additions and 174 deletions.
152 changes: 152 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

101 changes: 51 additions & 50 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,38 +2,6 @@
"name": "@sanity/plugin-kit",
"version": "2.0.9",
"description": "Enhanced Sanity.io plugin development experience",
"scripts": {
"clean": "rimraf lib",
"prebuild": "npm run clean",
"build": "tsc",
"postbuild": "node executable-index.js",
"watch": "tsc --watch",
"test": "tap",
"prepare": "husky install",
"commit": "git-cz",
"lint": "eslint .",
"compile": "tsc --noEmit",
"format": "prettier src -w",
"prepublishOnly": "npm run build"
},
"binname": "sanity-plugin",
"source": "./src/index.ts",
"types": "./lib/src/index.d.ts",
"bin": "lib/src/index.js",
"main": "./lib/src/index.js",
"files": [
"v2-incompatible.js",
"src",
"lib",
"assets"
],
"repository": {
"type": "git",
"url": "git+ssh://[email protected]/sanity-io/plugin-kit.git"
},
"engines": {
"node": ">=14.0.0"
},
"keywords": [
"sanity-io",
"sanity",
Expand All @@ -43,12 +11,52 @@
"typescript",
"bootstrap"
],
"author": "Sanity.io <[email protected]>",
"license": "MIT",
"homepage": "https://github.com/sanity-io/plugin-kit#readme",
"bugs": {
"url": "https://github.com/sanity-io/plugin-kit/issues"
},
"homepage": "https://github.com/sanity-io/plugin-kit#readme",
"repository": {
"type": "git",
"url": "git+ssh://[email protected]/sanity-io/plugin-kit.git"
},
"license": "MIT",
"author": "Sanity.io <[email protected]>",
"main": "./lib/src/index.js",
"source": "./src/index.ts",
"types": "./lib/src/index.d.ts",
"bin": "lib/src/index.js",
"files": [
"v2-incompatible.js",
"src",
"lib",
"assets"
],
"scripts": {
"prebuild": "npm run clean",
"build": "tsc",
"postbuild": "node executable-index.js",
"clean": "rimraf lib",
"commit": "git-cz",
"compile": "tsc --noEmit",
"format": "prettier src -w",
"lint": "eslint .",
"prepare": "husky install",
"prepublishOnly": "npm run build",
"test": "tap",
"watch": "tsc --watch"
},
"tap": {
"browser": false,
"check-coverage": false,
"coverage-report": [
"html"
],
"jobs": 2,
"reporter": "spec",
"test-ignore": "^lib/.*|.*ignore.*|.*run-test-command.*|.*fixture.utils.*",
"timeout": 120,
"ts": true
},
"dependencies": {
"@rexxars/choosealicense-list": "^1.1.2",
"chalk": "^4.1.2",
Expand Down Expand Up @@ -78,9 +86,6 @@
"xdg-basedir": "^4.0.0",
"yalc": "^1.0.0-pre.53"
},
"peerDependencies": {
"eslint": ">=8.0.0"
},
"devDependencies": {
"@commitlint/cli": "^17.0.3",
"@commitlint/config-conventional": "^17.0.3",
Expand All @@ -104,6 +109,7 @@
"json5": "^2.2.1",
"lint-staged": "^13.0.3",
"prettier": "^2.7.1",
"prettier-plugin-packagejson": "^2.3.0",
"readdirp": "^3.6.0",
"rimraf": "^3.0.2",
"sanity": "3.0.0-rc.0",
Expand All @@ -112,16 +118,11 @@
"ts-node": "^10.9.1",
"typescript": "^4.8.4"
},
"tap": {
"jobs": 2,
"browser": false,
"timeout": 120,
"reporter": "spec",
"check-coverage": false,
"coverage-report": [
"html"
],
"test-ignore": "^lib/.*|.*ignore.*|.*run-test-command.*|.*fixture.utils.*",
"ts": true
}
"peerDependencies": {
"eslint": ">=8.0.0"
},
"engines": {
"node": ">=14.0.0"
},
"binname": "sanity-plugin"
}
16 changes: 12 additions & 4 deletions tap-snapshots/test/verify-package.test.ts.test.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
* Make sure to inspect the output below. Do not ignore changes!
*/
'use strict'
exports[`test/verify-package.test.ts TAP plugin-kit verify-package in ok package > stdout should match snapshot 1`] = `
exports[
`test/verify-package.test.ts TAP plugin-kit verify-package in ok package > stdout should match snapshot 1`
] = `
[success] No outstanding upgrade issues detected.
Suggested next steps:
Expand All @@ -14,7 +16,9 @@ Suggested next steps:
- Test the plugin using the link-watch command
`

exports[`test/verify-package.test.ts TAP plugin-kit verify-package in package with all checks failing > stderr should match snapshot 1`] = `
exports[
`test/verify-package.test.ts TAP plugin-kit verify-package in package with all checks failing > stderr should match snapshot 1`
] = `
[error]
Invalid package.json: "name" should be prefixed with "sanity-plugin-" (or scoped - @your-company/plugin-name)
Expand Down Expand Up @@ -256,7 +260,9 @@ To fail-fast on first detected issue run:
npx @sanity/plugin-kit verify-package' --single
`

exports[`test/verify-package.test.ts TAP plugin-kit verify-package in package with invalid eslint config > stderr should match snapshot 1`] = `
exports[
`test/verify-package.test.ts TAP plugin-kit verify-package in package with invalid eslint config > stderr should match snapshot 1`
] = `
[error] Failed to run eslint check Error: Failed to load config "this-does-not-exist" to extend from.
Referenced from: root/.eslintrc
at configInvalidError root/node_modules/@eslint/eslintrc/lib/config-array-factory.js:299:9)
Expand Down Expand Up @@ -310,7 +316,9 @@ To fail-fast on first detected issue run:
npx @sanity/plugin-kit verify-package' --single
`

exports[`test/verify-package.test.ts TAP plugin-kit verify-studio in fresh v2 studio > stderr should match snapshot 1`] = `
exports[
`test/verify-package.test.ts TAP plugin-kit verify-studio in fresh v2 studio > stderr should match snapshot 1`
] = `
[error]
Found sanity.json. This file is not used by Sanity Studio V3.
Expand Down
Loading

0 comments on commit 937f4bc

Please sign in to comment.