@tyyyho/treg 0.1.15 → 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 CHANGED
@@ -1,9 +1,15 @@
1
1
  # @tyyyho/treg
2
2
 
3
- [繁體中文 README](./README.zh-hant.md)
3
+ `treg` is a CLI for applying tooling standards in existing repositories.
4
4
 
5
- `treg` is a CLI for quickly setting up project tooling conventions in an existing repository.
6
- It applies infra setup such as lint, format, TypeScript, test, husky, and AI skill guidance.
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
- ```bash
23
- npx @tyyyho/treg <command> [options]
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-detected framework:
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 override:
34
+ Initialize with explicit framework:
66
35
 
67
36
  ```bash
68
37
  npx @tyyyho/treg init --framework react
69
38
  ```
70
39
 
71
- Add only lint + format:
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 instead of prettier:
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/test setup to keep existing project rules untouched:
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
- Use Vitest for test feature:
58
+ Preview only:
90
59
 
91
60
  ```bash
92
- npx @tyyyho/treg init --framework node --features test --test-runner vitest
61
+ npx @tyyyho/treg init --dry-run
93
62
  ```
94
63
 
95
- Preview changes only:
96
-
97
- ```bash
98
- npx @tyyyho/treg init --framework react --dry-run
99
- ```
100
-
101
- Update AI skill guidance:
102
-
103
- ```bash
104
- npx @tyyyho/treg add --features lint,format,husky
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
- 預設搭建基礎設定,包含 lint、format、TypeScript、test、husky、skills。
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
- `init` 會依照依賴自動偵測 framework。
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
- - `husky`
52
- - `typescript`
53
- - `lint`
54
- - `format`
55
- - `test`
39
+ - `init`:依賴自動偵測 framework 並套用基礎規範。
40
+ - `add`:只套用指定 features。
41
+ - `list`:列出支援的 framework、feature、formatter、test runner。
56
42
 
57
- ## 使用範例
43
+ ## 常見用法
58
44
 
59
- 依賴自動偵測 framework 初始化:
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
- 只安裝 lint + format:
57
+ 只套用 lint + format:
72
58
 
73
59
  ```bash
74
60
  npx @tyyyho/treg add --features lint,format
75
61
  ```
76
62
 
77
- 改用 oxfmt(不使用 prettier):
63
+ format 改用 `oxfmt`:
78
64
 
79
65
  ```bash
80
66
  npx @tyyyho/treg add --features format --formatter oxfmt
81
67
  ```
82
68
 
83
- 若要保留既有設定,可跳過 format/test 安裝:
69
+ 保留既有設定,跳過 format/test
84
70
 
85
71
  ```bash
86
72
  npx @tyyyho/treg add --no-format --no-test-runner
87
73
  ```
88
74
 
89
- test feature 使用 Vitest:
75
+ 只預覽計畫不寫檔:
90
76
 
91
77
  ```bash
92
- npx @tyyyho/treg init --framework node --features test --test-runner vitest
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 --dry-run
84
+ npx @tyyyho/treg init --framework react --dir ./packages/web
99
85
  ```
100
86
 
101
- 更新 AI skills 指引:
87
+ ## 重要預設
102
88
 
103
- ```bash
104
- npx @tyyyho/treg add --features lint,format,husky
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
- npx @tyyyho/treg init --framework react --dir ./packages/web
131
+ pnpm release patch
111
132
  ```
112
133
 
113
- ## 注意事項
134
+ 支援目標:
114
135
 
115
- - `init` 會依 repo 依賴自動偵測 framework。
116
- - 偵測順序:`nuxt -> next -> react -> vue -> svelte -> node`。
117
- - 預設測試工具為:`vue`/`nuxt` 使用 `vitest`,其他 framework 使用 `jest`。
118
- - 預設 formatter 為 `prettier`(可用 `--formatter oxfmt` 覆寫)。
119
- - 可透過 `--no-format` 與 `--no-test-runner` 跳過對 format/test 的設定,避免覆寫既有專案規則。
120
- - `add` 可只安裝你指定的 features。
121
- - 每個 framework 僅提供單一穩定設定,不支援 `--framework-version` 版本變體。
122
- - `--dry-run` 會輸出完整計畫且不寫入任何檔案。
136
+ - `patch`
137
+ - `minor`
138
+ - `major`
139
+ - `prepatch`
140
+ - `preminor`
141
+ - `premajor`
142
+ - `prerelease`
143
+ - 指定版本(`x.y.z`)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tyyyho/treg",
3
- "version": "0.1.15",
3
+ "version": "0.1.16",
4
4
  "description": "CLI tool for initializing development conventions in existing projects.",
5
5
  "license": "MIT",
6
6
  "repository": {