nsbp-cli 0.2.35 → 0.2.38

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
@@ -147,7 +147,7 @@ node ./bin/nsbp.js --help # Test CLI locally
147
147
 
148
148
  - **Package Name**: `nsbp-cli`
149
149
  - **Bin Command**: `nsbp` (install globally and run `nsbp --help`)
150
- - **Version**: `0.2.35`
150
+ - **Version**: `0.2.38`
151
151
  - **Dependencies**: chalk, commander, fs-extra, inquirer
152
152
  - **Package Manager**: Uses pnpm (also compatible with npm)
153
153
  - **Node Version**: >=16.0.0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nsbp-cli",
3
- "version": "0.2.35",
3
+ "version": "0.2.38",
4
4
  "description": "CLI tool for creating NSBP (Node React SSR by Webpack) projects",
5
5
  "main": "index.js",
6
6
  "homepage": "https://nsbp.erishen.cn/",
@@ -8,12 +8,24 @@
8
8
  ![React](https://img.shields.io/badge/React-19.x-61DAFB?style=flat-square&logo=react)
9
9
  ![TypeScript](https://img.shields.io/badge/TypeScript-5.x-3178C6?style=flat-square&logo=typescript)
10
10
  ![Downloads](https://img.shields.io/npm/dm/nsbp-cli?style=flat-square)
11
- ![GitHub Issues](https://img.shields.io/github/issues/erishen/nsbp?style=flat-square&logo=github)
12
- ![Last Commit](https://img.shields.io/github/last-commit/erishen/nsbp?style=flat-square&logo=github)
13
- ![Maintenance](https://img.shields.io/maintenance/yes/2025?style=flat-square)
11
+ [![GitHub Issues](https://img.shields.io/github/issues/erishen/nsbp?style=flat-square&logo=github)](https://github.com/erishen/nsbp/issues)
12
+ [![GitHub Forks](https://img.shields.io/github/forks/erishen/nsbp?style=flat-square&logo=github)](https://github.com/erishen/nsbp/network/members)
13
+ [![GitHub Stars](https://img.shields.io/github/stars/erishen/nsbp?style=flat-square&logo=github)](https://github.com/erishen/nsbp/stargazers)
14
+ [![Last Commit](https://img.shields.io/github/last-commit/erishen/nsbp?style=flat-square&logo=github)](https://github.com/erishen/nsbp/commits/main)
15
+ [![Maintenance](https://img.shields.io/maintenance/yes/2025?style=flat-square)](https://github.com/erishen/nsbp)
14
16
 
15
17
  🌐 **Online Demo**: [https://nsbp.erishen.cn/](https://nsbp.erishen.cn/)
16
18
 
19
+ [![Star on GitHub](https://img.shields.io/badge/Star-⭐-gold?style=flat-square)](https://github.com/erishen/nsbp)
20
+
21
+ </div>
22
+
23
+ ## 📚 文档
24
+
25
+ - [更新日志](./CHANGELOG.md) - 查看版本更新记录
26
+ - [贡献指南](./CONTRIBUTING.md) - 如何参与贡献
27
+ - [行为准则](./CODE_OF_CONDUCT.md) - 社区行为规范
28
+
17
29
  </div>
18
30
 
19
31
  ## 🚀 快速开始
@@ -361,12 +373,7 @@ ENABLE_RATE_LIMIT=1 pnpm start
361
373
  - [ ] 静态文件访问已测试
362
374
  - [ ] CSP 策略已测试(检查控制台错误)
363
375
 
364
- ### CLI 发布
365
-
366
- 从项目根目录发布 CLI 到 npm 注册表:
367
376
 
368
- ```bash
369
- make publish-cli # 同步模板、更新版本、发布到 npm
370
- ```
377
+ ---
371
378
 
372
- 注意:此命令仅在项目根目录可用,生成的 NSBP 项目不包含此目标。
379
+ 如有问题,请参考 [NSBP 文档](https://github.com/erishen/nsbp)。
@@ -29,7 +29,9 @@ module.exports = [
29
29
  'webpack.server.js',
30
30
  '.prettierrc.js',
31
31
  'cli/**',
32
- 'scripts/**'
32
+ 'scripts/**',
33
+ 'jest.setup.*',
34
+ 'jest.config.*'
33
35
  ]
34
36
  },
35
37
  {
@@ -18,7 +18,7 @@
18
18
  "format": "prettier --write **/*.{js,css,less,scss,ts,tsx}",
19
19
  "lint": "eslint src --ext .ts,.tsx,.js,.jsx",
20
20
  "lint:fix": "eslint src --ext .ts,.tsx,.js,.jsx --fix",
21
- "test": "echo \"Error: no test specified\" && exit 1",
21
+ "test": "jest",
22
22
  "prepare": "husky"
23
23
  },
24
24
  "keywords": [
@@ -63,10 +63,17 @@
63
63
  "@babel/plugin-transform-optional-chaining": "^7.25.0",
64
64
  "@babel/preset-env": "^7.25.0",
65
65
  "@babel/preset-react": "^7.24.0",
66
+ "@babel/preset-typescript": "^7.25.0",
66
67
  "@eslint/js": "^9.39.2",
68
+ "@jest/globals": "^30.2.0",
67
69
  "@loadable/babel-plugin": "^5.13.2",
68
70
  "@loadable/webpack-plugin": "^5.15.0",
71
+ "@playwright/test": "^1.44.0",
72
+ "@testing-library/jest-dom": "^6.4.2",
73
+ "@testing-library/react": "^15.0.0",
74
+ "@testing-library/user-event": "^14.5.2",
69
75
  "@types/express": "^5.0.6",
76
+ "@types/jest": "^30.0.0",
70
77
  "@types/loadable__component": "^5.13.3",
71
78
  "@types/loadable__server": "^5.12.5",
72
79
  "@types/lodash": "^4.17.15",
@@ -95,6 +102,8 @@
95
102
  "globals": "^17.0.0",
96
103
  "html-webpack-plugin": "^5.6.0",
97
104
  "husky": "^9.0.0",
105
+ "jest": "^29.7.0",
106
+ "jest-environment-jsdom": "^29.7.0",
98
107
  "less": "^4.2.0",
99
108
  "less-loader": "^12.0.0",
100
109
  "lint-staged": "^15.0.0",
@@ -109,6 +118,7 @@
109
118
  "sass-loader": "^16.0.0",
110
119
  "style-loader": "^4.0.0",
111
120
  "terser-webpack-plugin": "^5.3.0",
121
+ "ts-jest": "^29.1.2",
112
122
  "ts-loader": "^9.5.0",
113
123
  "typescript": "^5.0.0",
114
124
  "typescript-loadable-components-plugin": "^1.0.2",
@@ -0,0 +1,5 @@
1
+ describe('Simple test', () => {
2
+ it('should work', () => {
3
+ expect(1 + 1).toBe(2)
4
+ })
5
+ })
@@ -3,7 +3,7 @@
3
3
  "target": "esnext",
4
4
  "lib": ["es5", "es6", "dom"],
5
5
  "module": "esnext",
6
- "moduleResolution": "node",
6
+ "moduleResolution": "bundler",
7
7
  "resolveJsonModule": true,
8
8
  "removeComments": false,
9
9
  "jsx": "react",
@@ -14,7 +14,6 @@
14
14
  "esModuleInterop": true,
15
15
  "preserveConstEnums": true,
16
16
  "skipLibCheck": true,
17
- "baseUrl": ".",
18
17
  "paths": {
19
18
  "@/*": ["./src/*"],
20
19
  "@components/*": ["./src/component/*"],