starter-structure-cli 0.2.0 → 0.2.1

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.
Files changed (2) hide show
  1. package/README.md +65 -42
  2. package/package.json +9 -1
package/README.md CHANGED
@@ -1,31 +1,28 @@
1
1
  # starter-structure-cli
2
2
 
3
- Scaffold your own starter templates from a stack combination such as `react vite ts tailwind express prisma mysql`, `nextjs tailwind mongoose mongodb`, or `vue vite ts tailwind express mongoose`.
3
+ Scaffold starter projects from your own stack-based template folders.
4
4
 
5
- The CLI discovers templates directly from your local `templates/` folder, so you only maintain the template code once. Naming the template folder with stack tokens is enough for the generator to match it.
5
+ Right now the package ships with one backend template:
6
6
 
7
- ## Template layout
7
+ - `backend-only/express-mongoose-jwt`
8
8
 
9
- Put each starter inside:
9
+ The CLI discovers templates from the local `templates/` directory, so you can keep adding new starters by folder name instead of hardcoding each option.
10
+
11
+ ## Current template
10
12
 
11
13
  ```text
12
14
  templates/
13
- fullstack/
14
- react-vite-ts-tailwind-express-prisma-mysql/
15
- react-vite-ts-tailwind-express-sequelize-mysql/
16
- nextjs-tailwind-mongoose-mongodb/
17
- single/
18
- react-vite-ts-tailwind/
19
- vue-vite-ts-tailwind/
20
15
  backend-only/
21
16
  express-mongoose-jwt/
22
- monorepo-client-server/
23
- react-vite-ts-express-mongoose/
24
- monorepo-turbo-pnpm/
25
- nextjs-api-express-prisma/
26
17
  ```
27
18
 
28
- Your folder names become the searchable stack tokens.
19
+ This template generates an Express API starter with:
20
+
21
+ - MongoDB with Mongoose
22
+ - JWT authentication
23
+ - User register/login flow
24
+ - Auth middleware
25
+ - Basic controller, route, model, middleware, and utils structure
29
26
 
30
27
  ## Usage
31
28
 
@@ -35,58 +32,84 @@ Interactive:
35
32
  npx starter-structure-cli my-app
36
33
  ```
37
34
 
38
- Direct stack query:
35
+ Direct selection by template:
39
36
 
40
37
  ```bash
41
- npx starter-structure-cli my-pos react vite ts tailwind express sequelize mysql
38
+ npx starter-structure-cli my-api --template backend-only/express-mongoose-jwt
42
39
  ```
43
40
 
44
- With explicit flags:
41
+ Direct stack query:
45
42
 
46
43
  ```bash
47
- npx starter-structure-cli my-saas --category fullstack --frontend react --backend express --orm prisma --database mysql --styling tailwind
44
+ npx starter-structure-cli my-api express mongoose jwt
48
45
  ```
49
46
 
50
- Exact template:
47
+ List available templates:
51
48
 
52
49
  ```bash
53
- npx starter-structure-cli my-gym --template fullstack/react-vite-ts-tailwind-express-sequelize-mysql
50
+ npx starter-structure-cli --list
54
51
  ```
55
52
 
56
- List discovered templates:
53
+ ## Placeholder replacement
54
+
55
+ The generator replaces `__APP_NAME__` in copied file contents and file or folder names.
56
+
57
+ ## Local development
57
58
 
58
59
  ```bash
59
- npx starter-structure-cli --list
60
+ npm install
61
+ node ./scripts/check-templates.js
62
+ node ./bin/starter-structure-cli.js --list
60
63
  ```
61
64
 
62
- ## Supported filters
65
+ ## Publish checks
63
66
 
64
- - `--category`: `fullstack`, `frontend-only`, `single`, `backend-only`, `monorepo`, `turbo`
65
- - `--frontend`: `react`, `nextjs`, `vue`
66
- - `--backend`: `express`, `nestjs`, `fastify`
67
- - `--styling`: `tailwind`, `shadcn`
68
- - `--orm`: `prisma`, `mongoose`, `sequelize`
69
- - `--database`: `mongodb`, `mysql`, `postgres`
70
- - `--auth`: `jwt`, `nextauth`
71
- - `--language`: `ts`, `js`
67
+ Before publishing, verify:
72
68
 
73
- ## Placeholder replacement
69
+ ```bash
70
+ npm.cmd install
71
+ node .\scripts\check-templates.js
72
+ node .\bin\starter-structure-cli.js --list
73
+ npm.cmd pack --dry-run
74
+ ```
74
75
 
75
- The CLI replaces `__APP_NAME__` in copied file contents and file/folder names.
76
+ `prepack` runs template validation automatically and blocks publish if a template directory has no files.
76
77
 
77
78
  ## Publish to npm
78
79
 
80
+ You can publish locally:
81
+
79
82
  ```bash
80
- npm install
81
- npm publish
83
+ npm.cmd publish
82
84
  ```
83
85
 
84
- `prepack` validates that every template directory contains at least one file. This prevents publishing a package that ships no starter templates.
86
+ Or publish from GitHub Actions using the workflow in `.github/workflows/publish.yml`.
87
+
88
+ For GitHub Actions publishing, add a repository secret named `NPM_TOKEN` and use a granular npm token that has:
89
+
90
+ - publish or write access
91
+ - `bypass 2FA` enabled
92
+
93
+ Without `bypass 2FA`, npm will fail in CI with `EOTP`.
94
+
95
+ ## Add more templates
96
+
97
+ Add new templates under `templates/<category>/<template-name>`.
98
+
99
+ Example:
100
+
101
+ ```text
102
+ templates/
103
+ fullstack/
104
+ react-vite-ts-tailwind-express-prisma-mysql/
105
+ single/
106
+ react-vite-ts-tailwind/
107
+ monorepo-client-server/
108
+ nextjs-express-prisma/
109
+ ```
85
110
 
86
- ## Development
111
+ Folder names become searchable stack tokens, so names like `react-vite-ts-tailwind-express-prisma-mysql` can be matched by queries such as:
87
112
 
88
113
  ```bash
89
- npm install
90
- node ./scripts/check-templates.js
91
- node ./bin/starter-structure-cli.js --list
114
+ npx starter-structure-cli my-app react vite ts tailwind express prisma mysql
92
115
  ```
package/package.json CHANGED
@@ -1,7 +1,15 @@
1
1
  {
2
2
  "name": "starter-structure-cli",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "Scaffold starter projects from your own stack-based template folders",
5
+ "homepage": "https://github.com/mohosin2126/starter-structure-cli#readme",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://github.com/mohosin2126/starter-structure-cli.git"
9
+ },
10
+ "bugs": {
11
+ "url": "https://github.com/mohosin2126/starter-structure-cli/issues"
12
+ },
5
13
  "type": "module",
6
14
  "files": [
7
15
  "bin",