@sanity/plugin-kit 0.1.0-v3-studio.0 → 1.0.1
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/LICENSE +0 -1
- package/README.md +20 -8
- package/lib/package.json +6 -7
- package/lib/src/actions/init.js +2 -4
- package/lib/src/actions/init.js.map +1 -1
- package/lib/src/actions/link-watch.js +7 -3
- package/lib/src/actions/link-watch.js.map +1 -1
- package/package.json +6 -7
- package/src/actions/init.ts +3 -4
- package/src/actions/link-watch.ts +9 -3
package/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
> **NOTE**
|
|
4
4
|
>
|
|
5
|
-
> This is a developer preview package
|
|
5
|
+
> This is a developer preview package meant for **Sanity Studio v3** plugin development.
|
|
6
6
|
>
|
|
7
7
|
> For a v2 alternative, consider using [Sanipack](https://github.com/rexxars/sanipack).
|
|
8
8
|
|
|
@@ -29,6 +29,7 @@ Check the [FAQ](#faq) fro more on these.
|
|
|
29
29
|
* [Testing a plugin in Sanity Studio](#testing-a-plugin-in-sanity-studio)
|
|
30
30
|
* [FAQ](#faq) aka "Do I _have_ to use this plugin-kit?" aka No
|
|
31
31
|
* [Configuration reference](#configuration-reference)
|
|
32
|
+
* [Developing plugin-kit](#developing-plugin-kit)
|
|
32
33
|
|
|
33
34
|
## Installation
|
|
34
35
|
|
|
@@ -49,7 +50,7 @@ Parcel uses a build cache, you probably want to put `.parcel-cache` into `.gitig
|
|
|
49
50
|
First, run the init command:
|
|
50
51
|
```bash
|
|
51
52
|
# Initialize a new plugin (outside of your Sanity studio folder)
|
|
52
|
-
npx @sanity/plugin-kit
|
|
53
|
+
npx @sanity/plugin-kit init sanity-plugin-testing-it-out
|
|
53
54
|
|
|
54
55
|
# Make your plugin linkable, and compile an initial version
|
|
55
56
|
cd sanity-plugin-testing-it-out
|
|
@@ -86,7 +87,7 @@ Since the plugin is running in watch mode, any changes you make to the plugin co
|
|
|
86
87
|
|
|
87
88
|
Verify that the plugin package is configured correctly by running:
|
|
88
89
|
|
|
89
|
-
> npx @sanity/plugin-kit
|
|
90
|
+
> npx @sanity/plugin-kit verify-package
|
|
90
91
|
|
|
91
92
|
### What does it do?
|
|
92
93
|
|
|
@@ -116,7 +117,7 @@ Simply use the `verify-package` command in a v2 plugin package, and it will noti
|
|
|
116
117
|
plugin to v3.
|
|
117
118
|
|
|
118
119
|
```sh
|
|
119
|
-
npx @sanity/plugin-kit
|
|
120
|
+
npx @sanity/plugin-kit verify-package
|
|
120
121
|
```
|
|
121
122
|
|
|
122
123
|
## Upgrade help in V2 Studio
|
|
@@ -125,7 +126,7 @@ You can use the `verify-studio` command in a v2 Sanity Studio to get some of the
|
|
|
125
126
|
to v3.
|
|
126
127
|
|
|
127
128
|
```sh
|
|
128
|
-
npx @sanity/plugin-kit
|
|
129
|
+
npx @sanity/plugin-kit verify-studio
|
|
129
130
|
```
|
|
130
131
|
|
|
131
132
|
This will:
|
|
@@ -138,10 +139,10 @@ This will:
|
|
|
138
139
|
|
|
139
140
|
```sh
|
|
140
141
|
## for plugins
|
|
141
|
-
npx @sanity/plugin-kit
|
|
142
|
+
npx @sanity/plugin-kit verify-package --single
|
|
142
143
|
|
|
143
144
|
## for studio
|
|
144
|
-
npx @sanity/plugin-kit
|
|
145
|
+
npx @sanity/plugin-kit verify-package --studio --single
|
|
145
146
|
```
|
|
146
147
|
|
|
147
148
|
This will only output the first validation that fails. Useful when working through the list of issues by fixing and rerunning the command.
|
|
@@ -168,7 +169,7 @@ This will publish the plugin to a local [yalc](https://github.com/wclr/yalc) reg
|
|
|
168
169
|
In another shell, in your test Sanity Studio directory, run:
|
|
169
170
|
|
|
170
171
|
```sh
|
|
171
|
-
npx yalc add <your-plugin-package> --link &&
|
|
172
|
+
npx yalc add <your-plugin-package> && npx yalc add <your-plugin-package> --link && npm install
|
|
172
173
|
```
|
|
173
174
|
|
|
174
175
|
You can now change your plugin code, which will:
|
|
@@ -396,3 +397,14 @@ npm run test -- test/verify-package.test.ts
|
|
|
396
397
|
```sh
|
|
397
398
|
npm run test -- test/verify-package.test.ts --snapshot
|
|
398
399
|
```
|
|
400
|
+
|
|
401
|
+
|
|
402
|
+
## Developing plugin kit
|
|
403
|
+
|
|
404
|
+
### Release new version
|
|
405
|
+
|
|
406
|
+
Run ["CI & Release" workflow](https://github.com/sanity-io/plugin-kitactions).
|
|
407
|
+
Make sure to select the main branch and check "Release new version".
|
|
408
|
+
|
|
409
|
+
Semantic release will only release on configured branches, so it is safe to run release on any branch.
|
|
410
|
+
|
package/lib/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sanity/plugin-kit",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "Enhanced Sanity.io plugin development experience",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"clean": "rimraf lib",
|
|
@@ -14,7 +14,6 @@
|
|
|
14
14
|
"lint": "eslint .",
|
|
15
15
|
"compile": "tsc --noEmit",
|
|
16
16
|
"format": "prettier src -w",
|
|
17
|
-
"semantic-release": "semantic-release",
|
|
18
17
|
"prepublishOnly": "npm run test && npm run build"
|
|
19
18
|
},
|
|
20
19
|
"binname": "sanity-plugin",
|
|
@@ -30,7 +29,7 @@
|
|
|
30
29
|
],
|
|
31
30
|
"repository": {
|
|
32
31
|
"type": "git",
|
|
33
|
-
"url": "git+ssh://git@github.com/
|
|
32
|
+
"url": "git+ssh://git@github.com/sanity-io/plugin-kit.git"
|
|
34
33
|
},
|
|
35
34
|
"engines": {
|
|
36
35
|
"node": ">=14.0.0"
|
|
@@ -47,9 +46,9 @@
|
|
|
47
46
|
"author": "Sanity.io <hello@sanity.io>",
|
|
48
47
|
"license": "MIT",
|
|
49
48
|
"bugs": {
|
|
50
|
-
"url": "https://github.com/
|
|
49
|
+
"url": "https://github.com/sanity-io/plugin-kit/issues"
|
|
51
50
|
},
|
|
52
|
-
"homepage": "https://github.com/
|
|
51
|
+
"homepage": "https://github.com/sanity-io/plugin-kit#readme",
|
|
53
52
|
"dependencies": {
|
|
54
53
|
"@rexxars/choosealicense-list": "^1.1.2",
|
|
55
54
|
"chalk": "^4.1.2",
|
|
@@ -87,6 +86,7 @@
|
|
|
87
86
|
"@commitlint/config-conventional": "^16.2.1",
|
|
88
87
|
"@parcel/packager-ts": "^2.6.0",
|
|
89
88
|
"@parcel/transformer-typescript-types": "^2.6.0",
|
|
89
|
+
"@sanity/semantic-release-preset": "^1.1.3",
|
|
90
90
|
"@types/eslint": "^8.4.3",
|
|
91
91
|
"@types/inquirer": "^8.2.1",
|
|
92
92
|
"@types/node": "^17.0.40",
|
|
@@ -105,8 +105,7 @@
|
|
|
105
105
|
"prettier": "^2.6.2",
|
|
106
106
|
"readdirp": "^3.6.0",
|
|
107
107
|
"rimraf": "^3.0.2",
|
|
108
|
-
"
|
|
109
|
-
"sanity": "^3.0.0-dev-preview.7",
|
|
108
|
+
"sanity": "3.0.0-dev-preview.15",
|
|
110
109
|
"sinon": "^14.0.0",
|
|
111
110
|
"tap": "^16.2.0",
|
|
112
111
|
"ts-node": "^10.8.0",
|
package/lib/src/actions/init.js
CHANGED
|
@@ -55,10 +55,8 @@ exports.initFlags = Object.assign(Object.assign({}, sharedFlags_1.default), { sc
|
|
|
55
55
|
type: 'string',
|
|
56
56
|
} });
|
|
57
57
|
const defaultDependencies = [constants_1.incompatiblePluginPackage];
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
const defaultDevDependencies = { react: '^17.0.0 || ^18.0.0', sanity: '2.29.5-purple-unicorn.856' };
|
|
61
|
-
const defaultPeerDependencies = { react: '^17.0.0 || ^18.0.0', sanity: 'purple-unicorn' };
|
|
58
|
+
const defaultDevDependencies = { react: '^17.0.0 || ^18.0.0', sanity: '^3.0.0-dev-preview.15' };
|
|
59
|
+
const defaultPeerDependencies = { react: '^17.0.0 || ^18.0.0', sanity: 'dev-preview' };
|
|
62
60
|
function init(options) {
|
|
63
61
|
return __awaiter(this, void 0, void 0, function* () {
|
|
64
62
|
let dependencies = {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.js","sourceRoot":"","sources":["../../../src/actions/init.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,gDAAuB;AACvB,mCAA6B;AAC7B,yCAAkD;AAClD,wEAAkE;AAClE,iEAAwC;AAExC,4CAAyC;AACzC,8DAA0E;AAC1E,4CAAsD;AAEzC,QAAA,SAAS,GAAG,gCACpB,qBAAW,KACd,OAAO,EAAE;QACP,IAAI,EAAE,SAAS;QACf,OAAO,EAAE,IAAI;KACd,EACD,MAAM,EAAE;QACN,IAAI,EAAE,SAAS;QACf,OAAO,EAAE,IAAI;KACd,EACD,UAAU,EAAE;QACV,IAAI,EAAE,SAAS;QACf,OAAO,EAAE,IAAI;KACd,EACD,QAAQ,EAAE;QACR,IAAI,EAAE,SAAS;QACf,OAAO,EAAE,IAAI;KACd,EACD,OAAO,EAAE;QACP,IAAI,EAAE,QAAQ;KACf,EACD,YAAY,EAAE;QACZ,IAAI,EAAE,SAAS;QACf,OAAO,EAAE,IAAI;KACd,EACD,SAAS,EAAE;QACT,IAAI,EAAE,SAAS;QACf,OAAO,EAAE,IAAI;KACd,EACD,KAAK,EAAE;QACL,IAAI,EAAE,SAAS;QACf,OAAO,EAAE,KAAK;KACf,EACD,OAAO,EAAE;QACP,IAAI,EAAE,SAAS;QACf,OAAO,EAAE,IAAI;KACd,EACD,IAAI,EAAE;QACJ,IAAI,EAAE,QAAQ;KACf,EACD,MAAM,EAAE;QACN,IAAI,EAAE,QAAQ;KACf,EACD,IAAI,EAAE;QACJ,IAAI,EAAE,QAAQ;KACf,GACO,CAAA;AAIV,MAAM,mBAAmB,GAAG,CAAC,qCAAyB,CAAC,CAAA;
|
|
1
|
+
{"version":3,"file":"init.js","sourceRoot":"","sources":["../../../src/actions/init.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AA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7 @@ const fs_1 = __importDefault(require("fs"));
|
|
|
37
37
|
const path_1 = __importDefault(require("path"));
|
|
38
38
|
const log_1 = __importDefault(require("../util/log"));
|
|
39
39
|
const package_1 = require("../npm/package");
|
|
40
|
+
const outdent_1 = __importDefault(require("outdent"));
|
|
40
41
|
function linkWatch({ basePath }) {
|
|
41
42
|
var _a;
|
|
42
43
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -51,9 +52,12 @@ function linkWatch({ basePath }) {
|
|
|
51
52
|
const pkg = yield (0, package_1.getPackage)({ basePath, validate: false });
|
|
52
53
|
nodemon_1.default
|
|
53
54
|
.on('start', function () {
|
|
54
|
-
log_1.default.info(
|
|
55
|
-
|
|
56
|
-
|
|
55
|
+
log_1.default.info((0, outdent_1.default) `
|
|
56
|
+
Watching ${watch.folder} for changes to files with extensions: ${watch.extensions}
|
|
57
|
+
|
|
58
|
+
To test this package in another repository directory run:
|
|
59
|
+
${chalk_1.default.greenBright(`npx yalc add ${pkg.name} && npx yalc link ${pkg.name} && npm install`)}
|
|
60
|
+
`.trimStart());
|
|
57
61
|
})
|
|
58
62
|
.on('quit', function () {
|
|
59
63
|
process.exit();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"link-watch.js","sourceRoot":"","sources":["../../../src/actions/link-watch.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;EAYE;;;;;;;;;;;;;;;AAEF;;;EAGE;AAEF,sDAA6B;AAC7B,gEAAuC;AACvC,kDAAyB;AACzB,4CAAmB;AACnB,gDAAuB;AACvB,sDAA6B;AAC7B,4CAAyC;
|
|
1
|
+
{"version":3,"file":"link-watch.js","sourceRoot":"","sources":["../../../src/actions/link-watch.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;EAYE;;;;;;;;;;;;;;;AAEF;;;EAGE;AAEF,sDAA6B;AAC7B,gEAAuC;AACvC,kDAAyB;AACzB,4CAAmB;AACnB,gDAAuB;AACvB,sDAA6B;AAC7B,4CAAyC;A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AAA;QAEJ,IAAA,sBAAY,EAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAA;;CAC9B;AAzCD,8BAyCC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sanity/plugin-kit",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "Enhanced Sanity.io plugin development experience",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"clean": "rimraf lib",
|
|
@@ -14,7 +14,6 @@
|
|
|
14
14
|
"lint": "eslint .",
|
|
15
15
|
"compile": "tsc --noEmit",
|
|
16
16
|
"format": "prettier src -w",
|
|
17
|
-
"semantic-release": "semantic-release",
|
|
18
17
|
"prepublishOnly": "npm run test && npm run build"
|
|
19
18
|
},
|
|
20
19
|
"binname": "sanity-plugin",
|
|
@@ -30,7 +29,7 @@
|
|
|
30
29
|
],
|
|
31
30
|
"repository": {
|
|
32
31
|
"type": "git",
|
|
33
|
-
"url": "git+ssh://git@github.com/
|
|
32
|
+
"url": "git+ssh://git@github.com/sanity-io/plugin-kit.git"
|
|
34
33
|
},
|
|
35
34
|
"engines": {
|
|
36
35
|
"node": ">=14.0.0"
|
|
@@ -47,9 +46,9 @@
|
|
|
47
46
|
"author": "Sanity.io <hello@sanity.io>",
|
|
48
47
|
"license": "MIT",
|
|
49
48
|
"bugs": {
|
|
50
|
-
"url": "https://github.com/
|
|
49
|
+
"url": "https://github.com/sanity-io/plugin-kit/issues"
|
|
51
50
|
},
|
|
52
|
-
"homepage": "https://github.com/
|
|
51
|
+
"homepage": "https://github.com/sanity-io/plugin-kit#readme",
|
|
53
52
|
"dependencies": {
|
|
54
53
|
"@rexxars/choosealicense-list": "^1.1.2",
|
|
55
54
|
"chalk": "^4.1.2",
|
|
@@ -87,6 +86,7 @@
|
|
|
87
86
|
"@commitlint/config-conventional": "^16.2.1",
|
|
88
87
|
"@parcel/packager-ts": "^2.6.0",
|
|
89
88
|
"@parcel/transformer-typescript-types": "^2.6.0",
|
|
89
|
+
"@sanity/semantic-release-preset": "^1.1.3",
|
|
90
90
|
"@types/eslint": "^8.4.3",
|
|
91
91
|
"@types/inquirer": "^8.2.1",
|
|
92
92
|
"@types/node": "^17.0.40",
|
|
@@ -105,8 +105,7 @@
|
|
|
105
105
|
"prettier": "^2.6.2",
|
|
106
106
|
"readdirp": "^3.6.0",
|
|
107
107
|
"rimraf": "^3.0.2",
|
|
108
|
-
"
|
|
109
|
-
"sanity": "^3.0.0-dev-preview.7",
|
|
108
|
+
"sanity": "3.0.0-dev-preview.15",
|
|
110
109
|
"sinon": "^14.0.0",
|
|
111
110
|
"tap": "^16.2.0",
|
|
112
111
|
"ts-node": "^10.8.0",
|
package/src/actions/init.ts
CHANGED
|
@@ -59,10 +59,9 @@ export const initFlags = {
|
|
|
59
59
|
export type InitFlags = TypedFlags<typeof initFlags>
|
|
60
60
|
|
|
61
61
|
const defaultDependencies = [incompatiblePluginPackage]
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
const
|
|
65
|
-
const defaultPeerDependencies = {react: '^17.0.0 || ^18.0.0', sanity: 'purple-unicorn'}
|
|
62
|
+
|
|
63
|
+
const defaultDevDependencies = {react: '^17.0.0 || ^18.0.0', sanity: '^3.0.0-dev-preview.15'}
|
|
64
|
+
const defaultPeerDependencies = {react: '^17.0.0 || ^18.0.0', sanity: 'dev-preview'}
|
|
66
65
|
|
|
67
66
|
export interface InitOptions {
|
|
68
67
|
basePath: string
|
|
@@ -24,6 +24,7 @@ import fs from 'fs'
|
|
|
24
24
|
import path from 'path'
|
|
25
25
|
import log from '../util/log'
|
|
26
26
|
import {getPackage} from '../npm/package'
|
|
27
|
+
import outdent from 'outdent'
|
|
27
28
|
|
|
28
29
|
interface YalcWatchConfig {
|
|
29
30
|
folder?: string
|
|
@@ -58,9 +59,14 @@ export async function linkWatch({basePath}: {basePath: string}) {
|
|
|
58
59
|
|
|
59
60
|
nodemon
|
|
60
61
|
.on('start', function () {
|
|
61
|
-
log.info(
|
|
62
|
-
|
|
63
|
-
|
|
62
|
+
log.info(
|
|
63
|
+
outdent`
|
|
64
|
+
Watching ${watch.folder} for changes to files with extensions: ${watch.extensions}
|
|
65
|
+
|
|
66
|
+
To test this package in another repository directory run:
|
|
67
|
+
${chalk.greenBright(`npx yalc add ${pkg.name} && npx yalc link ${pkg.name} && npm install`)}
|
|
68
|
+
`.trimStart()
|
|
69
|
+
)
|
|
64
70
|
})
|
|
65
71
|
.on('quit', function () {
|
|
66
72
|
process.exit()
|