@saulpaulus17/node-module-generator 2.0.5 → 2.0.8
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.
|
@@ -5,10 +5,18 @@ on:
|
|
|
5
5
|
tags:
|
|
6
6
|
- 'v*.*.*'
|
|
7
7
|
|
|
8
|
+
# Prevent multiple simultaneous releases
|
|
9
|
+
concurrency:
|
|
10
|
+
group: ${{ github.workflow }}-${{ github.ref }}
|
|
11
|
+
cancel-in-progress: true
|
|
12
|
+
|
|
8
13
|
jobs:
|
|
9
14
|
publish:
|
|
10
15
|
runs-on: ubuntu-latest
|
|
11
|
-
|
|
16
|
+
permissions:
|
|
17
|
+
contents: read
|
|
18
|
+
id-token: write # Required for NPM provenance
|
|
19
|
+
|
|
12
20
|
steps:
|
|
13
21
|
- name: Checkout
|
|
14
22
|
uses: actions/checkout@v4
|
|
@@ -19,13 +27,13 @@ jobs:
|
|
|
19
27
|
node-version: 20
|
|
20
28
|
registry-url: 'https://registry.npmjs.org'
|
|
21
29
|
|
|
22
|
-
- name: Install
|
|
23
|
-
run: npm
|
|
30
|
+
- name: Install dependencies
|
|
31
|
+
run: npm ci
|
|
24
32
|
|
|
25
|
-
- name: Run
|
|
33
|
+
- name: Run tests
|
|
26
34
|
run: npm test
|
|
27
35
|
|
|
28
36
|
- name: Publish to npm
|
|
29
|
-
run: npm publish --access public
|
|
37
|
+
run: npm publish --access public --provenance
|
|
30
38
|
env:
|
|
31
39
|
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
package/README.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<div align="center">
|
|
2
|
-
<img src="
|
|
2
|
+
<img src="./assets/banner.png" alt="Node Module Generator Banner" width="600" style="max-width: 100%;" />
|
|
3
3
|
<h1>🚀 Node Module Generator (NMG)</h1>
|
|
4
4
|
<p><strong>The ultimate CLI companion for rapid, enterprise-grade Node.js scaffolding.</strong></p>
|
|
5
5
|
<p>
|
|
@@ -76,6 +76,25 @@ npx @saulpaulus17/node-module-generator <command> <name>
|
|
|
76
76
|
|
|
77
77
|
---
|
|
78
78
|
|
|
79
|
+
## 🛠️ Target Project Dependencies
|
|
80
|
+
|
|
81
|
+
To ensure the modules generated by NMG function correctly, your main project must have the following core dependencies installed:
|
|
82
|
+
|
|
83
|
+
### Production Dependencies
|
|
84
|
+
```bash
|
|
85
|
+
npm install express awilix @prisma/client
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
### Development Dependencies
|
|
89
|
+
```bash
|
|
90
|
+
npm install --save-dev jest
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
> [!TIP]
|
|
94
|
+
> These dependencies are essential because the generated code relies on Express for routing, Awilix for Dependency Injection, and Prisma for the data layer.
|
|
95
|
+
|
|
96
|
+
---
|
|
97
|
+
|
|
79
98
|
## 🚀 Detailed Usage
|
|
80
99
|
|
|
81
100
|
### 1. Generating a Full Module
|
|
Binary file
|
|
@@ -19,8 +19,6 @@ module.exports = async function (name) {
|
|
|
19
19
|
// Create directories
|
|
20
20
|
dirs.forEach((dir) => fs.ensureDirSync(path.join(basePath, dir)));
|
|
21
21
|
|
|
22
|
-
// Generate scoped package.json for ESM support
|
|
23
|
-
fs.writeJsonSync(path.join(basePath, "package.json"), { type: "module" }, { spaces: 2 });
|
|
24
22
|
|
|
25
23
|
const templateData = {
|
|
26
24
|
name,
|
|
@@ -18,8 +18,6 @@ module.exports = async function (name) {
|
|
|
18
18
|
|
|
19
19
|
dirs.forEach((dir) => fs.ensureDirSync(path.join(basePath, dir)));
|
|
20
20
|
|
|
21
|
-
// Generate scoped package.json for ESM support
|
|
22
|
-
fs.writeJsonSync(path.join(basePath, "package.json"), { type: "module" }, { spaces: 2 });
|
|
23
21
|
|
|
24
22
|
const templateData = {
|
|
25
23
|
name,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@saulpaulus17/node-module-generator",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.8",
|
|
4
4
|
"description": "CLI tool to grenerate modular scaffolding for nodejs projects following clean arsitecture principles. ",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"nodejs",
|
|
@@ -11,6 +11,14 @@
|
|
|
11
11
|
"license": "MIT",
|
|
12
12
|
"author": "saul-paulus (ixspx)",
|
|
13
13
|
"type": "commonjs",
|
|
14
|
+
"repository": {
|
|
15
|
+
"type": "git",
|
|
16
|
+
"url": "git+https://github.com/saul-paulus/node-module-generator.git"
|
|
17
|
+
},
|
|
18
|
+
"bugs": {
|
|
19
|
+
"url": "https://github.com/saul-paulus/node-module-generator/issues"
|
|
20
|
+
},
|
|
21
|
+
"homepage": "https://github.com/saul-paulus/node-module-generator#readme",
|
|
14
22
|
"main": "index.js",
|
|
15
23
|
"bin": {
|
|
16
24
|
"nmg": "./bin/cli.js"
|