@supersdk/supercli 0.2.1-staging.20 → 0.3.0-staging.22
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/dist/api/consoleClient.js +17 -12
- package/dist/api/consoleClient.js.map +1 -1
- package/dist/auth/browserAuth.js +42 -44
- package/dist/auth/browserAuth.js.map +1 -1
- package/dist/auth/tokenAuth.js +46 -0
- package/dist/auth/tokenAuth.js.map +1 -0
- package/dist/cli.js +70 -8
- package/dist/cli.js.map +1 -1
- package/dist/commands/accounts.js +89 -31
- package/dist/commands/accounts.js.map +1 -1
- package/dist/commands/add.js +519 -0
- package/dist/commands/add.js.map +1 -0
- package/dist/commands/init.js +234 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/login.js +75 -48
- package/dist/commands/login.js.map +1 -1
- package/dist/commands/logout.js +20 -25
- package/dist/commands/logout.js.map +1 -1
- package/dist/commands/publishSite.js +491 -149
- package/dist/commands/publishSite.js.map +1 -1
- package/dist/commands/switchaccount.js +36 -24
- package/dist/commands/switchaccount.js.map +1 -1
- package/dist/config/appConfig.js +160 -45
- package/dist/config/appConfig.js.map +1 -1
- package/dist/config/environments.js +17 -1
- package/dist/config/environments.js.map +1 -1
- package/dist/exit/exitCodes.js +55 -0
- package/dist/exit/exitCodes.js.map +1 -0
- package/dist/output/envelope.js +104 -0
- package/dist/output/envelope.js.map +1 -0
- package/dist/output/resultPrinter.js +70 -0
- package/dist/output/resultPrinter.js.map +1 -0
- package/dist/publish/siteClient.js +14 -4
- package/dist/publish/siteClient.js.map +1 -1
- package/dist/publish/siteConfig.js +278 -63
- package/dist/publish/siteConfig.js.map +1 -1
- package/dist/store/accountStore.js +2 -2
- package/dist/store/accountStore.js.map +1 -1
- package/dist/store/backends/encryptedFile.js +4 -1
- package/dist/store/backends/encryptedFile.js.map +1 -1
- package/dist/store/backends/osKeyring.js +4 -8
- package/dist/store/backends/osKeyring.js.map +1 -1
- package/dist/store/credentialStore.js +22 -0
- package/dist/store/credentialStore.js.map +1 -1
- package/dist/template/README.md +144 -85
- package/dist/template/android/app/build.gradle.kts +0 -3
- package/dist/template/android/app/src/main/java/com/supersdk/simple/EnvironmentStore.java +41 -0
- package/dist/template/android/app/src/main/java/com/supersdk/simple/MainActivity.java +57 -4
- package/dist/template/android/app/src/main/java/com/supersdk/simple/SimpleApplication.java +3 -1
- package/dist/template/android/gradle/supersdk-config-reader.gradle +5 -3
- package/dist/template/android/supersdk-default.config.json +4 -3
- package/dist/template/ios/Sources/App/EnvironmentStore.swift +35 -0
- package/dist/template/ios/Sources/App/SimpleSDKBootstrap.swift +2 -1
- package/dist/template/ios/Sources/App/SimpleSDKProbe.swift +15 -0
- package/dist/template/ios/Sources/App/SimpleViewController.swift +52 -8
- package/dist/template/ios/Tests/SimpleAppTests/SimpleSDKInitializationTests.swift +12 -1
- package/dist/template/scripts/android_snapshot_canary.py +17 -8
- package/dist/template/scripts/build_android.sh +36 -9
- package/dist/template/scripts/build_ios.sh +63 -24
- package/dist/template/scripts/build_site.sh +43 -0
- package/dist/template/scripts/lib/workspace.sh +43 -0
- package/dist/template/scripts/serve_web.py +26 -9
- package/dist/template/scripts/super_build_orchestrator.py +49 -28
- package/dist/template/scripts/supersdk_template.py +759 -240
- package/dist/template/scripts/web_package.py +44 -20
- package/dist/template/super_build.sh +40 -12
- package/dist/template/supersdk.json +25 -13
- package/dist/template/template_manifest.json +25 -0
- package/dist/template/web/src/css/style.css +28 -0
- package/dist/template/web/src/index.html +8 -0
- package/dist/template/web/src/js/app.js +92 -19
- package/dist/util/log.js +10 -1
- package/dist/util/log.js.map +1 -1
- package/dist/util/prompt.js +25 -0
- package/dist/util/prompt.js.map +1 -1
- package/dist/workspace/config.js +440 -0
- package/dist/workspace/config.js.map +1 -0
- package/dist/workspace/identity.js +106 -0
- package/dist/workspace/identity.js.map +1 -0
- package/dist/workspace/interactive.js +96 -0
- package/dist/workspace/interactive.js.map +1 -0
- package/dist/workspace/template.js +357 -0
- package/dist/workspace/template.js.map +1 -0
- package/package.json +1 -1
- package/dist/auth/refresh.js +0 -32
- package/dist/auth/refresh.js.map +0 -1
- package/dist/commands/createApp.js +0 -448
- package/dist/commands/createApp.js.map +0 -1
- package/dist/createApp/copyTemplate.js +0 -561
- package/dist/createApp/copyTemplate.js.map +0 -1
- package/dist/template/scripts/build_web.sh +0 -12
|
@@ -1,448 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.runCreateApp = runCreateApp;
|
|
37
|
-
exports.registerCreateAppCommand = registerCreateAppCommand;
|
|
38
|
-
const fs = __importStar(require("node:fs"));
|
|
39
|
-
const path = __importStar(require("node:path"));
|
|
40
|
-
const copyTemplate_1 = require("../createApp/copyTemplate");
|
|
41
|
-
const log_1 = require("../util/log");
|
|
42
|
-
const prompt_1 = require("../util/prompt");
|
|
43
|
-
const shell_1 = require("../util/shell");
|
|
44
|
-
const defaultFsOps = {
|
|
45
|
-
rm: (targetPath) => fs.rmSync(targetPath, { recursive: true, force: true }),
|
|
46
|
-
rename: (oldPath, newPath) => fs.renameSync(oldPath, newPath),
|
|
47
|
-
};
|
|
48
|
-
const DEFAULT_ENVIRONMENT = 'prod';
|
|
49
|
-
/** Bounded so an interactive session that only ever sees EOF/garbage still terminates with the flag hint. */
|
|
50
|
-
const MAX_PROMPT_ATTEMPTS = 3;
|
|
51
|
-
function trimFlag(value) {
|
|
52
|
-
if (value === undefined)
|
|
53
|
-
return undefined;
|
|
54
|
-
const trimmed = value.trim();
|
|
55
|
-
return trimmed === '' ? undefined : trimmed;
|
|
56
|
-
}
|
|
57
|
-
function platformScope(platform) {
|
|
58
|
-
const platforms = (0, copyTemplate_1.selectedPlatforms)(platform);
|
|
59
|
-
return {
|
|
60
|
-
platforms,
|
|
61
|
-
android: platforms.includes('android'),
|
|
62
|
-
ios: platforms.includes('ios'),
|
|
63
|
-
web: platforms.includes('web'),
|
|
64
|
-
};
|
|
65
|
-
}
|
|
66
|
-
/**
|
|
67
|
-
* The exact command a caller must run to succeed non-interactively. Known values
|
|
68
|
-
* are echoed back verbatim; unknown ones become quoted `<...>` placeholders, and
|
|
69
|
-
* only the flags this `--platform` scope actually needs are listed.
|
|
70
|
-
* Quoting matters: the whole line stays runnable (shlex semantics, single
|
|
71
|
-
* quotes — double quotes would let the shell expand a `$` inside a path), so
|
|
72
|
-
* pasting it without editing fails on this command's own validation
|
|
73
|
-
* ("--android-package ...: must be a Java package") instead of on a shell redirect.
|
|
74
|
-
*/
|
|
75
|
-
function suggestedCommand(target, opts, resolved, scope) {
|
|
76
|
-
const placeholder = (hint) => (0, shell_1.shellQuote)(`<${hint}>`);
|
|
77
|
-
const parts = ['supercli create-app', (0, shell_1.shellQuote)(target)];
|
|
78
|
-
parts.push('--spid', resolved.spid ? (0, shell_1.shellQuote)(resolved.spid) : placeholder(copyTemplate_1.SPID_PATTERN_SOURCE));
|
|
79
|
-
parts.push('--name', resolved.name ? (0, shell_1.shellQuote)(resolved.name) : placeholder('App label'));
|
|
80
|
-
if (scope.android || resolved.androidPackage) {
|
|
81
|
-
parts.push('--android-package', resolved.androidPackage ? (0, shell_1.shellQuote)(resolved.androidPackage) : placeholder('com.acme.myapp'));
|
|
82
|
-
}
|
|
83
|
-
if (scope.ios || resolved.iosBundleId) {
|
|
84
|
-
parts.push('--ios-bundle-id', resolved.iosBundleId ? (0, shell_1.shellQuote)(resolved.iosBundleId) : placeholder('com.acme.myapp'));
|
|
85
|
-
}
|
|
86
|
-
parts.push('--environment', (0, shell_1.shellQuote)(resolved.environment ?? trimFlag(opts.environment) ?? DEFAULT_ENVIRONMENT));
|
|
87
|
-
if (scope.web || resolved.webHost) {
|
|
88
|
-
parts.push('--web-host', resolved.webHost ? (0, shell_1.shellQuote)(resolved.webHost) : placeholder('myapp.example.com'));
|
|
89
|
-
}
|
|
90
|
-
const platform = trimFlag(opts.platform);
|
|
91
|
-
if (platform && platform !== 'all')
|
|
92
|
-
parts.push('--platform', platform);
|
|
93
|
-
if (opts.force)
|
|
94
|
-
parts.push('--force');
|
|
95
|
-
return parts.join(' ');
|
|
96
|
-
}
|
|
97
|
-
/**
|
|
98
|
-
* Validates a flag the caller actually typed. A blank/whitespace-only value is
|
|
99
|
-
* "typed, but empty" — an error, never a silent fallback to a derived default.
|
|
100
|
-
* The value is trimmed first so a shell-added space cannot trip the Python-side
|
|
101
|
-
* "no leading/trailing whitespace" label rule at build time.
|
|
102
|
-
*/
|
|
103
|
-
function checkProvided(flag, raw, check) {
|
|
104
|
-
if (raw === undefined)
|
|
105
|
-
return {};
|
|
106
|
-
const value = raw.trim();
|
|
107
|
-
if (value === '')
|
|
108
|
-
return { error: `${flag} "${raw}": must not be empty` };
|
|
109
|
-
const reason = check(value);
|
|
110
|
-
return reason ? { error: `${flag} "${value}": ${reason}` } : { value };
|
|
111
|
-
}
|
|
112
|
-
/** Validates only the flags the caller actually passed — pure, no prompting, no filesystem access. */
|
|
113
|
-
function validateProvidedIdentityFlags(opts) {
|
|
114
|
-
const checks = [
|
|
115
|
-
['--name', opts.name, copyTemplate_1.checkAppName],
|
|
116
|
-
['--environment', opts.environment, copyTemplate_1.checkEnvironment],
|
|
117
|
-
['--android-package', opts.androidPackage, copyTemplate_1.checkAndroidPackage],
|
|
118
|
-
['--ios-bundle-id', opts.iosBundleId, copyTemplate_1.checkIosBundleId],
|
|
119
|
-
['--web-host', opts.webHost, copyTemplate_1.checkWebHost],
|
|
120
|
-
];
|
|
121
|
-
const errors = [];
|
|
122
|
-
for (const [flag, raw, check] of checks) {
|
|
123
|
-
const error = checkProvided(flag, raw, check).error;
|
|
124
|
-
if (error)
|
|
125
|
-
errors.push(error);
|
|
126
|
-
}
|
|
127
|
-
return errors;
|
|
128
|
-
}
|
|
129
|
-
/**
|
|
130
|
-
* Fills in every identity field the caller did not pass, for the platforms this
|
|
131
|
-
* run actually scaffolds.
|
|
132
|
-
*
|
|
133
|
-
* TTY -> ask, offering the derived default (Enter accepts it).
|
|
134
|
-
* 🔴 no TTY -> only genuinely derivable values (name from the target directory,
|
|
135
|
-
* ios.bundleId from android.package, environment=prod) are filled in. Anything
|
|
136
|
-
* still missing **and in scope** is a hard failure naming the exact flag. The
|
|
137
|
-
* template's own package/bundleId/host are NEVER inherited: a project generated
|
|
138
|
-
* with com.supersdk.simple.host cannot be shipped, and silently producing one is
|
|
139
|
-
* a far worse outcome than refusing to generate anything.
|
|
140
|
-
*
|
|
141
|
-
* Out-of-scope platforms are neither prompted for nor required — but an explicit
|
|
142
|
-
* flag is still honoured, and an unresolved field is dropped from supersdk.json
|
|
143
|
-
* rather than inheriting the template's value.
|
|
144
|
-
*/
|
|
145
|
-
function resolveIdentity(target, opts, spid, scope, interactive, prompt) {
|
|
146
|
-
const missingFlags = [];
|
|
147
|
-
const errors = [];
|
|
148
|
-
const resolved = { spid };
|
|
149
|
-
const ask = (flag, question, provided, fallback, check,
|
|
150
|
-
/** false = 本次 scope 用不到它:不追问、不进 missingFlags,未解析就留空。 */
|
|
151
|
-
required,
|
|
152
|
-
/** required=false 时是否还值得问一句(out-of-scope 的平台字段连问都不问)。 */
|
|
153
|
-
askWhenOptional = false) => {
|
|
154
|
-
if (provided !== undefined) {
|
|
155
|
-
const outcome = checkProvided(flag, provided, check);
|
|
156
|
-
if (outcome.error) {
|
|
157
|
-
errors.push(outcome.error);
|
|
158
|
-
return undefined;
|
|
159
|
-
}
|
|
160
|
-
return outcome.value;
|
|
161
|
-
}
|
|
162
|
-
if (interactive && (required || askWhenOptional)) {
|
|
163
|
-
for (let attempt = 0; attempt < MAX_PROMPT_ATTEMPTS; attempt += 1) {
|
|
164
|
-
const answer = prompt(question, fallback).trim();
|
|
165
|
-
if (answer === '') {
|
|
166
|
-
if (!required)
|
|
167
|
-
return undefined;
|
|
168
|
-
log_1.log.warn(`${flag} is required`);
|
|
169
|
-
continue;
|
|
170
|
-
}
|
|
171
|
-
const reason = check(answer);
|
|
172
|
-
if (reason) {
|
|
173
|
-
log_1.log.warn(`${flag} "${answer}": ${reason}`);
|
|
174
|
-
continue;
|
|
175
|
-
}
|
|
176
|
-
return answer;
|
|
177
|
-
}
|
|
178
|
-
// 🔴 只有**必填**字段答不出来才中止整次脚手架。一个可选字段答错 3 次比什么都不填后果
|
|
179
|
-
// 更重,是说不通的(非交互分支从来就是这个口径)—— 这里留空并说明,与之对齐。
|
|
180
|
-
if (required)
|
|
181
|
-
missingFlags.push(flag);
|
|
182
|
-
else
|
|
183
|
-
log_1.log.warn(`${flag}: no usable answer after ${MAX_PROMPT_ATTEMPTS} attempts — leaving it unset`);
|
|
184
|
-
return undefined;
|
|
185
|
-
}
|
|
186
|
-
if (fallback !== undefined) {
|
|
187
|
-
const reason = check(fallback);
|
|
188
|
-
if (reason) {
|
|
189
|
-
errors.push(`${flag} (derived "${fallback}"): ${reason}; pass ${flag} explicitly`);
|
|
190
|
-
return undefined;
|
|
191
|
-
}
|
|
192
|
-
return fallback;
|
|
193
|
-
}
|
|
194
|
-
if (required)
|
|
195
|
-
missingFlags.push(flag);
|
|
196
|
-
return undefined;
|
|
197
|
-
};
|
|
198
|
-
const name = ask('--name', 'App name (Android label / iOS display name)', opts.name, path.basename(target) || undefined, copyTemplate_1.checkAppName, true);
|
|
199
|
-
if (name !== undefined)
|
|
200
|
-
resolved.name = name;
|
|
201
|
-
const environment = ask('--environment', "SDK environment for this app's own native config", opts.environment, DEFAULT_ENVIRONMENT, copyTemplate_1.checkEnvironment, true);
|
|
202
|
-
if (environment !== undefined)
|
|
203
|
-
resolved.environment = environment;
|
|
204
|
-
const androidPackage = ask('--android-package', 'android.package (Java package, e.g. com.acme.myapp)', opts.androidPackage, undefined, copyTemplate_1.checkAndroidPackage, scope.android);
|
|
205
|
-
if (androidPackage !== undefined)
|
|
206
|
-
resolved.androidPackage = androidPackage;
|
|
207
|
-
// ios.bundleId defaults to android.package. When android is in scope but its
|
|
208
|
-
// package could not be resolved, there is no default to derive from, and
|
|
209
|
-
// reporting --ios-bundle-id as "missing" too would bury the single root cause —
|
|
210
|
-
// the run already fails on --android-package.
|
|
211
|
-
// Out of scope: no derivation either — the generated supersdk.json describes what was
|
|
212
|
-
// actually scaffolded, and an explicit --ios-bundle-id is still honoured.
|
|
213
|
-
const iosRequired = scope.ios && !(scope.android && androidPackage === undefined);
|
|
214
|
-
const iosBundleId = ask('--ios-bundle-id', 'ios.bundleId', opts.iosBundleId, scope.ios ? androidPackage : undefined, copyTemplate_1.checkIosBundleId, iosRequired, scope.ios);
|
|
215
|
-
if (iosBundleId !== undefined)
|
|
216
|
-
resolved.iosBundleId = iosBundleId;
|
|
217
|
-
// 🔴 web 在 scope 内时 web.host 是**必填**:没有它,默认产物过不了 `./super_build.sh
|
|
218
|
-
// --build`(web_package.py 拿到 host=None,报的还是一段关于 IDN/数字 TLD 的诊断,
|
|
219
|
-
// 完全指不到「你没设 web.host」)。`--plan` 恰好是唯一看不出这件事的模式。
|
|
220
|
-
const webHostRaw = ask('--web-host', scope.web
|
|
221
|
-
? 'web.host (offline-package host, required to build the web platform, e.g. myapp.example.com)'
|
|
222
|
-
: 'web.host (offline-package host, blank to skip)', opts.webHost, undefined, copyTemplate_1.checkWebHost, scope.web);
|
|
223
|
-
if (webHostRaw !== undefined) {
|
|
224
|
-
const normalized = (0, copyTemplate_1.normalizeWebHost)(webHostRaw);
|
|
225
|
-
if ('host' in normalized)
|
|
226
|
-
resolved.webHost = normalized.host;
|
|
227
|
-
else
|
|
228
|
-
errors.push(`--web-host "${webHostRaw}": ${normalized.error}`);
|
|
229
|
-
}
|
|
230
|
-
if (missingFlags.length > 0 ||
|
|
231
|
-
errors.length > 0 ||
|
|
232
|
-
resolved.name === undefined ||
|
|
233
|
-
resolved.environment === undefined ||
|
|
234
|
-
// Defence in depth: an in-scope platform that somehow got here unresolved must
|
|
235
|
-
// never reach the copy step (that is exactly how a template default ships).
|
|
236
|
-
(scope.android && resolved.androidPackage === undefined) ||
|
|
237
|
-
(scope.ios && resolved.iosBundleId === undefined) ||
|
|
238
|
-
(scope.web && resolved.webHost === undefined)) {
|
|
239
|
-
return { ok: false, missingFlags, errors, resolved };
|
|
240
|
-
}
|
|
241
|
-
return {
|
|
242
|
-
ok: true,
|
|
243
|
-
identity: {
|
|
244
|
-
spid,
|
|
245
|
-
name: resolved.name,
|
|
246
|
-
environment: resolved.environment,
|
|
247
|
-
androidPackage: resolved.androidPackage,
|
|
248
|
-
iosBundleId: resolved.iosBundleId,
|
|
249
|
-
webHost: resolved.webHost,
|
|
250
|
-
},
|
|
251
|
-
missingFlags,
|
|
252
|
-
errors,
|
|
253
|
-
resolved,
|
|
254
|
-
};
|
|
255
|
-
}
|
|
256
|
-
function identityFailureMessage(target, opts, interactive, resolution, scope) {
|
|
257
|
-
const lines = [];
|
|
258
|
-
if (resolution.errors.length > 0) {
|
|
259
|
-
lines.push('invalid create-app arguments:');
|
|
260
|
-
for (const error of resolution.errors)
|
|
261
|
-
lines.push(` - ${error}`);
|
|
262
|
-
}
|
|
263
|
-
if (resolution.missingFlags.length > 0) {
|
|
264
|
-
lines.push(interactive
|
|
265
|
-
? `no usable answer after ${MAX_PROMPT_ATTEMPTS} attempts for: ${resolution.missingFlags.join(', ')}`
|
|
266
|
-
: `stdin is not a TTY, so create-app cannot prompt; these are required: ${resolution.missingFlags.join(', ')}`);
|
|
267
|
-
}
|
|
268
|
-
const scopeLabel = scope.platforms.join('/');
|
|
269
|
-
const outOfScope = (name) => `only needed when ${name} is in the --platform scope (this run: ${scopeLabel})`;
|
|
270
|
-
lines.push('', "create-app never falls back to the template's own SuperSDK identity " +
|
|
271
|
-
`(name "${copyTemplate_1.TEMPLATE_DEFAULTS.name}", android.package ${copyTemplate_1.TEMPLATE_DEFAULTS.androidPackage}, ` +
|
|
272
|
-
`ios.bundleId ${copyTemplate_1.TEMPLATE_DEFAULTS.iosBundleId}, web.host ${copyTemplate_1.TEMPLATE_DEFAULTS.webHost}) — ` +
|
|
273
|
-
'a project generated from those values cannot be published to any store.', '', 'Re-run with the values spelled out:', '', ` ${suggestedCommand(target, opts, resolution.resolved, scope)}`, '', `Flags (required ones follow --platform ${trimFlag(opts.platform) ?? 'all'} → ${scopeLabel}):`, ` --spid <spid> required, 8 lowercase letters/digits (${copyTemplate_1.SPID_PATTERN_SOURCE}) issued by Console`, ' --name <label> defaults to the target directory name', ` --android-package <pkg> ${scope.android ? 'required, Java package (e.g. com.acme.myapp)' : outOfScope('android')}`, ` --ios-bundle-id <id> ${scope.ios
|
|
274
|
-
? `required${scope.android ? '; defaults to --android-package' : ' (no --android-package in this scope to derive it from)'}`
|
|
275
|
-
: outOfScope('ios')}`, ` --environment <env> defaults to ${DEFAULT_ENVIRONMENT}`, ` --web-host <host> ${scope.web
|
|
276
|
-
? 'required, the offline-package host (e.g. myapp.example.com); without it `./super_build.sh --build` fails on the web platform'
|
|
277
|
-
: `${outOfScope('web')}; omitted leaves web.host out of ${copyTemplate_1.APP_CONFIG_FILENAME}`}`);
|
|
278
|
-
return lines.join('\n');
|
|
279
|
-
}
|
|
280
|
-
function buildSummary(target, result, platform, identity, scope) {
|
|
281
|
-
const platformsLabel = result.platforms.length > 0 ? result.platforms.join(', ') : '(none)';
|
|
282
|
-
const unset = (name) => `(unset — ${name} is not in this --platform scope: ${scope.platforms.join('/')})`;
|
|
283
|
-
return [
|
|
284
|
-
`generated project at ${target}`,
|
|
285
|
-
`platform${platform === 'all' ? 's' : ''}: ${platformsLabel}`,
|
|
286
|
-
`files: ${result.fileCount}`,
|
|
287
|
-
`spid: ${identity.spid}`,
|
|
288
|
-
`name: ${identity.name}`,
|
|
289
|
-
`environment: ${identity.environment}`,
|
|
290
|
-
`android.package: ${identity.androidPackage ?? unset('android')}`,
|
|
291
|
-
`ios.bundleId: ${identity.iosBundleId ?? unset('ios')}`,
|
|
292
|
-
`web.host: ${identity.webHost ?? unset('web')}`,
|
|
293
|
-
`next: cd ${(0, shell_1.shellQuote)(target)} && ./super_build.sh --plan${platform === 'all' ? '' : ` --platform ${platform}`}`,
|
|
294
|
-
].join('\n');
|
|
295
|
-
}
|
|
296
|
-
/**
|
|
297
|
-
* Core create-app logic, decoupled from commander (logout.ts:54 pattern) so
|
|
298
|
-
* it can be exercised directly in unit/integration tests against a fixture
|
|
299
|
-
* template without shelling out or touching the real supersimples template.
|
|
300
|
-
*/
|
|
301
|
-
async function runCreateApp(dirArg, opts, deps = {}) {
|
|
302
|
-
const platformRaw = opts.platform ?? 'all';
|
|
303
|
-
if (!(0, copyTemplate_1.isValidPlatform)(platformRaw)) {
|
|
304
|
-
return { ok: false, message: `invalid --platform "${platformRaw}"; expected android|ios|web|all` };
|
|
305
|
-
}
|
|
306
|
-
const platform = platformRaw;
|
|
307
|
-
const scope = platformScope(platform);
|
|
308
|
-
const target = path.resolve(dirArg);
|
|
309
|
-
// spid is never derived and never prompted for: it is issued by Console and
|
|
310
|
-
// the command declares it as a requiredOption. This guard covers direct
|
|
311
|
-
// runCreateApp() callers.
|
|
312
|
-
const spid = trimFlag(opts.spid);
|
|
313
|
-
if (!spid) {
|
|
314
|
-
return { ok: false, message: 'missing required --spid <spid>; use the 8-character project spid from Console' };
|
|
315
|
-
}
|
|
316
|
-
const spidReason = (0, copyTemplate_1.checkSpid)(spid);
|
|
317
|
-
if (spidReason) {
|
|
318
|
-
return { ok: false, message: `--spid "${spid}" is invalid; ${spidReason}` };
|
|
319
|
-
}
|
|
320
|
-
// Explicitly passed identity flags are validated before anything touches the
|
|
321
|
-
// filesystem, so a typo can never take out an occupied --force target.
|
|
322
|
-
const flagErrors = validateProvidedIdentityFlags(opts);
|
|
323
|
-
if (flagErrors.length > 0) {
|
|
324
|
-
return { ok: false, message: ['invalid create-app arguments:', ...flagErrors.map((e) => ` - ${e}`)].join('\n') };
|
|
325
|
-
}
|
|
326
|
-
let targetExists = false;
|
|
327
|
-
try {
|
|
328
|
-
const st = fs.statSync(target);
|
|
329
|
-
targetExists = true;
|
|
330
|
-
if (!st.isDirectory()) {
|
|
331
|
-
return { ok: false, message: `target path "${target}" already exists and is not a directory` };
|
|
332
|
-
}
|
|
333
|
-
const nonEmpty = fs.readdirSync(target).length > 0;
|
|
334
|
-
if (nonEmpty && !opts.force) {
|
|
335
|
-
return { ok: false, message: `target directory "${target}" is not empty — pass --force to overwrite` };
|
|
336
|
-
}
|
|
337
|
-
}
|
|
338
|
-
catch (err) {
|
|
339
|
-
if (err.code !== 'ENOENT') {
|
|
340
|
-
return { ok: false, message: `cannot inspect target "${target}": ${err.message}` };
|
|
341
|
-
}
|
|
342
|
-
}
|
|
343
|
-
let templateRoot;
|
|
344
|
-
try {
|
|
345
|
-
templateRoot = deps.templateRoot ?? (0, copyTemplate_1.locateDefaultTemplateRoot)();
|
|
346
|
-
}
|
|
347
|
-
catch (err) {
|
|
348
|
-
return { ok: false, message: err.message };
|
|
349
|
-
}
|
|
350
|
-
if (!fs.existsSync(templateRoot)) {
|
|
351
|
-
return { ok: false, message: `template root not found at "${templateRoot}"` };
|
|
352
|
-
}
|
|
353
|
-
// Asked last, so the user is never interrogated for a run that was going to
|
|
354
|
-
// fail on the target directory or a missing template anyway.
|
|
355
|
-
const interactive = (deps.isInteractive ?? prompt_1.isInteractiveStdin)();
|
|
356
|
-
const prompt = deps.prompt ?? prompt_1.promptLineWithDefaultSync;
|
|
357
|
-
const resolution = resolveIdentity(target, opts, spid, scope, interactive, prompt);
|
|
358
|
-
if (!resolution.ok || !resolution.identity) {
|
|
359
|
-
return { ok: false, message: identityFailureMessage(target, opts, interactive, resolution, scope) };
|
|
360
|
-
}
|
|
361
|
-
const identity = resolution.identity;
|
|
362
|
-
const fsOps = deps.fsOps ?? defaultFsOps;
|
|
363
|
-
const tempDir = `${target}.tmp-${process.pid}`;
|
|
364
|
-
// Only this process-owned temp path may be removed. Sweeping every matching
|
|
365
|
-
// sibling can delete another live create-app run or user-owned data.
|
|
366
|
-
try {
|
|
367
|
-
fs.rmSync(tempDir, { recursive: true, force: true }); // clear any leftover from a crashed prior run (same pid)
|
|
368
|
-
}
|
|
369
|
-
catch {
|
|
370
|
-
// best-effort
|
|
371
|
-
}
|
|
372
|
-
let buildResult;
|
|
373
|
-
try {
|
|
374
|
-
fs.mkdirSync(tempDir, { recursive: true });
|
|
375
|
-
buildResult = (0, copyTemplate_1.copyTemplateInto)(templateRoot, tempDir, platform);
|
|
376
|
-
(0, copyTemplate_1.applyAppIdentity)(tempDir, identity, templateRoot);
|
|
377
|
-
}
|
|
378
|
-
catch (err) {
|
|
379
|
-
try {
|
|
380
|
-
fs.rmSync(tempDir, { recursive: true, force: true });
|
|
381
|
-
}
|
|
382
|
-
catch {
|
|
383
|
-
// best-effort cleanup only
|
|
384
|
-
}
|
|
385
|
-
return { ok: false, message: `failed to generate project: ${err.message}` };
|
|
386
|
-
}
|
|
387
|
-
if (targetExists) {
|
|
388
|
-
try {
|
|
389
|
-
fsOps.rm(target);
|
|
390
|
-
}
|
|
391
|
-
catch (err) {
|
|
392
|
-
// Old target is untouched here (rm itself failed) — safe to discard
|
|
393
|
-
// the temp build and let the user retry from a clean slate.
|
|
394
|
-
try {
|
|
395
|
-
fs.rmSync(tempDir, { recursive: true, force: true });
|
|
396
|
-
}
|
|
397
|
-
catch {
|
|
398
|
-
// best-effort
|
|
399
|
-
}
|
|
400
|
-
return { ok: false, message: `failed to remove existing target "${target}": ${err.message}` };
|
|
401
|
-
}
|
|
402
|
-
}
|
|
403
|
-
try {
|
|
404
|
-
fsOps.rename(tempDir, target);
|
|
405
|
-
}
|
|
406
|
-
catch (err) {
|
|
407
|
-
// Non-atomic window (EXT-10): if targetExists, the old directory is
|
|
408
|
-
// already gone at this point. Do NOT delete tempDir — it holds the only
|
|
409
|
-
// copy of the generated output and is the recovery path.
|
|
410
|
-
return {
|
|
411
|
-
ok: false,
|
|
412
|
-
message: `generated project is ready but could not be moved into place at "${target}": ${err.message}. ` +
|
|
413
|
-
`The generated output is preserved at "${tempDir}" — move it into place manually ` +
|
|
414
|
-
`(e.g. mv "${tempDir}" "${target}") or rerun create-app.`,
|
|
415
|
-
};
|
|
416
|
-
}
|
|
417
|
-
return {
|
|
418
|
-
ok: true,
|
|
419
|
-
message: buildSummary(target, buildResult, platform, identity, scope),
|
|
420
|
-
targetDir: target,
|
|
421
|
-
platforms: buildResult.platforms,
|
|
422
|
-
fileCount: buildResult.fileCount,
|
|
423
|
-
identity,
|
|
424
|
-
};
|
|
425
|
-
}
|
|
426
|
-
function registerCreateAppCommand(program) {
|
|
427
|
-
program
|
|
428
|
-
.command('create-app <dir>')
|
|
429
|
-
.description('Generate a SuperSDK project repo (android/ios/web) from the built-in template.')
|
|
430
|
-
.option('--platform <platform>', 'android|ios|web|all', 'all')
|
|
431
|
-
.requiredOption('--spid <spid>', '8-character project spid issued by the SuperSDK Console')
|
|
432
|
-
.option('--name <name>', 'app name (Android label / iOS display name); defaults to the target directory name')
|
|
433
|
-
.option('--android-package <package>', 'android.package, e.g. com.acme.myapp (required when android is in --platform scope; prompted only on a TTY)')
|
|
434
|
-
.option('--ios-bundle-id <bundleId>', 'ios.bundleId (required when ios is in --platform scope; defaults to --android-package)')
|
|
435
|
-
.option('--web-host <host>', 'web.host for the offline package (required when web is in --platform scope — the web build fails without it)')
|
|
436
|
-
.option('--environment <environment>', `SDK environment written into the native config (default: ${DEFAULT_ENVIRONMENT})`)
|
|
437
|
-
.option('--force', 'overwrite a non-empty target directory')
|
|
438
|
-
.action(async (dirArg, opts) => {
|
|
439
|
-
const result = await runCreateApp(dirArg, opts);
|
|
440
|
-
if (!result.ok) {
|
|
441
|
-
log_1.log.error(result.message);
|
|
442
|
-
process.exitCode = 1;
|
|
443
|
-
return;
|
|
444
|
-
}
|
|
445
|
-
log_1.log.info(result.message);
|
|
446
|
-
});
|
|
447
|
-
}
|
|
448
|
-
//# sourceMappingURL=createApp.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"createApp.js","sourceRoot":"","sources":["../../src/commands/createApp.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4bA,oCAoIC;AAED,4DA2BC;AA5lBD,4CAA8B;AAC9B,gDAAkC;AAClC,4DAoBmC;AACnC,qCAAkC;AAClC,2CAA+E;AAC/E,yCAA2C;AAyC3C,MAAM,YAAY,GAAmB;IACnC,EAAE,EAAE,CAAC,UAAU,EAA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