@ubox-tools/deploy-xperience 1.1.2 → 1.1.4

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 +4 -0
  2. package/deploy.js +27 -5
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -26,6 +26,8 @@ npx @ubox-tools/deploy-xperience [app1 app2 ...] [options]
26
26
  | `--password <pass>` | Ubox Studio password (or `UBOX_PASSWORD` env var) |
27
27
  | `--project-name <name>` | Override the project name (default: parent directory name) |
28
28
  | `--noassets` | Skip uploading assets (images, fonts, files) |
29
+ | `--nosource` | Skip source injection entirely |
30
+ | `--nosource <files>` | Skip specific files (comma-separated, e.g. `ubox.js,logic.js`) |
29
31
  | `--noplayer` | Skip Phase 3 — deploy apps only, do not create/update Uboxes |
30
32
  | `--ubox-id <id>` | Use a pre-existing Ubox by ID — skips search/create (single-app deployments) |
31
33
  | `--ubox-id <app>:<id>` | Scoped form for multi-app deployments (repeatable) |
@@ -47,6 +49,8 @@ npx @ubox-tools/deploy-xperience # Deploy all apps (headl
47
49
  npx @ubox-tools/deploy-xperience --show # Deploy all apps, show browser
48
50
  npx @ubox-tools/deploy-xperience mobile # Deploy only the mobile app
49
51
  npx @ubox-tools/deploy-xperience main --noassets # Deploy main app, skip asset uploads
52
+ npx @ubox-tools/deploy-xperience --nosource # Deploy without re-injecting source
53
+ npx @ubox-tools/deploy-xperience --nosource ubox.js # Skip only ubox.js injection
50
54
  npx @ubox-tools/deploy-xperience --noplayer # Deploy apps only, skip Uboxes
51
55
  npx @ubox-tools/deploy-xperience --project-name "MyProject"
52
56
  npx @ubox-tools/deploy-xperience mobile --ubox-id 42 # Use existing Ubox #42 for mobile
package/deploy.js CHANGED
@@ -52,6 +52,8 @@ Options:
52
52
  --password <pass> Ubox studio password (or set UBOX_PASSWORD env var)
53
53
  --project-name <name> Override project name (default: directory name)
54
54
  --noassets Skip uploading assets (resources)
55
+ --nosource Skip source injection entirely
56
+ --nosource <files> Skip specific files (comma-separated, e.g. ubox.js,logic.js)
55
57
  --noplayer Skip Ubox creation (Phase 3) — only deploy applications
56
58
  --ubox-id <id> Use a pre-existing Ubox by ID (skips search/create)
57
59
  --ubox-id <app>:<id> Scoped form when deploying multiple apps
@@ -75,6 +77,7 @@ Examples:
75
77
  let password = process.env.UBOX_PASSWORD;
76
78
  let projectName = null;
77
79
  let noAssets = false;
80
+ let noSource = false;
78
81
  let noPlayer = false;
79
82
  let show = false;
80
83
  const appArgs = [];
@@ -86,6 +89,11 @@ Examples:
86
89
  else if (args[i] === '--password') { password = args[++i]; }
87
90
  else if (args[i] === '--project-name') { projectName = args[++i]; }
88
91
  else if (args[i] === '--noassets') { noAssets = true; }
92
+ else if (args[i] === '--nosource') {
93
+ const next = args[i + 1];
94
+ if (next && !next.startsWith('--')) { noSource = args[++i]; }
95
+ else { noSource = true; }
96
+ }
89
97
  else if (args[i] === '--noplayer') { noPlayer = true; }
90
98
  else if (args[i] === '--show') { show = true; }
91
99
  else if (args[i] === '--ubox-id') {
@@ -125,7 +133,7 @@ Examples:
125
133
  uboxIds[ordered[0]] = bareUboxId;
126
134
  }
127
135
 
128
- return { apps: ordered, email, password, projectName, noAssets, noPlayer, show, uboxIds };
136
+ return { apps: ordered, email, password, projectName, noAssets, noSource, noPlayer, show, uboxIds };
129
137
  }
130
138
 
