@mai0313/go_template 0.1.14 → 0.1.19

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
@@ -3,6 +3,8 @@
3
3
  # Go Project Template
4
4
 
5
5
  [![Go](https://img.shields.io/badge/Go-1.24+-00ADD8?logo=go&logoColor=white)](https://go.dev/dl/)
6
+ [![npm version](https://img.shields.io/npm/v/@mai0313/go_template?logo=npm&style=flat-square&color=CB3837)](https://www.npmjs.com/package/@mai0313/go_template)
7
+ [![npm downloads](https://img.shields.io/npm/dt/@mai0313/go_template?logo=npm&style=flat-square)](https://www.npmjs.com/package/@mai0313/go_template)
6
8
  [![tests](https://github.com/Mai0313/go_template/actions/workflows/test.yml/badge.svg)](.github/workflows/test.yml)
7
9
  [![code-quality](https://github.com/Mai0313/go_template/actions/workflows/code-quality-check.yml/badge.svg)](https://github.com/Mai0313/go_template/actions/workflows/code-quality-check.yml)
8
10
  [![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit)](https://github.com/pre-commit/pre-commit)
@@ -50,11 +52,51 @@ Run the example CLI:
50
52
  ./build/go_template --version
51
53
  ```
52
54
 
53
- Use as a template:
55
+ ## Using as a Template
54
56
 
55
- 1. Click Use this template to create your repository
56
- 2. Replace module name in `go.mod` as needed
57
- 3. Rename the command under `cmd/` if you want a different binary name
57
+ **IMPORTANT**: This is a template, not a library. You must rename `go_template` to your project name.
58
+
59
+ ### Quick Setup
60
+
61
+ 1. Click **Use this template** to create your repository
62
+ 2. Clone your new repository
63
+ 3. Run the rename script or follow manual steps below
64
+
65
+ ### Manual Rename Steps
66
+
67
+ **Required changes** (replace `{your_project}` with your actual project name):
68
+
69
+ 1. **Go Module**:
70
+
71
+ - Update `go.mod`: `module go_template` → `module {your_project}`
72
+ - Rename `cmd/go_template/` → `cmd/{your_project}/`
73
+ - Update imports in `cmd/{your_project}/main.go`
74
+ - Update `Makefile` LDFLAGS (lines 17-19) and `BIN_NAME` (line 23)
75
+
76
+ 2. **CLI Wrappers** (if using npm/PyPI distribution):
77
+
78
+ - Node.js: Update `cli/nodejs/package.json` and `cli/nodejs/bin/start.js`
79
+ - Python: Update `cli/python/pyproject.toml` and rename `cli/python/src/go_template/`
80
+
81
+ 3. **Docker**:
82
+
83
+ - Update `docker/Dockerfile` labels and binary paths
84
+ - Update `.devcontainer/Dockerfile` labels
85
+
86
+ 4. **Documentation**:
87
+
88
+ - Update badge URLs in `README.md`, `README.zh-CN.md`, `README.zh-TW.md`
89
+ - Update `.github/CODEOWNERS`
90
+
91
+ **Verification**:
92
+
93
+ ```bash
94
+ make clean && make build
95
+ ./build/{your_project} --version
96
+ grep -r "go_template" --exclude-dir=.git --exclude-dir=build .
97
+ ```
98
+
99
+ For detailed instructions, see [.github/copilot-instructions.md](.github/copilot-instructions.md).
58
100
 
59
101
  ## Project Structure
60
102
 
package/README.zh-CN.md CHANGED
@@ -3,6 +3,8 @@
3
3
  # Go 项目模板
4
4
 
5
5
  [![Go](https://img.shields.io/badge/Go-1.24+-00ADD8?logo=go&logoColor=white)](https://go.dev/dl/)
6
+ [![npm version](https://img.shields.io/npm/v/@mai0313/go_template?logo=npm&style=flat-square&color=CB3837)](https://www.npmjs.com/package/@mai0313/go_template)
7
+ [![npm downloads](https://img.shields.io/npm/dt/@mai0313/go_template?logo=npm&style=flat-square)](https://www.npmjs.com/package/@mai0313/go_template)
6
8
  [![tests](https://github.com/Mai0313/go_template/actions/workflows/test.yml/badge.svg)](.github/workflows/test.yml)
7
9
  [![code-quality](https://github.com/Mai0313/go_template/actions/workflows/code-quality-check.yml/badge.svg)](https://github.com/Mai0313/go_template/actions/workflows/code-quality-check.yml)
8
10
  [![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit)](https://github.com/pre-commit/pre-commit)
@@ -50,11 +52,51 @@ make build-all # 交叉编译常见 OS/ARCH
50
52
  ./build/go_template --version
51
53
  ```
52
54
 
53
- 作为模板使用:
55
+ ## 作为模板使用
54
56
 
55
- 1. 点击“使用此模板”创建你的仓库
56
- 2. 按需修改 `go.mod` 的 module 名称
57
- 3. 若需更换二进制名称,调整 `cmd/` 目录结构
57
+ **重要提示**:这是一个模板,不是库。你必须将 `go_template` 重命名为你的项目名称。
58
+
59
+ ### 快速设置
60
+
61
+ 1. 点击 **使用此模板** 创建你的仓库
62
+ 2. 克隆你的新仓库
63
+ 3. 运行重命名脚本或按照下方手动步骤操作
64
+
65
+ ### 手动重命名步骤
66
+
67
+ **必需修改**(将 `{your_project}` 替换为你的实际项目名称):
68
+
69
+ 1. **Go 模块**:
70
+
71
+ - 更新 `go.mod`:`module go_template` → `module {your_project}`
72
+ - 重命名 `cmd/go_template/` → `cmd/{your_project}/`
73
+ - 更新 `cmd/{your_project}/main.go` 中的导入
74
+ - 更新 `Makefile` 的 LDFLAGS(第17-19行)和 `BIN_NAME`(第23行)
75
+
76
+ 2. **CLI 包装器**(如果使用 npm/PyPI 分发):
77
+
78
+ - Node.js:更新 `cli/nodejs/package.json` 和 `cli/nodejs/bin/start.js`
79
+ - Python:更新 `cli/python/pyproject.toml` 并重命名 `cli/python/src/go_template/`
80
+
81
+ 3. **Docker**:
82
+
83
+ - 更新 `docker/Dockerfile` 标签和二进制路径
84
+ - 更新 `.devcontainer/Dockerfile` 标签
85
+
86
+ 4. **文档**:
87
+
88
+ - 更新 `README.md`、`README.zh-CN.md`、`README.zh-TW.md` 中的徽章 URL
89
+ - 更新 `.github/CODEOWNERS`
90
+
91
+ **验证**:
92
+
93
+ ```bash
94
+ make clean && make build
95
+ ./build/{your_project} --version
96
+ grep -r "go_template" --exclude-dir=.git --exclude-dir=build .
97
+ ```
98
+
99
+ 详细说明请参见 [.github/copilot-instructions.md](.github/copilot-instructions.md)。
58
100
 
59
101
  ## 项目结构
60
102
 
package/README.zh-TW.md CHANGED
@@ -3,6 +3,8 @@
3
3
  # Go 專案模板
4
4
 
5
5
  [![Go](https://img.shields.io/badge/Go-1.24+-00ADD8?logo=go&logoColor=white)](https://go.dev/dl/)
6
+ [![npm version](https://img.shields.io/npm/v/@mai0313/go_template?logo=npm&style=flat-square&color=CB3837)](https://www.npmjs.com/package/@mai0313/go_template)
7
+ [![npm downloads](https://img.shields.io/npm/dt/@mai0313/go_template?logo=npm&style=flat-square)](https://www.npmjs.com/package/@mai0313/go_template)
6
8
  [![tests](https://github.com/Mai0313/go_template/actions/workflows/test.yml/badge.svg)](.github/workflows/test.yml)
7
9
  [![code-quality](https://github.com/Mai0313/go_template/actions/workflows/code-quality-check.yml/badge.svg)](https://github.com/Mai0313/go_template/actions/workflows/code-quality-check.yml)
8
10
  [![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit)](https://github.com/pre-commit/pre-commit)
@@ -50,11 +52,51 @@ make build-all # 跨平台編譯常見 OS/ARCH
50
52
  ./build/go_template --version
51
53
  ```
52
54
 
53
- 作為模板使用:
55
+ ## 作為模板使用
54
56
 
55
- 1. 點擊「使用此模板」建立你的倉庫
56
- 2. 視需求修改 `go.mod` 的 module 名稱
57
- 3. 若要更換二進位名稱,請調整 `cmd/` 目錄結構
57
+ **重要提示**:這是一個模板,不是函式庫。你必須將 `go_template` 重新命名為你的專案名稱。
58
+
59
+ ### 快速設定
60
+
61
+ 1. 點擊 **使用此模板** 建立你的倉庫
62
+ 2. 複製你的新倉庫
63
+ 3. 執行重新命名腳本或按照下方手動步驟操作
64
+
65
+ ### 手動重新命名步驟
66
+
67
+ **必要修改**(將 `{your_project}` 替換為你的實際專案名稱):
68
+
69
+ 1. **Go 模組**:
70
+
71
+ - 更新 `go.mod`:`module go_template` → `module {your_project}`
72
+ - 重新命名 `cmd/go_template/` → `cmd/{your_project}/`
73
+ - 更新 `cmd/{your_project}/main.go` 中的匯入
74
+ - 更新 `Makefile` 的 LDFLAGS(第17-19行)和 `BIN_NAME`(第23行)
75
+
76
+ 2. **CLI 包裝器**(如果使用 npm/PyPI 發佈):
77
+
78
+ - Node.js:更新 `cli/nodejs/package.json` 和 `cli/nodejs/bin/start.js`
79
+ - Python:更新 `cli/python/pyproject.toml` 並重新命名 `cli/python/src/go_template/`
80
+
81
+ 3. **Docker**:
82
+
83
+ - 更新 `docker/Dockerfile` 標籤和二進位路徑
84
+ - 更新 `.devcontainer/Dockerfile` 標籤
85
+
86
+ 4. **文件**:
87
+
88
+ - 更新 `README.md`、`README.zh-CN.md`、`README.zh-TW.md` 中的徽章 URL
89
+ - 更新 `.github/CODEOWNERS`
90
+
91
+ **驗證**:
92
+
93
+ ```bash
94
+ make clean && make build
95
+ ./build/{your_project} --version
96
+ grep -r "go_template" --exclude-dir=.git --exclude-dir=build .
97
+ ```
98
+
99
+ 詳細說明請參見 [.github/copilot-instructions.md](.github/copilot-instructions.md)。
58
100
 
59
101
  ## 專案結構
60
102
 
Binary file
Binary file
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mai0313/go_template",
3
- "version": "0.1.14",
3
+ "version": "0.1.19",
4
4
  "description": "A production-ready Go project template to bootstrap new projects fast. It includes a clean Go module layout, Docker, and a complete CI/CD suite.",
5
5
  "author": "Wei Lee <mai@mai0313.com>",
6
6
  "license": "MIT",
@@ -40,6 +40,8 @@
40
40
  "files": [
41
41
  "bin/",
42
42
  "binaries/",
43
- "README.md"
43
+ "README.md",
44
+ "README.zh-CN.md",
45
+ "README.zh-TW.md"
44
46
  ]
45
47
  }