jiek 2.1.0 → 2.1.2
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +18 -3
- package/dist/cli-only-build.cjs +1 -1
- package/dist/cli-only-build.js +1 -1
- package/dist/cli.cjs +20 -2
- package/dist/cli.js +20 -2
- package/package.json +1 -1
- package/src/commands/publish.ts +27 -2
package/README.md
CHANGED
@@ -56,11 +56,26 @@ yarn add -D jiek
|
|
56
56
|
}
|
57
57
|
```
|
58
58
|
|
59
|
-
- 假设你在工作空间下有一个包名字为 `@monorepo/utils` ,那么你可以运行 `
|
59
|
+
- 假设你在工作空间下有一个包名字为 `@monorepo/utils` ,那么你可以运行 `jk -f utils build` 来构建这个包。
|
60
60
|
|
61
|
-
-
|
61
|
+
- 当需要发布当前的包的时候,首先你可以通过 `jk -f utils prepublish` 来准备发布内容,然后再运行 `jk -f utils publish` 来发布,最后通过 `jk -f utils postpublish` 来清理发布内容。
|
62
62
|
|
63
|
-
|
63
|
+
- 当然可能你会觉得上面的操作有点繁琐,你可以通过在对应包的 `package.json` 中添加 `scripts` 来简化操作。
|
64
|
+
|
65
|
+
```json
|
66
|
+
{
|
67
|
+
...
|
68
|
+
"scripts": {
|
69
|
+
"prepublish": "jb && jk",
|
70
|
+
"postpublish": "jk"
|
71
|
+
},
|
72
|
+
...
|
73
|
+
}
|
74
|
+
```
|
75
|
+
|
76
|
+
> 如果你需要在发布前对要发布的内容进行检查,你可以通过 `prepublish` 子指令来在你的 dist 产物目录(可配置)下会生成相关的 `package.json` 文件,你可以检阅相关生成的文件。
|
77
|
+
|
78
|
+
- 当配置好了上述的 hook 后,通过 `jk publish` 就可以一键完成构建发布动作了。
|
64
79
|
|
65
80
|
## CLI
|
66
81
|
|
package/dist/cli-only-build.cjs
CHANGED
@@ -116,7 +116,7 @@ async function getSelectedProjectsGraph(filter = commander.program.getOptionValu
|
|
116
116
|
|
117
117
|
var name = "jiek";
|
118
118
|
var type = "module";
|
119
|
-
var version = "2.
|
119
|
+
var version = "2.1.1";
|
120
120
|
var description$1 = "A lightweight toolkit for compiling and managing libraries based on `package.json` metadata and suitable for `Monorepo`.";
|
121
121
|
var author = "YiJie <yijie4188@gmail.com>";
|
122
122
|
var repository = {
|
package/dist/cli-only-build.js
CHANGED
@@ -108,7 +108,7 @@ async function getSelectedProjectsGraph(filter = program.getOptionValue("filter"
|
|
108
108
|
|
109
109
|
var name = "jiek";
|
110
110
|
var type = "module";
|
111
|
-
var version = "2.
|
111
|
+
var version = "2.1.1";
|
112
112
|
var description$1 = "A lightweight toolkit for compiling and managing libraries based on `package.json` metadata and suitable for `Monorepo`.";
|
113
113
|
var author = "YiJie <yijie4188@gmail.com>";
|
114
114
|
var repository = {
|
package/dist/cli.cjs
CHANGED
@@ -4780,5 +4780,23 @@ commander.program.action(async () => {
|
|
4780
4780
|
commander.program.help();
|
4781
4781
|
}
|
4782
4782
|
});
|
4783
|
-
|
4784
|
-
|
4783
|
+
const prepublishDescription = `
|
4784
|
+
Prepare package.json for publish, you can add \`jk\` to the \`prepublish\` script in package.json, the command will automatically run \`jk prepublish\`.
|
4785
|
+
.e.g
|
4786
|
+
{
|
4787
|
+
"scripts": {
|
4788
|
+
"prepublish": "jk"
|
4789
|
+
}
|
4790
|
+
}
|
4791
|
+
`.trim();
|
4792
|
+
commander.program.command("prepublish").description(prepublishDescription).action(prepublish);
|
4793
|
+
const postpublishDescription = `
|
4794
|
+
Restore package.json after publish, you can add \`jk\` to the \`postpublish\` script in package.json, the command will automatically run \`jk postpublish\`.
|
4795
|
+
.e.g
|
4796
|
+
{
|
4797
|
+
"scripts": {
|
4798
|
+
"postpublish": "jk"
|
4799
|
+
}
|
4800
|
+
}
|
4801
|
+
`.trim();
|
4802
|
+
commander.program.command("postpublish").description(postpublishDescription).action(postpublish);
|
package/dist/cli.js
CHANGED
@@ -4750,5 +4750,23 @@ program.action(async () => {
|
|
4750
4750
|
program.help();
|
4751
4751
|
}
|
4752
4752
|
});
|
4753
|
-
|
4754
|
-
|
4753
|
+
const prepublishDescription = `
|
4754
|
+
Prepare package.json for publish, you can add \`jk\` to the \`prepublish\` script in package.json, the command will automatically run \`jk prepublish\`.
|
4755
|
+
.e.g
|
4756
|
+
{
|
4757
|
+
"scripts": {
|
4758
|
+
"prepublish": "jk"
|
4759
|
+
}
|
4760
|
+
}
|
4761
|
+
`.trim();
|
4762
|
+
program.command("prepublish").description(prepublishDescription).action(prepublish);
|
4763
|
+
const postpublishDescription = `
|
4764
|
+
Restore package.json after publish, you can add \`jk\` to the \`postpublish\` script in package.json, the command will automatically run \`jk postpublish\`.
|
4765
|
+
.e.g
|
4766
|
+
{
|
4767
|
+
"scripts": {
|
4768
|
+
"postpublish": "jk"
|
4769
|
+
}
|
4770
|
+
}
|
4771
|
+
`.trim();
|
4772
|
+
program.command("postpublish").description(postpublishDescription).action(postpublish);
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "jiek",
|
3
3
|
"type": "module",
|
4
|
-
"version": "2.1.
|
4
|
+
"version": "2.1.2",
|
5
5
|
"description": "A lightweight toolkit for compiling and managing libraries based on `package.json` metadata and suitable for `Monorepo`.",
|
6
6
|
"author": "YiJie <yijie4188@gmail.com>",
|
7
7
|
"repository": {
|
package/src/commands/publish.ts
CHANGED
@@ -413,5 +413,30 @@ program
|
|
413
413
|
}
|
414
414
|
})
|
415
415
|
|
416
|
-
|
417
|
-
|
416
|
+
const prepublishDescription = `
|
417
|
+
Prepare package.json for publish, you can add \`jk\` to the \`prepublish\` script in package.json, the command will automatically run \`jk prepublish\`.
|
418
|
+
.e.g
|
419
|
+
{
|
420
|
+
"scripts": {
|
421
|
+
"prepublish": "jk"
|
422
|
+
}
|
423
|
+
}
|
424
|
+
`.trim()
|
425
|
+
program
|
426
|
+
.command('prepublish')
|
427
|
+
.description(prepublishDescription)
|
428
|
+
.action(prepublish)
|
429
|
+
|
430
|
+
const postpublishDescription = `
|
431
|
+
Restore package.json after publish, you can add \`jk\` to the \`postpublish\` script in package.json, the command will automatically run \`jk postpublish\`.
|
432
|
+
.e.g
|
433
|
+
{
|
434
|
+
"scripts": {
|
435
|
+
"postpublish": "jk"
|
436
|
+
}
|
437
|
+
}
|
438
|
+
`.trim()
|
439
|
+
program
|
440
|
+
.command('postpublish')
|
441
|
+
.description(postpublishDescription)
|
442
|
+
.action(postpublish)
|