koa3-cli 1.0.3 → 1.0.4

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
@@ -38,7 +38,7 @@ npm run dev
38
38
  ## 项目结构
39
39
 
40
40
  ```
41
- koa2-cli/
41
+ koa3-cli/
42
42
  ├── app/ # 应用代码目录
43
43
  │ ├── controller/ # 控制器目录
44
44
  │ │ ├── home.js # 首页控制器
@@ -99,18 +99,6 @@ npm start
99
99
  - API 示例: http://localhost:3000/api/user
100
100
  - 文档: http://localhost:3000/index.html
101
101
 
102
- ### 文档开发
103
-
104
- 启动 VuePress 文档开发服务器:
105
- ```bash
106
- npm run docs:dev
107
- ```
108
-
109
- 构建文档为静态文件:
110
- ```bash
111
- npm run docs:build
112
- ```
113
-
114
102
  ## 环境配置
115
103
 
116
104
  项目支持多环境配置,通过 `NODE_ENV` 环境变量控制:
@@ -196,8 +184,8 @@ router.get('/api/product', productController.list);
196
184
 
197
185
  ## 技术栈
198
186
 
199
- - **Koa2**: Web 框架
200
- - **koa-router**: 路由
187
+ - **Koa3**: Web 框架
188
+ - **@koa/router**: 路由
201
189
  - **koa-bodyparser**: 请求体解析
202
190
  - **koa-static**: 静态资源服务
203
191
  - **koa-views**: 模板引擎支持
@@ -7,7 +7,7 @@ class HomeController {
7
7
  */
8
8
  async index(ctx) {
9
9
  ctx.body = {
10
- message: 'Welcome to Koa2 CLI',
10
+ message: 'Welcome to Koa3 CLI',
11
11
  version: '1.0.0',
12
12
  timestamp: new Date().toISOString()
13
13
  };
package/app.js CHANGED
@@ -1,5 +1,4 @@
1
1
  const Koa = require('koa');
2
- const { Router } = require('@koa/router');
3
2
  const bodyParser = require('koa-bodyparser');
4
3
  const static = require('koa-static');
5
4
  const views = require('@ladjs/koa-views');
@@ -33,7 +32,7 @@ const router = require('./app/router');
33
32
  const app = new Koa();
34
33
 
35
34
  // 应用配置
36
- app.keys = config.keys || ['koa2-cli-secret-key'];
35
+ app.keys = config.keys || ['koa3-cli-secret-key'];
37
36
 
38
37
  // 静态资源
39
38
  if (config.static && config.static.enable !== false) {
@@ -4,7 +4,7 @@
4
4
  */
5
5
  module.exports = {
6
6
  // 应用名称
7
- name: 'koa2-cli',
7
+ name: 'koa3-cli',
8
8
 
9
9
  // 运行环境: development, production, test
10
10
  env: process.env.NODE_ENV || 'development',
@@ -13,7 +13,7 @@ module.exports = {
13
13
  port: process.env.PORT || 3000,
14
14
 
15
15
  // 密钥,用于加密cookie等
16
- keys: process.env.KEYS ? process.env.KEYS.split(',') : ['koa2-cli-secret-key'],
16
+ keys: process.env.KEYS ? process.env.KEYS.split(',') : ['koa3-cli-secret-key'],
17
17
 
18
18
  // 静态资源配置
19
19
  static: {
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "koa3-cli",
3
- "version": "1.0.3",
3
+ "version": "1.0.4",
4
4
  "description": "Koa3脚手架",
5
5
  "main": "app.js",
6
6
  "bin": {
7
- "koa3-cli": "./bin/cli.js"
7
+ "koa3-cli": "bin/cli.js"
8
8
  },
9
9
  "preferGlobal": true,
10
10
  "scripts": {