nsbp-cli 0.2.9 → 0.2.11

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
@@ -2,6 +2,8 @@
2
2
 
3
3
  Command-line interface for creating NSBP (Node React SSR by Webpack) projects.
4
4
 
5
+ 🌐 **Online Demo**: [https://nsbp.erishen.cn/](https://nsbp.erishen.cn/)
6
+
5
7
  📦 **Published on npm**: [https://www.npmjs.com/package/nsbp-cli](https://www.npmjs.com/package/nsbp-cli)
6
8
 
7
9
  ## Installation
@@ -145,7 +147,7 @@ node ./bin/nsbp.js --help # Test CLI locally
145
147
 
146
148
  - **Package Name**: `nsbp-cli`
147
149
  - **Bin Command**: `nsbp` (install globally and run `nsbp --help`)
148
- - **Version**: `0.2.9`
150
+ - **Version**: `0.2.11`
149
151
  - **Dependencies**: chalk, commander, fs-extra, inquirer
150
152
  - **Package Manager**: Uses pnpm (also compatible with npm)
151
153
  - **Node Version**: >=16.0.0
package/package.json CHANGED
@@ -1,8 +1,9 @@
1
1
  {
2
2
  "name": "nsbp-cli",
3
- "version": "0.2.9",
3
+ "version": "0.2.11",
4
4
  "description": "CLI tool for creating NSBP (Node React SSR by Webpack) projects",
5
5
  "main": "index.js",
6
+ "homepage": "https://nsbp.erishen.cn/",
6
7
  "files": [
7
8
  "bin/**/*",
8
9
  "templates/**/*",
@@ -37,7 +38,6 @@
37
38
  "bugs": {
38
39
  "url": "https://github.com/erishen/nsbp/issues"
39
40
  },
40
- "homepage": "https://github.com/erishen/nsbp#readme",
41
41
  "dependencies": {
42
42
  "chalk": "^4.1.2",
43
43
  "commander": "^11.0.0",
@@ -21,8 +21,8 @@ RUN npm run build
21
21
  # Stage 2: Production
22
22
  FROM node:20-alpine AS production
23
23
 
24
- # Install dumb-init for proper signal handling
25
- RUN apk add --no-cache dumb-init
24
+ # Update apk cache and install dumb-init for proper signal handling
25
+ RUN apk update && apk add dumb-init
26
26
 
27
27
  # Create non-root user
28
28
  RUN addgroup -g 1001 -S nodejs && \
@@ -2,8 +2,8 @@
2
2
 
3
3
  FROM node:20-alpine
4
4
 
5
- # Install dumb-init for proper signal handling
6
- RUN apk add --no-cache dumb-init
5
+ # Update apk cache and install dumb-init for proper signal handling
6
+ RUN apk update && apk add dumb-init
7
7
 
8
8
  # Create non-root user
9
9
  RUN addgroup -g 1001 -S nodejs && \
@@ -40,7 +40,7 @@ exec su-exec nodejs:nodejs "$@"\n' > /entrypoint.sh && \
40
40
  chmod +x /entrypoint.sh
41
41
 
42
42
  # Install su-exec for user switching
43
- RUN apk add --no-cache su-exec
43
+ RUN apk add su-exec
44
44
 
45
45
  # Expose port
46
46
  EXPOSE 3001
@@ -9,6 +9,9 @@ else
9
9
  PM := pnpm
10
10
  endif
11
11
 
12
+ # Docker compose detection
13
+ COMPOSE := $(shell docker compose version >/dev/null 2>&1 && echo "docker compose" || echo "docker-compose")
14
+
12
15
  help: ## Show this help message
13
16
  @echo 'Usage: make [target]'
14
17
  @echo ''
@@ -16,48 +19,48 @@ help: ## Show this help message
16
19
  @awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf " \033[36m%-15s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)
17
20
 
18
21
  build: ## Build Docker images for production
19
- docker-compose build
22
+ $(COMPOSE) build
20
23
 
21
24
  build-dev: ## Build Docker images for development
22
- docker-compose -f docker-compose.dev.yml build
25
+ $(COMPOSE) -f docker-compose.dev.yml build
23
26
 
24
27
  dev: ## Start development environment (removes orphan containers)
25
- docker-compose -f docker-compose.dev.yml up --build --remove-orphans
28
+ $(COMPOSE) -f docker-compose.dev.yml up --build --remove-orphans
26
29
 
27
30
  prod: ## Start production environment (removes orphan containers)
28
- docker-compose up -d --remove-orphans
31
+ $(COMPOSE) up -d --remove-orphans
29
32
 
30
33
  down: ## Stop and remove containers (including orphan containers)
31
- docker-compose down --remove-orphans
32
- docker-compose -f docker-compose.dev.yml down --remove-orphans
34
+ $(COMPOSE) down --remove-orphans
35
+ $(COMPOSE) -f docker-compose.dev.yml down --remove-orphans
33
36
 
34
37
  clean: ## Stop containers, remove images and volumes (including orphan containers)
35
- docker-compose down -v --rmi all --remove-orphans
36
- docker-compose -f docker-compose.dev.yml down -v --rmi all --remove-orphans
38
+ $(COMPOSE) down -v --rmi all --remove-orphans
39
+ $(COMPOSE) -f docker-compose.dev.yml down -v --rmi all --remove-orphans
37
40
 
38
41
  logs: ## View logs
39
- docker-compose logs -f
42
+ $(COMPOSE) logs -f
40
43
 
41
44
  logs-dev: ## View development logs
42
- docker-compose -f docker-compose.dev.yml logs -f
45
+ $(COMPOSE) -f docker-compose.dev.yml logs -f
43
46
 
44
47
  restart: ## Restart production containers
45
- docker-compose restart
48
+ $(COMPOSE) restart
46
49
 
47
50
  restart-dev: ## Restart development containers
48
- docker-compose -f docker-compose.dev.yml restart
51
+ $(COMPOSE) -f docker-compose.dev.yml restart
49
52
 
50
53
  rebuild: ## Rebuild and restart production containers (removes orphan containers)
51
- docker-compose up -d --build --remove-orphans
54
+ $(COMPOSE) up -d --build --remove-orphans
52
55
 
53
56
  rebuild-dev: ## Rebuild and restart development containers (removes orphan containers)
54
- docker-compose -f docker-compose.dev.yml up -d --build --remove-orphans
57
+ $(COMPOSE) -f docker-compose.dev.yml up -d --build --remove-orphans
55
58
 
56
59
  shell: ## Open shell in production container
57
- docker-compose exec app sh
60
+ $(COMPOSE) exec app sh
58
61
 
59
62
  shell-dev: ## Open shell in development container
60
- docker-compose -f docker-compose.dev.yml exec app sh
63
+ $(COMPOSE) -f docker-compose.dev.yml exec app sh
61
64
 
62
65
  test: ## Run tests (if configured)
63
- docker-compose exec app npm test
66
+ $(COMPOSE) exec app npm test
@@ -1,8 +1,14 @@
1
- # 开发
1
+ # NSBP
2
+
3
+ 🌐 **Online Demo**: [https://nsbp.erishen.cn/](https://nsbp.erishen.cn/)
4
+
5
+ ## 开发
2
6
  - npm run dev (开发运行)
3
7
  - npm run build (生产编译)
4
8
  - npm start (生产运行)
5
9
 
10
+ ### 本地访问
11
+
6
12
  客户端渲染
7
13
  http://localhost:3001/
8
14
 
@@ -5,7 +5,7 @@ services:
5
5
  dockerfile: Dockerfile
6
6
  container_name: nsbp-app
7
7
  ports:
8
- - "3001:3001"
8
+ - "8091:3001"
9
9
  environment:
10
10
  - NODE_ENV=production
11
11
  - PORT=3001
@@ -3,6 +3,7 @@
3
3
  "version": "1.0.0",
4
4
  "description": "node react ssr by webpack",
5
5
  "main": "index.js",
6
+ "homepage": "https://nsbp.erishen.cn/",
6
7
  "scripts": {
7
8
  "dev": "npm-run-all -l -s dev:init -p dev:build:*",
8
9
  "dev:init": "cross-env INIT=1 webpack --config webpack.server.js --mode development",