131
139
  // ─── Credentials ──────────────────────────────────────────────────────────────
@@ -652,7 +660,7 @@ async function injectSource(page, proxy) {
652
660
  await sleep(3000);
653
661
  }
654
662
 
655
- async function deployApp(page, appName, projectName, { noAssets = false } = {}) {
663
+ async function deployApp(page, appName, projectName, { noAssets = false, noSource = false } = {}) {
656
664
  const fullName = `${projectName} ${appName}`;
657
665
  const { proxy, assets, params } = generateProxy(appName);
658
666
 
@@ -666,7 +674,14 @@ async function deployApp(page, appName, projectName, { noAssets = false } = {})
666
674
  await uploadResources(page, assets);
667
675
  }
668
676
  await configureParameters(page, params);
669
- await injectSource(page, proxy);
677
+ if (noSource === true) {
678
+ console.log(' [source] Skipped (--nosource)');
679
+ } else {
680
+ const filteredProxy = typeof noSource === 'string'
681
+ ? Object.fromEntries(Object.entries(proxy).filter(([f]) => !noSource.split(',').includes(f)))
682
+ : proxy;
683
+ await injectSource(page, filteredProxy);
684
+ }
670
685
 
671
686
  // Extract app ID from current URL
672
687
  const appId = page.url().match(/#\/application(?:-source)?\/(\d+)/)?.[1] || '?';
@@ -1024,6 +1039,11 @@ async function deployUbox(page, appName, projectName, appParams, mobileVirtualLi
1024
1039
  console.log(` [ubox] Mobile Virtual Link: ${virtualLink}`);
1025
1040
  }
1026
1041
  }
1042
+
1043
+ // Still assign mobileLink if one was captured this session
1044
+ if (appParams.mobileLink !== undefined && mobileVirtualLink) {
1045
+ await setMobileLink(page, fullName, mobileVirtualLink);
1046
+ }
1027
1047
  }
1028
1048
 
1029
1049
  const uboxId = page.url().match(/#\/ubox\/(\d+)/)?.[1] ||
@@ -1034,7 +1054,7 @@ async function deployUbox(page, appName, projectName, appParams, mobileVirtualLi
1034
1054
  // ─── Main ─────────────────────────────────────────────────────────────────────
1035
1055
 
1036
1056
  async function main() {
1037
- const { apps, email: emailArg, password: passwordArg, projectName: projectNameArg, noAssets, noPlayer, show, uboxIds } = parseArgs();
1057
+ const { apps, email: emailArg, password: passwordArg, projectName: projectNameArg, noAssets, noSource, noPlayer, show, uboxIds } = parseArgs();
1038
1058
 
1039
1059
  if (apps.length === 0) {
1040
1060
  console.error('No apps found in apps/ directory. Nothing to deploy.');
@@ -1046,6 +1066,8 @@ async function main() {
1046
1066
  console.log(`Project : ${projectName}`);
1047
1067
  console.log(`Apps : ${apps.join(', ')}`);
1048
1068
  if (noAssets) console.log('Flags : --noassets (skip resource uploads)');
1069
+ if (noSource === true) console.log('Flags : --nosource (skip all source injection)');
1070
+ else if (noSource) console.log(`Flags : --nosource ${noSource} (skip specific files)`);
1049
1071
  if (noPlayer) console.log('Flags : --noplayer (skip Ubox creation)');
1050
1072
  console.log('');
1051
1073
 
@@ -1073,7 +1095,7 @@ async function main() {
1073
1095
  state[appName] = {};
1074
1096
  const { params } = generateProxy(appName);
1075
1097
  appParamsMap[appName] = params;
1076
- state[appName].appId = await deployApp(page, appName, projectName, { noAssets });
1098
+ state[appName].appId = await deployApp(page, appName, projectName, { noAssets, noSource });
1077
1099
  }
1078
1100
 
1079
1101
  // 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.2",
3
+ "version": "1.1.4",
4
4
  "description": "Deploy a Ubox experience to studio.ubox.world",
5
5
  "bin": { "deploy-xperience": "./deploy.js" },
6
6
  "dependencies": { "puppeteer": "*" },