@realtimex/email-automator 2.3.1 → 2.3.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/api/server.ts CHANGED
@@ -66,10 +66,8 @@ app.use('/api', apiRateLimit);
66
66
  // API routes
67
67
  app.use('/api', routes);
68
68
 
69
- // Serve static files - robust resolution for compiled app
70
- // In npx/dist mode, dist is at ../../../dist relative to this file
71
- // In dev mode, it is at ../dist
72
- const distPath = path.join(process.cwd(), 'dist');
69
+ // Serve static files - robust resolution for compiled app and NPX
70
+ const distPath = process.env.ELECTRON_STATIC_PATH || path.join(process.cwd(), 'dist');
73
71
  app.use(express.static(distPath));
74
72
 
75
73
  // Handle client-side routing
@@ -32,11 +32,16 @@ console.log('');
32
32
 
33
33
  // Path to compiled server
34
34
  const serverPath = join(__dirname, '..', 'dist', 'api', 'server.js');
35
+ const distPath = join(__dirname, '..', 'dist');
35
36
 
36
37
  // Start server with standard node
37
38
  const server = spawn(process.execPath, [serverPath, ...args], {
38
39
  stdio: 'inherit',
39
- env: { ...process.env, PORT: port },
40
+ env: {
41
+ ...process.env,
42
+ PORT: port,
43
+ ELECTRON_STATIC_PATH: distPath // Reuse a standard env name for static assets
44
+ },
40
45
  });
41
46
 
42
47
  server.on('error', (error) => {
@@ -55,10 +55,8 @@ app.use((req, res, next) => {
55
55
  app.use('/api', apiRateLimit);
56
56
  // API routes
57
57
  app.use('/api', routes);
58
- // Serve static files - robust resolution for compiled app
59
- // In npx/dist mode, dist is at ../../../dist relative to this file
60
- // In dev mode, it is at ../dist
61
- const distPath = path.join(process.cwd(), 'dist');
58
+ // Serve static files - robust resolution for compiled app and NPX
59
+ const distPath = process.env.ELECTRON_STATIC_PATH || path.join(process.cwd(), 'dist');
62
60
  app.use(express.static(distPath));
63
61
  // Handle client-side routing
64
62
  app.get(/.*/, (req, res, next) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@realtimex/email-automator",
3
- "version": "2.3.1",
3
+ "version": "2.3.2",
4
4
  "type": "module",
5
5
  "main": "dist/api/server.js",
6
6
  "bin": {