@supersdk/supercli 0.2.1-staging.21 → 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.
Files changed (53) hide show
  1. package/dist/cli.js +4 -2
  2. package/dist/cli.js.map +1 -1
  3. package/dist/commands/add.js +519 -0
  4. package/dist/commands/add.js.map +1 -0
  5. package/dist/commands/init.js +234 -0
  6. package/dist/commands/init.js.map +1 -0
  7. package/dist/commands/publishSite.js +354 -71
  8. package/dist/commands/publishSite.js.map +1 -1
  9. package/dist/config/appConfig.js +160 -45
  10. package/dist/config/appConfig.js.map +1 -1
  11. package/dist/publish/siteConfig.js +278 -63
  12. package/dist/publish/siteConfig.js.map +1 -1
  13. package/dist/template/README.md +144 -85
  14. package/dist/template/android/app/build.gradle.kts +0 -3
  15. package/dist/template/android/app/src/main/java/com/supersdk/simple/EnvironmentStore.java +41 -0
  16. package/dist/template/android/app/src/main/java/com/supersdk/simple/MainActivity.java +57 -4
  17. package/dist/template/android/app/src/main/java/com/supersdk/simple/SimpleApplication.java +3 -1
  18. package/dist/template/android/gradle/supersdk-config-reader.gradle +5 -3
  19. package/dist/template/android/supersdk-default.config.json +4 -3
  20. package/dist/template/ios/Sources/App/EnvironmentStore.swift +35 -0
  21. package/dist/template/ios/Sources/App/SimpleSDKBootstrap.swift +2 -1
  22. package/dist/template/ios/Sources/App/SimpleSDKProbe.swift +15 -0
  23. package/dist/template/ios/Sources/App/SimpleViewController.swift +52 -8
  24. package/dist/template/ios/Tests/SimpleAppTests/SimpleSDKInitializationTests.swift +12 -1
  25. package/dist/template/scripts/android_snapshot_canary.py +17 -8
  26. package/dist/template/scripts/build_android.sh +36 -9
  27. package/dist/template/scripts/build_ios.sh +63 -24
  28. package/dist/template/scripts/build_site.sh +43 -0
  29. package/dist/template/scripts/lib/workspace.sh +43 -0
  30. package/dist/template/scripts/serve_web.py +26 -9
  31. package/dist/template/scripts/super_build_orchestrator.py +49 -28
  32. package/dist/template/scripts/supersdk_template.py +759 -240
  33. package/dist/template/scripts/web_package.py +44 -20
  34. package/dist/template/super_build.sh +40 -12
  35. package/dist/template/supersdk.json +25 -13
  36. package/dist/template/template_manifest.json +25 -0
  37. package/dist/template/web/src/css/style.css +28 -0
  38. package/dist/template/web/src/index.html +8 -0
  39. package/dist/template/web/src/js/app.js +92 -19
  40. package/dist/workspace/config.js +440 -0
  41. package/dist/workspace/config.js.map +1 -0
  42. package/dist/workspace/identity.js +106 -0
  43. package/dist/workspace/identity.js.map +1 -0
  44. package/dist/workspace/interactive.js +96 -0
  45. package/dist/workspace/interactive.js.map +1 -0
  46. package/dist/workspace/template.js +357 -0
  47. package/dist/workspace/template.js.map +1 -0
  48. package/package.json +1 -1
  49. package/dist/commands/createApp.js +0 -448
  50. package/dist/commands/createApp.js.map +0 -1
  51. package/dist/createApp/copyTemplate.js +0 -561
  52. package/dist/createApp/copyTemplate.js.map +0 -1
  53. package/dist/template/scripts/build_web.sh +0 -12
