Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(eas-cli): update EAS Metadata with new props for App Store 3.6.0 #2671

Merged
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ This is the log of notable changes to EAS CLI and related packages.

### 🧹 Chores

- Upgrade EAS Metadata with new properties from App Store. ([#2671](https://github.com/expo/eas-cli/pull/2671) by [@byCedric](https://github.com/byCedric))

## [13.0.0](https://github.com/expo/eas-cli/releases/tag/v13.0.0) - 2024-11-05

### 🛠 Breaking changes
Expand Down
2 changes: 1 addition & 1 deletion packages/eas-cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
},
"bugs": "https://github.com/expo/eas-cli/issues",
"dependencies": {
"@expo/apple-utils": "2.0.3",
"@expo/apple-utils": "2.1.0",
"@expo/code-signing-certificates": "0.0.5",
"@expo/config": "9.0.4",
"@expo/config-plugins": "8.0.10",
Expand Down
71 changes: 53 additions & 18 deletions packages/eas-cli/schema/metadata-0.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,20 @@
{
"$schema": "http://json-schema.org/draft-06/schema",
"type": "object",
"properties": {
"configVersion": {
"enum": [0],
"description": "The EAS metadata store configuration version"
},
"apple": {
"$ref": "#/definitions/AppleConfig"
}
},
"additionalProperties": false,
"required": [
"configVersion",
"apple"
],
"definitions": {
"apple": {
"AppleKidsAge": {
Expand Down Expand Up @@ -323,7 +337,8 @@
"gambling",
"unrestrictedWebAccess",
"kidsAgeBand",
"seventeenPlus"
"ageRatingOverride",
"koreaAgeRatingOverride"
],
"defaultSnippets": [
{
Expand All @@ -345,7 +360,9 @@
"gambling": false,
"unrestrictedWebAccess": false,
"kidsAgeBand": null,
"seventeenPlus": false
"ageRatingOverride": "NONE",
"koreaAgeRatingOverride": "NONE",
"lootBox": false
}
},
{
Expand All @@ -367,7 +384,9 @@
"unrestrictedWebAccess": false,
"gambling": false,
"kidsAgeBand": null,
"seventeenPlus": false
"ageRatingOverride": "${13|NONE,SEVENTEEN_PLUS,UNRATED|}",
"koreaAgeRatingOverride": "${14|NONE,FIFTEEN_PLUS,NINETEEN_PLUS|}",
"lootBox": false
}
}
],
Expand Down Expand Up @@ -442,8 +461,24 @@
},
"seventeenPlus": {
"type": "boolean",
"deprecated": true,
"deprecationMessage": "This property is deprecated, use `ageRatingOverride` instead.",
"description": "If your app rates 12+ or lower, and you believe its content may not be suitable for children under 17, you can manually set the age rating to 17+.\n@see https://help.apple.com/app-store-connect/#/dev599d50efb",
"markdownDescription": "If your app rates 12+ or lower, and you believe its content may not be suitable for children under 17, you can manually set the age rating to 17+.\n\n[Learn more](https://help.apple.com/app-store-connect/#/dev599d50efb)"
},
"ageRatingOverride": {
"$ref": "#/definitions/apple/AppleAgeRatingOverride",
"description": "If your app rates 12+ or lower, and you believe its content may not be suitable for children under 17, you can manually set the age rating to 17+.\n\nIf your app will be distributed through alternative app marketplaces or websites in the European Union and you believe your app is [Unrated](https://developer.apple.com/help/app-store-connect/reference/age-ratings), set this to `UNRATED`.\n\n@see https://help.apple.com/app-store-connect/#/dev599d50efb",
"markdownDescription": "If your app rates 12+ or lower, and you believe its content may not be suitable for children under 17, you can manually set the age rating to 17+.\n\nIf your app will be distributed through alternative app marketplaces or websites in the European Union and you believe your app is [Unrated](https://developer.apple.com/help/app-store-connect/reference/age-ratings), set this to `UNRATED`.\n\n[Learn more](https://help.apple.com/app-store-connect/#/dev599d50efb)"
},
"koreaAgeRatingOverride": {
"$ref": "#/definitions/apple/AppleKoreaAgeRatingOverride",
"description": "If your app rates 12+ or lower, and you believe its content may not be suitable for children under 15 or 19, you can manually set the age rating to 15+ or 19+.\n\nIf your app will be distributed through alternative app marketplaces or websites in the European Union and you believe your app is [Unrated](https://developer.apple.com/help/app-store-connect/reference/age-ratings), set this to `UNRATED`.\n\n@see https://help.apple.com/app-store-connect/#/dev599d50efb",
"markdownDescription": "If your app rates 12+ or lower, and you believe its content may not be suitable for children under 15 or 19, you can manually set the age rating to 15+ or 19+.\n\nIf your app will be distributed through alternative app marketplaces or websites in the European Union and you believe your app is [Unrated](https://developer.apple.com/help/app-store-connect/reference/age-ratings), set this to `UNRATED`.\n\n[Learn more](https://help.apple.com/app-store-connect/#/dev599d50efb)"
},
"lootBox": {
"type": "boolean",
"description": "Does your app contain purchasable loot boxes? These virtual containers provide players with in-game items, including functional cards or cosmetic modifications, based on random chance."
}
}
},
Expand Down Expand Up @@ -565,6 +600,20 @@
"maxLength": 4000
}
}
},
"AppleAgeRatingOverride": {
"enum": [
"NONE",
"SEVENTEEN_PLUS",
"UNRATED"
]
},
"AppleKoreaAgeRatingOverride": {
"enum": [
"NONE",
"FIFTEEN_PLUS",
"NINETEEN_PLUS"
]
}
},
"AppleConfig": {
Expand Down Expand Up @@ -775,19 +824,5 @@
}
}
}
},
"properties": {
"configVersion": {
"enum": [0],
"description": "The EAS metadata store configuration version"
},
"apple": {
"$ref": "#/definitions/AppleConfig"
}
},
"additionalProperties": false,
"required": [
"configVersion",
"apple"
]
}
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import { AgeRatingDeclaration, KidsAge, Rating } from '@expo/apple-utils';
import { AgeRatingDeclaration, KidsAgeBand, KoreaRatingOverride, Rating, RatingOverride } from '@expo/apple-utils';

