@makefully/adaptfully 3.12.0 → 3.13.0
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/CHANGELOG.md +12 -0
- package/README.md +23 -2
- package/lib/node/apple-publish.js +2 -1
- package/lib/node/google-publish.js +2 -1
- package/lib/node/index.js +8 -0
- package/lib/node/packagers/base.js +5 -2
- package/lib/node/packagers/electron.js +5 -2
- package/lib/node/platform-config.js +81 -0
- package/lib/node/publish-credentials.js +35 -6
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project are documented in this file.
|
|
4
4
|
|
|
5
|
+
## 3.13.0 — 2026-07-24
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
|
|
9
|
+
- **Per-platform `config.*` overrides** — `config.platforms.<key>.packageName` (and other identity/branding fields) override top-level `config.*` defaults for that platform. Control fields (`packager`, `registrations`, `builder`, `deployments`, `steamId`, `socialLogin`, `steamworks`) are unchanged. Helpers: `resolvePlatformConfig`, `getConfigValue`, `resolveConfigForBuild`.
|
|
10
|
+
|
|
11
|
+
## 3.12.1 — 2026-07-23
|
|
12
|
+
|
|
13
|
+
### Fixed
|
|
14
|
+
|
|
15
|
+
- **Publish path prompts** — strip wrapping quotes from user-supplied paths (e.g. pasted `"D:\…\key.json"`) so absolute paths are not treated as project-relative.
|
|
16
|
+
|
|
5
17
|
## 3.12.0 — 2026-07-23
|
|
6
18
|
|
|
7
19
|
### Added
|
package/README.md
CHANGED
|
@@ -437,13 +437,13 @@ Standard npm fields (`name`, `version`, `description`) are used directly. Add a
|
|
|
437
437
|
| Field | Used by | Description |
|
|
438
438
|
|-------|---------|-------------|
|
|
439
439
|
| `title` | All | Display name shown in stores and app shells |
|
|
440
|
-
| `packageName` | Cordova, Electron, UWP | Reverse-DNS identifier (`com.company.game`) |
|
|
440
|
+
| `packageName` | Cordova, Capacitor, Electron, UWP, Play upload | Reverse-DNS identifier (`com.company.game`) |
|
|
441
441
|
| `publisherDisplayName` | Cordova, Electron, web | Short publisher name |
|
|
442
442
|
| `publisherFullName` | Electron | Legal entity name for copyright |
|
|
443
443
|
| `publisherWebsite` | Cordova, web | Company URL |
|
|
444
444
|
| `publisherEmailAddress` | Cordova | Contact email |
|
|
445
445
|
| `scope` | Web/PWA | Base URL scope for the web app |
|
|
446
|
-
| `themeColor` | Cordova, Electron, UWP, web | Loading screen / theme color |
|
|
446
|
+
| `themeColor` | Cordova, Capacitor, Electron, UWP, web | Loading screen / theme color |
|
|
447
447
|
| `twitterId` | Web | Twitter handle for meta tags |
|
|
448
448
|
| `deployFolder` | Client | Neutral deploy directory staged before prebuild (default: `deploy`) |
|
|
449
449
|
| `htmlInjections` | Prebuild | Deploy-relative HTML paths to inject (default: `["index.html"]`) |
|
|
@@ -454,8 +454,29 @@ Standard npm fields (`name`, `version`, `description`) are used directly. Add a
|
|
|
454
454
|
| `platforms.<name>.packager` | Prebuild | `web` (default), `electron`, `cordova`, or `capacitor` — selects the packager class that adds platform-specific files during prebuild |
|
|
455
455
|
| `platforms.<name>.steamId` | Electron + steam-auth | Steamworks app ID baked into `preload.js` (client). Upload app IDs belong in the Steam deployment `manifest.json` |
|
|
456
456
|
| `platforms.<name>.socialLogin` | Capacitor + social-auth | Capgo provider config (`providers`, `google.webClientId`, `apple.clientId`, optional `defaultProvider`) |
|
|
457
|
+
| `platforms.<name>.<configField>` | Build/deploy | Overrides the matching top-level `config.*` default for that platform only (e.g. `platforms.android.packageName`, `platforms.ios.title`). Does not apply to control fields: `packager`, `registrations`, `builder`, `builders`, `deployments`, `steamId`, `socialLogin`, `steamworks` |
|
|
457
458
|
| `properties` | Cordova | Cordova config.xml entries (plugins, allow-navigation, etc.) |
|
|
458
459
|
|
|
460
|
+
Top-level `config.*` values are **defaults**. Any non-control field on `config.platforms.<name>` overrides the default when that platform is built or deployed. Example:
|
|
461
|
+
|
|
462
|
+
```json
|
|
463
|
+
"config": {
|
|
464
|
+
"packageName": "com.example.game",
|
|
465
|
+
"title": "My Game",
|
|
466
|
+
"platforms": {
|
|
467
|
+
"android": {
|
|
468
|
+
"packager": "capacitor",
|
|
469
|
+
"packageName": "com.example.game.android"
|
|
470
|
+
},
|
|
471
|
+
"android-dev": {
|
|
472
|
+
"packager": "capacitor",
|
|
473
|
+
"packageName": "com.example.game.dev"
|
|
474
|
+
}
|
|
475
|
+
}
|
|
476
|
+
}
|
|
477
|
+
```
|
|
478
|
+
|
|
479
|
+
|
|
459
480
|
### `wrapfully.json`
|
|
460
481
|
|
|
461
482
|
Optional. Fields are shallow-merged into `package.json`'s `config`:
|
|
@@ -7,6 +7,7 @@ import {
|
|
|
7
7
|
ensureDeploymentManifest,
|
|
8
8
|
ensurePublishCredentialsGitignore,
|
|
9
9
|
parsePublishCredentialArgv,
|
|
10
|
+
resolveUserPath,
|
|
10
11
|
} from './publish-credentials.js';
|
|
11
12
|
|
|
12
13
|
/**
|
|
@@ -82,7 +83,7 @@ export async function runApplePublish(options = {}) {
|
|
|
82
83
|
let appleJson;
|
|
83
84
|
|
|
84
85
|
if (options.from) {
|
|
85
|
-
const fromPath =
|
|
86
|
+
const fromPath = resolveUserPath(options.from);
|
|
86
87
|
let raw;
|
|
87
88
|
|
|
88
89
|
try {
|
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
ensurePublishCredentialsGitignore,
|
|
7
7
|
parsePublishCredentialArgv,
|
|
8
8
|
promptRequired,
|
|
9
|
+
resolveUserPath,
|
|
9
10
|
} from './publish-credentials.js';
|
|
10
11
|
|
|
11
12
|
const GOOGLE_REQUIRED_FIELDS = [
|
|
@@ -72,7 +73,7 @@ export async function runGooglePublish(options = {}) {
|
|
|
72
73
|
options.output ?? defaultGooglePublishPath(projectRoot, deploymentKey),
|
|
73
74
|
);
|
|
74
75
|
|
|
75
|
-
const fromPath =
|
|
76
|
+
const fromPath = resolveUserPath(
|
|
76
77
|
await promptRequired(
|
|
77
78
|
'Path to Google Play service account JSON: ',
|
|
78
79
|
options.from ?? process.env.GOOGLE_APPLICATION_CREDENTIALS,
|
package/lib/node/index.js
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
export { buildOutputDir, clearStaleBuildExtract, resolveBuildArtifactDir } from './artifacts.js';
|
|
2
2
|
export { createArchive, createDeployArchive, createReleaseArchive, createSourceArchive } from './archive.js';
|
|
3
3
|
export { loadProjectConfig, resolveServerUrl } from './config.js';
|
|
4
|
+
export {
|
|
5
|
+
getConfigValue,
|
|
6
|
+
PLATFORM_CONTROL_KEYS,
|
|
7
|
+
resolveConfigForBuild,
|
|
8
|
+
resolvePlatformConfig,
|
|
9
|
+
} from './platform-config.js';
|
|
4
10
|
export { send } from './deploy.js';
|
|
5
11
|
export {
|
|
6
12
|
appendMetaIcons,
|
|
@@ -54,9 +60,11 @@ export {
|
|
|
54
60
|
defaultDeploymentCredentialPath,
|
|
55
61
|
ensureDeploymentManifest,
|
|
56
62
|
ensurePublishCredentialsGitignore,
|
|
63
|
+
normalizeUserPath,
|
|
57
64
|
parsePublishCredentialArgv,
|
|
58
65
|
promptRequired,
|
|
59
66
|
PUBLISH_CREDENTIAL_GITIGNORE_PATTERNS,
|
|
67
|
+
resolveUserPath,
|
|
60
68
|
} from './publish-credentials.js';
|
|
61
69
|
export {
|
|
62
70
|
buildSteamPublishJson,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import fs from 'node:fs';
|
|
2
2
|
import path from 'node:path';
|
|
3
3
|
import { STANDARD_PLUGINS } from '../registrations.js';
|
|
4
|
+
import { resolvePlatformConfig } from '../platform-config.js';
|
|
4
5
|
|
|
5
6
|
/** @typedef {import('../registrations.js').RegistrationMap} RegistrationMap */
|
|
6
7
|
/** @typedef {'web' | 'electron' | 'cordova' | 'capacitor'} PackagerName */
|
|
@@ -38,15 +39,17 @@ function gameConfigPlatform(platformKey) {
|
|
|
38
39
|
/**
|
|
39
40
|
* @param {string} dest
|
|
40
41
|
* @param {string} platformKey
|
|
41
|
-
* @param {{ name: string, version: string, config?:
|
|
42
|
+
* @param {{ name: string, version: string, config?: object }} pkg
|
|
42
43
|
* @param {(message: string) => void} log
|
|
43
44
|
*/
|
|
44
45
|
function writeGameConfig(dest, platformKey, pkg, log) {
|
|
46
|
+
const config = resolvePlatformConfig(pkg, platformKey);
|
|
45
47
|
const content = `window.gameConfig = ${JSON.stringify({
|
|
46
|
-
title:
|
|
48
|
+
title: config.title,
|
|
47
49
|
version: pkg.version,
|
|
48
50
|
id: pkg.name,
|
|
49
51
|
platform: gameConfigPlatform(platformKey),
|
|
52
|
+
packageName: config.packageName,
|
|
50
53
|
}, null, 4)};`;
|
|
51
54
|
|
|
52
55
|
fs.writeFileSync(path.join(dest, 'game-config.js'), content);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import fs from 'node:fs';
|
|
2
2
|
import path from 'node:path';
|
|
3
3
|
import { Packager } from './base.js';
|
|
4
|
+
import { resolvePlatformConfig } from '../platform-config.js';
|
|
4
5
|
|
|
5
6
|
const STEAM_INIT = `const path = require('path');
|
|
6
7
|
|
|
@@ -221,8 +222,10 @@ export class ElectronPackager extends Packager {
|
|
|
221
222
|
|
|
222
223
|
/** @param {string} dest */
|
|
223
224
|
writeElectronMain(dest) {
|
|
224
|
-
const
|
|
225
|
-
|
|
225
|
+
const
|
|
226
|
+
withSteam = this.usesPlugin('steam-auth'),
|
|
227
|
+
config = resolvePlatformConfig(this.pkg, this.platformKey),
|
|
228
|
+
mainContent = buildElectronMain(withSteam, config.themeColor);
|
|
226
229
|
|
|
227
230
|
if (withSteam) {
|
|
228
231
|
const steamId = resolvePlatformSteamId(this.platformKey, this.pkg);
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Keys that configure platform behavior (not inherited identity/defaults).
|
|
3
|
+
* These stay on `platforms.<key>` and are not treated as config.* overrides.
|
|
4
|
+
*/
|
|
5
|
+
export const PLATFORM_CONTROL_KEYS = new Set([
|
|
6
|
+
'registrations',
|
|
7
|
+
'builder',
|
|
8
|
+
'builders',
|
|
9
|
+
'packager',
|
|
10
|
+
'deployments',
|
|
11
|
+
'steamId',
|
|
12
|
+
'socialLogin',
|
|
13
|
+
'steamworks',
|
|
14
|
+
]);
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Resolve effective `config` for a platform: top-level `config.*` are defaults;
|
|
18
|
+
* any non-control field on `config.platforms.<platformKey>` overrides them.
|
|
19
|
+
*
|
|
20
|
+
* @param {{ config?: Record<string, unknown> }} pkg
|
|
21
|
+
* @param {string | null | undefined} platformKey
|
|
22
|
+
* @returns {Record<string, unknown>}
|
|
23
|
+
*/
|
|
24
|
+
export function resolvePlatformConfig(pkg, platformKey) {
|
|
25
|
+
const root = pkg?.config && typeof pkg.config === 'object' ? pkg.config : {};
|
|
26
|
+
/** @type {Record<string, unknown>} */
|
|
27
|
+
const resolved = { ...root };
|
|
28
|
+
delete resolved.platforms;
|
|
29
|
+
|
|
30
|
+
if (!platformKey || typeof platformKey !== 'string') {
|
|
31
|
+
return resolved;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const platform = root.platforms?.[platformKey];
|
|
35
|
+
if (!platform || typeof platform !== 'object' || Array.isArray(platform)) {
|
|
36
|
+
return resolved;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
for (const [key, value] of Object.entries(platform)) {
|
|
40
|
+
if (PLATFORM_CONTROL_KEYS.has(key) || value === undefined) {
|
|
41
|
+
continue;
|
|
42
|
+
}
|
|
43
|
+
resolved[key] = value;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
return resolved;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* @param {{ config?: Record<string, unknown> }} pkg
|
|
51
|
+
* @param {string | null | undefined} platformKey
|
|
52
|
+
* @param {string} key
|
|
53
|
+
* @param {unknown} [fallback]
|
|
54
|
+
*/
|
|
55
|
+
export function getConfigValue(pkg, platformKey, key, fallback) {
|
|
56
|
+
const resolved = resolvePlatformConfig(pkg, platformKey);
|
|
57
|
+
return resolved[key] !== undefined ? resolved[key] : fallback;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Prefer a platform whose key matches the deployment key (e.g. deploy "android"
|
|
62
|
+
* → platforms.android), else the build's platformKey.
|
|
63
|
+
*
|
|
64
|
+
* @param {{ config?: Record<string, unknown> }} pkg
|
|
65
|
+
* @param {{ platformKey?: string | null, deploymentKey?: string | null }} [context]
|
|
66
|
+
*/
|
|
67
|
+
export function resolveConfigForBuild(pkg, context = {}) {
|
|
68
|
+
const { platformKey = null, deploymentKey = null } = context;
|
|
69
|
+
const platforms = pkg?.config?.platforms;
|
|
70
|
+
|
|
71
|
+
if (
|
|
72
|
+
deploymentKey
|
|
73
|
+
&& platforms
|
|
74
|
+
&& typeof platforms === 'object'
|
|
75
|
+
&& platforms[deploymentKey]
|
|
76
|
+
) {
|
|
77
|
+
return resolvePlatformConfig(pkg, deploymentKey);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
return resolvePlatformConfig(pkg, platformKey);
|
|
81
|
+
}
|
|
@@ -158,6 +158,35 @@ export async function ensureDeploymentManifest(deploymentDir, type, log = consol
|
|
|
158
158
|
return { manifestPath, created: false, updated: true };
|
|
159
159
|
}
|
|
160
160
|
|
|
161
|
+
/**
|
|
162
|
+
* Strip wrapping quotes and whitespace from a user-supplied filesystem path.
|
|
163
|
+
* Quoted absolute paths (common when pasting on Windows) must not be treated as relative.
|
|
164
|
+
*
|
|
165
|
+
* @param {string} value
|
|
166
|
+
* @returns {string}
|
|
167
|
+
*/
|
|
168
|
+
export function normalizeUserPath(value) {
|
|
169
|
+
let result = String(value).trim();
|
|
170
|
+
|
|
171
|
+
if (
|
|
172
|
+
(result.startsWith('"') && result.endsWith('"'))
|
|
173
|
+
|| (result.startsWith("'") && result.endsWith("'"))
|
|
174
|
+
) {
|
|
175
|
+
result = result.slice(1, -1).trim();
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
return result;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
/**
|
|
182
|
+
* @param {string} value
|
|
183
|
+
* @param {string} [base]
|
|
184
|
+
* @returns {string}
|
|
185
|
+
*/
|
|
186
|
+
export function resolveUserPath(value, base = process.cwd()) {
|
|
187
|
+
return path.resolve(base, normalizeUserPath(value));
|
|
188
|
+
}
|
|
189
|
+
|
|
161
190
|
/**
|
|
162
191
|
* @param {string} prompt
|
|
163
192
|
* @param {string} [existing]
|
|
@@ -165,13 +194,13 @@ export async function ensureDeploymentManifest(deploymentDir, type, log = consol
|
|
|
165
194
|
*/
|
|
166
195
|
export async function promptRequired(prompt, existing) {
|
|
167
196
|
if (existing != null && String(existing).trim() !== '') {
|
|
168
|
-
return
|
|
197
|
+
return normalizeUserPath(existing);
|
|
169
198
|
}
|
|
170
199
|
|
|
171
200
|
const rl = readline.createInterface({ input, output });
|
|
172
201
|
|
|
173
202
|
try {
|
|
174
|
-
const value =
|
|
203
|
+
const value = normalizeUserPath(await rl.question(prompt));
|
|
175
204
|
if (!value) {
|
|
176
205
|
throw new Error(`${prompt.replace(/:\s*$/, '')} is required.`);
|
|
177
206
|
}
|
|
@@ -196,15 +225,15 @@ export function parsePublishCredentialArgv(argv, startIndex = 3) {
|
|
|
196
225
|
const arg = argv[i];
|
|
197
226
|
|
|
198
227
|
if (arg === '--from' && argv[i + 1]) {
|
|
199
|
-
options.from = argv[++i];
|
|
228
|
+
options.from = normalizeUserPath(argv[++i]);
|
|
200
229
|
} else if (arg === '--output' && argv[i + 1]) {
|
|
201
|
-
options.output = argv[++i];
|
|
230
|
+
options.output = normalizeUserPath(argv[++i]);
|
|
202
231
|
} else if (arg === '--deployment' && argv[i + 1]) {
|
|
203
232
|
options.deployment = argv[++i];
|
|
204
233
|
} else if (arg === '--project-root' && argv[i + 1]) {
|
|
205
|
-
options.projectRoot = argv[++i];
|
|
234
|
+
options.projectRoot = normalizeUserPath(argv[++i]);
|
|
206
235
|
} else if (arg === '--steamcmd-dir' && argv[i + 1]) {
|
|
207
|
-
options.steamcmdDir = argv[++i];
|
|
236
|
+
options.steamcmdDir = normalizeUserPath(argv[++i]);
|
|
208
237
|
} else if (arg === '--category' && argv[i + 1]) {
|
|
209
238
|
options.category = argv[++i];
|
|
210
239
|
} else if (arg === '--identity' && argv[i + 1]) {
|