@ubox-tools/deploy-xperience 1.1.2 → 1.1.3
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 +4 -0
- package/deploy.js +22 -5
- 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
|
-
|
|
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] || '?';
|
|
@@ -1034,7 +1049,7 @@ async function deployUbox(page, appName, projectName, appParams, mobileVirtualLi
|
|
|
1034
1049
|
// ─── Main ─────────────────────────────────────────────────────────────────────
|
|
1035
1050
|
|
|
1036
1051
|
async function main() {
|
|
1037
|
-
const { apps, email: emailArg, password: passwordArg, projectName: projectNameArg, noAssets, noPlayer, show, uboxIds } = parseArgs();
|
|
1052
|
+
const { apps, email: emailArg, password: passwordArg, projectName: projectNameArg, noAssets, noSource, noPlayer, show, uboxIds } = parseArgs();
|
|
1038
1053
|
|
|
1039
1054
|
if (apps.length === 0) {
|
|
1040
1055
|
console.error('No apps found in apps/ directory. Nothing to deploy.');
|
|
@@ -1046,6 +1061,8 @@ async function main() {
|
|
|
1046
1061
|
console.log(`Project : ${projectName}`);
|
|
1047
1062
|
console.log(`Apps : ${apps.join(', ')}`);
|
|
1048
1063
|
if (noAssets) console.log('Flags : --noassets (skip resource uploads)');
|
|
1064
|
+
if (noSource === true) console.log('Flags : --nosource (skip all source injection)');
|
|
1065
|
+
else if (noSource) console.log(`Flags : --nosource ${noSource} (skip specific files)`);
|
|
1049
1066
|
if (noPlayer) console.log('Flags : --noplayer (skip Ubox creation)');
|
|
1050
1067
|
console.log('');
|
|
1051
1068
|
|
|
@@ -1073,7 +1090,7 @@ async function main() {
|
|
|
1073
1090
|
state[appName] = {};
|
|
1074
1091
|
const { params } = generateProxy(appName);
|
|
1075
1092
|
appParamsMap[appName] = params;
|
|
1076
|
-
state[appName].appId = await deployApp(page, appName, projectName, { noAssets });
|
|
1093
|
+
state[appName].appId = await deployApp(page, appName, projectName, { noAssets, noSource });
|
|
1077
1094
|
}
|
|
1078
1095
|
|
|
1079
1096
|
// Phase 3 — Deploy Uboxes
|
package/package.json
CHANGED