@ubox-tools/deploy-xperience 1.1.10 → 1.1.12

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.
Files changed (3) hide show
  1. package/README.md +1 -1
  2. package/deploy.js +10 -1
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -110,7 +110,7 @@ Before injecting source files, `generateProxy()` applies three transforms to eac
110
110
 
111
111
  | Transform | Applies to | What it does |
112
112
  |---|---|---|
113
- | Parameter substitution | JS | Replaces `const KEY = "value"` with `const KEY = "{parameter:KEY}"` for every key in `parameters.json` |
113
+ | Parameter substitution | JS | Replaces `const KEY = <value>` with `const KEY = "{parameter:KEY}"` for every key in `parameters.json` (value may be a string, number, boolean, null, undefined, or template literal) |
114
114
  | Asset path substitution | JS, CSS | Replaces `../assets/file.ext` references with `{resources:type/file.ext}` tokens |
115
115
  | Emoji escaping | JS | Converts non-ASCII characters to `\uXXXX` Unicode escape sequences |
116
116
  | Local tag stripping | HTML | Removes local `<link href>` and `<script src>` tags (CDN URLs are kept) |
package/deploy.js CHANGED
@@ -241,7 +241,10 @@ function generateProxy(appName) {
241
241
  // 1. Parameter token substitution (JS only — parameters live in JS files)
242
242
  if (isJS) {
243
243
  for (const key of Object.keys(params)) {
244
- const re = new RegExp(`((?:const|let|var)\\s+${key}\\s*=\\s*)(?:"[^"]*"|'[^']*')`, 'g');
244
+ const re = new RegExp(
245
+ `((?:const|let|var)\\s+${key}\\s*=\\s*)(?:"[^"]*"|'[^']*'|\`[^\`]*\`|-?\\d+\\.?\\d*(?:[eE][+-]?\\d+)?|true|false|null|undefined)`,
246
+ 'g'
247
+ );
245
248
  content = content.replace(re, `$1"{parameter:${key}}"`);
246
249
  }
247
250
  }
@@ -268,6 +271,12 @@ function generateProxy(appName) {
268
271
  });
269
272
  }
270
273
 
274
+ // 2b. Log substitution results
275
+ if (isJS && Object.keys(params).length > 0) {
276
+ const hit = Object.keys(params).filter(k => content.includes(`{parameter:${k}}`));
277
+ console.log(` [proxy] ${file}: ${hit.length}/${Object.keys(params).length} params substituted${hit.length ? ': ' + hit.join(', ') : ''}`);
278
+ }
279
+
271
280
  // 3. Emoji → unicode escapes (JS only)
272
281
  if (isJS) content = escapeEmojiInJS(content);
273
282
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ubox-tools/deploy-xperience",
3
- "version": "1.1.10",
3
+ "version": "1.1.12",
4
4
  "description": "Deploy a Ubox experience to studio.ubox.world",
5
5
  "bin": { "deploy-xperience": "./deploy.js" },
6
6
  "dependencies": { "puppeteer": "*" },