nsbp-cli 0.2.8 → 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 +3 -1
- package/package.json +2 -2
- package/templates/basic/Dockerfile +2 -2
- package/templates/basic/Dockerfile.dev +3 -3
- package/templates/basic/Makefile +20 -17
- package/templates/basic/README.md +7 -1
- package/templates/basic/docker-compose.yml +1 -1
- package/templates/basic/package.json +1 -0
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**:
|
|
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.
|
|
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
|
-
#
|
|
25
|
-
RUN apk add
|
|
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
|
-
#
|
|
6
|
-
RUN apk add
|
|
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
|
|
43
|
+
RUN apk add su-exec
|
|
44
44
|
|
|
45
45
|
# Expose port
|
|
46
46
|
EXPOSE 3001
|
package/templates/basic/Makefile
CHANGED
|
@@ -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
|
-
|
|
22
|
+
$(COMPOSE) build
|
|
20
23
|
|
|
21
24
|
build-dev: ## Build Docker images for development
|
|
22
|
-
|
|
25
|
+
$(COMPOSE) -f docker-compose.dev.yml build
|
|
23
26
|
|
|
24
27
|
dev: ## Start development environment (removes orphan containers)
|
|
25
|
-
|
|
28
|
+
$(COMPOSE) -f docker-compose.dev.yml up --build --remove-orphans
|
|
26
29
|
|
|
27
30
|
prod: ## Start production environment (removes orphan containers)
|
|
28
|
-
|
|
31
|
+
$(COMPOSE) up -d --remove-orphans
|
|
29
32
|
|
|
30
33
|
down: ## Stop and remove containers (including orphan containers)
|
|
31
|
-
|
|
32
|
-
|
|
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
|
-
|
|
36
|
-
|
|
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
|
-
|
|
42
|
+
$(COMPOSE) logs -f
|
|
40
43
|
|
|
41
44
|
logs-dev: ## View development logs
|
|
42
|
-
|
|
45
|
+
$(COMPOSE) -f docker-compose.dev.yml logs -f
|
|
43
46
|
|
|
44
47
|
restart: ## Restart production containers
|
|
45
|
-
|
|
48
|
+
$(COMPOSE) restart
|
|
46
49
|
|
|
47
50
|
restart-dev: ## Restart development containers
|
|
48
|
-
|
|
51
|
+
$(COMPOSE) -f docker-compose.dev.yml restart
|
|
49
52
|
|
|
50
53
|
rebuild: ## Rebuild and restart production containers (removes orphan containers)
|
|
51
|
-
|
|
54
|
+
$(COMPOSE) up -d --build --remove-orphans
|
|
52
55
|
|
|
53
56
|
rebuild-dev: ## Rebuild and restart development containers (removes orphan containers)
|
|
54
|
-
|
|
57
|
+
$(COMPOSE) -f docker-compose.dev.yml up -d --build --remove-orphans
|
|
55
58
|
|
|
56
59
|
shell: ## Open shell in production container
|
|
57
|
-
|
|
60
|
+
$(COMPOSE) exec app sh
|
|
58
61
|
|
|
59
62
|
shell-dev: ## Open shell in development container
|
|
60
|
-
|
|
63
|
+
$(COMPOSE) -f docker-compose.dev.yml exec app sh
|
|
61
64
|
|
|
62
65
|
test: ## Run tests (if configured)
|
|
63
|
-
|
|
66
|
+
$(COMPOSE) exec app npm test
|
|
@@ -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",
|