@@ -1,561 +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.stringifyAppConfig = exports.PLATFORM_DIRS = exports.IGNORE_SUFFIXES = exports.IGNORE_NAMES = exports.WEB_HOST_DIAGNOSTIC = exports.TEMPLATE_DEFAULTS = exports.ANDROID_NAMESPACE = exports.IOS_BUNDLE_ID_PATTERN_SOURCE = exports.ANDROID_PACKAGE_PATTERN_SOURCE = exports.ENVIRONMENT_PATTERN_SOURCE = exports.SPID_PATTERN_SOURCE = exports.LEGACY_APP_CONFIG_FILENAMES = exports.APP_CONFIG_SKELETON = exports.APP_CONFIG_SCHEMA_VERSION = exports.APP_CONFIG_FILENAME = void 0;
37
- exports.isValidSpid = isValidSpid;
38
- exports.checkSpid = checkSpid;
39
- exports.checkEnvironment = checkEnvironment;
40
- exports.checkAppName = checkAppName;
41
- exports.checkAndroidPackage = checkAndroidPackage;
42
- exports.checkIosBundleId = checkIosBundleId;
43
- exports.normalizeWebHost = normalizeWebHost;
44
- exports.checkWebHost = checkWebHost;
45
- exports.isValidPlatform = isValidPlatform;
46
- exports.selectedPlatforms = selectedPlatforms;
47
- exports.locateDefaultTemplateRoot = locateDefaultTemplateRoot;
48
- exports.copyTemplateInto = copyTemplateInto;
49
- exports.legacyYamlMigrationMessage = legacyYamlMigrationMessage;
50
- exports.parseAppConfig = parseAppConfig;
51
- exports.applyAppIdentity = applyAppIdentity;
52
- // BL-005/BL-008 create-app: template discovery + `supersdk.json` identity injection.
53
- //
54
- // The copy step is intentionally a plain byte-for-byte file copy (no templating
55
- // engine). The ONLY content edit is the generated project's root
56
- // `supersdk.json`, and that edit is a real `JSON.parse -> mutate -> stringify`
57
- // round-trip (never a regex over the file text):
58
- //
59
- // * every unknown key is preserved — a human may add fields the CLI does not
60
- // know about, and a machine write must not erase them;
61
- // * output uses a fixed key order, 2-space indentation and a trailing newline,
62
- // so `git diff` shows only real changes — the order, the schemaVersion and the
63
- // retired-file set all come from src/config/appConfig.ts, the single copy the
64
- // publish-site side reads too;
65
- // * `orgId` / `sites` are owned by supercli's publish-site side. create-app
66
- // never writes them, only carries them through untouched.
67
- //
68
- // There is NO compatibility path for the retired YAML dialects (schema_version:
69
- // 1). Meeting one is a hard failure with a copy-pasteable migration snippet.
70
- const fs = __importStar(require("node:fs"));
71
- const path = __importStar(require("node:path"));
72
- const appConfig_1 = require("../config/appConfig");
73
- Object.defineProperty(exports, "APP_CONFIG_FILENAME", { enumerable: true, get: function () { return appConfig_1.APP_CONFIG_FILENAME; } });
74
- Object.defineProperty(exports, "APP_CONFIG_SCHEMA_VERSION", { enumerable: true, get: function () { return appConfig_1.APP_CONFIG_SCHEMA_VERSION; } });
75
- Object.defineProperty(exports, "APP_CONFIG_SKELETON", { enumerable: true, get: function () { return appConfig_1.APP_CONFIG_SKELETON; } });
76
- Object.defineProperty(exports, "LEGACY_APP_CONFIG_FILENAMES", { enumerable: true, get: function () { return appConfig_1.LEGACY_APP_CONFIG_FILENAMES; } });
77
- const shell_1 = require("../util/shell");
78
- // ---------------------------------------------------------------------------
79
- // Local validation, mirrored from the authoritative Python implementation.
80
- //
81
- // 🔴 权威在 Python 侧,不在这里:
82
- // supersimples/app_repo_example/scripts/supersdk_template.py
83
- // - SPID_PATTERN / ENVIRONMENT_PATTERN / BUNDLE_ID_PATTERN
84
- // - ANDROID_NAMESPACE + require_android_config()(Java 包名、label 规则)
85
- // supersimples/app_repo_example/scripts/web_host_validator.py
86
- // - normalize_host()(web.host 归一化与拒绝规则)
87
- // 下面这些函数只是把「build 期才会炸的错误」提前到 create 期暴露的镜像实现。
88
- // Python 侧规则一旦改动,必须以 Python 为准同步到这里;两边不一致时以 Python 为准。
89
- // ---------------------------------------------------------------------------
90
- exports.SPID_PATTERN_SOURCE = '[a-z0-9]{8}';
91
- exports.ENVIRONMENT_PATTERN_SOURCE = '[a-z0-9]{1,10}';
92
- exports.ANDROID_PACKAGE_PATTERN_SOURCE = '[A-Za-z][A-Za-z0-9_]*(\\.[A-Za-z][A-Za-z0-9_]*)+';
93
- exports.IOS_BUNDLE_ID_PATTERN_SOURCE = '[A-Za-z0-9][A-Za-z0-9-]*(\\.[A-Za-z0-9][A-Za-z0-9-]*)+';
94
- /** Fixed Gradle namespace baked into the template's android module (ANDROID_NAMESPACE in supersdk_template.py). */
95
- exports.ANDROID_NAMESPACE = 'com.supersdk.simple';
96
- /**
97
- * The template's own SuperSDK identity. create-app must never let any of these
98
- * survive into a generated project — a repo carrying them cannot be shipped.
99
- * Listed here so failure messages can name them explicitly.
100
- */
101
- exports.TEMPLATE_DEFAULTS = {
102
- name: 'SuperSDK Simple',
103
- androidPackage: 'com.supersdk.simple.host',
104
- iosBundleId: 'com.supersdk.simple',
105
- webHost: 'simple.supersdk.com',
106
- };
107
- const SPID_PATTERN = new RegExp(`^${exports.SPID_PATTERN_SOURCE}$`);
108
- const ENVIRONMENT_PATTERN = new RegExp(`^${exports.ENVIRONMENT_PATTERN_SOURCE}$`);
109
- const ANDROID_PACKAGE_PATTERN = new RegExp(`^${exports.ANDROID_PACKAGE_PATTERN_SOURCE}$`);
110
- const IOS_BUNDLE_ID_PATTERN = new RegExp(`^${exports.IOS_BUNDLE_ID_PATTERN_SOURCE}$`);
111
- function isValidSpid(spid) {
112
- return SPID_PATTERN.test(spid);
113
- }
114
- /** Validators return `undefined` when the value is acceptable, otherwise a human-readable reason. */
115
- function checkSpid(value) {
116
- return isValidSpid(value) ? undefined : `must match ^${exports.SPID_PATTERN_SOURCE}$ (8 lowercase letters or digits, issued by Console)`;
117
- }
118
- function checkEnvironment(value) {
119
- return ENVIRONMENT_PATTERN.test(value) ? undefined : `must match ^${exports.ENVIRONMENT_PATTERN_SOURCE}$ (e.g. prod, staging)`;
120
- }
121
- /** Android app label rules from require_android_config(): non-empty, no control chars, no surrounding whitespace. */
122
- function checkAppName(value) {
123
- if (value.trim() === '')
124
- return 'must not be empty';
125
- if (value !== value.trim())
126
- return 'must not have leading or trailing whitespace';
127
- for (const char of value) {
128
- // Python authority uses `ord(char) < 32`; deliberately identical, no extra rules.
129
- if ((char.codePointAt(0) ?? 0) < 32)
130
- return 'must not contain control characters';
131
- }
132
- return undefined;
133
- }
134
- function checkAndroidPackage(value) {
135
- if (!ANDROID_PACKAGE_PATTERN.test(value)) {
136
- return `must be a Java package matching ^${exports.ANDROID_PACKAGE_PATTERN_SOURCE}$ (e.g. com.acme.myapp)`;
137
- }
138
- if (value === exports.ANDROID_NAMESPACE) {
139
- return `must differ from the template's fixed Gradle namespace ${exports.ANDROID_NAMESPACE}`;
140
- }
141
- return undefined;
142
- }
143
- function checkIosBundleId(value) {
144
- return IOS_BUNDLE_ID_PATTERN.test(value)
145
- ? undefined
146
- : `must be a bundle identifier matching ^${exports.IOS_BUNDLE_ID_PATTERN_SOURCE}$ (e.g. com.acme.myapp)`;
147
- }
148
- /** Mirrors HOST_DIAGNOSTIC in web_host_validator.py so both sides say the same thing. */
149
- exports.WEB_HOST_DIAGNOSTIC = 'must be a deployable bare domain; localhost, IP literals, single-label hosts, whitespace, ' +
150
- 'trailing dots, numeric TLDs, and non-ASCII/IDN input are not supported';
151
- function isIpLiteral(value) {
152
- if (value.includes(':'))
153
- return true; // IPv6-ish
154
- const parts = value.split('.');
155
- if (parts.length !== 4)
156
- return false;
157
- return parts.every((part) => /^\d{1,3}$/.test(part) && Number(part) <= 255);
158
- }
159
- /**
160
- * Port of normalize_host() (web_host_validator.py): accepts a bare host or an
161
- * http(s) URL and returns the lowercased bare host, or an error reason.
162
- */
163
- function normalizeWebHost(raw) {
164
- const failure = { error: exports.WEB_HOST_DIAGNOSTIC };
165
- if (raw === '' || raw !== raw.trim() || /\s/.test(raw))
166
- return failure;
167
- // eslint-disable-next-line no-control-regex
168
- if (/[^\x00-\x7f]/.test(raw))
169
- return failure; // non-ASCII / IDN
170
- let host;
171
- if (raw.includes('://')) {
172
- let parsed;
173
- try {
174
- parsed = new URL(raw);
175
- }
176
- catch {
177
- return failure;
178
- }
179
- const scheme = parsed.protocol.replace(/:$/, '').toLowerCase();
180
- if (scheme !== 'http' && scheme !== 'https')
181
- return failure;
182
- if (!parsed.hostname || parsed.hostname.startsWith('['))
183
- return failure;
184
- host = parsed.hostname.toLowerCase();
185
- }
186
- else {
187
- if (raw.includes(':'))
188
- return failure;
189
- host = raw.toLowerCase();
190
- }
191
- if (!host || host === 'localhost' || isIpLiteral(host))
192
- return failure;
193
- if (host.startsWith('.') || host.endsWith('.') || host.includes('..'))
194
- return failure;
195
- if (host.length > 253)
196
- return failure;
197
- const labels = host.split('.');
198
- if (labels.length < 2)
199
- return failure;
200
- const labelPattern = /^[a-z0-9]([a-z0-9-]*[a-z0-9])?$/;
201
- for (const label of labels) {
202
- if (label.length < 1 || label.length > 63 || !labelPattern.test(label))
203
- return failure;
204
- }
205
- if (/^\d+$/.test(labels[labels.length - 1]))
206
- return failure;
207
- if (labels.length === 4 && labels.every((label) => /^\d+$/.test(label)))
208
- return failure;
209
- return { host };
210
- }
211
- function checkWebHost(value) {
212
- const result = normalizeWebHost(value);
213
- return 'error' in result ? result.error : undefined;
214
- }
215
- /**
216
- * Directory/file names excluded at every depth of the copy — mirrors
217
- * `ignore_generated` in supersimples/tests/e2e/build_orchestration_smoke.py
218
- * (TC-C06/AC-C4).
219
- */
220
- exports.IGNORE_NAMES = new Set([
221
- '.supersdk',
222
- '.gradle',
223
- '.swiftpm',
224
- '.build',
225
- 'build',
226
- '__pycache__',
227
- 'local.properties',
228
- 'Package.resolved',
229
- ]);
230
- exports.IGNORE_SUFFIXES = ['.pyc', '.xcodeproj', '.xcworkspace'];
231
- function isIgnoredName(name) {
232
- if (exports.IGNORE_NAMES.has(name))
233
- return true;
234
- return exports.IGNORE_SUFFIXES.some((suffix) => name.endsWith(suffix));
235
- }
236
- exports.PLATFORM_DIRS = ['android', 'ios', 'web'];
237
- function isValidPlatform(value) {
238
- return value === 'all' || exports.PLATFORM_DIRS.includes(value);
239
- }
240
- /**
241
- * 本次 create-app 的平台 scope,镜像 supersdk_template.py 的 `selected_platforms()`。
242
- *
243
- * 🔴 create 期的必填项必须跟 build 期的 scope 一致:`enforce_platform_contracts()` 只对
244
- * selected 里的平台跑 require_*_config,所以 `--platform web` 的工程既不该被逼着编一个
245
- * 假 Java 包名,也不该在 web 进了 scope 时把 web.host 留空 —— 后者下一步 build 就炸。
246
- */
247
- function selectedPlatforms(platform) {
248
- return platform === 'all' ? [...exports.PLATFORM_DIRS] : [platform];
249
- }
250
- /**
251
- * Locates the create-app template root. Two supported layouts, checked in order:
252
- *
253
- * 1. BUNDLED (npm-installed CLI): scripts/postbuild.mjs copies the template
254
- * into `<package>/dist/template`. From the compiled
255
- * `dist/createApp/copyTemplate.js` that is `../template` relative to
256
- * __dirname. This is the ONLY layout available in a published install
257
- * (package.json `files: ["dist"]` ships dist/ but not supersimples/), so it
258
- * is tried FIRST (EXT-3/ARCH-4).
259
- * 2. DEV/MONOREPO: walk up from this module's directory to find the sibling
260
- * `supersimples/app_repo_example` — the source template used during
261
- * development and by the real-template smoke test before a build has run.
262
- *
263
- * Callers can always override both via an explicit templateRoot.
264
- */
265
- function locateDefaultTemplateRoot() {
266
- // 1) Bundled template shipped inside dist/ (compiled location: dist/createApp).
267
- const bundled = path.join(__dirname, '..', 'template');
268
- if (fs.existsSync(bundled) && fs.statSync(bundled).isDirectory()) {
269
- return bundled;
270
- }
271
- // 2) Dev/monorepo walk-up to supersimples/app_repo_example.
272
- let dir = __dirname;
273
- for (let i = 0; i < 10; i++) {
274
- const candidate = path.join(dir, 'supersimples', 'app_repo_example');
275
- if (fs.existsSync(candidate) && fs.statSync(candidate).isDirectory()) {
276
- return candidate;
277
- }
278
- const parent = path.dirname(dir);
279
- if (parent === dir)
280
- break;
281
- dir = parent;
282
- }
283
- throw new Error(`could not locate the create-app template — neither a bundled dist/template (at "${bundled}") ` +
284
- `nor a supersimples/app_repo_example above "${__dirname}". Run \`npm run build\` to bundle the ` +
285
- 'template, or pass an explicit template root.');
286
- }
287
- function copyDirRecursive(src, dest) {
288
- fs.mkdirSync(dest, { recursive: true });
289
- let count = 0;
290
- const entries = fs.readdirSync(src, { withFileTypes: true });
291
- for (const entry of entries) {
292
- if (isIgnoredName(entry.name))
293
- continue;
294
- const srcPath = path.join(src, entry.name);
295
- if (entry.isSymbolicLink()) {
296
- throw new Error(`template contains an unsupported symlink at "${srcPath}"`);
297
- }
298
- const destPath = path.join(dest, entry.name);
299
- if (entry.isDirectory()) {
300
- count += copyDirRecursive(srcPath, destPath);
301
- }
302
- else if (entry.isFile()) {
303
- fs.copyFileSync(srcPath, destPath);
304
- // Preserve the source file's permission bits (notably android/gradlew's
305
- // executable bit, AC-C4) rather than whatever copyFileSync's default
306
- // creation mode would be.
307
- fs.chmodSync(destPath, fs.statSync(srcPath).mode);
308
- count += 1;
309
- }
310
- // Other dirent kinds (fifo/socket/device) are not expected in a template
311
- // and are silently skipped.
312
- }
313
- return count;
314
- }
315
- /**
316
- * Copies templateRoot into destDir (which must already exist, typically an
317
- * empty build/temp directory), applying the exclude set at every depth and,
318
- * for platform !== 'all', keeping only the selected platform directory among
319
- * android/ios/web while always keeping everything else at the template root
320
- * (the shared root: supersdk.json, super_build.sh, README.md, .gitignore,
321
- * scripts/, ...) — AC-C2/AC-C4.
322
- */
323
- function copyTemplateInto(templateRoot, destDir, platform) {
324
- fs.mkdirSync(destDir, { recursive: true });
325
- const entries = fs.readdirSync(templateRoot, { withFileTypes: true });
326
- let fileCount = 0;
327
- const platforms = [];
328
- for (const entry of entries) {
329
- if (isIgnoredName(entry.name))
330
- continue;
331
- const isPlatformDir = exports.PLATFORM_DIRS.includes(entry.name);
332
- if (isPlatformDir && platform !== 'all' && platform !== entry.name)
333
- continue;
334
- const srcPath = path.join(templateRoot, entry.name);
335
- if (entry.isSymbolicLink()) {
336
- throw new Error(`template contains an unsupported symlink at "${srcPath}"`);
337
- }
338
- const destPath = path.join(destDir, entry.name);
339
- if (entry.isDirectory()) {
340
- fileCount += copyDirRecursive(srcPath, destPath);
341
- if (isPlatformDir)
342
- platforms.push(entry.name);
343
- }
344
- else if (entry.isFile()) {
345
- fs.copyFileSync(srcPath, destPath);
346
- fs.chmodSync(destPath, fs.statSync(srcPath).mode);
347
- fileCount += 1;
348
- }
349
- }
350
- return { fileCount, platforms };
351
- }
352
- // ---------------------------------------------------------------------------
353
- // supersdk.json (schemaVersion 2) read / modify / write
354
- // ---------------------------------------------------------------------------
355
- function isPlainObject(value) {
356
- return typeof value === 'object' && value !== null && !Array.isArray(value);
357
- }
358
- /** Serializes with the canonical key order, 2-space indent and a trailing newline. */
359
- exports.stringifyAppConfig = appConfig_1.serializeAppConfig;
360
- /**
361
- * Fail-closed diagnostic for a retired YAML config. The snippet is meant to be
362
- * pasted into a shell verbatim — a migration hint that is missing even one
363
- * required field is a dead end, so the skeleton carries the complete set.
364
- *
365
- * 两种情形,动作顺序不同(且不能反):
366
- * - 目录里**已经有一份合法的 supersdk.json** → 没有任何字段需要搬运,只发 `rm <legacy>`。
367
- * 再让人照抄一遍 `cat >` 会用占位值覆盖掉他已经写好的真配置。
368
- * - 没有 → 先写新文件、**再**删旧文件:旧文件是字段的唯一来源,先删就没得抄了。
369
- */
370
- function legacyYamlMigrationMessage(yamlPath, jsonAlreadyValid = false) {
371
- const legacyName = path.basename(yamlPath);
372
- const dir = path.dirname(yamlPath);
373
- const head = [
374
- `${legacyName} (retired schema_version: 1 dialect) is no longer supported — supercli reads ` +
375
- `${appConfig_1.APP_CONFIG_FILENAME} (schemaVersion ${appConfig_1.APP_CONFIG_SCHEMA_VERSION}) only, and there is no compatibility fallback.`,
376
- `found: ${yamlPath}`,
377
- '',
378
- ];
379
- if (jsonAlreadyValid) {
380
- return [
381
- ...head,
382
- `your ${appConfig_1.APP_CONFIG_FILENAME} is already in place at ${path.join(dir, appConfig_1.APP_CONFIG_FILENAME)} — nothing to migrate, ` +
383
- 'just delete the retired file:',
384
- '',
385
- `cd ${(0, shell_1.shellQuote)(dir)}`,
386
- `rm ${(0, shell_1.shellQuote)(legacyName)}`,
387
- ].join('\n');
388
- }
389
- return [
390
- ...head,
391
- 'Migrate it once — replace the placeholder values with the ones already in your YAML, then run:',
392
- '',
393
- `cd ${(0, shell_1.shellQuote)(dir)}`,
394
- `cat > ${(0, shell_1.shellQuote)(appConfig_1.APP_CONFIG_FILENAME)} <<'SUPERSDK_JSON'`,
395
- appConfig_1.APP_CONFIG_SKELETON,
396
- 'SUPERSDK_JSON',
397
- `rm ${(0, shell_1.shellQuote)(legacyName)}`,
398
- ].join('\n');
399
- }
400
- /**
401
- * Strict schemaVersion-2 parse. Unknown keys are kept (they belong to whoever
402
- * wrote them), but a wrong/absent schemaVersion, a non-object document, or a
403
- * malformed `orgId`/`sites` fails closed rather than being "fixed up".
404
- */
405
- function parseAppConfig(raw, sourceLabel) {
406
- let parsed;
407
- try {
408
- parsed = JSON.parse(raw);
409
- }
410
- catch (err) {
411
- throw new Error(`${sourceLabel} is not valid JSON: ${err.message}`);
412
- }
413
- // 🔴 JSON.parse 对重复键静默取最后一个,权威侧 reject_duplicate_keys() 是硬失败。
414
- // 不在这里拦,CLI 就会把一份 Python 认定非法的文件重写成合法文件并丢掉数据。
415
- const duplicate = (0, appConfig_1.findDuplicateKey)(raw);
416
- if (duplicate !== undefined) {
417
- throw new Error(`${sourceLabel}: "${duplicate}": duplicate key — a JSON object must not repeat a key. ` +
418
- 'Keep exactly one of them (the build-time parser rejects the file outright; ' +
419
- 'silently keeping the last one would drop data).');
420
- }
421
- if (!isPlainObject(parsed)) {
422
- throw new Error(`${sourceLabel} must contain a JSON object at the top level`);
423
- }
424
- // Retired root keys get a targeted diagnostic instead of being carried through
425
- // as "unknown keys" (RETIRED_ROOT_KEYS in supersdk_template.py).
426
- for (const [key, reason] of Object.entries(appConfig_1.RETIRED_ROOT_KEYS)) {
427
- if ((0, appConfig_1.hasOwn)(parsed, key))
428
- throw new Error(`${sourceLabel}: "${key}" ${reason}`);
429
- }
430
- if (parsed.schemaVersion !== appConfig_1.APP_CONFIG_SCHEMA_VERSION) {
431
- throw new Error(`${sourceLabel} has schemaVersion ${JSON.stringify(parsed.schemaVersion)}; supercli only reads ` +
432
- `schemaVersion ${appConfig_1.APP_CONFIG_SCHEMA_VERSION}.\n\nExpected shape:\n\n${appConfig_1.APP_CONFIG_SKELETON}`);
433
- }
434
- // `orgId` and `sites` are owned by supercli's publish-site side. create-app
435
- // only sanity-checks their shape and then carries them through untouched.
436
- if ((0, appConfig_1.hasOwn)(parsed, 'orgId') && typeof parsed.orgId !== 'string') {
437
- throw new Error(`${sourceLabel}: "orgId" must be a string`);
438
- }
439
- if ((0, appConfig_1.hasOwn)(parsed, 'sites') && !Array.isArray(parsed.sites)) {
440
- throw new Error(`${sourceLabel}: "sites" must be an array`);
441
- }
442
- return parsed;
443
- }
444
- function sectionOf(config, key, sourceLabel) {
445
- const current = (0, appConfig_1.hasOwn)(config, key) ? config[key] : undefined;
446
- if (current === undefined || current === null) {
447
- const created = {};
448
- config[key] = created;
449
- return created;
450
- }
451
- if (!isPlainObject(current)) {
452
- throw new Error(`${sourceLabel}: "${key}" must be a JSON object`);
453
- }
454
- return current;
455
- }
456
- /**
457
- * Sets `<section>.<key>` when the caller resolved a value, and otherwise DELETES
458
- * it (dropping the section when nothing is left).
459
- *
460
- * 🔴 「没解析出值」永远不等于「沿用模板里的值」:模板自带 com.supersdk.simple.host /
461
- * simple.supersdk.com,让它们混进生成工程等于交付一个发不出去的仓库。
462
- */
463
- function setOrDrop(config, section, key, value, sourceLabel) {
464
- if (value !== undefined) {
465
- sectionOf(config, section, sourceLabel)[key] = value;
466
- return;
467
- }
468
- const current = (0, appConfig_1.hasOwn)(config, section) ? config[section] : undefined;
469
- if (current === undefined || current === null)
470
- return;
471
- const bag = sectionOf(config, section, sourceLabel);
472
- delete bag[key];
473
- if (Object.keys(bag).length === 0)
474
- delete config[section];
475
- }
476
- /**
477
- * Rewrites `<destDir>/supersdk.json` in place with the caller's identity.
478
- * `sourceDirForMessages` is only used to make diagnostics point at the template
479
- * the user can actually inspect, not at the internal temp build directory.
480
- */
481
- function applyAppIdentity(destDir, identity, sourceDirForMessages = destDir) {
482
- const configPath = path.join(destDir, appConfig_1.APP_CONFIG_FILENAME);
483
- const sourceLabel = path.join(sourceDirForMessages, appConfig_1.APP_CONFIG_FILENAME);
484
- // 退役文件集必须与权威侧 LEGACY_CONFIG_FILENAMES 逐字一致:只认 supersdk.yaml 就会
485
- // 出现「create-app 生成成功、Python 侧同一棵树立刻 fail-closed」。
486
- for (const legacyName of appConfig_1.LEGACY_APP_CONFIG_FILENAMES) {
487
- const legacyPath = path.join(destDir, legacyName);
488
- if (!fs.existsSync(legacyPath))
489
- continue;
490
- let jsonAlreadyValid = false;
491
- try {
492
- parseAppConfig(fs.readFileSync(configPath, 'utf8'), sourceLabel);
493
- jsonAlreadyValid = true;
494
- }
495
- catch {
496
- jsonAlreadyValid = false; // 缺失/非法 —— 迁移提示要带完整骨架
497
- }
498
- throw new Error(legacyYamlMigrationMessage(path.join(sourceDirForMessages, legacyName), jsonAlreadyValid));
499
- }
500
- if (!fs.existsSync(configPath)) {
501
- throw new Error(`template is missing ${appConfig_1.APP_CONFIG_FILENAME} at "${sourceLabel}" — every SuperSDK project repo must carry a ` +
502
- `schemaVersion ${appConfig_1.APP_CONFIG_SCHEMA_VERSION} ${appConfig_1.APP_CONFIG_FILENAME} at its root.\n\nExpected shape:\n\n${appConfig_1.APP_CONFIG_SKELETON}`);
503
- }
504
- const config = parseAppConfig(fs.readFileSync(configPath, 'utf8'), sourceLabel);
505
- config.schemaVersion = appConfig_1.APP_CONFIG_SCHEMA_VERSION;
506
- config.spid = identity.spid;
507
- config.name = identity.name;
508
- config.environment = identity.environment;
509
- setOrDrop(config, 'android', 'package', identity.androidPackage, sourceLabel);
510
- setOrDrop(config, 'ios', 'bundleId', identity.iosBundleId, sourceLabel);
511
- setOrDrop(config, 'web', 'host', identity.webHost, sourceLabel);
512
- fs.writeFileSync(configPath, (0, exports.stringifyAppConfig)(config), 'utf8');
513
- applyAndroidDefaultConfigIdentity(destDir, config);
514
- }
515
- /**
516
- * 同步改写 `android/supersdk-default.config.json`。
517
- *
518
- * 🔴 为什么必须做:它不是死文件。`android/gradle/supersdk-config-reader.gradle` 用它当
519
- * `.supersdk/managed/config.json` **缺失时的 fallback**,而刚 create-app 出来的工程里
520
- * `.supersdk/` 根本不存在 —— 正好落在 fallback 分支。不改写的话,用户直接
521
- * Android Studio Run / `./gradlew assembleRelease` 拿到的 APK 是
522
- * applicationId `com.supersdk.simple.host`、label「SuperSDK Simple」、spid `demo0001`,
523
- * 而且**静默成功、退出码 0、零告警**。
524
- *
525
- * 加重情节:create-app 打印的下一步是 `./super_build.sh --plan`,而 plan **不做 inject**,
526
- * 照着提示走完的工程正好停在这个状态。
527
- *
528
- * 这与「绝不沿用模板自带的 SuperSDK 身份」是同一条纪律 —— supersdk.json 那条路已经堵上,
529
- * 这条 fallback 路不能漏。
530
- *
531
- * 缺失/损坏一律静默跳过:它是可选的便利文件,不该让脚手架整体失败;真正的单源始终是
532
- * 根目录的 supersdk.json,`./super_build.sh --build` 会用它重新投影出 managed config。
533
- */
534
- function applyAndroidDefaultConfigIdentity(destDir, config) {
535
- const defaultConfigPath = path.join(destDir, 'android', 'supersdk-default.config.json');
536
- if (!fs.existsSync(defaultConfigPath))
537
- return;
538
- let document;
539
- try {
540
- const parsed = JSON.parse(fs.readFileSync(defaultConfigPath, 'utf8'));
541
- if (!parsed || typeof parsed !== 'object' || Array.isArray(parsed))
542
- return;
543
- document = parsed;
544
- }
545
- catch {
546
- return;
547
- }
548
- document.spid = config.spid;
549
- document.environment = config.environment;
550
- document.name = config.name;
551
- const androidPackage = config.android?.package;
552
- if (typeof androidPackage === 'string') {
553
- const platformConfig = document.platform_config;
554
- document.platform_config =
555
- platformConfig && typeof platformConfig === 'object' && !Array.isArray(platformConfig)
556
- ? { ...platformConfig, package: androidPackage }
557
- : { package: androidPackage };
558
- }
559
- fs.writeFileSync(defaultConfigPath, `${JSON.stringify(document, null, 2)}\n`, 'utf8');
560
- }
561
- //# sourceMappingURL=copyTemplate.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"copyTemplate.js","sourceRoot":"","sources":["../../src/createApp/copyTemplate.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiFA,kCAEC;AAGD,8BAEC;AAED,4CAEC;AAGD,oCAQC;AAED,kDAQC;AAED,4CAIC;AAkBD,4CAoCC;AAED,oCAGC;AA6BD,0CAEC;AASD,8CAEC;AAiBD,8DAuBC;AA4CD,4CA2BC;AAuBD,gEA6BC;AAOD,wCAwCC;AAsDD,4CAsCC;AA1gBD,qFAAqF;AACrF,EAAE;AACF,gFAAgF;AAChF,iEAAiE;AACjE,+EAA+E;AAC/E,iDAAiD;AACjD,EAAE;AACF,+EAA+E;AAC/E,2DAA2D;AAC3D,iFAAiF;AACjF,mFAAmF;AACnF,kFAAkF;AAClF,mCAAmC;AACnC,8EAA8E;AAC9E,8DAA8D;AAC9D,EAAE;AACF,gFAAgF;AAChF,6EAA6E;AAC7E,4CAA8B;AAC9B,gDAAkC;AAClC,mDAU6B;AAM3B,oGAfA,+BAAmB,OAeA;AACnB,0GAfA,qCAAyB,OAeA;AACzB,oGAfA,+BAAmB,OAeA;AACnB,4GAfA,uCAA2B,OAeA;AAR7B,yCAA2C;AAY3C,8EAA8E;AAC9E,2EAA2E;AAC3E,EAAE;AACF,wBAAwB;AACxB,+DAA+D;AAC/D,+DAA+D;AAC/D,uEAAuE;AACvE,gEAAgE;AAChE,4CAA4C;AAC5C,+CAA+C;AAC/C,uDAAuD;AACvD,8EAA8E;AAEjE,QAAA,mBAAmB,GAAG,aAAa,CAAC;AACpC,QAAA,0BAA0B,GAAG,gBAAg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,CAAC,IAAI,CAAC;IAC5B,MAAM,cAAc,GAAI,MAAM,CAAC,OAA+C,EAAE,OAAO,CAAC;IACxF,IAAI,OAAO,cAAc,KAAK,QAAQ,EAAE,CAAC;QACvC,MAAM,cAAc,GAAG,QAAQ,CAAC,eAAe,CAAC;QAChD,QAAQ,CAAC,eAAe;YACtB,cAAc,IAAI,OAAO,cAAc,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,cAAc,CAAC;gBACpF,CAAC,CAAC,EAAE,GAAI,cAA0C,EAAE,OAAO,EAAE,cAAc,EAAE;gBAC7E,CAAC,CAAC,EAAE,OAAO,EAAE,cAAc,EAAE,CAAC;IACpC,CAAC;IAED,EAAE,CAAC,aAAa,CAAC,iBAAiB,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;AACxF,CAAC"}
@@ -1,12 +0,0 @@
1
- #!/usr/bin/env bash
2
- set -euo pipefail
3
-
4
- APP_ROOT="$(cd "$(dirname "$0")/.." && pwd)"
5
- PYTHON_BIN="${PYTHON_BIN:-python3}"
6
-
7
- if [ "${1:---build}" != "--build" ] || [ "$#" -gt 1 ]; then
8
- echo "error: expected --build" >&2
9
- exit 2
10
- fi
11
-
12
- exec "$PYTHON_BIN" "$APP_ROOT/scripts/web_package.py" package-managed --root "$APP_ROOT"