Check warning on line 1 in packages/eas-cli/src/metadata/apple/config/__tests__/fixtures/ageRatingDeclaration.ts

View workflow job for this annotation

GitHub Actions / Test with Node 22

Replace `·AgeRatingDeclaration,·KidsAgeBand,·KoreaRatingOverride,·Rating,·RatingOverride·` with `⏎··AgeRatingDeclaration,⏎··KidsAgeBand,⏎··KoreaRatingOverride,⏎··Rating,⏎··RatingOverride,⏎`

import { AttributesOf } from '../../../../utils/asc';

// @ts-expect-error: Deprecated property `gamblingAndContests` needs to be deleted from the types
// Note, both `seventeenPlus` and `gamlingAndContests` are deprecated
type AgeRatingDeclarationProps = Omit<AttributesOf<AgeRatingDeclaration>, 'seventeenPlus' | 'gamblingAndContests'>;

Check warning on line 6 in packages/eas-cli/src/metadata/apple/config/__tests__/fixtures/ageRatingDeclaration.ts

View workflow job for this annotation

GitHub Actions / Test with Node 22

Replace `AttributesOf<AgeRatingDeclaration>,·'seventeenPlus'·|·'gamblingAndContests'` with `⏎··AttributesOf<AgeRatingDeclaration>,⏎··'seventeenPlus'·|·'gamblingAndContests'⏎`

