@ubox-tools/deploy-xperience 1.1.10 → 1.1.11
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/README.md +1 -1
- package/deploy.js +4 -1
- 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 =
|
|
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(
|
|
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
|
}
|
package/package.json
CHANGED