zshy 0.3.4 → 0.3.5
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 +40 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -73,7 +73,7 @@ pnpm add --save-dev zshy
|
|
|
73
73
|
+ "exports": {
|
|
74
74
|
+ ".": "./src/index.ts",
|
|
75
75
|
+ "./utils": "./src/utils.ts",
|
|
76
|
-
+ "./plugins/*": "./src/plugins/*"
|
|
76
|
+
+ "./plugins/*": "./src/plugins/*",
|
|
77
77
|
+ "./components/**/*": "./src/components/**/*"
|
|
78
78
|
+ }
|
|
79
79
|
+ }
|
|
@@ -332,6 +332,45 @@ The `"bin"` field is automatically written into your `package.json`:
|
|
|
332
332
|
}
|
|
333
333
|
```
|
|
334
334
|
|
|
335
|
+
For packages that expose multiple CLI tools, `"bin"` can also be an object mapping
|
|
336
|
+
each command name to its source file:
|
|
337
|
+
|
|
338
|
+
```jsonc
|
|
339
|
+
{
|
|
340
|
+
// package.json
|
|
341
|
+
"name": "my-cli",
|
|
342
|
+
"version": "1.0.0",
|
|
343
|
+
"type": "module",
|
|
344
|
+
"zshy": {
|
|
345
|
+
"bin": {
|
|
346
|
+
"my-cli": "./src/cli.ts",
|
|
347
|
+
"other": "./src/other.ts"
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
```
|
|
352
|
+
|
|
353
|
+
This generates a corresponding object `"bin"` field:
|
|
354
|
+
|
|
355
|
+
```diff
|
|
356
|
+
{
|
|
357
|
+
// package.json
|
|
358
|
+
"name": "my-cli",
|
|
359
|
+
"version": "1.0.0",
|
|
360
|
+
"zshy": {
|
|
361
|
+
"exports": "./src/index.ts",
|
|
362
|
+
"bin": {
|
|
363
|
+
"my-cli": "./src/cli.ts",
|
|
364
|
+
"other": "./src/other.ts"
|
|
365
|
+
}
|
|
366
|
+
},
|
|
367
|
+
"bin": {
|
|
368
|
+
"my-cli": "./dist/cli.cjs",
|
|
369
|
+
"other": "./dist/other.cjs"
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
```
|
|
373
|
+
|
|
335
374
|
Be sure to include a [shebang](<https://en.wikipedia.org/wiki/Shebang_(Unix)>) as the first line of your CLI entrypoint file:
|
|
336
375
|
|
|
337
376
|
```ts
|