@nitronjs/framework 0.1.0 → 0.1.2
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/cli/create.js +10 -12
- package/package.json +11 -13
- package/skeleton/.env.example +1 -1
package/cli/create.js
CHANGED
|
@@ -114,12 +114,19 @@ function generateAppKey() {
|
|
|
114
114
|
return crypto.randomBytes(32).toString("base64");
|
|
115
115
|
}
|
|
116
116
|
|
|
117
|
+
function getFrameworkVersion() {
|
|
118
|
+
const pkgPath = path.join(__dirname, "..", "package.json");
|
|
119
|
+
const pkg = JSON.parse(fs.readFileSync(pkgPath, "utf-8"));
|
|
120
|
+
return pkg.version;
|
|
121
|
+
}
|
|
122
|
+
|
|
117
123
|
function updatePackageJson(projectPath, projectName) {
|
|
118
124
|
const pkgPath = path.join(projectPath, "package.json");
|
|
119
125
|
|
|
120
126
|
if (fs.existsSync(pkgPath)) {
|
|
121
127
|
const pkg = JSON.parse(fs.readFileSync(pkgPath, "utf-8"));
|
|
122
128
|
pkg.name = projectName;
|
|
129
|
+
pkg.dependencies["@nitronjs/framework"] = `^${getFrameworkVersion()}`;
|
|
123
130
|
fs.writeFileSync(pkgPath, JSON.stringify(pkg, null, 4));
|
|
124
131
|
}
|
|
125
132
|
}
|
|
@@ -142,22 +149,13 @@ function runNpmInstall(projectPath) {
|
|
|
142
149
|
|
|
143
150
|
const child = spawn(npm, ["install"], {
|
|
144
151
|
cwd: projectPath,
|
|
145
|
-
stdio:
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
let output = "";
|
|
149
|
-
|
|
150
|
-
child.stdout.on("data", (data) => {
|
|
151
|
-
output += data.toString();
|
|
152
|
-
});
|
|
153
|
-
|
|
154
|
-
child.stderr.on("data", (data) => {
|
|
155
|
-
output += data.toString();
|
|
152
|
+
stdio: "inherit",
|
|
153
|
+
shell: isWindows
|
|
156
154
|
});
|
|
157
155
|
|
|
158
156
|
child.on("close", (code) => {
|
|
159
157
|
if (code === 0) {
|
|
160
|
-
resolve(
|
|
158
|
+
resolve();
|
|
161
159
|
} else {
|
|
162
160
|
reject(new Error(`npm install failed with code ${code}`));
|
|
163
161
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nitronjs/framework",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "NitronJS is a modern and extensible Node.js MVC framework built on Fastify. It focuses on clean architecture, modular structure, and developer productivity, offering built-in routing, middleware, configuration management, CLI tooling, and native React integration for scalable full-stack applications.",
|
|
5
5
|
"bin": {
|
|
6
6
|
"njs": "./cli/njs.js"
|
|
@@ -9,30 +9,28 @@
|
|
|
9
9
|
".": "./lib/index.js"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
|
+
"@babel/parser": "^7.28.5",
|
|
13
|
+
"@babel/traverse": "^7.28.5",
|
|
12
14
|
"@fastify/cookie": "^11.0.2",
|
|
13
15
|
"@fastify/cors": "^11.2.0",
|
|
14
16
|
"@fastify/formbody": "^8.0.2",
|
|
15
17
|
"@fastify/helmet": "^13.0.2",
|
|
16
18
|
"@fastify/multipart": "^9.3.0",
|
|
17
19
|
"@fastify/static": "^8.3.0",
|
|
20
|
+
"@tailwindcss/postcss": "^4.1.18",
|
|
21
|
+
"@types/react": "^19.2.7",
|
|
22
|
+
"@types/react-dom": "^19.2.3",
|
|
18
23
|
"bcrypt": "^5.1.1",
|
|
24
|
+
"chokidar": "^5.0.0",
|
|
19
25
|
"dotenv": "^17.2.3",
|
|
26
|
+
"esbuild": "^0.27.2",
|
|
20
27
|
"fastify": "^5.6.2",
|
|
21
28
|
"mysql2": "^3.16.0",
|
|
22
29
|
"nodemailer": "^7.0.11",
|
|
30
|
+
"postcss": "^8.5.6",
|
|
23
31
|
"react": "^19.2.3",
|
|
24
32
|
"react-dom": "^19.2.3",
|
|
25
|
-
"socket.io": "^4.8.1"
|
|
26
|
-
},
|
|
27
|
-
"devDependencies": {
|
|
28
|
-
"@babel/parser": "^7.28.5",
|
|
29
|
-
"@babel/traverse": "^7.28.5",
|
|
30
|
-
"@tailwindcss/postcss": "^4.1.18",
|
|
31
|
-
"@types/react": "^19.2.7",
|
|
32
|
-
"@types/react-dom": "^19.2.3",
|
|
33
|
-
"chokidar": "^5.0.0",
|
|
34
|
-
"esbuild": "^0.27.2",
|
|
35
|
-
"postcss": "^8.5.6",
|
|
33
|
+
"socket.io": "^4.8.1",
|
|
36
34
|
"tailwindcss": "^4.1.18",
|
|
37
35
|
"typescript": "^5.9.3"
|
|
38
36
|
},
|
|
@@ -44,4 +42,4 @@
|
|
|
44
42
|
"author": "Burak AKBULUT",
|
|
45
43
|
"license": "ISC",
|
|
46
44
|
"type": "module"
|
|
47
|
-
}
|
|
45
|
+
}
|