@crossbind/extension-app-store 2.0.0-beta.82 → 2.0.0-beta.83

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crossbind/extension-app-store",
3
- "version": "2.0.0-beta.82",
3
+ "version": "2.0.0-beta.83",
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.82"
23
+ "@crossbind/core-store-kit": "^2.0.0-beta.83"
24
24
  },
25
25
  "keywords": [
26
26
  "crossbind-extension",
@@ -16,6 +16,8 @@ const TEXTS = {
16
16
  marketingUrl: 'marketing URL',
17
17
  };
18
18
  const file = (name) => path.join(APP_STORE_LISTING, name);
19
+ // The platforms whose App Review notes and files can differ, as their folders in review_information name them.
20
+ const REVIEW_PLATFORMS = { ios: 'iOS', macos: 'macOS' };
19
21
 
20
22
  // What crossbind app store --send sends of a locale, as a release does: its texts and its screenshots of
21
23
  // each display type.
@@ -30,36 +32,57 @@ function localeLine({
30
32
  return `${path.join(APP_STORE_LISTING, locale)}: ${parts.join('; ')}`;
31
33
  }
32
34
 
33
- // The project's listing and settings, with what stops reading them as a problem of its own.
34
- function readAll(root, platform) {
35
+ // The project's listing, its settings for the platform and each platform's App Review details, with what stops reading
36
+ // them as a problem of its own.
37
+ function readAll(root, platform = 'ios') {
35
38
  const problems = [];
36
39
  let listings = [];
37
40
  let settings = { categories: {}, review: {} };
41
+ const reviews = {};
38
42
  try {
39
43
  listings = readAppStoreListing(root);
40
44
  problems.push(...appStoreListingProblems(root, listings));
41
45
  } catch (error) {
42
46
  problems.push(error.message);
43
47
  }
44
- try {
45
- settings = readAppStoreSettings(root, platform);
46
- } catch (error) {
47
- problems.push(error.message);
48
+ for (const name of Object.keys(REVIEW_PLATFORMS)) {
49
+ try {
50
+ const read = readAppStoreSettings(root, name);
51
+ reviews[name] = read.review;
52
+ if (name === platform) settings = read;
53
+ } catch (error) {
54
+ if (!problems.includes(error.message)) problems.push(error.message);
55
+ }
48
56
  }
49
- return { listings, settings, problems };
57
+ return { listings, settings, reviews, problems };
58
+ }
59
+
60
+ // App Review's notes and files, once where every platform's are the same, else each platform's own.
61
+ function reviewLines(reviews) {
62
+ const lines = (valueOf, line) => {
63
+ const values = Object.entries(reviews).map(([name, review]) => [name, valueOf(review)]);
64
+ if (values.every(([, value]) => value === undefined)) return [];
65
+ if (new Set(values.map(([, value]) => JSON.stringify(value ?? null))).size === 1) return [line(values[0][1], '')];
66
+ return values.filter(([, value]) => value !== undefined).map(([name, value]) => line(value, ` for ${REVIEW_PLATFORMS[name]}`));
67
+ };
68
+ const names = (files) => (files.length === 0 ? "none, so App Store Connect's go" : files.map((one) => path.basename(one)).join(', '));
69
+ return [
70
+ ...lines((review) => review.notes, (notes, whose) => `App Review notes${whose}`),
71
+ ...lines((review) => review.attachments?.map((one) => path.basename(one)), (files, whose) => `App Review attachments${whose}: ${names(files)}`),
72
+ ];
50
73
  }
51
74
 
52
75
  // What crossbind app store --send sends of the app's settings, as a release does.
53
76
  function settingsLines({
54
77
  copyright, categories, ageRating, review,
55
- }) {
78
+ }, reviews) {
56
79
  return [
57
80
  copyright === undefined ? null : `copyright: ${copyright}`,
58
81
  Object.keys(categories).length === 0 ? null : `categories: ${Object.values(categories).join(', ')}`,
59
82
  ageRating ? `the age rating's answers in ${file('store.json.ageRating')}` : null,
60
83
  Object.hasOwn(review, 'demoAccountRequired') ? `App Review sign-in required: ${review.demoAccountRequired ? 'yes' : 'no'}` : null,
61
84
  Object.keys(review).some((key) => key.startsWith('contact')) ? 'App Review contact details' : null,
62
- review.notes !== undefined ? 'App Review notes' : null,
85
+ ...reviewLines(reviews),
63
86
  ].filter(Boolean);
64
87
  }
65
88
 
@@ -83,13 +106,13 @@ function lackedSteps(listings, settings) {
83
106
  // a release puts out, what --send sends, which a release sends too, what App Store Connect would refuse of them, and the
84
107
  // steps it alone takes.
85
108
  export function appStoreGuide(api) {
86
- const { listings, settings, problems: read } = readAll(api.project.root, api.platform);
109
+ const { listings, settings, reviews, problems: read } = readAll(api.project.root, api.platform);
87
110
  const problems = [...read, ...(api.app.category?.macos ? [] : ['crossbind: app.category is not set, and the Mac App Store takes no app without its category.'])];
88
111
  const uploads = [
89
112
  'the iOS app, archived and uploaded, which TestFlight hands to testers once Apple has processed it; -p ios sends it alone',
90
113
  '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',
91
114
  ];
92
- const sends = [...listings.map(localeLine), ...settingsLines(settings)];
115
+ const sends = [...listings.map(localeLine), ...settingsLines(settings, reviews)];
93
116
  const releases = [
94
117
  "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",
95
118
  'with it, the page --send sends',