@sanity/plugin-kit 0.1.0-v3-studio.0 → 0.1.0-v3-studio.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/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
|
|
|
@@ -168,7 +168,7 @@ This will publish the plugin to a local [yalc](https://github.com/wclr/yalc) reg
|
|
|
168
168
|
In another shell, in your test Sanity Studio directory, run:
|
|
169
169
|
|
|
170
170
|
```sh
|
|
171
|
-
npx yalc add <your-plugin-package> --link &&
|
|
171
|
+
npx yalc add <your-plugin-package> && npx yalc add <your-plugin-package> --link && npm install
|
|
172
172
|
```
|
|
173
173
|
|
|
174
174
|
You can now change your plugin code, which will:
|
package/lib/package.json
CHANGED
|
@@ -37,6 +37,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;AACzC,sDAA6B;AAY7B,SAAsB,SAAS,CAAC,EAAC,QAAQ,EAAqB;;;QAC5D,MAAM,WAAW,GAAgB,IAAI,CAAC,KAAK,CACzC,YAAE,CAAC,YAAY,CAAC,cAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,cAAc,CAAC,EAAE,MAAM,CAAC,CAClE,CAAA;QAED,MAAM,KAAK,mBACT,MAAM,EAAE,KAAK,EACb,OAAO,EAAE,eAAe,EACxB,UAAU,EAAE,yBAAyB,IAClC,MAAA,WAAW,CAAC,YAAY,0CAAE,SAAS,CACvC,CAAA;QAED,IAAA,iBAAO,EAAC;YACN,KAAK,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC;YACrB,GAAG,EAAE,KAAK,CAAC,UAAU;YACrB,IAAI,EAAE,qBAAqB;YAC3B,aAAa;SACd,CAAC,CAAA;QAEF,MAAM,GAAG,GAAG,MAAM,IAAA,oBAAU,EAAC,EAAC,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAC,CAAC,CAAA;QAEzD,iBAAO;aACJ,EAAE,CAAC,OAAO,EAAE;YACX,aAAG,CAAC,IAAI,CACN,IAAA,iBAAO,EAAA;mBACI,KAAK,CAAC,MAAM,0CAA0C,KAAK,CAAC,UAAU;;;UAG/E,eAAK,CAAC,WAAW,CAAC,gBAAgB,GAAG,CAAC,IAAI,qBAAqB,GAAG,CAAC,IAAI,iBAAiB,CAAC;OAC5F,CAAC,SAAS,EAAE,CACZ,CAAA;QACH,CAAC,CAAC;aACD,EAAE,CAAC,MAAM,EAAE;YACV,OAAO,CAAC,IAAI,EAAE,CAAA;QAChB,CAAC,CAAC;aACD,EAAE,CAAC,SAAS,EAAE,UAAU,KAAU;YACjC,aAAG,CAAC,IAAI,CAAC,yBAAyB,EAAE,eAAK,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,CAAA;YAC/D,aAAG,CAAC,IAAI,CAAC,6BAA6B,CAAC,CAAA;QACzC,CAAC,CAAC,CAAA;QAEJ,IAAA,sBAAY,EAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAA;;CAC9B;AAzCD,8BAyCC"}
|
package/package.json
CHANGED
|
@@ -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()
|