// These attributes is what we get from the API when no questions are answered
export const emptyAdvisory: AttributesOf<AgeRatingDeclaration> = {
export const emptyAdvisory: AgeRatingDeclarationProps = {
alcoholTobaccoOrDrugUseOrReferences: null,
contests: null,
gamblingSimulated: null,
Expand All @@ -20,11 +22,12 @@
gambling: false,
unrestrictedWebAccess: false,
kidsAgeBand: null,
seventeenPlus: false,
ageRatingOverride: null,
koreaAgeRatingOverride: null,
lootBox: null,
};

// @ts-expect-error: Deprecated property `gamblingAndContests` needs to be deleted from the types
export const leastRestrictiveAdvisory: AttributesOf<AgeRatingDeclaration> = {
export const leastRestrictiveAdvisory: AgeRatingDeclarationProps = {
alcoholTobaccoOrDrugUseOrReferences: Rating.NONE,
contests: Rating.NONE,
gamblingSimulated: Rating.NONE,
Expand All @@ -40,11 +43,12 @@
gambling: false,
unrestrictedWebAccess: false,
kidsAgeBand: null,
seventeenPlus: false,
ageRatingOverride: RatingOverride.NONE,
koreaAgeRatingOverride: KoreaRatingOverride.NONE,
lootBox: false,
};

// @ts-expect-error: Deprecated property `gamblingAndContests` needs to be deleted from the types
export const mostRestrictiveAdvisory: AttributesOf<AgeRatingDeclaration> = {
export const mostRestrictiveAdvisory: AgeRatingDeclarationProps = {
alcoholTobaccoOrDrugUseOrReferences: Rating.FREQUENT_OR_INTENSE,
contests: Rating.FREQUENT_OR_INTENSE,
gamblingSimulated: Rating.FREQUENT_OR_INTENSE,
Expand All @@ -60,11 +64,12 @@
gambling: true,
unrestrictedWebAccess: true,
kidsAgeBand: null,
seventeenPlus: true,
ageRatingOverride: RatingOverride.SEVENTEEN_PLUS,
koreaAgeRatingOverride: KoreaRatingOverride.NINETEEN_PLUS,
lootBox: true,
};

// @ts-expect-error: Deprecated property `gamblingAndContests` needs to be deleted from the types
export const kidsSixToEightAdvisory: AttributesOf<AgeRatingDeclaration> = {
export const kidsSixToEightAdvisory: AgeRatingDeclarationProps = {
alcoholTobaccoOrDrugUseOrReferences: Rating.NONE,
contests: Rating.NONE,
gamblingSimulated: Rating.NONE,
Expand All @@ -79,6 +84,8 @@
violenceRealisticProlongedGraphicOrSadistic: Rating.NONE,
gambling: false,
unrestrictedWebAccess: false,
kidsAgeBand: KidsAge.SIX_TO_EIGHT,
seventeenPlus: false,
kidsAgeBand: KidsAgeBand.SIX_TO_EIGHT,
ageRatingOverride: RatingOverride.NONE,
koreaAgeRatingOverride: KoreaRatingOverride.NONE,
lootBox: false,
};
Original file line number Diff line number Diff line change
@@ -1,48 +1,48 @@
import { AppStoreState, AppStoreVersion, Platform, ReleaseType } from '@expo/apple-utils';
import { AppStoreState, AppStoreVersion, AppVersionState, Platform, ReleaseType, ReviewType } from '@expo/apple-utils';

Check warning on line 1 in packages/eas-cli/src/metadata/apple/config/__tests__/fixtures/appStoreVersion.ts

View workflow job for this annotation

GitHub Actions / Test with Node 22

Replace `·AppStoreState,·AppStoreVersion,·AppVersionState,·Platform,·ReleaseType,·ReviewType·` with `⏎··AppStoreState,⏎··AppStoreVersion,⏎··AppVersionState,⏎··Platform,⏎··ReleaseType,⏎··ReviewType,⏎`

import { AttributesOf } from '../../../../utils/asc';

export const manualRelease: AttributesOf<AppStoreVersion> = {
platform: Platform.IOS,
versionString: '1.0.0',
appStoreState: AppStoreState.WAITING_FOR_REVIEW,
appVersionState: AppVersionState.WAITING_FOR_REVIEW,
storeIcon: null,
watchStoreIcon: null,
copyright: '2022 - ACME',
releaseType: ReleaseType.MANUAL,
earliestReleaseDate: null,
usesIdfa: null,
isWatchOnly: false,
downloadable: false,
createdDate: '2022-05-23T00:00:00.000Z',
reviewType: ReviewType.APP_STORE,
};

export const automaticRelease: AttributesOf<AppStoreVersion> = {
platform: Platform.IOS,
versionString: '2.0.0',
appStoreState: AppStoreState.WAITING_FOR_REVIEW,
appVersionState: AppVersionState.WAITING_FOR_REVIEW,
storeIcon: null,
watchStoreIcon: null,
copyright: '2022 - ACME',
releaseType: ReleaseType.AFTER_APPROVAL,
earliestReleaseDate: null,
usesIdfa: null,
isWatchOnly: false,
downloadable: false,
createdDate: '2022-05-23T00:00:00.000Z',
reviewType: ReviewType.APP_STORE,
};

export const scheduledRelease: AttributesOf<AppStoreVersion> = {
platform: Platform.IOS,
versionString: '3.0.0',
appStoreState: AppStoreState.READY_FOR_SALE,
appVersionState: AppVersionState.ACCEPTED,
storeIcon: null,
watchStoreIcon: null,
copyright: '2022 - ACME',
releaseType: ReleaseType.SCHEDULED,
earliestReleaseDate: '2022-05-29T00:00:00.000Z',
usesIdfa: null,
isWatchOnly: false,
downloadable: false,
createdDate: '2022-05-23T00:00:00.000Z',
reviewType: ReviewType.APP_STORE,
};
12 changes: 8 additions & 4 deletions packages/eas-cli/src/metadata/apple/config/reader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@ import {
AppStoreVersionLocalization,
AppStoreVersionPhasedRelease,
CategoryIds,
KoreaRatingOverride,
PhasedReleaseState,
Rating,
RatingOverride,
ReleaseType,
} from '@expo/apple-utils';

Expand Down Expand Up @@ -35,24 +37,26 @@ export class AppleConfigReader {
}

return {
ageRatingOverride: attributes.ageRatingOverride ?? RatingOverride.NONE,
alcoholTobaccoOrDrugUseOrReferences:
attributes.alcoholTobaccoOrDrugUseOrReferences ?? Rating.NONE,
contests: attributes.contests ?? Rating.NONE,
gambling: attributes.gambling ?? false,
gamblingSimulated: attributes.gamblingSimulated ?? Rating.NONE,
horrorOrFearThemes: attributes.horrorOrFearThemes ?? Rating.NONE,
kidsAgeBand: attributes.kidsAgeBand ?? null,
koreaAgeRatingOverride: attributes.koreaAgeRatingOverride ?? KoreaRatingOverride.NONE,
lootBox: attributes.lootBox ?? false,
matureOrSuggestiveThemes: attributes.matureOrSuggestiveThemes ?? Rating.NONE,
medicalOrTreatmentInformation: attributes.medicalOrTreatmentInformation ?? Rating.NONE,
profanityOrCrudeHumor: attributes.profanityOrCrudeHumor ?? Rating.NONE,
sexualContentGraphicAndNudity: attributes.sexualContentGraphicAndNudity ?? Rating.NONE,
sexualContentOrNudity: attributes.sexualContentOrNudity ?? Rating.NONE,
unrestrictedWebAccess: attributes.unrestrictedWebAccess ?? false,
violenceCartoonOrFantasy: attributes.violenceCartoonOrFantasy ?? Rating.NONE,
violenceRealistic: attributes.violenceRealistic ?? Rating.NONE,
violenceRealisticProlongedGraphicOrSadistic:
attributes.violenceRealisticProlongedGraphicOrSadistic ?? Rating.NONE,
gambling: attributes.gambling ?? false,
unrestrictedWebAccess: attributes.unrestrictedWebAccess ?? false,
kidsAgeBand: attributes.kidsAgeBand ?? null,
seventeenPlus: attributes.seventeenPlus ?? false,
};
}

Expand Down
15 changes: 10 additions & 5 deletions packages/eas-cli/src/metadata/apple/config/writer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
AppStoreVersion,
AppStoreVersionLocalization,
AppStoreVersionPhasedRelease,
KoreaRatingOverride,
Rating,
RatingOverride,
ReleaseType,
} from '@expo/apple-utils';

Expand All @@ -28,26 +30,29 @@
};
}

