jiek 2.0.1 → 2.0.2-alpha.10
Sign up to get free protection for your applications and to get access to all the features.
- package/{dist/cli-only-build.cjs → cli-only-build.cjs} +19 -87
- package/{dist/cli-only-build.js → cli-only-build.js} +19 -87
- package/{dist/cli.cjs → cli.cjs} +385 -531
- package/cli.d.cts +14 -0
- package/cli.d.ts +14 -0
- package/{dist/cli.js → cli.js} +385 -530
- package/{dist/index.d.cts → index.d.cts} +0 -53
- package/{dist/index.d.ts → index.d.ts} +0 -53
- package/package.json +29 -36
- package/{dist/rollup → rollup}/index.cjs +2 -2
- package/{dist/rollup → rollup}/index.js +2 -2
- package/README.md +0 -78
- package/bin/jiek-build.js +0 -16
- package/bin/jiek.js +0 -13
- package/dist/cli.d.cts +0 -67
- package/dist/cli.d.ts +0 -67
- package/src/cli-only-build.ts +0 -7
- package/src/cli.ts +0 -3
- package/src/commands/base.ts +0 -18
- package/src/commands/build.ts +0 -462
- package/src/commands/descriptions.ts +0 -17
- package/src/commands/init.ts +0 -373
- package/src/commands/meta.ts +0 -5
- package/src/commands/publish.ts +0 -204
- package/src/index.ts +0 -8
- package/src/inner.ts +0 -11
- package/src/rollup/base.ts +0 -137
- package/src/rollup/index.ts +0 -565
- package/src/rollup/plugins/progress.ts +0 -26
- package/src/rollup/plugins/skip.ts +0 -21
- package/src/rollup/utils/commonOptions.ts +0 -9
- package/src/rollup/utils/externalResolver.ts +0 -35
- package/src/rollup/utils/globalResolver.ts +0 -13
- package/src/rollup/utils/withMinify.ts +0 -18
- package/src/utils/filterSupport.ts +0 -91
- package/src/utils/getExports.ts +0 -140
- package/src/utils/getRoot.ts +0 -16
- package/src/utils/getWD.ts +0 -31
- package/src/utils/loadConfig.ts +0 -111
- package/src/utils/recusiveListFiles.ts +0 -13
- package/src/utils/ts.ts +0 -94
- package/src/utils/tsRegister.ts +0 -26
- /package/{dist/cli-only-build.d.cts → cli-only-build.d.cts} +0 -0
- /package/{dist/cli-only-build.d.ts → cli-only-build.d.ts} +0 -0
- /package/{dist/index.cjs → index.cjs} +0 -0
- /package/{dist/index.js → index.js} +0 -0
- /package/{dist/rollup → rollup}/index.d.cts +0 -0
- /package/{dist/rollup → rollup}/index.d.ts +0 -0
@@ -90,59 +90,6 @@ declare module 'jiek' {
|
|
90
90
|
}
|
91
91
|
}
|
92
92
|
|
93
|
-
declare module 'jiek' {
|
94
|
-
type InitNamedFunction = (argument: string, paths: {
|
95
|
-
full: string;
|
96
|
-
relative: string;
|
97
|
-
basename?: string;
|
98
|
-
}) => [name?: string, path?: string];
|
99
|
-
type InitNamed = InitNamedFunction | {
|
100
|
-
[key: string]: string | InitNamedFunction;
|
101
|
-
};
|
102
|
-
interface Config {
|
103
|
-
init?: {
|
104
|
-
/**
|
105
|
-
* the package.json template file path or file content
|
106
|
-
*
|
107
|
-
* if it can be parsed as json, it will be parsed
|
108
|
-
* if it is a relative file path, it will be resolved to an absolute path based on the current working directory
|
109
|
-
* if it is an absolute file path, it will be used directly
|
110
|
-
* @default '.jiek.template.package.json'
|
111
|
-
*/
|
112
|
-
template?: string;
|
113
|
-
/**
|
114
|
-
* the readme content
|
115
|
-
*
|
116
|
-
* $name will be replaced with the package name
|
117
|
-
* $license will be replaced with the license
|
118
|
-
*/
|
119
|
-
readme?: string | ((ctx: {
|
120
|
-
dir: string;
|
121
|
-
packageJson: Record<string, any>;
|
122
|
-
}) => string);
|
123
|
-
/**
|
124
|
-
* the readme template file path
|
125
|
-
* @default '.jiek.template.readme.md'
|
126
|
-
*/
|
127
|
-
readmeTemplate?: string;
|
128
|
-
bug?: {
|
129
|
-
/**
|
130
|
-
* @default 'bug_report.yml'
|
131
|
-
*/
|
132
|
-
template?: string;
|
133
|
-
/**
|
134
|
-
* @default ['bug']
|
135
|
-
*/
|
136
|
-
labels?: string[] | ((ctx: {
|
137
|
-
name: string;
|
138
|
-
dir: string;
|
139
|
-
}) => string[]);
|
140
|
-
};
|
141
|
-
named?: InitNamed;
|
142
|
-
};
|
143
|
-
}
|
144
|
-
}
|
145
|
-
|
146
93
|
declare module 'jiek' {
|
147
94
|
interface Config {
|
148
95
|
publish?: {
|
@@ -90,59 +90,6 @@ declare module 'jiek' {
|
|
90
90
|
}
|
91
91
|
}
|
92
92
|
|
93
|
-
declare module 'jiek' {
|
94
|
-
type InitNamedFunction = (argument: string, paths: {
|
95
|
-
full: string;
|
96
|
-
relative: string;
|
97
|
-
basename?: string;
|
98
|
-
}) => [name?: string, path?: string];
|
99
|
-
type InitNamed = InitNamedFunction | {
|
100
|
-
[key: string]: string | InitNamedFunction;
|
101
|
-
};
|
102
|
-
interface Config {
|
103
|
-
init?: {
|
104
|
-
/**
|
105
|
-
* the package.json template file path or file content
|
106
|
-
*
|
107
|
-
* if it can be parsed as json, it will be parsed
|
108
|
-
* if it is a relative file path, it will be resolved to an absolute path based on the current working directory
|
109
|
-
* if it is an absolute file path, it will be used directly
|
110
|
-
* @default '.jiek.template.package.json'
|
111
|
-
*/
|
112
|
-
template?: string;
|
113
|
-
/**
|
114
|
-
* the readme content
|
115
|
-
*
|
116
|
-
* $name will be replaced with the package name
|
117
|
-
* $license will be replaced with the license
|
118
|
-
*/
|
119
|
-
readme?: string | ((ctx: {
|
120
|
-
dir: string;
|
121
|
-
packageJson: Record<string, any>;
|
122
|
-
}) => string);
|
123
|
-
/**
|
124
|
-
* the readme template file path
|
125
|
-
* @default '.jiek.template.readme.md'
|
126
|
-
*/
|
127
|
-
readmeTemplate?: string;
|
128
|
-
bug?: {
|
129
|
-
/**
|
130
|
-
* @default 'bug_report.yml'
|
131
|
-
*/
|
132
|
-
template?: string;
|
133
|
-
/**
|
134
|
-
* @default ['bug']
|
135
|
-
*/
|
136
|
-
labels?: string[] | ((ctx: {
|
137
|
-
name: string;
|
138
|
-
dir: string;
|
139
|
-
}) => string[]);
|
140
|
-
};
|
141
|
-
named?: InitNamed;
|
142
|
-
};
|
143
|
-
}
|
144
|
-
}
|
145
|
-
|
146
93
|
declare module 'jiek' {
|
147
94
|
interface Config {
|
148
95
|
publish?: {
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "jiek",
|
3
3
|
"type": "module",
|
4
|
-
"version": "2.0.
|
4
|
+
"version": "2.0.2-alpha.10",
|
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": {
|
@@ -16,13 +16,6 @@
|
|
16
16
|
"jiek-build": "bin/jiek-build.js",
|
17
17
|
"jb": "bin/jiek-build.js"
|
18
18
|
},
|
19
|
-
"files": [
|
20
|
-
"dist",
|
21
|
-
"src",
|
22
|
-
"bin",
|
23
|
-
"LICENSE",
|
24
|
-
"README.md"
|
25
|
-
],
|
26
19
|
"exports": {
|
27
20
|
"./package.json": "./package.json",
|
28
21
|
".": {
|
@@ -51,6 +44,7 @@
|
|
51
44
|
},
|
52
45
|
"dependencies": {
|
53
46
|
"@jiek/rollup-plugin-dts": "^6.2.1",
|
47
|
+
"@inquirer/prompts": "^7.1.0",
|
54
48
|
"@rollup/plugin-commonjs": "^28.0.0",
|
55
49
|
"@rollup/plugin-json": "^6.0.1",
|
56
50
|
"@rollup/plugin-node-resolve": "^15.3.0",
|
@@ -58,12 +52,11 @@
|
|
58
52
|
"commander": "^12.0.0",
|
59
53
|
"detect-indent": "^6.1.0",
|
60
54
|
"execa": "9.3.1",
|
61
|
-
"inquirer": "^8.2.6",
|
62
55
|
"js-yaml": "^4.1.0",
|
63
56
|
"jsonc-parser": "^3.2.1",
|
64
57
|
"rollup": "4.13.2",
|
65
|
-
"@jiek/
|
66
|
-
"@jiek/
|
58
|
+
"@jiek/utils": "^0.2.3",
|
59
|
+
"@jiek/pkger": "^0.2.0"
|
67
60
|
},
|
68
61
|
"peerDependencies": {
|
69
62
|
"@rollup/plugin-terser": "^0.4.4",
|
@@ -75,6 +68,23 @@
|
|
75
68
|
"rollup-plugin-swc3": "^0.12.1",
|
76
69
|
"typescript": "^4.0.0||^5.0.0"
|
77
70
|
},
|
71
|
+
"devDependencies": {
|
72
|
+
"@npm/types": "^1.0.2",
|
73
|
+
"@pnpm/filter-workspace-packages": "^7.2.13",
|
74
|
+
"@pnpm/workspace.pkgs-graph": "^2.0.15",
|
75
|
+
"@rollup/plugin-terser": "^0.4.4",
|
76
|
+
"@types/cli-progress": "^3.11.5",
|
77
|
+
"@types/inquirer": "^9.0.7",
|
78
|
+
"@types/js-yaml": "^4.0.9",
|
79
|
+
"@types/micromatch": "^4.0.6",
|
80
|
+
"esbuild-register": "^3.5.0",
|
81
|
+
"micromatch": "^4.0.5",
|
82
|
+
"node-sass": "^9.0.0",
|
83
|
+
"postcss": "^8.4.47",
|
84
|
+
"rollup-plugin-postcss": "^4.0.2",
|
85
|
+
"rollup-plugin-esbuild": "^6.1.0",
|
86
|
+
"rollup-plugin-swc3": "^0.12.1"
|
87
|
+
},
|
78
88
|
"peerDependenciesMeta": {
|
79
89
|
"@rollup/plugin-terser": {
|
80
90
|
"optional": true
|
@@ -101,37 +111,20 @@
|
|
101
111
|
"optional": true
|
102
112
|
}
|
103
113
|
},
|
104
|
-
"devDependencies": {
|
105
|
-
"@npm/types": "^1.0.2",
|
106
|
-
"@pnpm/filter-workspace-packages": "^7.2.13",
|
107
|
-
"@pnpm/workspace.pkgs-graph": "^2.0.15",
|
108
|
-
"@rollup/plugin-terser": "^0.4.4",
|
109
|
-
"@types/cli-progress": "^3.11.5",
|
110
|
-
"@types/inquirer": "^9.0.7",
|
111
|
-
"@types/js-yaml": "^4.0.9",
|
112
|
-
"@types/micromatch": "^4.0.6",
|
113
|
-
"esbuild-register": "^3.5.0",
|
114
|
-
"micromatch": "^4.0.5",
|
115
|
-
"node-sass": "^9.0.0",
|
116
|
-
"postcss": "^8.4.47",
|
117
|
-
"rollup-plugin-postcss": "^4.0.2",
|
118
|
-
"rollup-plugin-esbuild": "^6.1.0",
|
119
|
-
"rollup-plugin-swc3": "^0.12.1"
|
120
|
-
},
|
121
114
|
"scripts": {
|
122
|
-
"prepublish": "jb
|
115
|
+
"prepublish": "jb -nm && jk"
|
123
116
|
},
|
124
|
-
"main": "./dist/index.cjs",
|
125
|
-
"module": "./dist/index.js",
|
126
117
|
"typesVersions": {
|
127
118
|
"<5.0": {
|
128
119
|
"*": [
|
129
120
|
"*",
|
130
|
-
"
|
131
|
-
"
|
132
|
-
"
|
133
|
-
"
|
121
|
+
"./*",
|
122
|
+
"./*/index.d.ts",
|
123
|
+
"./*/index.d.mts",
|
124
|
+
"./*/index.d.cts"
|
134
125
|
]
|
135
126
|
}
|
136
|
-
}
|
127
|
+
},
|
128
|
+
"main": "./dist/index.cjs",
|
129
|
+
"module": "./dist/index.js"
|
137
130
|
}
|
@@ -4503,7 +4503,7 @@ const {
|
|
4503
4503
|
JIEK_WITHOUT_DTS,
|
4504
4504
|
JIEK_WITHOUT_MINIFY,
|
4505
4505
|
JIEK_MINIFY_TYPE,
|
4506
|
-
|
4506
|
+
JIEK_CLEAN,
|
4507
4507
|
JIEK_ONLY_MINIFY,
|
4508
4508
|
JIEK_TSCONFIG,
|
4509
4509
|
JIEK_DTSCONFIG
|
@@ -4527,7 +4527,7 @@ const WITHOUT_JS = JIEK_WITHOUT_JS === "true";
|
|
4527
4527
|
const WITHOUT_DTS = JIEK_WITHOUT_DTS === "true";
|
4528
4528
|
const WITHOUT_MINIFY = JIEK_WITHOUT_MINIFY === "true";
|
4529
4529
|
const ONLY_MINIFY = JIEK_ONLY_MINIFY === "true";
|
4530
|
-
const CLEAN =
|
4530
|
+
const CLEAN = JIEK_CLEAN === "true";
|
4531
4531
|
const MINIFY_DEFAULT_VALUE = WITHOUT_MINIFY ? false : ONLY_MINIFY ? "only-minify" : true;
|
4532
4532
|
const BUILDER_OPTIONS = {
|
4533
4533
|
type: JIEK_BUILDER ?? "esbuild"
|
@@ -4490,7 +4490,7 @@ const {
|
|
4490
4490
|
JIEK_WITHOUT_DTS,
|
4491
4491
|
JIEK_WITHOUT_MINIFY,
|
4492
4492
|
JIEK_MINIFY_TYPE,
|
4493
|
-
|
4493
|
+
JIEK_CLEAN,
|
4494
4494
|
JIEK_ONLY_MINIFY,
|
4495
4495
|
JIEK_TSCONFIG,
|
4496
4496
|
JIEK_DTSCONFIG
|
@@ -4514,7 +4514,7 @@ const WITHOUT_JS = JIEK_WITHOUT_JS === "true";
|
|
4514
4514
|
const WITHOUT_DTS = JIEK_WITHOUT_DTS === "true";
|
4515
4515
|
const WITHOUT_MINIFY = JIEK_WITHOUT_MINIFY === "true";
|
4516
4516
|
const ONLY_MINIFY = JIEK_ONLY_MINIFY === "true";
|
4517
|
-
const CLEAN =
|
4517
|
+
const CLEAN = JIEK_CLEAN === "true";
|
4518
4518
|
const MINIFY_DEFAULT_VALUE = WITHOUT_MINIFY ? false : ONLY_MINIFY ? "only-minify" : true;
|
4519
4519
|
const BUILDER_OPTIONS = {
|
4520
4520
|
type: JIEK_BUILDER ?? "esbuild"
|
package/README.md
DELETED
@@ -1,78 +0,0 @@
|
|
1
|
-
# Jiek
|
2
|
-
|
3
|
-
| zh-Hans
|
4
|
-
| [en](https://github.com/NWYLZW/jiek/blob/master/packages/jiek/.about/en/README.md)
|
5
|
-
|
6
|
-
[![npm version](https://img.shields.io/npm/v/jiek)](https://npmjs.com/package/jiek)
|
7
|
-
[![npm downloads](https://img.shields.io/npm/dm/jiek)](https://npm.chart.dev/jiek)
|
8
|
-
|
9
|
-
> 基于 `package.json` 元数据并适用于 `Monorepo` 的**轻便**工具库编译管理套件。
|
10
|
-
|
11
|
-
- [x] 自动推断:基于 `package.json` 的相关字段自动推断出构建规则,减少配置文件的编写,更加轻便与符合标准
|
12
|
-
- `exports`:根据入口文件推断构建目标与类型
|
13
|
-
- `imports`:定义路径别名,并在构建的时候自动 bundle 进来
|
14
|
-
- `type: module`:根据选项智能决定输出文件后缀,不需要考虑 `cjs` 与 `esm` 的适配问题
|
15
|
-
- `dependencies`、`peerDependencies`、`optionalDependencies`:自动将符合规则的依赖标记为 `external`
|
16
|
-
- `devDependencies`:将标记为开发依赖的 bundle 进对应的最终产物之中
|
17
|
-
- [ ] 构建工具:支持多种构建工具,无需纠结于用 swc 还是 esbuild 又或者是 tsc
|
18
|
-
- [x] `esbuild`
|
19
|
-
- [x] `swc`
|
20
|
-
- [ ] `typescript`
|
21
|
-
- [x] 工作空间友好:支持在 pnpm 下的工作空间开发范式
|
22
|
-
- [ ] 支持更多的 PM
|
23
|
-
- [ ] 更好的工作空间任务流
|
24
|
-
- [x] 类型定义文件:支持聚合生成类型定义文件
|
25
|
-
- [x] 监听模式:适配 rollup 的监听模式
|
26
|
-
- [x] 发布适配:支持同构生成 `package.json` 等相关字段
|
27
|
-
- [ ] 根据 `package.json` 中的路径自动替换 README.md 中的相对路径链接为对应的网络链接
|
28
|
-
- [x] CommonJS:产物兼容正在使用 cjs 的用户
|
29
|
-
- [ ] 插件化
|
30
|
-
- [ ] Dotenv:支持 dotenv 配置文件
|
31
|
-
- [ ] Replacer:支持替换文件内容
|
32
|
-
|
33
|
-
## 安装
|
34
|
-
|
35
|
-
```bash
|
36
|
-
npm i -D jiek
|
37
|
-
# or
|
38
|
-
pnpm i -D jiek
|
39
|
-
# or
|
40
|
-
yarn add -D jiek
|
41
|
-
```
|
42
|
-
|
43
|
-
## 快速起步
|
44
|
-
|
45
|
-
通过一些简单的方式能又快又轻松的生成需要的产物。
|
46
|
-
|
47
|
-
- 在 `package.json` 中添加入口文件,这里需要设置为原文件路径。
|
48
|
-
|
49
|
-
你可以在 Node.js 文档中查看更多对于 [exports](https://nodejs.org/api/packages.html#exports) 的相关内容。
|
50
|
-
|
51
|
-
```json
|
52
|
-
{
|
53
|
-
...
|
54
|
-
"exports": "./src/index.ts",
|
55
|
-
...
|
56
|
-
}
|
57
|
-
```
|
58
|
-
|
59
|
-
- 假设你在工作空间下有一个包名字为 `@monorepo/utils` ,那么你可以运行 `jb utils` 来构建这个包。
|
60
|
-
|
61
|
-
- 当你完成了开发的相关步骤后,在发布阶段你可以使用 `jk -f utils publish` 来发布你的包,本工具会自动转化并填充 `package.json` 对应的字段。
|
62
|
-
|
63
|
-
你可以添加 `-p/--preview` 参数来预览待发布的 `package.json` 的内容。
|
64
|
-
|
65
|
-
## CLI
|
66
|
-
|
67
|
-
```text
|
68
|
-
Usage: jk [options] [command]
|
69
|
-
```
|
70
|
-
|
71
|
-
## 为什么不使用 X?
|
72
|
-
|
73
|
-
在这里与 `jiek` 类似的工具有:[tsup](https://github.com/egoist/tsup)、[unbuild](https://github.com/unjs/unbuild)、[bunchee](https://github.com/huozhi/bunchee)、[pkgroll](https://github.com/privatenumber/pkgroll)、[tsdown](https://github.com/sxzz/tsdown)。但是他们都有着一些共同问题没有解决,比如说:
|
74
|
-
|
75
|
-
- `monorepo` 的支持存在一定的问题,在依赖工作空间其他的包时必须重新编译相关依赖
|
76
|
-
- 编写入口文件的规则过于繁琐,不够自然
|
77
|
-
- 无法处理 `tsconfig.json` 中的 `Project Reference` 相关问题
|
78
|
-
- 根据`conditions`
|
package/bin/jiek-build.js
DELETED
@@ -1,16 +0,0 @@
|
|
1
|
-
#!/usr/bin/env node
|
2
|
-
import { existsSync } from 'node:fs'
|
3
|
-
import { createRequire } from 'node:module'
|
4
|
-
import { dirname, resolve } from 'node:path'
|
5
|
-
import process from 'node:process'
|
6
|
-
|
7
|
-
process.env.JIEK_IS_ONLY_BUILD = 'true'
|
8
|
-
|
9
|
-
const __dirname = dirname(import.meta.url.replace('file://', ''))
|
10
|
-
if (existsSync(resolve(__dirname, '../.jiek-dev-tag'))) {
|
11
|
-
const require = createRequire(import.meta.url)
|
12
|
-
require('esbuild-register')
|
13
|
-
require('../src/cli-only-build.ts')
|
14
|
-
} else {
|
15
|
-
import('jiek/cli-only-build')
|
16
|
-
}
|
package/bin/jiek.js
DELETED
@@ -1,13 +0,0 @@
|
|
1
|
-
#!/usr/bin/env node
|
2
|
-
import { existsSync } from 'node:fs'
|
3
|
-
import { createRequire } from 'node:module'
|
4
|
-
import { dirname, resolve } from 'node:path'
|
5
|
-
|
6
|
-
const __dirname = dirname(import.meta.url.replace('file://', ''))
|
7
|
-
if (existsSync(resolve(__dirname, '../.jiek-dev-tag'))) {
|
8
|
-
const require = createRequire(import.meta.url)
|
9
|
-
require('esbuild-register')
|
10
|
-
require('../src/cli.ts')
|
11
|
-
} else {
|
12
|
-
import('jiek/cli')
|
13
|
-
}
|
package/dist/cli.d.cts
DELETED
@@ -1,67 +0,0 @@
|
|
1
|
-
declare module 'jiek' {
|
2
|
-
type InitNamedFunction = (argument: string, paths: {
|
3
|
-
full: string;
|
4
|
-
relative: string;
|
5
|
-
basename?: string;
|
6
|
-
}) => [name?: string, path?: string];
|
7
|
-
type InitNamed = InitNamedFunction | {
|
8
|
-
[key: string]: string | InitNamedFunction;
|
9
|
-
};
|
10
|
-
interface Config {
|
11
|
-
init?: {
|
12
|
-
/**
|
13
|
-
* the package.json template file path or file content
|
14
|
-
*
|
15
|
-
* if it can be parsed as json, it will be parsed
|
16
|
-
* if it is a relative file path, it will be resolved to an absolute path based on the current working directory
|
17
|
-
* if it is an absolute file path, it will be used directly
|
18
|
-
* @default '.jiek.template.package.json'
|
19
|
-
*/
|
20
|
-
template?: string;
|
21
|
-
/**
|
22
|
-
* the readme content
|
23
|
-
*
|
24
|
-
* $name will be replaced with the package name
|
25
|
-
* $license will be replaced with the license
|
26
|
-
*/
|
27
|
-
readme?: string | ((ctx: {
|
28
|
-
dir: string;
|
29
|
-
packageJson: Record<string, any>;
|
30
|
-
}) => string);
|
31
|
-
/**
|
32
|
-
* the readme template file path
|
33
|
-
* @default '.jiek.template.readme.md'
|
34
|
-
*/
|
35
|
-
readmeTemplate?: string;
|
36
|
-
bug?: {
|
37
|
-
/**
|
38
|
-
* @default 'bug_report.yml'
|
39
|
-
*/
|
40
|
-
template?: string;
|
41
|
-
/**
|
42
|
-
* @default ['bug']
|
43
|
-
*/
|
44
|
-
labels?: string[] | ((ctx: {
|
45
|
-
name: string;
|
46
|
-
dir: string;
|
47
|
-
}) => string[]);
|
48
|
-
};
|
49
|
-
named?: InitNamed;
|
50
|
-
};
|
51
|
-
}
|
52
|
-
}
|
53
|
-
|
54
|
-
declare module 'jiek' {
|
55
|
-
interface Config {
|
56
|
-
publish?: {
|
57
|
-
/**
|
58
|
-
* @default false
|
59
|
-
*/
|
60
|
-
withSuffix?: boolean;
|
61
|
-
/**
|
62
|
-
* @default true
|
63
|
-
*/
|
64
|
-
withSource?: boolean;
|
65
|
-
};
|
66
|
-
}
|
67
|
-
}
|
package/dist/cli.d.ts
DELETED
@@ -1,67 +0,0 @@
|
|
1
|
-
declare module 'jiek' {
|
2
|
-
type InitNamedFunction = (argument: string, paths: {
|
3
|
-
full: string;
|
4
|
-
relative: string;
|
5
|
-
basename?: string;
|
6
|
-
}) => [name?: string, path?: string];
|
7
|
-
type InitNamed = InitNamedFunction | {
|
8
|
-
[key: string]: string | InitNamedFunction;
|
9
|
-
};
|
10
|
-
interface Config {
|
11
|
-
init?: {
|
12
|
-
/**
|
13
|
-
* the package.json template file path or file content
|
14
|
-
*
|
15
|
-
* if it can be parsed as json, it will be parsed
|
16
|
-
* if it is a relative file path, it will be resolved to an absolute path based on the current working directory
|
17
|
-
* if it is an absolute file path, it will be used directly
|
18
|
-
* @default '.jiek.template.package.json'
|
19
|
-
*/
|
20
|
-
template?: string;
|
21
|
-
/**
|
22
|
-
* the readme content
|
23
|
-
*
|
24
|
-
* $name will be replaced with the package name
|
25
|
-
* $license will be replaced with the license
|
26
|
-
*/
|
27
|
-
readme?: string | ((ctx: {
|
28
|
-
dir: string;
|
29
|
-
packageJson: Record<string, any>;
|
30
|
-
}) => string);
|
31
|
-
/**
|
32
|
-
* the readme template file path
|
33
|
-
* @default '.jiek.template.readme.md'
|
34
|
-
*/
|
35
|
-
readmeTemplate?: string;
|
36
|
-
bug?: {
|
37
|
-
/**
|
38
|
-
* @default 'bug_report.yml'
|
39
|
-
*/
|
40
|
-
template?: string;
|
41
|
-
/**
|
42
|
-
* @default ['bug']
|
43
|
-
*/
|
44
|
-
labels?: string[] | ((ctx: {
|
45
|
-
name: string;
|
46
|
-
dir: string;
|
47
|
-
}) => string[]);
|
48
|
-
};
|
49
|
-
named?: InitNamed;
|
50
|
-
};
|
51
|
-
}
|
52
|
-
}
|
53
|
-
|
54
|
-
declare module 'jiek' {
|
55
|
-
interface Config {
|
56
|
-
publish?: {
|
57
|
-
/**
|
58
|
-
* @default false
|
59
|
-
*/
|
60
|
-
withSuffix?: boolean;
|
61
|
-
/**
|
62
|
-
* @default true
|
63
|
-
*/
|
64
|
-
withSource?: boolean;
|
65
|
-
};
|
66
|
-
}
|
67
|
-
}
|
package/src/cli-only-build.ts
DELETED
package/src/cli.ts
DELETED
package/src/commands/base.ts
DELETED
@@ -1,18 +0,0 @@
|
|
1
|
-
import { program } from 'commander'
|
2
|
-
import pkg from 'jiek/package.json'
|
3
|
-
|
4
|
-
import { filterDescription } from '#~/commands/descriptions.ts'
|
5
|
-
import { IS_WORKSPACE } from '#~/commands/meta.ts'
|
6
|
-
import { type } from '#~/utils/filterSupport.ts'
|
7
|
-
|
8
|
-
program
|
9
|
-
.name('jk/jiek')
|
10
|
-
.version(pkg.version)
|
11
|
-
.description(`${pkg.description} - Version ${pkg.version}`)
|
12
|
-
.option('--root <root>', 'The root path of the project')
|
13
|
-
.option('-c, --config-path <configPath>', 'Custom jiek config path')
|
14
|
-
|
15
|
-
if (type !== '' && IS_WORKSPACE) {
|
16
|
-
program
|
17
|
-
.option('-f, --filter <filter>', filterDescription)
|
18
|
-
}
|