@rayburst/cli 0.1.16 → 0.1.17
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.
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { _ as __vitePreload } from './preload-helper-Dea3Szod.js';
|
|
2
2
|
|
|
3
|
-
const remoteEntryPromise = __vitePreload(() => import('./remoteEntry-
|
|
3
|
+
const remoteEntryPromise = __vitePreload(() => import('./remoteEntry-B8biLITo.js'),true ?[]:void 0);
|
|
4
4
|
// __tla only serves as a hack for vite-plugin-top-level-await.
|
|
5
5
|
Promise.resolve(remoteEntryPromise)
|
|
6
6
|
.then(remoteEntry => {
|
|
@@ -77,7 +77,7 @@ const importMap = {
|
|
|
77
77
|
entryGlobalName: "rayburstApp",
|
|
78
78
|
name: "rayburstApp",
|
|
79
79
|
type: "module",
|
|
80
|
-
entry: "https://www.rayburst.app/remoteEntry.js?t=
|
|
80
|
+
entry: "https://www.rayburst.app/remoteEntry.js?t=1763426532048",
|
|
81
81
|
shareScope: "default",
|
|
82
82
|
}
|
|
83
83
|
|
package/dist/index.html
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<!DOCTYPE html>
|
|
2
2
|
<html lang="en">
|
|
3
3
|
<head>
|
|
4
|
-
<script type="module" src="/assets/hostInit-
|
|
4
|
+
<script type="module" src="/assets/hostInit-BWYxHpMp.js"></script>
|
|
5
5
|
|
|
6
6
|
<meta charset="UTF-8" />
|
|
7
7
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rayburst/cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.17",
|
|
4
4
|
"description": "Rayburst CLI - A module federation host for Rayburst app",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -34,6 +34,7 @@
|
|
|
34
34
|
"chokidar": "^4.0.3",
|
|
35
35
|
"commander": "^11.1.0",
|
|
36
36
|
"express": "^4.18.2",
|
|
37
|
+
"http-proxy-middleware": "^3.0.5",
|
|
37
38
|
"ts-morph": "^21.0.1",
|
|
38
39
|
"ws": "^8.18.3"
|
|
39
40
|
},
|
package/server.js
CHANGED
|
@@ -2,6 +2,7 @@ import express from 'express';
|
|
|
2
2
|
import { fileURLToPath } from 'url';
|
|
3
3
|
import { dirname, join } from 'path';
|
|
4
4
|
import { existsSync } from 'fs';
|
|
5
|
+
import { createProxyMiddleware } from 'http-proxy-middleware';
|
|
5
6
|
import {
|
|
6
7
|
listProjects,
|
|
7
8
|
getProject,
|
|
@@ -52,6 +53,45 @@ console.log('');
|
|
|
52
53
|
// Enable JSON body parsing for API routes
|
|
53
54
|
app.use(express.json());
|
|
54
55
|
|
|
56
|
+
// Proxy auth API requests to production API in production/staging mode
|
|
57
|
+
if (NODE_ENV === 'production' || NODE_ENV === 'staging') {
|
|
58
|
+
const apiUrl = NODE_ENV === 'staging' ? 'https://api-dev.rayburst.app' : 'https://api.rayburst.app';
|
|
59
|
+
|
|
60
|
+
app.use('/api/v1/auth', createProxyMiddleware({
|
|
61
|
+
target: apiUrl,
|
|
62
|
+
changeOrigin: true,
|
|
63
|
+
cookieDomainRewrite: 'localhost',
|
|
64
|
+
onProxyReq: (proxyReq, req, res) => {
|
|
65
|
+
// Forward cookies
|
|
66
|
+
if (req.headers.cookie) {
|
|
67
|
+
proxyReq.setHeader('cookie', req.headers.cookie);
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
onProxyRes: (proxyRes, req, res) => {
|
|
71
|
+
// Rewrite set-cookie headers to work with localhost
|
|
72
|
+
const setCookie = proxyRes.headers['set-cookie'];
|
|
73
|
+
if (setCookie) {
|
|
74
|
+
proxyRes.headers['set-cookie'] = setCookie.map(cookie =>
|
|
75
|
+
cookie.replace(/Domain=[^;]+/gi, 'Domain=localhost')
|
|
76
|
+
);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}));
|
|
80
|
+
|
|
81
|
+
app.use('/api/v1/newsletter', createProxyMiddleware({
|
|
82
|
+
target: apiUrl,
|
|
83
|
+
changeOrigin: true,
|
|
84
|
+
cookieDomainRewrite: 'localhost',
|
|
85
|
+
onProxyReq: (proxyReq, req, res) => {
|
|
86
|
+
if (req.headers.cookie) {
|
|
87
|
+
proxyReq.setHeader('cookie', req.headers.cookie);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}));
|
|
91
|
+
|
|
92
|
+
console.log(`🔄 Proxying auth/newsletter API requests to: ${apiUrl}`);
|
|
93
|
+
}
|
|
94
|
+
|
|
55
95
|
// API Routes - These run regardless of build status
|
|
56
96
|
// GET /api/projects - List all registered projects
|
|
57
97
|
app.get('/api/projects', (req, res) => {
|