@crossbind/extension-app-store 2.0.0-beta.78 → 2.0.0-beta.79
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +19 -12
- package/crossbind.extension.js +114 -68
- package/package.json +2 -2
- package/src/appSetup.js +1 -1
- package/src/appStoreGuide.js +20 -15
package/README.md
CHANGED
|
@@ -2,24 +2,31 @@
|
|
|
2
2
|
|
|
3
3
|
Uploads an iOS or a macOS app to App Store Connect, for TestFlight and App Review.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
It comes with `@crossbind/core-app-host`: there is nothing to install or list.
|
|
6
6
|
|
|
7
7
|
## Use
|
|
8
8
|
|
|
9
9
|
```sh
|
|
10
10
|
npx crossbind app store app-store
|
|
11
|
-
npx crossbind app
|
|
12
|
-
npx crossbind app
|
|
11
|
+
npx crossbind app store app-store --send
|
|
12
|
+
npx crossbind app upload app-store
|
|
13
|
+
npx crossbind app release app-store -p macos --rollout 10
|
|
13
14
|
```
|
|
14
15
|
|
|
15
|
-
|
|
16
|
-
`crossbind app store`
|
|
17
|
-
|
|
18
|
-
the App
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
16
|
+
An upload sends the iOS app, then the macOS one; `-p` sends one alone, and `crossbind app upload -p ios` with no
|
|
17
|
+
store name comes here. `crossbind app store` lists what only Apple's sites take, and `crossbind app store app-store
|
|
18
|
+
--send` sends the listing in `store/app-store` alone, with no build, into the version of `package.json`'s number,
|
|
19
|
+
through the App Store Connect API key.
|
|
20
|
+
|
|
21
|
+
- **iOS:** the upload builds the app with the next build number, archives it and uploads it to App Store Connect,
|
|
22
|
+
whose TestFlight hands it to testers.
|
|
23
|
+
- **macOS:** the upload builds the app in the App Sandbox, without its updater and for macOS 13 or later, and Xcode
|
|
24
|
+
exports it into the iOS app's record, as a universal purchase. Xcode's account or an Admin key signs the app and its
|
|
25
|
+
installer package in the cloud, so you make no certificate by hand.
|
|
26
|
+
|
|
27
|
+
A release hands the version to App Review, with no build, with the newest build of it TestFlight's testers have and the
|
|
28
|
+
listing in `store/app-store`: its `APP_DESKTOP` screenshots go with the macOS version, the others with the iOS one.
|
|
29
|
+
`--rollout` releases what App Review approves in phases over 7 days.
|
|
23
30
|
|
|
24
31
|
## Platforms
|
|
25
32
|
|
|
@@ -29,4 +36,4 @@ An iOS app, built on a Mac with Xcode, and a macOS app, built and uploaded on ma
|
|
|
29
36
|
|
|
30
37
|
An extension named `app-store` with a publisher takes its place, and `app: { without: ['app-store'] }` in `crossbind.config.js` leaves it out. [extensions.md](https://github.com/crossbind/crossbind/blob/main/docs/api/extensions.md#publishers) says what one gives.
|
|
31
38
|
|
|
32
|
-
[app.md](https://github.com/crossbind/crossbind/blob/main/docs/api/app.md#app-store-connect) has what it needs before the build
|
|
39
|
+
[app.md](https://github.com/crossbind/crossbind/blob/main/docs/api/app.md#app-store-connect) has what it needs before the build and how it asks for what is missing, and its [Mac App Store](https://github.com/crossbind/crossbind/blob/main/docs/api/app.md#mac-app-store) section what the App Sandbox changes.
|
package/crossbind.extension.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
|
-
APP_STORE_LISTING, appStoreApp, appStoreCaller, appStoreListingProblems,
|
|
3
|
-
readAppStoreListing, readAppStoreSettings,
|
|
2
|
+
APP_STORE_LISTING, appStoreApp, appStoreCaller, appStoreListingProblems, appStoreState, askAppId, listingOf,
|
|
3
|
+
readAppStoreListing, readAppStoreSettings, releaseVersion, sendListing, untilDone, uploadArchive,
|
|
4
4
|
} from '@crossbind/core-store-kit';
|
|
5
5
|
import {
|
|
6
6
|
addDsyms, archiveIosApp, archivedBinary, archivedPrivacy, archivedTargets, uploadIosArchive,
|
|
@@ -17,15 +17,18 @@ const PLATFORMS = {
|
|
|
17
17
|
// The Mac App Store takes an Apple silicon app of macOS 13 or later.
|
|
18
18
|
const MINIMUM_MACOS = '13.0';
|
|
19
19
|
|
|
20
|
-
const NO_APP_ID = 'crossbind: App Store Connect knows an app by its bundle id, app.id, which crossbind.config.js does not set: set it, as com.example.myapp, before the first
|
|
20
|
+
const NO_APP_ID = 'crossbind: App Store Connect knows an app by its bundle id, app.id, which crossbind.config.js does not set: set it, as com.example.myapp, before the first upload, as Apple keeps it for good.';
|
|
21
21
|
const NO_TEAM = "crossbind: App Store Connect takes uploads from an Apple Developer Program team, which neither app.team in crossbind.config.js nor this machine's XCODE_DEVELOPMENT_TEAM names: set either to its id, which developer.apple.com/account shows under Membership details.";
|
|
22
22
|
const NO_CATEGORY = 'crossbind: the Mac App Store takes no app without its category: set app.category in crossbind.config.js.';
|
|
23
23
|
const NO_ENCRYPTION = 'crossbind: app.encryption is not set, so App Store Connect asks whether this build uses encryption before TestFlight hands it out; set it in crossbind.config.js to answer for every build.';
|
|
24
|
-
const
|
|
25
|
-
const
|
|
24
|
+
const NO_KEY_TO_RELEASE = "crossbind: crossbind app release hands the version to App Review through App Store Connect's API, which takes an API key: set CROSSBIND_APPLE_API_KEY, CROSSBIND_APPLE_API_KEY_ID and CROSSBIND_APPLE_API_ISSUER, as app.md's Publishing says.";
|
|
25
|
+
const NO_KEY_TO_SEND = "crossbind: crossbind app store --send sends the page through App Store Connect's API, which takes an API key: set CROSSBIND_APPLE_API_KEY, CROSSBIND_APPLE_API_KEY_ID and CROSSBIND_APPLE_API_ISSUER, as app.md's Publishing says.";
|
|
26
|
+
const NO_KEY_TO_SEE = "Set CROSSBIND_APPLE_API_KEY, CROSSBIND_APPLE_API_KEY_ID and CROSSBIND_APPLE_API_ISSUER, an App Store Connect API key's, to see what App Store Connect has.";
|
|
26
27
|
const TEAM_ID = /^[A-Z0-9]{10}$/;
|
|
27
28
|
const noIcon = (platform) => `crossbind: App Store Connect takes no ${platform} app without an icon: set app.icon in crossbind.config.js to a square PNG, at best 1024 × 1024.`;
|
|
28
|
-
const notOnMac = (id) => `crossbind: App Store Connect's app ${id} is not on macOS yet: add the platform there, with the + beside its platform in the sidebar, which makes it a universal purchase, then
|
|
29
|
+
const notOnMac = (id, then = 'upload again, or upload the iOS app alone with -p ios') => `crossbind: App Store Connect's app ${id} is not on macOS yet: add the platform there, with the + beside its platform in the sidebar, which makes it a universal purchase, then ${then}.`;
|
|
30
|
+
const SEND_AGAIN = "send again, or send the iOS app's page alone with -p ios";
|
|
31
|
+
const RELEASE_AGAIN = 'release again, or release the iOS app alone with -p ios';
|
|
29
32
|
|
|
30
33
|
async function pickTeam(api, teams) {
|
|
31
34
|
if (teams.length === 1) {
|
|
@@ -82,52 +85,61 @@ async function isOnMac(call, appId) {
|
|
|
82
85
|
return data.length > 0;
|
|
83
86
|
}
|
|
84
87
|
|
|
85
|
-
// What a
|
|
86
|
-
//
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
const isMac = api.platform === 'macos';
|
|
90
|
-
if (!key || (!shouldSubmit && !isMac)) return { release: null };
|
|
88
|
+
// What a macOS app's record lacks, which a key reads before the build: the macOS platform, which App Store Connect takes
|
|
89
|
+
// no macOS build of the app without.
|
|
90
|
+
async function macRecordMissing(api, key) {
|
|
91
|
+
if (!key || api.platform !== 'macos') return [];
|
|
91
92
|
const call = appStoreCaller(key);
|
|
92
|
-
|
|
93
|
-
if (isMac && !await isOnMac(call, appStoreId)) return { missing: [notOnMac(api.app.id)] };
|
|
94
|
-
if (!shouldSubmit) return { release: null };
|
|
95
|
-
await assertReviewable(call, appStoreId, api.app.appleVersion, PLATFORMS[api.platform].api);
|
|
96
|
-
return {
|
|
97
|
-
release: {
|
|
98
|
-
call, appStoreId, listings, settings,
|
|
99
|
-
},
|
|
100
|
-
};
|
|
93
|
+
return await isOnMac(call, await appStoreApp(call, api.app.id)) ? [] : [notOnMac(api.app.id)];
|
|
101
94
|
}
|
|
102
95
|
|
|
103
|
-
//
|
|
104
|
-
|
|
105
|
-
async function submitToReview(api, {
|
|
106
|
-
call, appStoreId, listings, settings,
|
|
107
|
-
}, before) {
|
|
108
|
-
const platform = PLATFORMS[api.platform];
|
|
109
|
-
const isPhased = api.options.phased;
|
|
110
|
-
const { build, listed, settled } = await submitRelease(call, {
|
|
111
|
-
appId: appStoreId, versionString: api.app.appleVersion, before, buildNumber: api.app.buildNumber, listings, settings, isPhased, platform: platform.api,
|
|
112
|
-
});
|
|
96
|
+
// Says what of the page changed on App Store Connect, as the project has it.
|
|
97
|
+
function saySent(api, platform, listings, { listed, settled }) {
|
|
113
98
|
if (listings.length > 0) {
|
|
114
99
|
api.log(listed.length > 0
|
|
115
100
|
? `crossbind: App Store Connect's ${platform.name} listing changed in ${listed.join(', ')}, as ${APP_STORE_LISTING} has it.`
|
|
116
101
|
: `crossbind: App Store Connect's ${platform.name} listing is the one ${APP_STORE_LISTING} has already.`);
|
|
117
102
|
}
|
|
118
103
|
if (settled.length > 0) api.log(`crossbind: App Store Connect's ${settled.join(', ')} changed, as ${APP_STORE_LISTING} has them.`);
|
|
119
|
-
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
// Hands App Review the version of package.json's number on the platform, with the newest build of it App Store Connect
|
|
107
|
+
// has processed, which TestFlight's testers have, and the page store/app-store holds, with no build, to go out in phases
|
|
108
|
+
// over 7 days once approved where --rollout says so; says how it went.
|
|
109
|
+
async function releaseToReview(api) {
|
|
110
|
+
const platform = PLATFORMS[api.platform];
|
|
111
|
+
const root = api.project.root;
|
|
112
|
+
const listings = listingOf(readAppStoreListing(root), platform.api);
|
|
113
|
+
const settings = readAppStoreSettings(root);
|
|
114
|
+
const missing = appStoreListingProblems(root, listings);
|
|
115
|
+
const key = api.apple.key();
|
|
116
|
+
if (!key) missing.push(NO_KEY_TO_RELEASE);
|
|
117
|
+
if (api.config.app.id === undefined) {
|
|
118
|
+
if (api.isGuided) await askAppId(api, 'App Store Connect', 'bundle id');
|
|
119
|
+
else missing.push(NO_APP_ID);
|
|
120
|
+
}
|
|
121
|
+
if (missing.length > 0) return { missing };
|
|
122
|
+
const call = appStoreCaller(key);
|
|
123
|
+
const appStoreId = await appStoreApp(call, api.app.id);
|
|
124
|
+
if (api.platform === 'macos' && !await isOnMac(call, appStoreId)) return { missing: [notOnMac(api.app.id, RELEASE_AGAIN)] };
|
|
125
|
+
const isPhased = api.options.rollout !== null;
|
|
126
|
+
api.log(`crossbind: handing ${api.app.id} ${api.app.appleVersion} for ${platform.name} to App Review, with the newest build of it App Store Connect has processed.`);
|
|
127
|
+
const { build, listed, settled } = await releaseVersion(call, {
|
|
128
|
+
appId: appStoreId, versionString: api.app.appleVersion, listings, settings, isPhased, usesEncryption: api.app.encryption, platform: platform.api,
|
|
129
|
+
});
|
|
130
|
+
saySent(api, platform, listings, { listed, settled });
|
|
131
|
+
const phases = isPhased ? ', to go out in phases over 7 days once approved' : '';
|
|
120
132
|
api.log(`crossbind: ${api.app.id} ${api.app.appleVersion} (build ${build}) for ${platform.name} went to App Review${phases}; Apple mails as the review goes.`);
|
|
133
|
+
return {};
|
|
121
134
|
}
|
|
122
135
|
|
|
123
|
-
// An app extension's reasons are its target's, which its extension gives, so the
|
|
136
|
+
// An app extension's reasons are its target's, which its extension gives, so the upload names them and asks for none.
|
|
124
137
|
const unreasonedTargetError = ({ name, unreasoned }) => new Error(`crossbind: App Store Connect refuses an iOS app that calls required reason API without Apple's reasons for it (ITMS-91053), and the app's target ${name} calls ${unreasoned.map(({ category, symbols }) => `${category} (${symbols.join(', ')})`).join(' and ')} with no reason in its privacy manifest. Its extension gives the target Apple's reasons in its privacy, as { fileTimestamp: ['C617.1'] }. Nothing went to App Store Connect.`);
|
|
125
138
|
const unreasonedError = (unreasoned) => new Error(`crossbind: App Store Connect refuses an iOS app that calls required reason API without Apple's reasons for it (ITMS-91053), and this app calls ${unreasoned.map(({ category, symbols }) => `${category} (${symbols.join(', ')})`).join(' and ')} with no reason in its privacy manifest. Give app.privacy Apple's reasons, as { fileTimestamp: ['C617.1'] }; Apple's "Describing use of required reason API" says what each covers. Nothing went to App Store Connect.`);
|
|
126
139
|
|
|
127
140
|
// What the app lacks that App Store Connect asks for, asked for on a terminal and named at once without one.
|
|
128
|
-
async function missingOf(api
|
|
141
|
+
async function missingOf(api) {
|
|
129
142
|
const missing = [];
|
|
130
|
-
if (shouldSubmit && !key) missing.push(NO_KEY_TO_SUBMIT);
|
|
131
143
|
if (api.config.app.id === undefined) {
|
|
132
144
|
if (api.isGuided) await askAppId(api, 'App Store Connect', 'bundle id');
|
|
133
145
|
else missing.push(NO_APP_ID);
|
|
@@ -141,14 +153,11 @@ async function missingOf(api, { key, shouldSubmit }) {
|
|
|
141
153
|
else missing.push(noIcon(PLATFORMS[api.platform].name));
|
|
142
154
|
}
|
|
143
155
|
if (api.platform === 'macos' && !api.app.category?.macos) missing.push(NO_CATEGORY);
|
|
144
|
-
if (shouldSubmit && !api.isGuided && api.app.encryption === null) missing.push(NO_ENCRYPTION_TO_SUBMIT);
|
|
145
156
|
return missing;
|
|
146
157
|
}
|
|
147
158
|
|
|
148
159
|
// Archives the iOS app crossbind built, which shows what required reason API it calls before it goes, and uploads it.
|
|
149
|
-
async function uploadIos(api, {
|
|
150
|
-
key, dsyms, facts, release,
|
|
151
|
-
}, { project }) {
|
|
160
|
+
async function uploadIos(api, { key, dsyms, facts }, { project }) {
|
|
152
161
|
api.log('crossbind: archiving the app, which takes a few minutes.');
|
|
153
162
|
const archive = await untilDone(api, () => archiveIosApp(api, project, { facts }));
|
|
154
163
|
const target = archivedTargets(api, archive).map(({ name, binary, privacy }) => ({ name, unreasoned: api.apple.unreasonedApis(binary, privacy) }))
|
|
@@ -164,24 +173,21 @@ async function uploadIos(api, {
|
|
|
164
173
|
addDsyms(archive, dsyms);
|
|
165
174
|
api.log(`crossbind: uploading the app to App Store Connect for team ${facts.team} with ${key ? `the API key ${key.keyId}` : "Xcode's account"}, which signs it.`);
|
|
166
175
|
const build = api.app.buildNumber;
|
|
167
|
-
const before = release ? await newestBuild(release.call, release.appStoreId, api.app.appleVersion) : null;
|
|
168
176
|
await untilDone(api, () => uploadIosArchive(api, archive, {
|
|
169
177
|
team: facts.team, key, isBuildManaged: build === null, facts,
|
|
170
178
|
}));
|
|
171
179
|
const app = build === null ? `${facts.id} ${api.app.appleVersion}, numbered by Xcode after the builds App Store Connect has of it,` : `${facts.id} ${api.app.appleVersion} (build ${build})`;
|
|
172
|
-
api.log(`crossbind: ${app} is on App Store Connect. TestFlight hands it out once Apple has processed it, usually within 5 to 30 minutes, and Apple mails when it has.`);
|
|
173
|
-
if (release) await submitToReview(api, release, before);
|
|
180
|
+
api.log(`crossbind: ${app} is on App Store Connect. TestFlight hands it out once Apple has processed it, usually within 5 to 30 minutes, and Apple mails when it has; crossbind app release app-store then hands it to App Review.`);
|
|
174
181
|
return { published: { appId: facts.id, version: api.app.appleVersion, build } };
|
|
175
182
|
}
|
|
176
183
|
|
|
177
184
|
// Puts the macOS app crossbind built in an archive Xcode exports to App Store Connect, which signs it and its installer
|
|
178
185
|
// package in the cloud.
|
|
179
|
-
async function uploadMac(api, { key, facts
|
|
186
|
+
async function uploadMac(api, { key, facts }, { apps }) {
|
|
180
187
|
const [built] = apps;
|
|
181
188
|
if (!built) throw new Error('crossbind: the build made no macOS app, so nothing went to App Store Connect.');
|
|
182
189
|
const archive = writeArchive(api, built, { team: facts.team });
|
|
183
190
|
const build = api.app.buildNumber;
|
|
184
|
-
const before = release ? await newestBuild(release.call, release.appStoreId, api.app.appleVersion, PLATFORMS.macos.api) : null;
|
|
185
191
|
api.log(`crossbind: uploading the app to App Store Connect for team ${facts.team} with ${key ? `the API key ${key.keyId}` : "Xcode's account"}, which signs it and its installer package.`);
|
|
186
192
|
await untilDone(api, () => uploadArchive(api, archive, {
|
|
187
193
|
team: facts.team, key, isBuildManaged: build === null, facts, platform: 'macOS',
|
|
@@ -189,14 +195,61 @@ async function uploadMac(api, { key, facts, release }, { apps }) {
|
|
|
189
195
|
const app = build === null
|
|
190
196
|
? `${facts.id} ${api.app.appleVersion} for macOS, numbered by Xcode after the builds App Store Connect has of it,`
|
|
191
197
|
: `${facts.id} ${api.app.appleVersion} (build ${build}) for macOS`;
|
|
192
|
-
api.log(`crossbind: ${app} is on App Store Connect. TestFlight hands it to Mac testers once Apple has processed it, usually within 5 to 30 minutes, and Apple mails when it has.`);
|
|
193
|
-
if (release) await submitToReview(api, release, before);
|
|
198
|
+
api.log(`crossbind: ${app} is on App Store Connect. TestFlight hands it to Mac testers once Apple has processed it, usually within 5 to 30 minutes, and Apple mails when it has; crossbind app release app-store then hands it to App Review.`);
|
|
194
199
|
return { published: { appId: facts.id, version: api.app.appleVersion, build } };
|
|
195
200
|
}
|
|
196
201
|
|
|
197
|
-
//
|
|
198
|
-
|
|
199
|
-
|
|
202
|
+
// Whether the project's settings give App Store Connect anything.
|
|
203
|
+
const hasSettings = ({
|
|
204
|
+
copyright, categories, ageRating, review,
|
|
205
|
+
}) => copyright !== undefined || Object.keys(categories).length > 0 || Boolean(ageRating) || Object.keys(review).length > 0;
|
|
206
|
+
|
|
207
|
+
// Sends the page store/app-store holds of the app on its platform, with no build: its listing, screenshots and settings,
|
|
208
|
+
// through App Store Connect's API, into the version of package.json's number, which shows them once out.
|
|
209
|
+
async function sendPage(api) {
|
|
210
|
+
const platform = PLATFORMS[api.platform];
|
|
211
|
+
const root = api.project.root;
|
|
212
|
+
const listings = listingOf(readAppStoreListing(root), platform.api);
|
|
213
|
+
const settings = readAppStoreSettings(root);
|
|
214
|
+
if (listings.length === 0 && !hasSettings(settings)) {
|
|
215
|
+
api.log(`crossbind: ${APP_STORE_LISTING} holds no page of the app, so nothing went to App Store Connect for ${platform.name}.`);
|
|
216
|
+
return {};
|
|
217
|
+
}
|
|
218
|
+
const problems = appStoreListingProblems(root, listings);
|
|
219
|
+
if (problems.length > 0) return { missing: problems };
|
|
220
|
+
const key = api.apple.key();
|
|
221
|
+
const missing = key ? [] : [NO_KEY_TO_SEND];
|
|
222
|
+
if (api.config.app.id === undefined) {
|
|
223
|
+
if (api.isGuided) await askAppId(api, 'App Store Connect', 'bundle id');
|
|
224
|
+
else missing.push(NO_APP_ID);
|
|
225
|
+
}
|
|
226
|
+
if (missing.length > 0) return { missing };
|
|
227
|
+
const call = appStoreCaller(key);
|
|
228
|
+
const appStoreId = await appStoreApp(call, api.app.id);
|
|
229
|
+
if (api.platform === 'macos' && !await isOnMac(call, appStoreId)) return { missing: [notOnMac(api.app.id, SEND_AGAIN)] };
|
|
230
|
+
api.log(`crossbind: sending the ${platform.name} page ${APP_STORE_LISTING} holds of ${api.app.id} ${api.app.appleVersion} to App Store Connect.`);
|
|
231
|
+
const sent = await sendListing(call, {
|
|
232
|
+
appId: appStoreId, versionString: api.app.appleVersion, listings, settings, platform: platform.api,
|
|
233
|
+
});
|
|
234
|
+
saySent(api, platform, listings, sent);
|
|
235
|
+
return {};
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
// What App Store Connect has of the app on each platform, asking for nothing.
|
|
239
|
+
async function pageState(api) {
|
|
240
|
+
const key = api.apple.key();
|
|
241
|
+
if (!key) return [NO_KEY_TO_SEE];
|
|
242
|
+
if (api.config.app.id === undefined) return ['Set app.id in crossbind.config.js, and App Store Connect tells what it has of the app.'];
|
|
243
|
+
const call = appStoreCaller(key);
|
|
244
|
+
const lines = await appStoreState(call, await appStoreApp(call, api.app.id));
|
|
245
|
+
return lines.length > 0 ? lines : [`no version or build of ${api.app.id} yet`];
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
// The publisher of an app's iOS and macOS builds to App Store Connect, whose TestFlight hands them out, both one after
|
|
249
|
+
// the other or the one -p names: crossbind builds the app, a macOS one sandboxed, the upload archives it, an iOS one
|
|
250
|
+
// after showing what required reason API it calls, and Xcode exports the archive to App Store Connect, which signs it in
|
|
251
|
+
// the cloud. The release hands the build TestFlight's testers have to App Review with the app's page in store/app-store,
|
|
252
|
+
// which also goes alone.
|
|
200
253
|
export default function appStore() {
|
|
201
254
|
return {
|
|
202
255
|
name: 'app-store',
|
|
@@ -206,41 +259,28 @@ export default function appStore() {
|
|
|
206
259
|
platform: ['ios', 'macos'],
|
|
207
260
|
isDefault: ['ios'],
|
|
208
261
|
store: 'App Store Connect',
|
|
209
|
-
|
|
210
|
-
submit: { help: "hand the app's version to App Review too, with the build and the listing in store/app-store, through App Store Connect's API" },
|
|
211
|
-
phased: { help: 'release the version App Review approves in phases over 7 days, with --submit' },
|
|
212
|
-
},
|
|
262
|
+
canStage: true,
|
|
213
263
|
|
|
214
264
|
// The store updates the macOS app it installs from the installer package the upload makes, and takes it
|
|
215
265
|
// sandboxed.
|
|
216
266
|
build: (api) => (api.platform === 'macos' ? { app: { updater: null, installers: [], macos: { sandbox: true, minimumVersion: minimumMacos(api) } } } : null),
|
|
217
267
|
|
|
218
268
|
async check(api) {
|
|
219
|
-
const { submit: shouldSubmit, phased } = api.options;
|
|
220
|
-
if (phased && !shouldSubmit) throw new Error('crossbind: --phased releases the version App Review approves, so it takes --submit.');
|
|
221
269
|
const platform = PLATFORMS[api.platform];
|
|
222
270
|
if (process.platform !== 'darwin') throw new Error(`crossbind: ${platform.name} apps build and go to App Store Connect on macOS, with Xcode.`);
|
|
223
|
-
const root = api.project.root;
|
|
224
271
|
const key = api.apple.key();
|
|
225
|
-
const
|
|
226
|
-
const settings = shouldSubmit ? readAppStoreSettings(root) : {};
|
|
227
|
-
const missing = [...appStoreListingProblems(root, listings), ...await missingOf(api, { key, shouldSubmit })];
|
|
272
|
+
const missing = await missingOf(api);
|
|
228
273
|
if (missing.length > 0) return { missing };
|
|
229
274
|
if (api.app.encryption === null) {
|
|
230
275
|
if (api.isGuided) await askEncryption(api);
|
|
231
276
|
else api.warn(NO_ENCRYPTION);
|
|
232
277
|
}
|
|
233
|
-
const
|
|
234
|
-
if (
|
|
235
|
-
const { release } = record;
|
|
278
|
+
const unready = await macRecordMissing(api, key);
|
|
279
|
+
if (unready.length > 0) return { missing: unready };
|
|
236
280
|
const facts = { id: api.app.id, team: api.app.team };
|
|
237
281
|
const dsyms = api.platform === 'ios' ? { dsyms: await api.apple.dsyms() } : {};
|
|
238
|
-
api.log(`crossbind: publishing ${facts.id} ${api.app.appleVersion} for ${platform.name} to App Store Connect for team ${facts.team}
|
|
239
|
-
return {
|
|
240
|
-
session: {
|
|
241
|
-
key, ...dsyms, facts, release,
|
|
242
|
-
},
|
|
243
|
-
};
|
|
282
|
+
api.log(`crossbind: publishing ${facts.id} ${api.app.appleVersion} for ${platform.name} to App Store Connect for team ${facts.team}; building the app first.`);
|
|
283
|
+
return { session: { key, ...dsyms, facts } };
|
|
244
284
|
},
|
|
245
285
|
|
|
246
286
|
// Xcode numbers a build without CROSSBIND_APP_BUILD_NUMBER after those App Store Connect has.
|
|
@@ -252,6 +292,12 @@ export default function appStore() {
|
|
|
252
292
|
|
|
253
293
|
upload: (api, session, output) => (api.platform === 'macos' ? uploadMac(api, session, output) : uploadIos(api, session, output)),
|
|
254
294
|
|
|
295
|
+
release: (api) => releaseToReview(api),
|
|
296
|
+
|
|
297
|
+
send: (api) => sendPage(api),
|
|
298
|
+
|
|
299
|
+
state: (api) => pageState(api),
|
|
300
|
+
|
|
255
301
|
guide: (api) => appStoreGuide(api),
|
|
256
302
|
},
|
|
257
303
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@crossbind/extension-app-store",
|
|
3
|
-
"version": "2.0.0-beta.
|
|
3
|
+
"version": "2.0.0-beta.79",
|
|
4
4
|
"description": "crossbind app extension: uploads an iOS or a macOS app to App Store Connect, for TestFlight and App Review.",
|
|
5
5
|
"homepage": "https://github.com/crossbind/crossbind/tree/main/extensions/app-store#readme",
|
|
6
6
|
"repository": {
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"extension": "./crossbind.extension.js"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@crossbind/core-store-kit": "^2.0.0-beta.
|
|
23
|
+
"@crossbind/core-store-kit": "^2.0.0-beta.79"
|
|
24
24
|
},
|
|
25
25
|
"keywords": [
|
|
26
26
|
"crossbind-extension",
|
package/src/appSetup.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// What only the project can answer, which
|
|
1
|
+
// What only the project can answer, which an upload asks on a terminal and writes into crossbind.config.js once the
|
|
2
2
|
// user says yes, through the api.
|
|
3
3
|
|
|
4
4
|
const REASONS_PAGE = 'https://developer.apple.com/documentation/bundleresources/describing-use-of-required-reason-api';
|
package/src/appStoreGuide.js
CHANGED
|
@@ -17,7 +17,8 @@ const TEXTS = {
|
|
|
17
17
|
};
|
|
18
18
|
const file = (name) => path.join(APP_STORE_LISTING, name);
|
|
19
19
|
|
|
20
|
-
// What
|
|
20
|
+
// What crossbind app store --send sends of a locale, as a release does: its texts and its screenshots of
|
|
21
|
+
// each display type.
|
|
21
22
|
function localeLine({
|
|
22
23
|
locale, info, version, screenshots,
|
|
23
24
|
}) {
|
|
@@ -25,7 +26,7 @@ function localeLine({
|
|
|
25
26
|
Object.keys({ ...info, ...version }).map((field) => TEXTS[field]).join(', '),
|
|
26
27
|
Object.entries(screenshots).map(([type, files]) => `${files.length} ${type} screenshots`).join(', '),
|
|
27
28
|
].filter(Boolean);
|
|
28
|
-
return
|
|
29
|
+
return `${path.join(APP_STORE_LISTING, locale)}: ${parts.join('; ')}`;
|
|
29
30
|
}
|
|
30
31
|
|
|
31
32
|
// The project's listing and settings, with what stops reading them as a problem of its own.
|
|
@@ -47,7 +48,7 @@ function readAll(root) {
|
|
|
47
48
|
return { listings, settings, problems };
|
|
48
49
|
}
|
|
49
50
|
|
|
50
|
-
// What
|
|
51
|
+
// What crossbind app store --send sends of the app's settings, as a release does.
|
|
51
52
|
function settingsLines({
|
|
52
53
|
copyright, categories, ageRating, review,
|
|
53
54
|
}) {
|
|
@@ -56,7 +57,7 @@ function settingsLines({
|
|
|
56
57
|
Object.keys(categories).length === 0 ? null : `categories: ${Object.values(categories).join(', ')}`,
|
|
57
58
|
ageRating ? `the age rating's answers in ${file('age_rating.json')}` : null,
|
|
58
59
|
Object.keys(review).length === 0 ? null : `App Review's contact in ${file('review_information')}`,
|
|
59
|
-
].filter(Boolean)
|
|
60
|
+
].filter(Boolean);
|
|
60
61
|
}
|
|
61
62
|
|
|
62
63
|
// The steps App Store Connect alone takes of what the project's files leave out.
|
|
@@ -75,31 +76,35 @@ function lackedSteps(listings, settings) {
|
|
|
75
76
|
].filter(Boolean).map((text) => ({ text }));
|
|
76
77
|
}
|
|
77
78
|
|
|
78
|
-
// What crossbind app store says of App Store Connect, of the iOS app and the macOS one alike: what
|
|
79
|
-
// --
|
|
79
|
+
// What crossbind app store says of App Store Connect, of the iOS app and the macOS one alike: what an upload sends, what
|
|
80
|
+
// a release puts out, what --send sends, which a release sends too, what App Store Connect would refuse of them, and the
|
|
81
|
+
// steps it alone takes.
|
|
80
82
|
export function appStoreGuide(api) {
|
|
81
83
|
const { listings, settings, problems: read } = readAll(api.project.root);
|
|
82
84
|
const problems = [...read, ...(api.app.category?.macos ? [] : ['crossbind: app.category is not set, and the Mac App Store takes no app without its category.'])];
|
|
83
|
-
const
|
|
84
|
-
'
|
|
85
|
-
'
|
|
86
|
-
|
|
87
|
-
|
|
85
|
+
const uploads = [
|
|
86
|
+
'the iOS app, archived and uploaded, which TestFlight hands to testers once Apple has processed it; -p ios sends it alone',
|
|
87
|
+
'then the macOS app, sandboxed, in an archive Xcode exports to App Store Connect, which signs it and its installer package in the cloud, and whose TestFlight hands it to Mac testers once Apple has processed it; -p macos sends it alone',
|
|
88
|
+
];
|
|
89
|
+
const sends = [...listings.map(localeLine), ...settingsLines(settings)];
|
|
90
|
+
const releases = [
|
|
91
|
+
"the newest build of the version TestFlight's testers have, to App Review, which puts it out once approved, in phases over 7 days with --rollout",
|
|
92
|
+
'with it, the page --send sends',
|
|
88
93
|
];
|
|
89
94
|
const id = api.config.app.id;
|
|
90
95
|
const steps = [
|
|
91
96
|
id === undefined
|
|
92
|
-
? { text: 'Set app.id in crossbind.config.js, as com.example.myapp, which App Store Connect keeps for good as the bundle ID; then create the app with it, under Apps, as a new app on iOS and,
|
|
93
|
-
: { text: `Apps › New App: an app with ${id} as its bundle ID, on iOS and,
|
|
97
|
+
? { text: 'Set app.id in crossbind.config.js, as com.example.myapp, which App Store Connect keeps for good as the bundle ID; then create the app with it, under Apps, as a new app on iOS and macOS, as an upload without -p sends both.', url: APP_STORE_CONNECT }
|
|
98
|
+
: { text: `Apps › New App: an app with ${id} as its bundle ID, on iOS and macOS, as an upload without -p sends both, with its name, primary language and SKU, as Apple's API makes none; an upload registers the bundle ID first, so the form lists it. An app on iOS alone takes macOS later with the + beside its platform in the sidebar, as a universal purchase, which stays one once both platforms are approved, and uploads with -p ios until then.`, url: APP_STORE_CONNECT },
|
|
94
99
|
{ text: "App Privacy: answer what data the app and the code it carries collect, as Data Not Collected where it collects none; Apple's API takes no answer." },
|
|
95
100
|
{ text: "Pricing and Availability: the price, free or one of Apple's, and the countries and regions the app goes to." },
|
|
96
101
|
{ text: "App Information › Content Rights: whether the app shows, holds or reaches others' content." },
|
|
97
102
|
...lackedSteps(listings, settings),
|
|
98
103
|
...(api.app.encryption === null ? [{ text: 'Set app.encryption in crossbind.config.js, whose answer App Store Connect takes of every build and App Review of every submission.' }] : []),
|
|
99
104
|
...(api.app.encryption === true ? [{ text: 'App Information › App Encryption Documentation: what export compliance takes of an app that uses encryption.' }] : []),
|
|
100
|
-
{ text: "For --
|
|
105
|
+
{ text: "For --send, releases and CI: Users and Access › Integrations › App Store Connect API: a key of the App Manager or Admin role, as CROSSBIND_APPLE_API_KEY, CROSSBIND_APPLE_API_KEY_ID and CROSSBIND_APPLE_API_ISSUER; Apple signs the uploads of an Admin key in the cloud, as it does those of Xcode's account on your Mac.", url: API_KEYS },
|
|
101
106
|
];
|
|
102
107
|
return {
|
|
103
|
-
sends, problems, where: 'App Store Connect', steps,
|
|
108
|
+
uploads, sends, releases, problems, where: 'App Store Connect', steps,
|
|
104
109
|
};
|
|
105
110
|
}
|