free-framework 4.4.0 → 4.4.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.
- package/bin/free.js +3 -1
- package/cli/commands/serve.js +14 -0
- package/package.json +1 -1
package/bin/free.js
CHANGED
|
@@ -11,8 +11,10 @@ const path = require("path");
|
|
|
11
11
|
// Load Environment variables globally
|
|
12
12
|
require('dotenv').config();
|
|
13
13
|
|
|
14
|
+
const pkg = require("../package.json");
|
|
15
|
+
|
|
14
16
|
program
|
|
15
|
-
.version(
|
|
17
|
+
.version(pkg.version)
|
|
16
18
|
.description("Free Framework CLI");
|
|
17
19
|
|
|
18
20
|
program
|
package/cli/commands/serve.js
CHANGED
|
@@ -39,6 +39,20 @@ module.exports = function (options) {
|
|
|
39
39
|
});
|
|
40
40
|
};
|
|
41
41
|
|
|
42
|
+
const fs = require("fs");
|
|
43
|
+
const appFile = path.join(process.cwd(), ".free/app.js");
|
|
44
|
+
|
|
45
|
+
if (!fs.existsSync(appFile)) {
|
|
46
|
+
console.log("📦 Target build missing. Compiling project...");
|
|
47
|
+
try {
|
|
48
|
+
build();
|
|
49
|
+
console.log("✅ Compilation successful.");
|
|
50
|
+
} catch (err) {
|
|
51
|
+
console.error("❌ Initial build failed:", err.message);
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
42
56
|
startServer();
|
|
43
57
|
|
|
44
58
|
const appDir = path.join(process.cwd(), "app");
|