@aravinthan_p/appnest-engine 1.0.20 → 1.0.22
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/README.md +73 -62
- package/appnest-command-line/appnest-command.js +41 -28
- package/appnest-command-line/frameworkDocsUtils.js +73 -0
- package/appnest-command-line/precheckUtils.js +7 -20
- package/appnest-command-line/setupAppUtils.js +15 -0
- package/appnest-command-line/validateUtils/index.js +2 -8
- package/appnest-command-line/validateUtils/lint/lint-backend.js +4 -3
- package/appnest-command-line/validateUtils/lint/lint-frontend.js +4 -4
- package/appnest-command-line/validateUtils/lint/lint-utils.js +67 -56
- package/appnest-command-line/validateUtils/lint/lint.js +5 -5
- package/appnest-command-line/validateUtils/manifestUtils.js +359 -120
- package/appnest-command-line/zipUtils.js +1 -1
- package/appnest-engine-commands.md +46 -0
- package/appnest-install-frontend/package.json +1 -1
- package/appnest-install-frontend/vite.config.js +4 -4
- package/appnest-proxy/server.js +20 -14
- package/cli.js +6 -4
- package/package.json +3 -1
package/appnest-proxy/server.js
CHANGED
|
@@ -63,8 +63,8 @@ const appProjectOverview = {
|
|
|
63
63
|
'ispresent': fs.existsSync(path.join(process.env.ORIGINAL_CWD, './app-backend')),
|
|
64
64
|
},
|
|
65
65
|
'appInstallationFrontend': {
|
|
66
|
-
'path': path.join(process.env.ORIGINAL_CWD, './app-
|
|
67
|
-
'ispresent': fs.existsSync(path.join(process.env.ORIGINAL_CWD, './app-
|
|
66
|
+
'path': path.join(process.env.ORIGINAL_CWD, './app-install-frontend'),
|
|
67
|
+
'ispresent': fs.existsSync(path.join(process.env.ORIGINAL_CWD, './app-install-frontend')),
|
|
68
68
|
},
|
|
69
69
|
};
|
|
70
70
|
|
|
@@ -80,12 +80,15 @@ let appInjectedEnv = {};
|
|
|
80
80
|
const startAppBackend = () => {
|
|
81
81
|
try {
|
|
82
82
|
// Start app-backend (Express)
|
|
83
|
+
const appBackendPrefix = appnestProjects['appnest-backend'];
|
|
84
|
+
const appBackendEnv = { ...process.env, ...appInjectedEnv, PORT: appBackendPort };
|
|
85
|
+
// console.log('📦 Command: npm run dev --prefix', appBackendPrefix, '| env:', appBackendEnv);
|
|
83
86
|
appBackendProcess = spawn(
|
|
84
87
|
'npm',
|
|
85
|
-
['run', 'dev', '--prefix',
|
|
88
|
+
['run', 'dev', '--prefix', appBackendPrefix],
|
|
86
89
|
{
|
|
87
90
|
stdio: 'inherit',
|
|
88
|
-
env:
|
|
91
|
+
env: appBackendEnv,
|
|
89
92
|
}
|
|
90
93
|
);
|
|
91
94
|
console.log(`🚀 Starting app-backend... on port ${appBackendPort}`);
|
|
@@ -100,13 +103,16 @@ const startAppFrontend = () => {
|
|
|
100
103
|
try {
|
|
101
104
|
console.log('📂 App Injected Environment Variables :', appInjectedEnv);
|
|
102
105
|
console.log('📂 App Injected Environment Variables - CLIENT_SCRIPT_URL :', appInjectedEnv.CLIENT_SCRIPT_URL);
|
|
106
|
+
const appFrontendPrefix = appnestProjects['appnest-frontend'];
|
|
107
|
+
const appFrontendEnv = { ...process.env, PORT: appFrontendPort, CLIENT_SCRIPT_URL: appInjectedEnv.CLIENT_SCRIPT_URL };
|
|
108
|
+
// console.log('📦 Command: npm run dev --prefix', appFrontendPrefix, '| env:', appFrontendEnv);
|
|
103
109
|
// Start app-frontend (React)
|
|
104
110
|
appFrontendProcess = spawn(
|
|
105
111
|
'npm',
|
|
106
|
-
['run', 'dev', '--prefix',
|
|
112
|
+
['run', 'dev', '--prefix', appFrontendPrefix],
|
|
107
113
|
{
|
|
108
114
|
stdio: 'inherit',
|
|
109
|
-
env:
|
|
115
|
+
env: appFrontendEnv,
|
|
110
116
|
}
|
|
111
117
|
);
|
|
112
118
|
console.log(`🚀 Starting app-frontend... on port ${appFrontendPort}`);
|
|
@@ -120,7 +126,7 @@ const startAppInstallationFrontend = () => {
|
|
|
120
126
|
try {
|
|
121
127
|
console.log('📂 App Injected Environment Variables :', appInjectedEnv);
|
|
122
128
|
console.log('📂 App Injected Environment Variables - CLIENT_SCRIPT_URL :', appInjectedEnv.CLIENT_SCRIPT_URL);
|
|
123
|
-
// Start app-
|
|
129
|
+
// Start app-install-frontend (React)
|
|
124
130
|
appInstallationFrontendProcess = spawn(
|
|
125
131
|
'npm',
|
|
126
132
|
['run', 'dev', '--prefix', appnestProjects['appnest-install-frontend']],
|
|
@@ -129,9 +135,9 @@ const startAppInstallationFrontend = () => {
|
|
|
129
135
|
env: { ...process.env, PORT: appInstallationFrontendPort, CLIENT_SCRIPT_URL: appInjectedEnv.CLIENT_SCRIPT_URL },
|
|
130
136
|
}
|
|
131
137
|
);
|
|
132
|
-
console.log(`🚀 Starting app-
|
|
138
|
+
console.log(`🚀 Starting app-install-frontend... on port ${appInstallationFrontendPort}`);
|
|
133
139
|
} catch (error) {
|
|
134
|
-
console.error('❌ Error starting app-
|
|
140
|
+
console.error('❌ Error starting app-install-frontend:', error);
|
|
135
141
|
throw error;
|
|
136
142
|
}
|
|
137
143
|
}
|
|
@@ -195,7 +201,7 @@ async function startServers() {
|
|
|
195
201
|
res.json({
|
|
196
202
|
'app-backend': appBackendProcess ? 'running' : 'stopped',
|
|
197
203
|
'app-frontend': appFrontendProcess ? 'running' : 'stopped',
|
|
198
|
-
'app-
|
|
204
|
+
'app-install-frontend': appProjectOverview['appInstallationFrontend']['ispresent'] === true ? (appInstallationFrontendProcess ? 'running' : 'stopped') : 'not present',
|
|
199
205
|
});
|
|
200
206
|
});
|
|
201
207
|
|
|
@@ -260,10 +266,10 @@ async function startServers() {
|
|
|
260
266
|
})
|
|
261
267
|
);
|
|
262
268
|
|
|
263
|
-
// 3. Proxy app-
|
|
269
|
+
// 3. Proxy app-install-frontend
|
|
264
270
|
if (appProjectOverview['appInstallationFrontend']['ispresent'] === true) {
|
|
265
271
|
app.use(
|
|
266
|
-
'/app-
|
|
272
|
+
'/app-install-frontend',
|
|
267
273
|
createProxyMiddleware({
|
|
268
274
|
target: `http://localhost:${appInstallationFrontendPort}`,
|
|
269
275
|
changeOrigin: true,
|
|
@@ -322,10 +328,10 @@ async function startServers() {
|
|
|
322
328
|
});
|
|
323
329
|
|
|
324
330
|
if(appProjectOverview['appInstallationFrontend']['ispresent'] === true) {
|
|
325
|
-
chokidar.watch(process.env.ORIGINAL_CWD + '/app-
|
|
331
|
+
chokidar.watch(process.env.ORIGINAL_CWD + '/app-install-frontend', { ignored: /node_modules|\.git/ })
|
|
326
332
|
.on('all', (event, filePath) => {
|
|
327
333
|
if(appInjectedEnv.DEBUG_FILE_CHANGES === 'true') {
|
|
328
|
-
console.log(`📂 app-
|
|
334
|
+
console.log(`📂 app-install-frontend change detected: ${filePath}`);
|
|
329
335
|
}
|
|
330
336
|
// Optional: restart dev server only for config changes
|
|
331
337
|
if (filePath.endsWith('vite.config.js') || filePath.endsWith('.env')) {
|
package/cli.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
console.log("🚀 Appnest Engine CLI Dev running!");
|
|
3
3
|
|
|
4
4
|
const path = require("path");
|
|
5
|
-
const { appnestAction, helpAction } = require("./appnest-command-line/appnest-command.js");
|
|
5
|
+
const { appnestAction, helpAction, HELP_TEXT } = require("./appnest-command-line/appnest-command.js");
|
|
6
6
|
const { Command } = require("commander");
|
|
7
7
|
const { version } = require("./package.json");
|
|
8
8
|
|
|
@@ -18,11 +18,13 @@ const program = new Command();
|
|
|
18
18
|
program
|
|
19
19
|
.name("appnest")
|
|
20
20
|
.description("Appnest Engine Development CLI")
|
|
21
|
-
.version(version)
|
|
21
|
+
.version(version)
|
|
22
|
+
.showHelpAfterError();
|
|
22
23
|
|
|
23
24
|
program
|
|
24
|
-
.command("
|
|
25
|
-
.description("
|
|
25
|
+
.command("app [param]")
|
|
26
|
+
.description("Run an app action. Use 'app', 'app help', or 'app -h' to list all actions.")
|
|
27
|
+
.addHelpText("after", HELP_TEXT)
|
|
26
28
|
.action(async (param) => {
|
|
27
29
|
await appnestAction(param || "");
|
|
28
30
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aravinthan_p/appnest-engine",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.22",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"bin": {
|
|
@@ -10,8 +10,10 @@
|
|
|
10
10
|
"license": "ISC",
|
|
11
11
|
"description": "",
|
|
12
12
|
"dependencies": {
|
|
13
|
+
"@eslint/js": "^9.39.2",
|
|
13
14
|
"commander": "^14.0.2",
|
|
14
15
|
"eslint": "^9.39.2",
|
|
16
|
+
"globals": "^14.0.0",
|
|
15
17
|
"stylelint": "^17.3.0"
|
|
16
18
|
}
|
|
17
19
|
}
|