@ubox-tools/deploy-xperience 1.1.18 → 1.1.20

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 (2) hide show
  1. package/deploy.js +8 -19
  2. package/package.json +1 -1
package/deploy.js CHANGED
@@ -241,10 +241,7 @@ 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(
245
- `((?:const|let|var)\\s+${key}\\s*=\\s*)(?:"[^"]*"|'[^']*'|\`[^\`]*\`|-?\\d+\\.?\\d*(?:[eE][+-]?\\d+)?|true|false|null|undefined)`,
246
- 'g'
247
- );
244
+ const re = new RegExp(`((?:const|let|var)\\s+${key}\\s*=\\s*)(?:"[^"]*"|'[^']*')`, 'g');
248
245
  content = content.replace(re, `$1"{parameter:${key}}"`);
249
246
  }
250
247
  }
@@ -608,6 +605,9 @@ async function configureParameters(page, params) {
608
605
 
609
606
  console.log(` [params] Creating ${toCreate.length} new parameter(s) (${existingKeys.length} already exist)...`);
610
607
 
608
+ // Accept any confirm() dialogs that Save triggers
609
+ page.on('dialog', async d => { await d.accept(); });
610
+
611
611
  await clickByText(page, 'Edit', 'button');
612
612
  await sleep(1000);
613
613
 
@@ -661,13 +661,11 @@ async function configureParameters(page, params) {
661
661
 
662
662
  async function injectSource(page, proxy) {
663
663
  console.log(' [source] Injecting source files...');
664
- console.log(` [source] URL: ${page.url()}`);
665
664
  await clickByText(page, 'Source');
666
665
  await sleep(1500);
667
666
 
668
667
  await clickByText(page, 'Edit source');
669
668
  await sleep(3000);
670
- console.log(` [source] URL after Edit source: ${page.url()}`);
671
669
 
672
670
  // Tab label → filename
673
671
  const tabs = [
@@ -688,11 +686,8 @@ async function injectSource(page, proxy) {
688
686
  await sleep(500);
689
687
  }
690
688
 
691
- const navPromise = page.waitForNavigation({ waitUntil: 'networkidle2', timeout: 15000 }).catch(() => null);
692
689
  await clickByText(page, 'Save and back to app');
693
- const navResult = await navPromise;
694
- await sleep(1000);
695
- console.log(` [source] URL after save: ${page.url()} (navigated: ${navResult ? 'yes' : 'no'})`);
690
+ await sleep(3000);
696
691
  }
697
692
 
698
693
  async function deployApp(page, appName, projectName, { noAssets = false, noSource = false } = {}) {
@@ -721,7 +716,7 @@ async function deployApp(page, appName, projectName, { noAssets = false, noSourc
721
716
  // Extract app ID from current URL
722
717
  const appId = page.url().match(/#\/application(?:-source)?\/(\d+)/)?.[1] || '?';
723
718
  console.log(` [app] Done — ID: ${appId}`);
724
- return { appId, params };
719
+ return appId;
725
720
  }
726
721
 
727
722
  // ─── Phase 3: Ubox Deployment ─────────────────────────────────────────────────
@@ -1135,12 +1130,6 @@ async function main() {
1135
1130
  const state = {};
1136
1131
 
1137
1132
  try {
1138
- // Always accept any confirm() dialogs the studio may show during deployment
1139
- page.on('dialog', async d => {
1140
- console.log(` [dialog] type=${d.type()} msg="${d.message()}" → accepted`);
1141
- await d.accept();
1142
- });
1143
-
1144
1133
  // Phase 1 — Login
1145
1134
  await login(page, email, password);
1146
1135
 
@@ -1148,9 +1137,9 @@ async function main() {
1148
1137
  const appParamsMap = {};
1149
1138
  for (const appName of apps) {
1150
1139
  state[appName] = {};
1151
- const { appId, params } = await deployApp(page, appName, projectName, { noAssets, noSource });
1152
- state[appName].appId = appId;
1140
+ const { params } = generateProxy(appName);
1153
1141
  appParamsMap[appName] = params;
1142
+ state[appName].appId = await deployApp(page, appName, projectName, { noAssets, noSource });
1154
1143
  }
1155
1144
 
1156
1145
  // Phase 3 — Deploy Uboxes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ubox-tools/deploy-xperience",
3
- "version": "1.1.18",
3
+ "version": "1.1.20",
4
4
  "description": "Deploy a Ubox experience to studio.ubox.world",
5
5
  "bin": { "deploy-xperience": "./deploy.js" },
6
6
  "dependencies": { "puppeteer": "*" },