@makefully/adaptfully 3.15.1 → 3.16.1

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 CHANGED
@@ -2,6 +2,24 @@
2
2
 
3
3
  All notable changes to this project are documented in this file.
4
4
 
5
+ ## 3.16.1 — 2026-09-03
6
+
7
+ ### Fixed
8
+
9
+ - **`adaptfully build` signing credentials** — Capacitor/Cordova zip builds now package `assets/meta/deployments/<canonical>/` (e.g. `ios-dev` → `ios`) so Wrapfully can sign device IPAs. Previously only `release` shipped deployment folders, so `ios:dev-build` arrived on the Mac without `apple/development.*`.
10
+
11
+ ## 3.16.0 — 2026-09-02
12
+
13
+ ### Added
14
+
15
+ - **Apple-only iOS `social-auth`** — `providers.google: false` + `providers.apple: true` no longer requires `google.webClientId`. On iOS, missing `apple.clientId` defaults to the platform `packageName`; runtime also falls back to `window.gameConfig.packageName`.
16
+ - **Publish gitignore** — ignore `assets/meta/deployments/**/apple/` (`.p12` / `.mobileprovision`).
17
+
18
+ ### Docs
19
+
20
+ - Registrations are owned by prebuild HTML markers (do not double-inline at compile time).
21
+ - Capacitor iOS signing is file-based under `apple/` (not Cordova-era `build.json` ios fields).
22
+
5
23
  ## 3.15.1 — 2026-09-01
6
24
 
7
25
  ### Fixed
package/README.md CHANGED
@@ -63,7 +63,7 @@ A **platform** (`config.platforms.<key>`) describes *how* to build — registrat
63
63
 
64
64
  > **Back-compat:** projects with no `assets/meta/deployments/` directory keep the legacy behavior — the entire `assets/meta/` tree (including `assets/meta/publish/`) is shipped as `meta/`, and a single set of credentials is read from `meta/publish/`.
65
65
 
66
- Place `<!-- adaptfully -->` / `<!-- /adaptfully -->` markers in your HTML templates where registrations should be injected (typically between split bundle scripts, before `account.js` runs).
66
+ Place `<!-- adaptfully -->` / `<!-- /adaptfully -->` markers in your HTML templates where registrations should be injected (typically between split bundle scripts, before `account.js` runs). **Do not also inline Adaptfully auth scripts at game compile time** — prebuild/release owns the marker block for each platform.
67
67
 
68
68
  ```javascript
69
69
  // Injected into deploy/index.html for the target platform (before game code):
@@ -224,7 +224,11 @@ The renderer `steam-auth` plugin reads the Steam ID from that bridge. When Steam
224
224
 
225
225
  When `social-auth` is registered on a **`capacitor`** platform, Adaptfully prebuild writes **`social-login-config.js`** (`window.__ADAPTFULLY_SOCIAL_LOGIN__`) from `platforms.<name>.socialLogin`. Wrapfully installs [`@capgo/capacitor-social-login`](https://github.com/Cap-go/capacitor-social-login) and syncs it into the native project (same role as `steamworks.js` for Electron).
226
226
 
227
- The runtime plugin calls Capgo `SocialLogin.initialize` / `login` / `logout` / `isLoggedIn`. Default provider is `google` on Android and `apple` on iOS when both are enabled (override with `socialLogin.defaultProvider`). Optional config keys:
227
+ The runtime plugin calls Capgo `SocialLogin.initialize` / `login` / `logout` / `isLoggedIn`. Default provider is `google` on Android and `apple` on iOS when both are enabled (override with `socialLogin.defaultProvider`).
228
+
229
+ **Apple-only iOS** (`providers.google: false`, `providers.apple: true`) is supported — Google `webClientId` is not required. On iOS, if `apple.clientId` is omitted, Adaptfully defaults it to the platform `packageName` (Capgo uses this as a plugin label on native iOS, not an Apple Services ID). On Android, Apple Sign-In still requires `apple.clientId`. At runtime, an empty Apple `clientId` also falls back to `window.gameConfig.packageName`.
230
+
231
+ Optional config keys:
228
232
 
229
233
  | Key | Default | Purpose |
230
234
  |-----|---------|---------|
@@ -604,29 +608,21 @@ The file looks like:
604
608
 
605
609
  #### Apple (`ios`, `ios-dev`, `ios-sim`, `mac`)
606
610
 
607
- Include `assets/meta/deployments/<deployment>/build.json` with iOS signing settings:
611
+ **Capacitor iOS** signing is file-based under the deployment folder (not the Cordova-style `build.json` `ios.*` identity fields):
608
612
 
609
- ```json
610
- {
611
- "ios": {
612
- "debug": {
613
- "codeSignIdentity": "iPhone Development",
614
- "provisioningProfile": "(your development provisioning profile id)",
615
- "developmentTeam": "(your team id)",
616
- "packageType": "development",
617
- "automaticProvisioning": false
618
- },
619
- "release": {
620
- "codeSignIdentity": "iPhone Distribution",
621
- "provisioningProfile": "(your distribution provisioning profile id)",
622
- "developmentTeam": "(your team id)",
623
- "packageType": "app-store",
624
- "automaticProvisioning": false
625
- }
626
- }
627
- }
613
+ ```
614
+ assets/meta/deployments/<deployment>/
615
+ apple.json
616
+ apple/distribution.p12 # release
617
+ apple/app-store.mobileprovision # release
618
+ apple/development.p12 # ios-dev device
619
+ apple/development.mobileprovision # ios-dev device
628
620
  ```