public setAgeRating(attributes: AttributesOf<AgeRatingDeclaration>): void {
// Note, both `seventeenPlus` and `gamlingAndContests` are deprecated
public setAgeRating(attributes: Omit<AttributesOf<AgeRatingDeclaration>, 'seventeenPlus' | 'gamblingAndContests'>): void {

Check warning on line 34 in packages/eas-cli/src/metadata/apple/config/writer.ts

View workflow job for this annotation

GitHub Actions / Test with Node 22

Replace `attributes:·Omit<AttributesOf<AgeRatingDeclaration>,·'seventeenPlus'·|·'gamblingAndContests'>` with `⏎····attributes:·Omit<AttributesOf<AgeRatingDeclaration>,·'seventeenPlus'·|·'gamblingAndContests'>⏎··`
this.schema.advisory = {
ageRatingOverride: attributes.ageRatingOverride ?? RatingOverride.NONE,
alcoholTobaccoOrDrugUseOrReferences:
attributes.alcoholTobaccoOrDrugUseOrReferences ?? Rating.NONE,
contests: attributes.contests ?? Rating.NONE,
gambling: attributes.gambling ?? false,
gamblingSimulated: attributes.gamblingSimulated ?? Rating.NONE,
horrorOrFearThemes: attributes.horrorOrFearThemes ?? Rating.NONE,
kidsAgeBand: attributes.kidsAgeBand ?? null,
koreaAgeRatingOverride: attributes.koreaAgeRatingOverride ?? KoreaRatingOverride.NONE,
lootBox: attributes.lootBox ?? false,
matureOrSuggestiveThemes: attributes.matureOrSuggestiveThemes ?? Rating.NONE,
medicalOrTreatmentInformation: attributes.medicalOrTreatmentInformation ?? Rating.NONE,
profanityOrCrudeHumor: attributes.profanityOrCrudeHumor ?? Rating.NONE,
sexualContentGraphicAndNudity: attributes.sexualContentGraphicAndNudity ?? Rating.NONE,
sexualContentOrNudity: attributes.sexualContentOrNudity ?? Rating.NONE,
unrestrictedWebAccess: attributes.unrestrictedWebAccess ?? false,
violenceCartoonOrFantasy: attributes.violenceCartoonOrFantasy ?? Rating.NONE,
violenceRealistic: attributes.violenceRealistic ?? Rating.NONE,
violenceRealisticProlongedGraphicOrSadistic:
attributes.violenceRealisticProlongedGraphicOrSadistic ?? Rating.NONE,
gambling: attributes.gambling ?? false,
unrestrictedWebAccess: attributes.unrestrictedWebAccess ?? false,
kidsAgeBand: attributes.kidsAgeBand ?? null,
seventeenPlus: attributes.seventeenPlus ?? false,
};
}

Expand Down
3 changes: 2 additions & 1 deletion packages/eas-cli/src/metadata/apple/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
review?: AppleReview;
}

export type AppleAdvisory = Partial<AgeRatingDeclarationProps>;
// The omited properties are deprecated
export type AppleAdvisory = Omit<Partial<AgeRatingDeclarationProps>, 'seventeenPlus' | 'gamblingAndContests'>;

Check warning on line 17 in packages/eas-cli/src/metadata/apple/types.ts

View workflow job for this annotation

GitHub Actions / Test with Node 22

Replace `Partial<AgeRatingDeclarationProps>,·'seventeenPlus'·|·'gamblingAndContests'` with `⏎··Partial<AgeRatingDeclarationProps>,⏎··'seventeenPlus'·|·'gamblingAndContests'⏎`

/** Apps can define up to two categories, or categories with up to two subcategories */
export type AppleCategory = (string | string[])[];
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading