@gxp-dev/tools 2.0.53 → 2.0.55

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.53",
3
+ "version": "2.0.55",
4
4
  "description": "Dev tools to create platform plugins",
5
5
  "type": "commonjs",
6
6
  "publishConfig": {
@@ -127,6 +127,10 @@ export default defineConfig(({ mode }) => {
127
127
  const useLocalIndex = env.USE_LOCAL_INDEX === "true" && hasLocalIndexHtml;
128
128
  const useLocalMain = env.USE_LOCAL_MAIN === "true" && hasLocalMainJs;
129
129
 
130
+ // Plugin enable/disable flags
131
+ const useSourceTracker = env.DISABLE_SOURCE_TRACKER !== "true";
132
+ const useInspector = env.DISABLE_INSPECTOR !== "true";
133
+
130
134
  // Log which files are being used
131
135
  console.log(`📄 index.html: ${useLocalIndex ? "local" : "runtime"}`);
132
136
  console.log(`📄 main.js: ${useLocalMain ? "local" : "runtime"}`);
@@ -239,10 +243,10 @@ export default defineConfig(({ mode }) => {
239
243
  plugins: [
240
244
  runtimeFilesPlugin,
241
245
  // Source tracker must run BEFORE vue() to transform templates before compilation
242
- gxpSourceTrackerPlugin(),
246
+ ...(useSourceTracker ? [gxpSourceTrackerPlugin()] : []),
243
247
  vue(),
244
248
  // GxP Inspector plugin for browser extension integration
245
- gxpInspectorPlugin(),
249
+ ...(useInspector ? [gxpInspectorPlugin()] : []),
246
250
  externalGlobals(
247
251
  {
248
252
  vue: "Vue",
@@ -313,17 +317,24 @@ export default defineConfig(({ mode }) => {
313
317
  https: getHttpsConfig(env),
314
318
  allowedHosts: env.ALLOWED_HOSTS
315
319
  ? env.ALLOWED_HOSTS.split(",").map((h) => h.trim()).filter(Boolean)
316
- : [],
320
+ : "all",
317
321
  cors: {
318
322
  origin: "*",
319
- methods: ["GET", "POST", "PUT", "DELETE", "OPTIONS"],
323
+ methods: ["GET", "POST", "PUT, DELETE", "OPTIONS"],
320
324
  allowedHeaders: ["*"],
321
325
  credentials: false,
322
326
  },
323
- hmr: {
324
- clientPort:
325
- parseInt(env.CLIENT_PORT) || parseInt(env.NODE_PORT) || 3060,
326
- },
327
+ hmr: env.HMR_HOST
328
+ ? {
329
+ protocol: env.HMR_PROTOCOL || "wss",
330
+ host: env.HMR_HOST,
331
+ port: parseInt(env.HMR_PORT) || 443,
332
+ clientPort: parseInt(env.HMR_PORT) || 443,
333
+ }
334
+ : {
335
+ clientPort:
336
+ parseInt(env.CLIENT_PORT) || parseInt(env.NODE_PORT) || 3060,
337
+ },
327
338
  host: true, // Allow access from network
328
339
  // Allow serving files from the toolkit runtime directory
329
340
  // 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