@tyyyho/treg 0.1.14 → 0.1.16
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 +37 -78
- package/README.npm.md +81 -0
- package/README.zh-hant.md +84 -63
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
# @tyyyho/treg
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
`treg` is a CLI for applying tooling standards in existing repositories.
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
It sets up infrastructure only:
|
|
6
|
+
|
|
7
|
+
- lint
|
|
8
|
+
- format
|
|
9
|
+
- TypeScript
|
|
10
|
+
- test
|
|
11
|
+
- husky
|
|
12
|
+
- AI skill guidance
|
|
7
13
|
|
|
8
14
|
## Quick Start
|
|
9
15
|
|
|
@@ -11,112 +17,65 @@ It applies infra setup such as lint, format, TypeScript, test, husky, and AI ski
|
|
|
11
17
|
npx @tyyyho/treg init
|
|
12
18
|
```
|
|
13
19
|
|
|
14
|
-
```bash
|
|
15
|
-
pnpm dlx @tyyyho/treg init
|
|
16
|
-
```
|
|
17
|
-
|
|
18
|
-
`init` auto-detects framework from dependencies.
|
|
19
|
-
|
|
20
20
|
## Commands
|
|
21
21
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
- `init`: Initialize infra rules (framework auto-detected from dependencies)
|
|
27
|
-
- `add`: Add selected infra features to an existing project
|
|
28
|
-
- `list`: List supported frameworks, features, formatters, and test runners
|
|
29
|
-
|
|
30
|
-
## Options
|
|
31
|
-
|
|
32
|
-
- `--framework <node|react|next|vue|svelte|nuxt>`: Optional framework override
|
|
33
|
-
- `--features <lint,format,typescript,test,husky>`: Features to install (defaults to all)
|
|
34
|
-
- `--no-format`: Skip format feature setup and avoid changing format configs/scripts
|
|
35
|
-
- `--no-test-runner`: Skip test feature setup and avoid changing test runner/config
|
|
36
|
-
- `--dir <path>`: Target directory (defaults to current directory)
|
|
37
|
-
- `--formatter <prettier|oxfmt>`: Formatter for format feature (default: `prettier`)
|
|
38
|
-
- `--test-runner <jest|vitest>`: Optional test runner override when test feature is enabled
|
|
39
|
-
- `--pm <pnpm|npm|yarn|auto>`: Package manager (auto-detected by default)
|
|
40
|
-
- `--force`: Overwrite existing config files
|
|
41
|
-
- `--dry-run`: Print full plan without writing files
|
|
42
|
-
- `--skip-husky-install`: Skip husky install command
|
|
43
|
-
- `--skills`: Update existing `CLAUDE.md`/`AGENTS.md`/`GEMINI.md` with skill guidance (enabled by default)
|
|
44
|
-
- `--no-skills`: Disable skill guidance updates
|
|
45
|
-
- `--help`: Show help
|
|
46
|
-
|
|
47
|
-
## Features
|
|
48
|
-
|
|
49
|
-
Default feature set:
|
|
50
|
-
|
|
51
|
-
- `husky`
|
|
52
|
-
- `typescript`
|
|
53
|
-
- `lint`
|
|
54
|
-
- `format`
|
|
55
|
-
- `test`
|
|
22
|
+
- `init`
|
|
23
|
+
- `add`
|
|
24
|
+
- `list`
|
|
56
25
|
|
|
57
|
-
## Examples
|
|
26
|
+
## Common Examples
|
|
58
27
|
|
|
59
|
-
Initialize with auto-
|
|
28
|
+
Initialize with auto-detection:
|
|
60
29
|
|
|
61
30
|
```bash
|
|
62
31
|
npx @tyyyho/treg init
|
|
63
32
|
```
|
|
64
33
|
|
|
65
|
-
Initialize with explicit framework
|
|
34
|
+
Initialize with explicit framework:
|
|
66
35
|
|
|
67
36
|
```bash
|
|
68
37
|
npx @tyyyho/treg init --framework react
|
|
69
38
|
```
|
|
70
39
|
|
|
71
|
-
|
|
40
|
+
Apply selected features:
|
|
72
41
|
|
|
73
42
|
```bash
|
|
74
43
|
npx @tyyyho/treg add --features lint,format
|
|
75
44
|
```
|
|
76
45
|
|
|
77
|
-
Use oxfmt
|
|
46
|
+
Use `oxfmt`:
|
|
78
47
|
|
|
79
48
|
```bash
|
|
80
49
|
npx @tyyyho/treg add --features format --formatter oxfmt
|
|
81
50
|
```
|
|
82
51
|
|
|
83
|
-
Skip format
|
|
52
|
+
Skip format and test setup:
|
|
84
53
|
|
|
85
54
|
```bash
|
|
86
55
|
npx @tyyyho/treg add --no-format --no-test-runner
|
|
87
56
|
```
|
|
88
57
|
|
|
89
|
-
|
|
58
|
+
Preview only:
|
|
90
59
|
|
|
91
60
|
```bash
|
|
92
|
-
npx @tyyyho/treg init --
|
|
61
|
+
npx @tyyyho/treg init --dry-run
|
|
93
62
|
```
|
|
94
63
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
```
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
64
|
+
## Key Options
|
|
65
|
+
|
|
66
|
+
```text
|
|
67
|
+
--framework <node|react|next|vue|svelte|nuxt>
|
|
68
|
+
--features <lint,format,typescript,test,husky>
|
|
69
|
+
--no-format
|
|
70
|
+
--no-test-runner
|
|
71
|
+
--formatter <prettier|oxfmt>
|
|
72
|
+
--test-runner <jest|vitest>
|
|
73
|
+
--pm <pnpm|npm|yarn|auto>
|
|
74
|
+
--dir <path>
|
|
75
|
+
--force
|
|
76
|
+
--dry-run
|
|
77
|
+
--skip-husky-install
|
|
78
|
+
--skills
|
|
79
|
+
--no-skills
|
|
80
|
+
--help
|
|
105
81
|
```
|
|
106
|
-
|
|
107
|
-
Target a different directory explicitly:
|
|
108
|
-
|
|
109
|
-
```bash
|
|
110
|
-
npx @tyyyho/treg init --framework react --dir ./packages/web
|
|
111
|
-
```
|
|
112
|
-
|
|
113
|
-
## Notes
|
|
114
|
-
|
|
115
|
-
- `init` auto-detects framework from repo dependencies.
|
|
116
|
-
- Detection order is `nuxt -> next -> react -> vue -> svelte -> node`.
|
|
117
|
-
- Default test runner is `vitest` for `vue`/`nuxt`, and `jest` for other frameworks.
|
|
118
|
-
- Default formatter is `prettier` (`--formatter oxfmt` to override).
|
|
119
|
-
- `--no-format` and `--no-test-runner` let you skip format/test setup to avoid overriding existing project config.
|
|
120
|
-
- `add` lets you install only the features you specify.
|
|
121
|
-
- Framework setup uses one stable config per framework (no `--framework-version` variants).
|
|
122
|
-
- `--dry-run` prints the full plan and does not write files.
|
package/README.npm.md
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
# @tyyyho/treg
|
|
2
|
+
|
|
3
|
+
`treg` is a CLI for applying tooling standards in existing repositories.
|
|
4
|
+
|
|
5
|
+
It sets up infrastructure only:
|
|
6
|
+
|
|
7
|
+
- lint
|
|
8
|
+
- format
|
|
9
|
+
- TypeScript
|
|
10
|
+
- test
|
|
11
|
+
- husky
|
|
12
|
+
- AI skill guidance
|
|
13
|
+
|
|
14
|
+
## Quick Start
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
npx @tyyyho/treg init
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Commands
|
|
21
|
+
|
|
22
|
+
- `init`
|
|
23
|
+
- `add`
|
|
24
|
+
- `list`
|
|
25
|
+
|
|
26
|
+
## Common Examples
|
|
27
|
+
|
|
28
|
+
Initialize with auto-detection:
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
npx @tyyyho/treg init
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Initialize with explicit framework:
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
npx @tyyyho/treg init --framework react
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
Apply selected features:
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
npx @tyyyho/treg add --features lint,format
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Use `oxfmt`:
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
npx @tyyyho/treg add --features format --formatter oxfmt
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Skip format and test setup:
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
npx @tyyyho/treg add --no-format --no-test-runner
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
Preview only:
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
npx @tyyyho/treg init --dry-run
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## Key Options
|
|
65
|
+
|
|
66
|
+
```text
|
|
67
|
+
--framework <node|react|next|vue|svelte|nuxt>
|
|
68
|
+
--features <lint,format,typescript,test,husky>
|
|
69
|
+
--no-format
|
|
70
|
+
--no-test-runner
|
|
71
|
+
--formatter <prettier|oxfmt>
|
|
72
|
+
--test-runner <jest|vitest>
|
|
73
|
+
--pm <pnpm|npm|yarn|auto>
|
|
74
|
+
--dir <path>
|
|
75
|
+
--force
|
|
76
|
+
--dry-run
|
|
77
|
+
--skip-husky-install
|
|
78
|
+
--skills
|
|
79
|
+
--no-skills
|
|
80
|
+
--help
|
|
81
|
+
```
|
package/README.zh-hant.md
CHANGED
|
@@ -2,8 +2,27 @@
|
|
|
2
2
|
|
|
3
3
|
[English README](./README.md)
|
|
4
4
|
|
|
5
|
-
`treg` 是一個用於既有專案的 CLI
|
|
6
|
-
|
|
5
|
+
`treg` 是一個用於既有專案的 CLI,可快速套用一致的工具鏈規範。
|
|
6
|
+
|
|
7
|
+
它只處理基礎設施設定:
|
|
8
|
+
|
|
9
|
+
- lint
|
|
10
|
+
- format
|
|
11
|
+
- TypeScript
|
|
12
|
+
- test
|
|
13
|
+
- husky
|
|
14
|
+
- AI skill 指引
|
|
15
|
+
|
|
16
|
+
## 為什麼用 treg
|
|
17
|
+
|
|
18
|
+
`treg` 可以在既有 repo 中快速建立一致的開發基線,避免每次手動重接工具。
|
|
19
|
+
|
|
20
|
+
適合用在:
|
|
21
|
+
|
|
22
|
+
- 快速補齊專案工具鏈
|
|
23
|
+
- 只套用部分 feature
|
|
24
|
+
- 需要可重跑且不破壞設定(`idempotent`)
|
|
25
|
+
- 先看完整計畫再寫檔(`--dry-run`)
|
|
7
26
|
|
|
8
27
|
## 快速開始
|
|
9
28
|
|
|
@@ -15,108 +34,110 @@ npx @tyyyho/treg init
|
|
|
15
34
|
pnpm dlx @tyyyho/treg init
|
|
16
35
|
```
|
|
17
36
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
## 指令
|
|
21
|
-
|
|
22
|
-
```bash
|
|
23
|
-
npx @tyyyho/treg <command> [options]
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
- `init`:初始化基礎規範(依賴自動偵測 framework)
|
|
27
|
-
- `add`:在既有專案中新增指定 feature
|
|
28
|
-
- `list`:列出支援的 framework、feature、formatter 與 test runner
|
|
29
|
-
|
|
30
|
-
## 參數
|
|
31
|
-
|
|
32
|
-
- `--framework <node|react|next|vue|svelte|nuxt>`:可選,手動覆寫 framework
|
|
33
|
-
- `--features <lint,format,typescript,test,husky>`:指定要安裝的 feature(預設全部)
|
|
34
|
-
- `--no-format`:略過 format feature,避免覆寫既有格式化設定與 scripts
|
|
35
|
-
- `--no-test-runner`:略過 test feature,避免覆寫既有測試 runner 與設定
|
|
36
|
-
- `--dir <path>`:指定目標目錄(預設為目前目錄)
|
|
37
|
-
- `--formatter <prettier|oxfmt>`:format feature 使用的 formatter(預設為 `prettier`)
|
|
38
|
-
- `--test-runner <jest|vitest>`:可選,啟用 test feature 時覆寫測試框架
|
|
39
|
-
- `--pm <pnpm|npm|yarn|auto>`:套件管理器(預設自動偵測)
|
|
40
|
-
- `--force`:覆寫既有設定檔
|
|
41
|
-
- `--dry-run`:輸出完整執行計畫,但不寫入檔案
|
|
42
|
-
- `--skip-husky-install`:略過 `husky install`
|
|
43
|
-
- `--skills`:更新既有 `CLAUDE.md`/`AGENTS.md`/`GEMINI.md` 的 skill 指引(預設啟用)
|
|
44
|
-
- `--no-skills`:停用 skill 指引更新
|
|
45
|
-
- `--help`:顯示說明
|
|
46
|
-
|
|
47
|
-
## Features
|
|
48
|
-
|
|
49
|
-
預設 feature 組合:
|
|
37
|
+
## 指令總覽
|
|
50
38
|
|
|
51
|
-
- `
|
|
52
|
-
- `
|
|
53
|
-
- `
|
|
54
|
-
- `format`
|
|
55
|
-
- `test`
|
|
39
|
+
- `init`:依賴自動偵測 framework 並套用基礎規範。
|
|
40
|
+
- `add`:只套用指定 features。
|
|
41
|
+
- `list`:列出支援的 framework、feature、formatter、test runner。
|
|
56
42
|
|
|
57
|
-
##
|
|
43
|
+
## 常見用法
|
|
58
44
|
|
|
59
|
-
|
|
45
|
+
自動偵測 framework 初始化:
|
|
60
46
|
|
|
61
47
|
```bash
|
|
62
48
|
npx @tyyyho/treg init
|
|
63
49
|
```
|
|
64
50
|
|
|
65
|
-
手動指定 framework
|
|
51
|
+
手動指定 framework:
|
|
66
52
|
|
|
67
53
|
```bash
|
|
68
54
|
npx @tyyyho/treg init --framework react
|
|
69
55
|
```
|
|
70
56
|
|
|
71
|
-
|
|
57
|
+
只套用 lint + format:
|
|
72
58
|
|
|
73
59
|
```bash
|
|
74
60
|
npx @tyyyho/treg add --features lint,format
|
|
75
61
|
```
|
|
76
62
|
|
|
77
|
-
改用 oxfmt
|
|
63
|
+
format 改用 `oxfmt`:
|
|
78
64
|
|
|
79
65
|
```bash
|
|
80
66
|
npx @tyyyho/treg add --features format --formatter oxfmt
|
|
81
67
|
```
|
|
82
68
|
|
|
83
|
-
|
|
69
|
+
保留既有設定,跳過 format/test:
|
|
84
70
|
|
|
85
71
|
```bash
|
|
86
72
|
npx @tyyyho/treg add --no-format --no-test-runner
|
|
87
73
|
```
|
|
88
74
|
|
|
89
|
-
|
|
75
|
+
只預覽計畫不寫檔:
|
|
90
76
|
|
|
91
77
|
```bash
|
|
92
|
-
npx @tyyyho/treg init --framework
|
|
78
|
+
npx @tyyyho/treg init --framework react --dry-run
|
|
93
79
|
```
|
|
94
80
|
|
|
95
|
-
|
|
81
|
+
指定目標目錄:
|
|
96
82
|
|
|
97
83
|
```bash
|
|
98
|
-
npx @tyyyho/treg init --framework react --
|
|
84
|
+
npx @tyyyho/treg init --framework react --dir ./packages/web
|
|
99
85
|
```
|
|
100
86
|
|
|
101
|
-
|
|
87
|
+
## 重要預設
|
|
102
88
|
|
|
103
|
-
|
|
104
|
-
|
|
89
|
+
framework 偵測順序:
|
|
90
|
+
|
|
91
|
+
`nuxt -> next -> react -> vue -> svelte -> node`
|
|
92
|
+
|
|
93
|
+
測試工具預設:
|
|
94
|
+
|
|
95
|
+
- `vue` / `nuxt`:`vitest`
|
|
96
|
+
- 其他:`jest`
|
|
97
|
+
|
|
98
|
+
formatter 預設:
|
|
99
|
+
|
|
100
|
+
- `prettier`(可用 `--formatter oxfmt` 覆寫)
|
|
101
|
+
|
|
102
|
+
## CLI 參數
|
|
103
|
+
|
|
104
|
+
```text
|
|
105
|
+
--framework <node|react|next|vue|svelte|nuxt>
|
|
106
|
+
--features <lint,format,typescript,test,husky>
|
|
107
|
+
--no-format
|
|
108
|
+
--no-test-runner
|
|
109
|
+
--dir <path>
|
|
110
|
+
--formatter <prettier|oxfmt>
|
|
111
|
+
--test-runner <jest|vitest>
|
|
112
|
+
--pm <pnpm|npm|yarn|auto>
|
|
113
|
+
--force
|
|
114
|
+
--dry-run
|
|
115
|
+
--skip-husky-install
|
|
116
|
+
--skills
|
|
117
|
+
--no-skills
|
|
118
|
+
--help
|
|
105
119
|
```
|
|
106
120
|
|
|
107
|
-
|
|
121
|
+
## AI Skills 行為
|
|
122
|
+
|
|
123
|
+
啟用 skills 時:
|
|
124
|
+
|
|
125
|
+
- 若 repo root 已存在 `CLAUDE.md`、`AGENTS.md`、`GEMINI.md`,會更新對應內容。
|
|
126
|
+
- 若檔案不存在,不會自動建立。
|
|
127
|
+
|
|
128
|
+
## 發布
|
|
108
129
|
|
|
109
130
|
```bash
|
|
110
|
-
|
|
131
|
+
pnpm release patch
|
|
111
132
|
```
|
|
112
133
|
|
|
113
|
-
|
|
134
|
+
支援目標:
|
|
114
135
|
|
|
115
|
-
- `
|
|
116
|
-
-
|
|
117
|
-
-
|
|
118
|
-
-
|
|
119
|
-
-
|
|
120
|
-
- `
|
|
121
|
-
-
|
|
122
|
-
-
|
|
136
|
+
- `patch`
|
|
137
|
+
- `minor`
|
|
138
|
+
- `major`
|
|
139
|
+
- `prepatch`
|
|
140
|
+
- `preminor`
|
|
141
|
+
- `premajor`
|
|
142
|
+
- `prerelease`
|
|
143
|
+
- 指定版本(`x.y.z`)
|