@aravinthan_p/appnest-engine 1.0.19 → 1.0.21

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 CHANGED
@@ -36,7 +36,7 @@ Appnest Engine runs in the **developer’s project directory** (where `app-backe
36
36
  │ • Allocates ports for app-backend, app-frontend, app-installation-* │
37
37
  │ • Starts appnest-backend (loads user’s app-backend/server.js) │
38
38
  │ • Starts appnest-frontend (Vite dev server for app-frontend) │
39
- │ • Starts appnest-installation-frontend if folder exists │
39
+ │ • Starts appnest-install-frontend if folder exists │
40
40
  │ • Proxies: │
41
41
  │ /app-backend/* → app-backend │
42
42
  │ /app-frontend/* → app-frontend │
@@ -57,7 +57,7 @@ Appnest Engine runs in the **developer’s project directory** (where `app-backe
57
57
  ```
58
58
 
59
59
  - **User directory** = where the developer runs the CLI (`process.cwd()` → `ORIGINAL_CWD` for child processes).
60
- - **Engine packages** = `appnest-backend`, `appnest-frontend`, `appnest-installation-frontend`, `appnest-proxy` (inside this repo). They are the runtime that loads and serves the **app** folders from the user directory.
60
+ - **Engine packages** = `appnest-backend`, `appnest-frontend`, `appnest-install-frontend`, `appnest-proxy` (inside this repo). They are the runtime that loads and serves the **app** folders from the user directory.
61
61
 
62
62
  ---
63
63
 
@@ -72,7 +72,7 @@ Appnest Engine runs in the **developer’s project directory** (where `app-backe
72
72
  | **appnest-proxy/** | Express server on port 3000; env from user `.env`; starts backend + frontends; proxies and file watching. |
73
73
  | **appnest-backend/** | Express app that loads the user’s `app-backend/server.js` and exposes it under `/app-backend`. |
74
74
  | **appnest-frontend/** | Vite dev server for the user’s `app-frontend`. |
75
- | **appnest-installation-frontend/** | Vite dev server for the user’s `app-installation-frontend` (optional). |
75
+ | **appnest-install-frontend/** | Vite dev server for the user’s `app-installation-frontend` (optional). |
76
76
 
77
77
  The developer’s project (user directory) is expected to have:
78
78
 
@@ -90,7 +90,7 @@ cd appnest-engine
90
90
  npm install
91
91
  ```
92
92
 
93
- If this repo uses **npm workspaces**, a single `npm install` at the root also installs dependencies for `appnest-backend`, `appnest-frontend`, `appnest-installation-frontend`, and `appnest-proxy`.
93
+ If this repo uses **npm workspaces**, a single `npm install` at the root also installs dependencies for `appnest-backend`, `appnest-frontend`, `appnest-install-frontend`, and `appnest-proxy`.
94
94
 
95
95
  ---
96
96
 
@@ -125,7 +125,7 @@ From the **appnest-engine** directory, or with the `appnest-engine` binary on `P
125
125
  2. **Proxy** reads `.env` from `ORIGINAL_CWD`, allocates ports for backend and frontends, then:
126
126
  - Starts **appnest-backend** (which loads the user’s `app-backend/server.js`).
127
127
  - Starts **appnest-frontend** (Vite for `app-frontend`).
128
- - If `app-installation-frontend` exists, starts **appnest-installation-frontend**.
128
+ - If `app-installation-frontend` exists, starts **appnest-install-frontend**.
129
129
  3. Proxy mounts:
130
130
  - `/app-backend` → app-backend
131
131
  - `/app-frontend` → app-frontend
@@ -136,7 +136,7 @@ From the **appnest-engine** directory, or with the `appnest-engine` binary on `P
136
136
 
137
137
  ## Zip / bundle flow
138
138
 
139
- - **`run zip-app`** runs **bundle-frontend** first (builds appnest-frontend and appnest-installation-frontend), then zips the **user’s** `app-frontend`, `app-backend`, and `app-installation-frontend` into **appnest-app-pack** (and updates paths in `app-frontend/dist/index.html` as needed). Use this to produce a single pack for deployment or distribution.
139
+ - **`run zip-app`** runs **bundle-frontend** first (builds appnest-frontend and appnest-install-frontend), then zips the **user’s** `app-frontend`, `app-backend`, and `app-installation-frontend` into **appnest-app-pack** (and updates paths in `app-frontend/dist/index.html` as needed). Use this to produce a single pack for deployment or distribution.
140
140
 
141
141
  ---
142
142
 
@@ -13,7 +13,7 @@ const { validateApp, validateAppFix } = require('./validateUtils');
13
13
  const projects = {
14
14
  'appnest-backend': path.join(__dirname, '../appnest-backend'),
15
15
  'appnest-frontend': path.join(__dirname, '../appnest-frontend'),
16
- 'appnest-installation-frontend': path.join(__dirname, '../appnest-installation-frontend'),
16
+ 'appnest-install-frontend': path.join(__dirname, '../appnest-install-frontend'),
17
17
  'appnest-proxy': path.join(__dirname, '../appnest-proxy'),
18
18
  'app-frontend': path.join(userDir, './app-frontend'),
19
19
  'app-installation-frontend': path.join(userDir, './app-installation-frontend'),
@@ -6,8 +6,8 @@ const bundleFrontend = ({ projects }) => {
6
6
  console.log('📦 Bundling the frontend app project...');
7
7
  const appFrontendProject = projects['appnest-frontend'];
8
8
  bundleFrontendProject({ frontendProject: appFrontendProject, projectName: 'appnest-frontend' });
9
- const appInstallationFrontendProject = projects['appnest-installation-frontend'];
10
- bundleFrontendProject({ frontendProject: appInstallationFrontendProject, projectName: 'appnest-installation-frontend' });
9
+ const appInstallFrontendProject = projects['appnest-install-frontend'];
10
+ bundleFrontendProject({ frontendProject: appInstallFrontendProject, projectName: 'appnest-install-frontend' });
11
11
  console.log('✅ All frontend app projects bundled successfully.');
12
12
  }
13
13
 
@@ -8,7 +8,7 @@ const installPackages = ({ projects }) => {
8
8
  const projectsToInstallKeys = [
9
9
  'appnest-backend',
10
10
  'appnest-frontend',
11
- 'appnest-installation-frontend',
11
+ 'appnest-install-frontend',
12
12
  'appnest-proxy'
13
13
  ];
14
14
  const projectsToInstall = projectsToInstallKeys.reduce((acc, key) => {
@@ -1,6 +1,5 @@
1
1
  import { StrictMode } from 'react'
2
2
  import { createRoot } from 'react-dom/client'
3
- import './index.css'
4
3
  import CoreUI from './CoreUI.jsx'
5
4
 
6
5
  createRoot(document.getElementById('root')).render(
@@ -1,7 +1,6 @@
1
1
  // src/App.jsx
2
2
  import React, { Suspense } from 'react';
3
3
  import { ErrorBoundary } from 'react-error-boundary';
4
- import './CoreUI.css';
5
4
 
6
5
  let App;
7
6
 
@@ -33,7 +32,41 @@ export default function CoreUI() {
33
32
  return (
34
33
  <>
35
34
  <ErrorBoundary FallbackComponent={ErrorFallback}>
36
- <Suspense fallback={<div>Loading developer UI...</div>}>
35
+ {/* <Suspense fallback={<div>Loading developer UI...</div>}>
36
+ <App />
37
+ </Suspense> */}
38
+ <Suspense
39
+ fallback={
40
+ <div
41
+ style={{
42
+ display: 'flex',
43
+ flexDirection: 'column',
44
+ alignItems: 'center',
45
+ justifyContent: 'center',
46
+ minHeight: '100vh',
47
+ gap: '1rem',
48
+ background: 'linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%)',
49
+ fontFamily: 'system-ui, -apple-system, sans-serif',
50
+ color: '#475569',
51
+ }}
52
+ >
53
+ <div
54
+ style={{
55
+ width: 40,
56
+ height: 40,
57
+ border: '3px solid #e2e8f0',
58
+ borderTopColor: '#3b82f6',
59
+ borderRadius: '50%',
60
+ animation: 'spin 0.8s linear infinite',
61
+ }}
62
+ />
63
+ <style>{`@keyframes spin { to { transform: rotate(360deg); } }`}</style>
64
+ <span style={{ fontSize: '0.9375rem', fontWeight: 500 }}>
65
+ Loading Appnest Engine...
66
+ </span>
67
+ </div>
68
+ }
69
+ >
37
70
  <App />
