@gxp-dev/tools 2.0.52 → 2.0.54

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gxp-dev/tools",
3
- "version": "2.0.52",
3
+ "version": "2.0.54",
4
4
  "description": "Dev tools to create platform plugins",
5
5
  "type": "commonjs",
6
6
  "publishConfig": {
@@ -259,6 +259,14 @@ export default defineConfig(({ mode }) => {
259
259
  name: "request-logger-cors",
260
260
  configureServer(server) {
261
261
  server.middlewares.use((req, res, next) => {
262
+ // Health check route
263
+ if (req.url === "/__health") {
264
+ res.statusCode = 200;
265
+ res.setHeader("Content-Type", "application/json");
266
+ res.end(JSON.stringify({ status: "ok" }));
267
+ return;
268
+ }
269
+
262
270
  const start = Date.now();
263
271
  const originalEnd = res.end;
264
272
 
@@ -305,17 +313,24 @@ export default defineConfig(({ mode }) => {
305
313
  https: getHttpsConfig(env),
306
314
  allowedHosts: env.ALLOWED_HOSTS
307
315
  ? env.ALLOWED_HOSTS.split(",").map((h) => h.trim()).filter(Boolean)
308
- : [],
316
+ : "all",
309
317
  cors: {
310
318
  origin: "*",
311
- methods: ["GET", "POST", "PUT", "DELETE", "OPTIONS"],
319
+ methods: ["GET", "POST", "PUT, DELETE", "OPTIONS"],
312
320
  allowedHeaders: ["*"],
313
321
  credentials: false,
314
322
  },
315
- hmr: {
316
- clientPort:
317
- parseInt(env.CLIENT_PORT) || parseInt(env.NODE_PORT) || 3060,
318
- },
323
+ hmr: env.HMR_HOST
324
+ ? {
325
+ protocol: env.HMR_PROTOCOL || "wss",
326
+ host: env.HMR_HOST,
327
+ port: parseInt(env.HMR_PORT) || 443,
328
+ clientPort: parseInt(env.HMR_PORT) || 443,
329
+ }
330
+ : {
331
+ clientPort:
332
+ parseInt(env.CLIENT_PORT) || parseInt(env.NODE_PORT) || 3060,
333
+ },
319
334
  host: true, // Allow access from network
320
335
  // Allow serving files from the toolkit runtime directory
321
336
  // Also resolve symlinks to allow files from the real path
@@ -262,17 +262,24 @@ export default defineConfig(({ mode }) => {
262
262
  https: getHttpsConfig(env),
263
263
  allowedHosts: env.ALLOWED_HOSTS
264
264
  ? env.ALLOWED_HOSTS.split(",").map((h) => h.trim()).filter(Boolean)
265
- : [],
265
+ : "all",
266
266
  cors: {
267
267
  origin: "*",
268
268
  methods: ["GET", "POST", "PUT", "DELETE", "OPTIONS"],
269
269
  allowedHeaders: ["*"],
270
270
  credentials: false,
271
271
  },
272
- hmr: {
273
- clientPort:
274
- parseInt(env.CLIENT_PORT) || parseInt(env.NODE_PORT) || 3060,
275
- },
272
+ hmr: env.HMR_HOST
273
+ ? {
274
+ protocol: env.HMR_PROTOCOL || "wss",
275
+ host: env.HMR_HOST,
276
+ port: parseInt(env.HMR_PORT) || 443,
277
+ clientPort: parseInt(env.HMR_PORT) || 443,
278
+ }
279
+ : {
280
+ clientPort:
281
+ parseInt(env.CLIENT_PORT) || parseInt(env.NODE_PORT) || 3060,
282
+ },
276
283
  host: true, // Allow access from network
277
284
  // API proxy for non-mock environments
278
285
  proxy: apiProxyTarget