629
621
 
622
+ `adaptfully build` (zip-only) still packages this deployment folder for Capacitor/Cordova so device debug builds can sign. The `.p12` passphrase must match `MAC_KEYCHAIN_PASSWORD` on the Mac Wrapfully host. Team ID and profile UUID are read from the `.mobileprovision`. Enable **Sign in with Apple** on the App ID when using Capgo Apple auth.
623
+
624
+ Optional `build.json` may still be present for tooling compatibility; Capacitor does not require its `ios.*` code-sign fields.
625
+
630
626
  To deploy to the App Store, include `assets/meta/deployments/<deployment>/apple.json`. The easiest path is:
631
627
 
632
628
  ```bash
@@ -638,13 +634,14 @@ The file looks like:
638
634
 
639
635
  ```json
640
636
  {
641
- "category": "(your app's category)",
642
- "identity": "(your team identity)",
643
- "username": "(your username)",
644
- "password": "(your password)"
637
+ "category": "public.app-category.games",
638
+ "identity": "(your team id)",
639
+ "username": "(Apple ID email)",
640
+ "password": "(app-specific password)"
645
641
  }
646
642
  ```
647
643
 
644
+ iOS IPA upload uses `username` + `password` via `xcrun altool --upload-app`. `category` / `identity` matter more for macOS Electron signing/notarization.
648
645
  #### Cordova
649
646
 
650
647
  Set `packager: "cordova"` on an `android` or `ios` platform to use Cordova instead of Capacitor. Requires the Android and Apple package requirements above.
@@ -144,7 +144,8 @@ function createZipStream(deployFolder, contents, options = {}) {
144
144
  }
145
145
 
146
146
  /**
147
- * Game source zip for /build and /release (no credentials unless release).
147
+ * Game source zip for /build (and legacy callers). Include `deploymentDirs` when
148
+ * the builder needs signing credentials (e.g. Capacitor ios-dev).
148
149
  *
149
150
  * @param {string} deployFolder
150
151
  * @param {string} contents
@@ -71,7 +71,11 @@ export async function send(gameId, contents, server, stage, family, deployFolder
71
71
  } else if (stage === 'release') {
72
72
  archiveStream = createReleaseArchive(deployFolder, contents, options.deploymentDirs ?? [], { log });
73
73
  } else {
74
- archiveStream = createSourceArchive(deployFolder, contents, { log });
74
+ archiveStream = createSourceArchive(deployFolder, contents, {
75
+ log,
76
+ publishDir: options.publishDir,
77
+ deploymentDirs: options.deploymentDirs,
78
+ });
75
79
  }
76
80
 
77
81
  const url = resolveWrapfullyUrl(server, stage, family, gameId, platformKey, options.deploymentKey);
package/lib/node/index.js CHANGED
@@ -52,6 +52,7 @@ export {
52
52
  resolveFamilyFromTarget,
53
53
  resolvePlatformKey,
54
54
  resolvePlatformRegistrationsByKey,
55
+ resolveBuildCredentialDirs,
55
56
  resolvePublishDir,
56
57
  resolveRegistrationAssets,
57
58
  } from './registrations.js';
@@ -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 CAPACITOR_CSP = '<meta http-equiv="Content-Security-Policy" content="default-src * \'self\' data: blob: \'unsafe-inline\' \'unsafe-eval\'; style-src * \'self\' \'unsafe-inline\'; script-src * \'self\' \'unsafe-inline\' \'unsafe-eval\'; connect-src *; img-src * data: blob:; media-src * data: blob:; frame-src *;" />';
6
7
 
@@ -17,24 +18,40 @@ export function resolvePlatformSocialLogin(platformKey, pkg) {
17
18
  return pkg.config?.platforms?.[platformKey]?.socialLogin;
18
19
  }
19
20
 
21
+ /**
22
+ * @param {string} platformKey
23
+ */
24
+ function isIosPlatformKey(platformKey) {
25
+ return platformKey === 'ios'
26
+ || platformKey === 'ios-dev'
27
+ || platformKey === 'ios-sim'
28
+ || String(platformKey).startsWith('ios');
29
+ }
30
+
20
31
  /**
21
32
  * @param {object} socialLogin
22
33
  * @param {string} platformKey
34
+ * @param {{ packageName?: string }} [options]
23
35
  */
24
- function normalizeSocialLoginConfig(socialLogin = {}, platformKey) {
36
+ export function normalizeSocialLoginConfig(socialLogin = {}, platformKey, options = {}) {
25
37
  const providers = socialLogin.providers ?? { google: true, apple: true };
26
38
  const googleEnabled = providers.google !== false;
27
39
  const appleEnabled = providers.apple !== false;
28
40
 
29
41
  let defaultProvider = socialLogin.defaultProvider;
30
42
  if (!defaultProvider) {
31
- if (platformKey === 'ios' || platformKey === 'ios-dev' || platformKey === 'ios-sim') {
43
+ if (isIosPlatformKey(platformKey)) {
32
44
  defaultProvider = appleEnabled ? 'apple' : 'google';
33
45
  } else {
34
46
  defaultProvider = googleEnabled ? 'google' : 'apple';
35
47
  }
36
48
  }
37
49
 
50
+ const apple = { ...(socialLogin.apple ?? {}) };
51
+ if (appleEnabled && !apple.clientId && options.packageName && isIosPlatformKey(platformKey)) {
52
+ apple.clientId = options.packageName;
53
+ }
54
+
38
55
  return {
39
56
  providers: {
40
57
  google: googleEnabled,
@@ -43,7 +60,7 @@ function normalizeSocialLoginConfig(socialLogin = {}, platformKey) {
43
60
  twitter: providers.twitter === true,
44
61
  },
45
62
  google: socialLogin.google ?? {},
46
- apple: socialLogin.apple ?? {},
63
+ apple,
47
64
  defaultProvider,
48
65
  platform: platformKey,
49
66
  };
@@ -52,7 +69,7 @@ function normalizeSocialLoginConfig(socialLogin = {}, platformKey) {
52
69
  /**
53
70
  * @param {object} config
54
71
  */
55
- function validateSocialLoginConfig(config) {
72
+ export function validateSocialLoginConfig(config) {
56
73
  const { providers, google, apple } = config;
57
74
 
58
75
  if (!providers.google && !providers.apple) {
@@ -83,6 +100,10 @@ export class CapacitorPackager extends Packager {
83
100
  /** @type {string[]} */
84
101
  static defaultPlatforms = ['ios', 'android'];
85
102
 
103
+ #socialLoginPackageName() {
104
+ return resolvePlatformConfig(this.pkg, this.platformKey).packageName;
105
+ }
106
+
86
107
  validate() {
87
108
  super.validate();
88
109
 
@@ -98,6 +119,7 @@ export class CapacitorPackager extends Packager {
98
119
  const config = normalizeSocialLoginConfig(
99
120
  socialLogin ?? this.pkg.config?.socialLogin,
100
121
  this.platformKey ?? 'android',
122
+ { packageName: this.#socialLoginPackageName() },
101
123
  );
102
124
  validateSocialLoginConfig(config);
103
125
  }
@@ -113,7 +135,9 @@ export class CapacitorPackager extends Packager {
113
135
  const socialLogin = resolvePlatformSocialLogin(this.platformKey, this.pkg)
114
136
  ?? this.pkg.config?.socialLogin
115
137
  ?? {};
116
- const config = normalizeSocialLoginConfig(socialLogin, this.platformKey);
138
+ const config = normalizeSocialLoginConfig(socialLogin, this.platformKey, {
139
+ packageName: this.#socialLoginPackageName(),
140
+ });
117
141
  const content = `window.__ADAPTFULLY_SOCIAL_LOGIN__ = ${JSON.stringify(config, null, 4)};\n`;
118
142
  fs.writeFileSync(path.join(dest, 'social-login-config.js'), content);
119
143
  this.log('adaptfully: write social-login-config.js (social-auth)');
@@ -4,7 +4,12 @@ import { ElectronPackager } from './electron.js';
4
4
  import { Packager, VALID_PACKAGERS } from './base.js';
5
5
  import { WebPackager } from './web.js';
6
6
 
7
- export { CapacitorPackager, resolvePlatformSocialLogin } from './capacitor.js';
7
+ export {
8
+ CapacitorPackager,
9
+ normalizeSocialLoginConfig,
10
+ resolvePlatformSocialLogin,
11
+ validateSocialLoginConfig,
12
+ } from './capacitor.js';
8
13
  export { CordovaPackager } from './cordova.js';
9
14
  export {
10
15
  ElectronPackager,
@@ -4,6 +4,7 @@ import { send } from './deploy.js';
4
4
  import { resolveBuildArtifactDir } from './artifacts.js';
5
5
  import { prebuildPlatform } from './prebuild.js';
6
6
  import {
7
+ resolveBuildCredentialDirs,
7
8
  resolveBuildSpec,
8
9
  resolveDeploymentsForPlatform,
9
10
  resolvePublishDir,
@@ -130,6 +131,9 @@ export async function runAdaptfullyStage(stage, platformKey, options) {
130
131
  for (const deploymentKey of deployments) {
131
132
  const publishDir = deploymentKey === 'zip' ? undefined : resolvePublishDir(deploymentKey);
132
133
  const wrapStage = stage === 'deploy' ? 'deploy' : 'build';
134
+ const deploymentDirs = wrapStage === 'build'
135
+ ? resolveBuildCredentialDirs(platformKey, pkg)
136
+ : [];
133
137
 
134
138
  log(
135
139
  `adaptfully: ${stage} ${platformKey} → `
@@ -137,6 +141,14 @@ export async function runAdaptfullyStage(stage, platformKey, options) {
137
141
  + `via Wrapfully /${wrapfullyRoute}/${wrapStage} (${buildSpec.family})`,
138
142
  );
139
143
 
144
+ if (deploymentDirs.length) {
145
+ log(
146
+ `adaptfully: build signing credentials → ${
147
+ deploymentDirs.map((dir) => path.resolve(dir)).join(', ')
148
+ }`,
149
+ );
150
+ }
151
+
140
152
  await send(
141
153
  gameId,
142
154
  contents,
@@ -149,6 +161,7 @@ export async function runAdaptfullyStage(stage, platformKey, options) {
149
161
  {
150
162
  log,
151
163
  publishDir,
164
+ deploymentDirs,
152
165
  platformKey,
153
166
  deploymentKey: wrapStage === 'deploy' ? deploymentKey : undefined,
154
167
  artifactPath,
@@ -12,6 +12,7 @@ export const PUBLISH_CREDENTIAL_GITIGNORE_PATTERNS = [
12
12
  'assets/meta/deployments/**/apple.json',
13
13
  'assets/meta/deployments/**/ms.json',
14
14
  'assets/meta/deployments/**/android/',
15
+ 'assets/meta/deployments/**/apple/',
15
16
  'assets/meta/deployments/**/ms/',
16
17
  ];
17
18
 
@@ -345,6 +345,30 @@ export function resolvePublishDir(deploymentKey, metaDir = 'assets/meta') {
345
345
  return path.join(metaDir, 'deployments', deploymentKey);
346
346
  }
347
347
 
348
+ const BUILD_SIGNING_PACKAGERS = new Set(['capacitor', 'cordova']);
349
+
350
+ /**
351
+ * Credential folders to ship with `adaptfully build` (zip artifact) when the
352
+ * Wrapfully builder needs signing material — e.g. ios-dev → deployments/ios.
353
+ * Upload-only targets (SFTP, Play, ASC) are not included.
354
+ *
355
+ * @param {string} platformKey
356
+ * @param {object} pkg
357
+ * @param {string} [metaDir='assets/meta']
358
+ * @returns {string[]} Absolute paths to existing deployment dirs
359
+ */
360
+ export function resolveBuildCredentialDirs(platformKey, pkg, metaDir = 'assets/meta') {
361
+ const platform = pkg?.config?.platforms?.[platformKey];
362
+ const packager = platform?.packager;
363
+ if (!BUILD_SIGNING_PACKAGERS.has(packager)) {
364
+ return [];
365
+ }
366
+
367
+ const credentialKey = DEFAULT_BUILDER_PLATFORMS[platformKey] ?? platformKey;
368
+ const dir = path.resolve(resolvePublishDir(credentialKey, metaDir));
369
+ return fs.existsSync(dir) ? [dir] : [];
370
+ }
371
+
348
372
  const ELECTRON_TARGETS = new Set([
349
373
  'win', 'win-dev', 'mac', 'mac-dev', 'linux', 'linux-dev',
350
374
  ]);
@@ -119,7 +119,9 @@
119
119
 
120
120
  if (config.providers?.apple !== false) {
121
121
  options.apple = {
122
- clientId: config.apple?.clientId || '',
122
+ clientId: config.apple?.clientId
123
+ || window.gameConfig?.packageName
124
+ || '',
123
125
  redirectUrl: config.apple?.redirectUrl,
124
126
  useProperTokenExchange: config.apple?.useProperTokenExchange !== false,
125
127
  useBroadcastChannel: config.apple?.useBroadcastChannel !== false,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@makefully/adaptfully",
3
- "version": "3.15.1",
3
+ "version": "3.16.1",
4
4
  "description": "Platform abstraction and Wrapfully deploy client for Makefully games",
5
5
  "type": "module",
6
6
  "main": "./lib/node/index.js",