@cedarjs/vite 0.15.1-next.0 → 0.15.1-next.23
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.
|
@@ -90,22 +90,26 @@ function getMergedConfig(rwConfig, rwPaths) {
|
|
|
90
90
|
setTimeout(() => {
|
|
91
91
|
waitingForApiServer = false;
|
|
92
92
|
}, 2500);
|
|
93
|
-
proxy.on("error", (err,
|
|
94
|
-
|
|
95
|
-
|
|
93
|
+
proxy.on("error", (err, req, res) => {
|
|
94
|
+
const isWaiting = waitingForApiServer && err.message.includes("ECONNREFUSED");
|
|
95
|
+
if (!isWaiting) {
|
|
96
|
+
console.error(err);
|
|
96
97
|
}
|
|
97
|
-
const
|
|
98
|
+
const isAuthTokenRequest = isWaiting && req.url === "/auth?method=getToken";
|
|
99
|
+
const waitingMessage = "\u231B API Server launching, please refresh your page...";
|
|
100
|
+
const genericMessage = "The Cedar API server is not available or is currently reloading. Please refresh.";
|
|
101
|
+
const responseBody = {
|
|
98
102
|
errors: [
|
|
99
|
-
{
|
|
100
|
-
message: "The RedwoodJS API server is not available or is currently reloading. Please refresh."
|
|
101
|
-
}
|
|
103
|
+
{ message: isWaiting ? waitingMessage : genericMessage }
|
|
102
104
|
]
|
|
103
105
|
};
|
|
104
106
|
res.writeHead(203, {
|
|
105
107
|
"Content-Type": "application/json",
|
|
106
108
|
"Cache-Control": "no-cache"
|
|
107
109
|
});
|
|
108
|
-
|
|
110
|
+
if (!isAuthTokenRequest) {
|
|
111
|
+
res.write(JSON.stringify(responseBody));
|
|
112
|
+
}
|
|
109
113
|
res.end();
|
|
110
114
|
});
|
|
111
115
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getMergedConfig.d.ts","sourceRoot":"","sources":["../../src/lib/getMergedConfig.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAE9D,OAAO,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAA;AAO5D;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,IACtD,YAAY,cAAc,EAAE,KAAK,SAAS,KAAG,cAAc,
|
|
1
|
+
{"version":3,"file":"getMergedConfig.d.ts","sourceRoot":"","sources":["../../src/lib/getMergedConfig.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAE9D,OAAO,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAA;AAO5D;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,IACtD,YAAY,cAAc,EAAE,KAAK,SAAS,KAAG,cAAc,CA0JpE"}
|
|
@@ -61,22 +61,26 @@ function getMergedConfig(rwConfig, rwPaths) {
|
|
|
61
61
|
setTimeout(() => {
|
|
62
62
|
waitingForApiServer = false;
|
|
63
63
|
}, 2500);
|
|
64
|
-
proxy.on("error", (err,
|
|
65
|
-
|
|
66
|
-
|
|
64
|
+
proxy.on("error", (err, req, res) => {
|
|
65
|
+
const isWaiting = waitingForApiServer && err.message.includes("ECONNREFUSED");
|
|
66
|
+
if (!isWaiting) {
|
|
67
|
+
console.error(err);
|
|
67
68
|
}
|
|
68
|
-
const
|
|
69
|
+
const isAuthTokenRequest = isWaiting && req.url === "/auth?method=getToken";
|
|
70
|
+
const waitingMessage = "\u231B API Server launching, please refresh your page...";
|
|
71
|
+
const genericMessage = "The Cedar API server is not available or is currently reloading. Please refresh.";
|
|
72
|
+
const responseBody = {
|
|
69
73
|
errors: [
|
|
70
|
-
{
|
|
71
|
-
message: "The RedwoodJS API server is not available or is currently reloading. Please refresh."
|
|
72
|
-
}
|
|
74
|
+
{ message: isWaiting ? waitingMessage : genericMessage }
|
|
73
75
|
]
|
|
74
76
|
};
|
|
75
77
|
res.writeHead(203, {
|
|
76
78
|
"Content-Type": "application/json",
|
|
77
79
|
"Cache-Control": "no-cache"
|
|
78
80
|
});
|
|
79
|
-
|
|
81
|
+
if (!isAuthTokenRequest) {
|
|
82
|
+
res.write(JSON.stringify(responseBody));
|
|
83
|
+
}
|
|
80
84
|
res.end();
|
|
81
85
|
});
|
|
82
86
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cedarjs/vite",
|
|
3
|
-
"version": "0.15.1-next.
|
|
3
|
+
"version": "0.15.1-next.23+0753a9ca2",
|
|
4
4
|
"description": "Vite configuration package for CedarJS",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -64,14 +64,14 @@
|
|
|
64
64
|
"@babel/generator": "7.27.5",
|
|
65
65
|
"@babel/parser": "7.27.5",
|
|
66
66
|
"@babel/traverse": "7.27.4",
|
|
67
|
-
"@cedarjs/auth": "0.15.1-next.
|
|
68
|
-
"@cedarjs/babel-config": "0.15.1-next.
|
|
69
|
-
"@cedarjs/cookie-jar": "0.15.1-next.
|
|
70
|
-
"@cedarjs/internal": "0.15.1-next.
|
|
71
|
-
"@cedarjs/project-config": "0.15.1-next.
|
|
72
|
-
"@cedarjs/server-store": "0.15.1-next.
|
|
73
|
-
"@cedarjs/testing": "0.15.1-next.
|
|
74
|
-
"@cedarjs/web": "0.15.1-next.
|
|
67
|
+
"@cedarjs/auth": "0.15.1-next.23+0753a9ca2",
|
|
68
|
+
"@cedarjs/babel-config": "0.15.1-next.23+0753a9ca2",
|
|
69
|
+
"@cedarjs/cookie-jar": "0.15.1-next.23+0753a9ca2",
|
|
70
|
+
"@cedarjs/internal": "0.15.1-next.23+0753a9ca2",
|
|
71
|
+
"@cedarjs/project-config": "0.15.1-next.23+0753a9ca2",
|
|
72
|
+
"@cedarjs/server-store": "0.15.1-next.23+0753a9ca2",
|
|
73
|
+
"@cedarjs/testing": "0.15.1-next.23+0753a9ca2",
|
|
74
|
+
"@cedarjs/web": "0.15.1-next.23+0753a9ca2",
|
|
75
75
|
"@swc/core": "1.13.5",
|
|
76
76
|
"@vitejs/plugin-react": "4.3.4",
|
|
77
77
|
"@whatwg-node/fetch": "0.9.21",
|
|
@@ -118,5 +118,5 @@
|
|
|
118
118
|
"publishConfig": {
|
|
119
119
|
"access": "public"
|
|
120
120
|
},
|
|
121
|
-
"gitHead": "
|
|
121
|
+
"gitHead": "0753a9ca25ba21702aed57f7f5e8b49db9957984"
|
|
122
122
|
}
|