nexpgen 1.0.5 → 1.0.6
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/LICENSE +1 -1
- package/bin/cli.js +1 -1
- package/package.json +2 -4
- package/src/commands/generate.js +1 -1
- package/src/commands/init.js +1 -1
- package/src/utils/architectureGenerator.js +2 -2
- package/src/utils/fileGenerator.js +1 -1
- package/src/utils/packageIntegrity.js +2 -2
- package/scripts/add-copyright.js +0 -78
package/LICENSE
CHANGED
package/bin/cli.js
CHANGED
package/package.json
CHANGED
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nexpgen",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.6",
|
|
4
4
|
"description": "A powerful CLI tool for generating code files from templates with support for multiple architectures (MVC, Microservices, Clean Architecture) and function styles. Built by CodevNexus.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"bin": {
|
|
7
7
|
"nexpgen": "./bin/cli.js"
|
|
8
8
|
},
|
|
9
9
|
"scripts": {
|
|
10
|
-
"test": "echo \"Error: no test specified\" && exit 1"
|
|
11
|
-
"add-copyright": "node scripts/add-copyright.js",
|
|
12
|
-
"prepublishOnly": "npm run add-copyright"
|
|
10
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
|
13
11
|
},
|
|
14
12
|
"keywords": [
|
|
15
13
|
"cli",
|
package/src/commands/generate.js
CHANGED
package/src/commands/init.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright (c)
|
|
2
|
+
* Copyright (c) 2025 CodevNexus
|
|
3
3
|
*
|
|
4
4
|
* This software is protected by copyright laws and international copyright
|
|
5
5
|
* treaties, as well as other intellectual property laws and treaties.
|
|
@@ -1107,7 +1107,7 @@ NODE_ENV=development
|
|
|
1107
1107
|
};
|
|
1108
1108
|
|
|
1109
1109
|
const devDependencies = {
|
|
1110
|
-
nodemon: '
|
|
1110
|
+
nodemon: '*'
|
|
1111
1111
|
};
|
|
1112
1112
|
|
|
1113
1113
|
const dependencies = {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright (c)
|
|
2
|
+
* Copyright (c) 2025 CodevNexus
|
|
3
3
|
*
|
|
4
4
|
* This software is protected by copyright laws and international copyright
|
|
5
5
|
* treaties, as well as other intellectual property laws and treaties.
|
|
@@ -77,7 +77,7 @@ class PackageIntegrity {
|
|
|
77
77
|
*/
|
|
78
78
|
static getCopyrightNotice() {
|
|
79
79
|
return `/**
|
|
80
|
-
* Copyright (c)
|
|
80
|
+
* Copyright (c) 2025 CodevNexus
|
|
81
81
|
*
|
|
82
82
|
* This software is protected by copyright laws and international copyright
|
|
83
83
|
* treaties, as well as other intellectual property laws and treaties.
|
package/scripts/add-copyright.js
DELETED
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Script to add copyright headers to all source files
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
const fs = require('fs');
|
|
6
|
-
const path = require('path');
|
|
7
|
-
|
|
8
|
-
const copyright = `/**
|
|
9
|
-
* Copyright (c) 2024 CodevNexus
|
|
10
|
-
*
|
|
11
|
-
* This software is protected by copyright laws and international copyright
|
|
12
|
-
* treaties, as well as other intellectual property laws and treaties.
|
|
13
|
-
*
|
|
14
|
-
* Unauthorized reproduction or distribution of this software, or any portion
|
|
15
|
-
* of it, may result in severe civil and criminal penalties.
|
|
16
|
-
*
|
|
17
|
-
* Licensed under the MIT License.
|
|
18
|
-
* See LICENSE file for details.
|
|
19
|
-
*/
|
|
20
|
-
|
|
21
|
-
`;
|
|
22
|
-
|
|
23
|
-
function addCopyrightToFile(filePath) {
|
|
24
|
-
try {
|
|
25
|
-
let content = fs.readFileSync(filePath, 'utf-8');
|
|
26
|
-
|
|
27
|
-
// Skip if already has copyright
|
|
28
|
-
if (content.includes('Copyright (c) 2024 CodevNexus')) {
|
|
29
|
-
return;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
// Skip if starts with shebang
|
|
33
|
-
if (content.startsWith('#!/')) {
|
|
34
|
-
const lines = content.split('\n');
|
|
35
|
-
const shebang = lines[0];
|
|
36
|
-
const rest = lines.slice(1).join('\n');
|
|
37
|
-
content = shebang + '\n' + copyright + rest;
|
|
38
|
-
} else {
|
|
39
|
-
content = copyright + content;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
fs.writeFileSync(filePath, content, 'utf-8');
|
|
43
|
-
console.log(`✅ Added copyright to: ${filePath}`);
|
|
44
|
-
} catch (error) {
|
|
45
|
-
console.error(`❌ Error processing ${filePath}: ${error.message}`);
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
function processDirectory(dir) {
|
|
50
|
-
const files = fs.readdirSync(dir, { withFileTypes: true });
|
|
51
|
-
|
|
52
|
-
files.forEach(file => {
|
|
53
|
-
const filePath = path.join(dir, file.name);
|
|
54
|
-
|
|
55
|
-
if (file.isDirectory()) {
|
|
56
|
-
// Skip node_modules and other directories
|
|
57
|
-
if (['node_modules', '.git', 'test-output', 'test-complete'].includes(file.name)) {
|
|
58
|
-
return;
|
|
59
|
-
}
|
|
60
|
-
processDirectory(filePath);
|
|
61
|
-
} else if (file.isFile()) {
|
|
62
|
-
// Only process JavaScript files
|
|
63
|
-
if (file.name.endsWith('.js') && !file.name.endsWith('.test.js')) {
|
|
64
|
-
addCopyrightToFile(filePath);
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
});
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
// Process src directory
|
|
71
|
-
const srcDir = path.join(__dirname, '../src');
|
|
72
|
-
const binDir = path.join(__dirname, '../bin');
|
|
73
|
-
|
|
74
|
-
console.log('Adding copyright headers to source files...\n');
|
|
75
|
-
processDirectory(srcDir);
|
|
76
|
-
processDirectory(binDir);
|
|
77
|
-
console.log('\n✅ Copyright headers added to all source files.');
|
|
78
|
-
|