38
71
  </Suspense>
39
72
  </ErrorBoundary>
@@ -55,6 +55,16 @@ export default defineConfig({
55
55
  'node_modules/react/jsx-runtime'
56
56
  ),
57
57
  },
58
+ modules: [
59
+ path.resolve(userProjectPath, 'app-frontend/node_modules'),
60
+ 'node_modules'
61
+ ]
62
+ },
63
+ optimizeDeps: {
64
+ entries: [
65
+ path.resolve(userProjectPath, 'app-frontend/src/**/*.jsx'),
66
+ path.resolve(userProjectPath, 'app-frontend/src/**/*.js')
67
+ ]
58
68
  },
59
69
  build: {
60
70
  // Output dist folder inside the developer’s project
@@ -1,11 +1,11 @@
1
1
  {
2
- "name": "appnest-installation-frontend",
2
+ "name": "appnest-install-frontend",
3
3
  "version": "0.0.0",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
- "name": "appnest-installation-frontend",
8
+ "name": "appnest-install-frontend",
9
9
  "version": "0.0.0",
10
10
  "dependencies": {
11
11
  "react": "^19.1.1",
@@ -1,5 +1,5 @@
1
1
  {
2
- "name":"appnest-installation-frontend",
2
+ "name": "appnest-install-frontend",
3
3
  "private": true,
4
4
  "version": "0.0.0",
5
5
  "type": "module",
@@ -50,7 +50,7 @@ const getAppEnv = () => {
50
50
  const appnestProjects = {
51
51
  'appnest-backend': path.join(__dirname, '../appnest-backend'),
52
52
  'appnest-frontend': path.join(__dirname, '../appnest-frontend'),
53
- 'appnest-installation-frontend': path.join(__dirname, '../appnest-installation-frontend'),
53
+ 'appnest-install-frontend': path.join(__dirname, '../appnest-install-frontend'),
54
54
  };
55
55
 
56
56
  const appProjectOverview = {
@@ -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', appnestProjects['appnest-backend']],
88
+ ['run', 'dev', '--prefix', appBackendPrefix],
86
89
  {
87
90
  stdio: 'inherit',
88
- env: { ...process.env, PORT: appBackendPort },
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', appnestProjects['appnest-frontend']],
112
+ ['run', 'dev', '--prefix', appFrontendPrefix],
107
113
  {
108
114
  stdio: 'inherit',
109
- env: { ...process.env, PORT: appFrontendPort, CLIENT_SCRIPT_URL: appInjectedEnv.CLIENT_SCRIPT_URL },
115
+ env: appFrontendEnv,
110
116
  }
111
117
  );
112
118
  console.log(`🚀 Starting app-frontend... on port ${appFrontendPort}`);
@@ -123,7 +129,7 @@ const startAppInstallationFrontend = () => {
123
129
  // Start app-installation-frontend (React)
124
130
  appInstallationFrontendProcess = spawn(
125
131
  'npm',
126
- ['run', 'dev', '--prefix', appnestProjects['appnest-installation-frontend']],
132
+ ['run', 'dev', '--prefix', appnestProjects['appnest-install-frontend']],
127
133
  {
128
134
  stdio: 'inherit',
129
135
  env: { ...process.env, PORT: appInstallationFrontendPort, CLIENT_SCRIPT_URL: appInjectedEnv.CLIENT_SCRIPT_URL },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aravinthan_p/appnest-engine",
3
- "version": "1.0.19",
3
+ "version": "1.0.21",
4
4
  "main": "index.js",
5
5
  "keywords": [],
6
6
  "bin": {