Skip to content

Commit 017b695

Browse files
committed
docs: pnpm install
1 parent 3048488 commit 017b695

File tree

1 file changed

+54
-50
lines changed

1 file changed

+54
-50
lines changed

README.md

+54-50
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ pnpm install
2424

2525
接下来下面所有的示例链接都基于 `username/subscription`, 请自行替换后打开
2626

27+
`pnpm install` 用于安装依赖, 如果您的 [./package.json](./package.json) 发生变化, 则需要再次运行 `pnpm install`
28+
2729
如果您无法初始化 nodejs 环境, 那可以直接使用 github 网页编辑文件后在线提交, 点击下面链接即可在线编辑
2830

2931
<https://github.com/username/subscription/edit/main/src/subscription.ts>
@@ -45,56 +47,6 @@ pnpm install
4547

4648
另外您必须修改 订阅详情 [./src/subscription.ts](./src/subscription.ts) 下的 id 字段, 否则可能会和其它订阅冲突, 填一个较大的随机数字即可
4749

48-
## 配置文件
49-
50-
你可以在 [./package.json](./package.json) 下添加 gkd 属性配置自定义构建选项
51-
52-
```json
53-
{
54-
"gkd": {
55-
"outDir": "dist",
56-
"file": "gkd.json5",
57-
"versionFile": "gkd.version.json5",
58-
"changelog": "CHANGELOG.md",
59-
"README.md": "README.md"
60-
}
61-
}
62-
```
63-
64-
这个 gkd 属性的类型如下
65-
66-
```ts
67-
/**
68-
* @default package.json.gkd
69-
*/
70-
type GkdConfig = {
71-
/**
72-
* @default 'dist'
73-
*/
74-
outDir?: string;
75-
/**
76-
* @default 'gkd.json5'
77-
*/
78-
file?: string;
79-
/**
80-
* @default 'gkd.version.json5'
81-
*/
82-
versionFile?: string;
83-
/**
84-
* @default 'CHANGELOG.md'
85-
*/
86-
changelog?: string;
87-
/**
88-
* @default 'README.md'
89-
*/
90-
readme?: string;
91-
};
92-
```
93-
94-
如果不想写配置文件, 也可以将这个参数直接传递给 `@gkd-kit/tools``updateDist` 函数
95-
96-
手动传递参数的时候, 你必须显式将路径(非文件名)参数传递给 [./.github/workflows/build_release.yml](./.github/workflows/build_release.yml) 下的 `updatePkgVersion``stdoutGkdVersion` 函数
97-
9850
## 格式修复
9951

10052
我们使用 [prettier](https://github.com/prettier/prettier) 来格式化代码 和 [eslint](https://github.com/eslint/eslint) 来检测并修复代码错误
@@ -166,3 +118,55 @@ https://registry.npmmirror.com/gkd-subscription-xxxx/latest/files/dist/gkd.json5
166118
```
167119

168120
注: 将 gkd-subscription-xxxx 换成您的包名
121+
122+
## 自定义配置文件
123+
124+
注意: **大多数情况下, 你不需要自定义, 使用默认配置时, 下面此节教程无需了解**
125+
126+
你可以在 [./package.json](./package.json) 下添加 gkd 属性配置自定义构建选项
127+
128+
```json
129+
{
130+
"gkd": {
131+
"outDir": "dist",
132+
"file": "gkd.json5",
133+
"versionFile": "gkd.version.json5",
134+
"changelog": "CHANGELOG.md",
135+
"README.md": "README.md"
136+
}
137+
}
138+
```
139+
140+
这个 gkd 属性的类型如下
141+
142+
```ts
143+
/**
144+
* @default package.json.gkd
145+
*/
146+
type GkdConfig = {
147+
/**
148+
* @default 'dist'
149+
*/
150+
outDir?: string;
151+
/**
152+
* @default 'gkd.json5'
153+
*/
154+
file?: string;
155+
/**
156+
* @default 'gkd.version.json5'
157+
*/
158+
versionFile?: string;
159+
/**
160+
* @default 'CHANGELOG.md'
161+
*/
162+
changelog?: string;
163+
/**
164+
* @default 'README.md'
165+
*/
166+
readme?: string;
167+
};
168+
```
169+
170+
如果不想写配置文件, 也可以将这个参数直接传递给 `@gkd-kit/tools``updateDist` 函数
171+
172+
手动传递参数的时候, 你必须显式将路径(非文件名)参数传递给 [./.github/workflows/build_release.yml](./.github/workflows/build_release.yml) 下的 `updatePkgVersion``stdoutGkdVersion` 函数

0 commit comments

Comments
 (0)