nsbp-cli 0.2.3 → 0.2.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
@@ -4,149 +4,156 @@ Command-line interface for creating NSBP (Node React SSR by Webpack) projects.
4
4
 
5
5
  📦 **Published on npm**: [https://www.npmjs.com/package/nsbp-cli](https://www.npmjs.com/package/nsbp-cli)
6
6
 
7
- ## Installation from npm
7
+ ## Installation
8
8
 
9
- Install globally from npm registry:
10
-
11
- \`\`\`bash
12
- # Install globally
9
+ ### Global Installation (npm)
10
+ ```bash
13
11
  npm install -g nsbp-cli
12
+ ```
14
13
 
15
- # Or use npx (no installation required)
14
+ ### Using npx (No Installation)
15
+ ```bash
16
16
  npx nsbp-cli create my-app
17
+ ```
17
18
 
18
- # Verify installation
19
- nsbp-cli --version
20
- \`\`\`
21
-
22
- ## Local Usage
23
-
24
- The CLI is also located in \`cli/\` directory of the NSBP project. Run it locally for development:
25
-
26
- \`\`\`bash
27
- # Navigate to CLI directory
28
- cd cli
29
-
30
- # Show help
31
- node ./bin/nsbp-cli.js --help
19
+ ### Verify Installation
20
+ ```bash
21
+ nsbp --version
22
+ ```
32
23
 
33
- # Show NSBP information
34
- node ./bin/nsbp-cli.js info
24
+ ## Quick Start
35
25
 
36
- # Create a new project
37
- node ./bin/nsbp-cli.js create my-app
26
+ Create a new NSBP project with a single command:
38
27
 
39
- # Skip npm install
40
- node ./bin/nsbp-cli.js create my-app --skip-install
41
- \`\`\`
28
+ ```bash
29
+ nsbp create my-app
30
+ cd my-app
31
+ npm install
32
+ npm run dev
33
+ ```
42
34
 
43
- ## Usage
35
+ For development with Docker (recommended):
36
+ ```bash
37
+ cd my-app
38
+ make dev # Starts development environment with hot reload
39
+ ```
44
40
 
45
- ### Create a new project
41
+ ## Command Reference
46
42
 
47
- \`\`\`bash
48
- # From npm (after global install)
49
- nsbp-cli create my-app
43
+ ### Create a New Project
44
+ ```bash
45
+ nsbp create <app-name> [options]
50
46
 
51
- # From npx
52
- npx nsbp-cli create my-app
47
+ # Examples
48
+ nsbp create my-app
49
+ nsbp create my-app --skip-install # Skip npm install
50
+ nsbp create my-app --template basic # Specify template (basic is default)
51
+ ```
53
52
 
54
- # From local CLI directory
55
- node ./bin/nsbp-cli.js create my-app
53
+ ### Display Framework Information
54
+ ```bash
55
+ nsbp info
56
+ ```
56
57
 
57
- # Skip npm install
58
- nsbp-cli create my-app --skip-install
58
+ ### Help
59
+ ```bash
60
+ nsbp --help # Show all commands
61
+ nsbp create --help # Show create command options
62
+ ```
59
63
 
60
- # Specify template (currently only basic is available)
61
- nsbp-cli create my-app --template basic
62
- \`\`\`
64
+ ## Templates
63
65
 
64
- ### Display information
66
+ The CLI provides project templates to get started quickly:
65
67
 
66
- \`\`\`bash
67
- # Show NSBP framework information
68
- nsbp-cli info
69
- \`\`\`
68
+ - **basic** (default) - Complete NSBP stack with React SSR, TypeScript, and Webpack
69
+ - Includes full Docker support for development and production
70
+ - Pre-configured with Makefile for easy Docker operations
71
+ - Ready-to-use project structure
70
72
 
71
- ### Help
73
+ - **blog** - Blog-focused template with article layouts (coming soon)
74
+ - **ecommerce** - E-commerce template with product pages (coming soon)
72
75
 
73
- \`\`\`bash
74
- # Show all commands
75
- nsbp-cli --help
76
+ ## Docker Support
76
77
 
77
- # Show create command help
78
- nsbp-cli create --help
79
- \`\`\`
78
+ The **basic** template includes comprehensive Docker configuration:
80
79
 
81
- ## Templates
80
+ ### Docker Files Included
81
+ - `.dockerignore` - Docker build ignore rules
82
+ - `docker-compose.yml` - Production environment configuration
83
+ - `docker-compose.dev.yml` - Development environment with hot reload
84
+ - `Dockerfile` - Multi-stage production build
85
+ - `Dockerfile.dev` - Development build
86
+ - `Makefile` - Convenient Docker commands
82
87
 
83
- - **basic**: Default template with core NSBP features (currently available)
84
- - **blog**: Blog-focused template with article layouts (coming soon)
85
- - **ecommerce**: E-commerce template with product pages (coming soon)
88
+ ### Available Make Commands
89
+ ```bash
90
+ make dev # Start development environment (hot reload)
91
+ make prod # Start production environment
92
+ make rebuild # Rebuild and restart production containers
93
+ make logs # View container logs
94
+ make down # Stop and remove containers
95
+ make shell # Open shell in production container
96
+ make shell-dev # Open shell in development container
97
+ ```
86
98
 
87
- ## How it works
99
+ ## How It Works
88
100
 
89
- The CLI copies NSBP project structure from \`templates/basic/\` to your target directory and creates a new \`package.json\` with appropriate dependencies. You get a fully functional NSBP project ready for development.
101
+ The CLI copies the NSBP project structure from `templates/basic/` to your target directory and creates a new `package.json` with appropriate dependencies. You get a fully functional NSBP project ready for development, including complete Docker support.
90
102
 
91
103
  ## Template Synchronization
92
104
 
93
105
  The CLI includes a synchronization script that keeps built-in templates up-to-date with the main NSBP project code.
94
106
 
95
107
  ### Sync Script
96
- Location: \`cli/scripts/sync-template.js\`
108
+ Location: `cli/scripts/sync-template.js`
97
109
 
98
110
  ### Usage
99
- \`\`\`bash
100
- # From CLI directory
101
- cd /path/to/nsbp-cli/cli
102
-
103
- # Run sync script
104
- pnpm run sync-template
105
- # or
106
- npm run sync-template
107
-
108
- # Or use to update shortcut
109
- pnpm run update
110
- # or
111
- npm run update
112
- \`\`\`
111
+ ```bash
112
+ cd cli
113
+ npm run update # Runs sync-template script
114
+ ```
113
115
 
114
116
  ### Features
115
- - **Smart copying**: Copies only source code and configuration files
116
- - **Build artifact filtering**: Automatically excludes .js.map, .css.map, .txt, .json, and .LICENSE.txt files from the public directory
117
- - **Template transformation**: Converts main project's package.json to template format (name: "nsbp-cli-template")
118
- - **Integrity verification**: Checks for required files like src/Routers.tsx, scripts/start.js, and package.json
119
-
120
- ### What gets synchronized
121
- - \`src/\` - React components and routing
122
- - \`public/\` - Static assets (images, favicon.ico)
123
- - \`scripts/\` - Startup and utility scripts
124
- - \`webpack.*.js\` - Webpack configuration files
125
- - \`tsconfig.json\` - TypeScript configuration
126
- - \`postcss.config.js\` - PostCSS configuration
127
- - \`package.json\` - Project configuration (automatically templatized)
128
- - \`.gitignore\`, \`.prettierrc\`, \`.prettierignore\`, \`README.md\`
117
+ - **Smart copying** - Copies only source code and configuration files
118
+ - **Build artifact filtering** - Automatically excludes build artifacts from the public directory
119
+ - **Template transformation** - Converts main project's package.json to template format
120
+ - **Integrity verification** - Checks for required files before synchronization
121
+
122
+ ### Synchronized Files
123
+ - `src/` - React components and routing
124
+ - `public/` - Static assets
125
+ - `scripts/` - Startup and utility scripts
126
+ - `webpack.*.js` - Webpack configuration
127
+ - `tsconfig.json` - TypeScript configuration
128
+ - `postcss.config.js` - PostCSS configuration
129
+ - `package.json` - Project configuration (templatized)
130
+ - `.gitignore`, `.prettierrc`, `.prettierignore`, `README.md`
131
+ - **Docker files**: `.dockerignore`, `docker-compose.yml`, `docker-compose.dev.yml`, `Dockerfile`, `Dockerfile.dev`, `Makefile`
129
132
 
130
133
  ## Development
131
134
 
132
135
  To work on the CLI locally:
133
136
 
134
- \`\`\`bash
137
+ ```bash
135
138
  cd cli
136
- pnpm install
137
- # or
138
139
  npm install
139
- node ./bin/nsbp-cli.js create test-app
140
- \`\`\`
140
+ node ./bin/nsbp.js --help # Test CLI locally
141
+ ```
142
+
143
+ ### Publishing Updates
144
+ From the NSBP project root:
145
+ ```bash
146
+ make publish-cli # Syncs templates, updates version, publishes to npm
147
+ ```
141
148
 
142
149
  ## Package Information
143
150
 
144
- - **Package Name**: \`nsbp-cli\`
145
- - **Bin Command**: \`nsbp-cli\`
146
- - **Version**: \`0.1.0\`
151
+ - **Package Name**: `nsbp-cli`
152
+ - **Bin Command**: `nsbp` (install globally and run `nsbp --help`)
153
+ - **Version**: `0.2.3`
147
154
  - **Dependencies**: chalk, commander, fs-extra, inquirer
148
- - **Package Manager**: Supports both npm and pnpm
155
+ - **Node Version**: >=16.0.0
149
156
 
150
157
  ## License
151
158
 
152
- ISC
159
+ ISC
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nsbp-cli",
3
- "version": "0.2.3",
3
+ "version": "0.2.4",
4
4
  "description": "CLI tool for creating NSBP (Node React SSR by Webpack) projects",
5
5
  "main": "index.js",
6
6
  "files": [
@@ -59,7 +59,14 @@ publish-cli: ## Publish CLI to npm registry
59
59
  @echo "📦 Template updated, committing changes..."
60
60
  git add .
61
61
  git diff --quiet && git diff --cached --quiet || git commit -m "chore: update cli template"
62
- cd cli && npm version patch
62
+ @echo "🔖 Updating version..."
63
+ cd cli && npm version patch --no-git-tag-version
64
+ @echo "📝 Committing version bump..."
65
+ git add cli/package.json
66
+ git commit -m "chore: bump version to v$$(cd cli && node -p "require('./package.json').version")"
67
+ @echo "🏷️ Creating git tag..."
68
+ git tag -a "v$$(cd cli && node -p "require('./package.json').version")" -m "Version $$(cd cli && node -p "require('./package.json').version")"
69
+ @echo "📤 Publishing to npm..."
63
70
  cd cli && npm publish
64
71
  @echo "📤 Pushing to git repository..."
65
72
  git push --follow-tags