From feaedbe634eb6b9adbc16ac6ab8bf6ddd763e3b4 Mon Sep 17 00:00:00 2001 From: Kadi Kraman Date: Tue, 3 Oct 2023 11:28:38 +0100 Subject: [PATCH] [eas-cli] [ENG-10225] add requiredPackageManager to build metadata (#2067) * Add requiredPackageManager to build metadata * Use correct version in changelog * Fix changelog * Update @expo/eas-build-job library * Update graphql schema * Update gql schema --- CHANGELOG.md | 2 + packages/eas-cli/graphql.schema.json | 60 +++++++++------------ packages/eas-cli/package.json | 4 +- packages/eas-cli/src/build/context.ts | 2 + packages/eas-cli/src/build/createContext.ts | 4 ++ packages/eas-cli/src/build/metadata.ts | 1 + packages/eas-cli/src/graphql/generated.ts | 5 +- yarn.lock | 30 ++++------- 8 files changed, 48 insertions(+), 60 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e7416b27b3..065e978b6c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,8 @@ This is the log of notable changes to EAS CLI and related packages. ### ๐Ÿงน Chores +- Add `requiredPackageManager` to metadata. ([#2067](https://github.com/expo/eas-cli/pull/2067) by [@kadikraman](https://github.com/kadikraman)) + ## [5.4.0](https://github.com/expo/eas-cli/releases/tag/v5.4.0) - 2023-09-28 ### ๐ŸŽ‰ New features diff --git a/packages/eas-cli/graphql.schema.json b/packages/eas-cli/graphql.schema.json index 82cd35c678..a08a04e88b 100644 --- a/packages/eas-cli/graphql.schema.json +++ b/packages/eas-cli/graphql.schema.json @@ -9437,18 +9437,6 @@ "defaultValue": null, "isDeprecated": false, "deprecationReason": null - }, - { - "name": "useDeprecatedBackend", - "description": null, - "type": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - }, - "defaultValue": null, - "isDeprecated": false, - "deprecationReason": null } ], "type": { @@ -9478,18 +9466,6 @@ "defaultValue": null, "isDeprecated": false, "deprecationReason": null - }, - { - "name": "useDeprecatedBackend", - "description": null, - "type": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - }, - "defaultValue": null, - "isDeprecated": false, - "deprecationReason": null } ], "type": { @@ -9523,18 +9499,6 @@ "defaultValue": null, "isDeprecated": false, "deprecationReason": null - }, - { - "name": "useDeprecatedBackend", - "description": null, - "type": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - }, - "defaultValue": null, - "isDeprecated": false, - "deprecationReason": null } ], "type": { @@ -14730,6 +14694,18 @@ "isDeprecated": false, "deprecationReason": null }, + { + "name": "requiredPackageManager", + "description": null, + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, { "name": "resourceClass", "description": "The builder resource class requested by the developer", @@ -16207,6 +16183,18 @@ "isDeprecated": false, "deprecationReason": null }, + { + "name": "requiredPackageManager", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, { "name": "runFromCI", "description": null, diff --git a/packages/eas-cli/package.json b/packages/eas-cli/package.json index ca45313ae8..e6bcf1c00d 100644 --- a/packages/eas-cli/package.json +++ b/packages/eas-cli/package.json @@ -13,12 +13,12 @@ "@expo/config": "8.1.2", "@expo/config-plugins": "7.2.4", "@expo/config-types": "49.0.0", - "@expo/eas-build-job": "1.0.43", + "@expo/eas-build-job": "1.0.46", "@expo/eas-json": "5.3.1", "@expo/json-file": "8.2.37", "@expo/multipart-body-parser": "1.1.0", "@expo/osascript": "2.0.33", - "@expo/package-manager": "0.0.57", + "@expo/package-manager": "1.1.1", "@expo/pkcs12": "0.0.8", "@expo/plist": "0.0.20", "@expo/plugin-help": "5.1.22", diff --git a/packages/eas-cli/src/build/context.ts b/packages/eas-cli/src/build/context.ts index 2a95a3684d..87ad149786 100644 --- a/packages/eas-cli/src/build/context.ts +++ b/packages/eas-cli/src/build/context.ts @@ -1,6 +1,7 @@ import { ExpoConfig } from '@expo/config'; import { Platform, Workflow } from '@expo/eas-build-job'; import { BuildProfile, EasJson } from '@expo/eas-json'; +import { NodePackageManager } from '@expo/package-manager'; import { Analytics, AnalyticsEventProperties } from '../analytics/AnalyticsManager'; import { ExpoGraphqlClient } from '../commandUtils/context/contextUtils/createGraphqlClient'; @@ -56,4 +57,5 @@ export interface BuildContext { android: T extends Platform.ANDROID ? AndroidBuildContext : undefined; ios: T extends Platform.IOS ? IosBuildContext : undefined; developmentClient: boolean; + requiredPackageManager: NodePackageManager['name'] | null; } diff --git a/packages/eas-cli/src/build/createContext.ts b/packages/eas-cli/src/build/createContext.ts index 4150677e20..0996996349 100644 --- a/packages/eas-cli/src/build/createContext.ts +++ b/packages/eas-cli/src/build/createContext.ts @@ -1,6 +1,7 @@ import { Platform } from '@expo/eas-build-job'; import { BuildProfile, EasJson, ResourceClass } from '@expo/eas-json'; import JsonFile from '@expo/json-file'; +import { resolvePackageManager } from '@expo/package-manager'; import getenv from 'getenv'; import resolveFrom from 'resolve-from'; import { v4 as uuidv4 } from 'uuid'; @@ -67,6 +68,8 @@ export async function createBuildContextAsync({ : (buildProfile as BuildProfile)?.buildConfiguration === 'Debug') ?? false; + const requiredPackageManager = resolvePackageManager(projectDir); + const credentialsCtx = new CredentialsContext({ projectInfo: { exp, projectId }, nonInteractive, @@ -127,6 +130,7 @@ export async function createBuildContextAsync({ runFromCI, customBuildConfigMetadata, developmentClient, + requiredPackageManager, }; if (platform === Platform.ANDROID) { const common = commonContext as CommonContext; diff --git a/packages/eas-cli/src/build/metadata.ts b/packages/eas-cli/src/build/metadata.ts index d498d87608..5416867476 100644 --- a/packages/eas-cli/src/build/metadata.ts +++ b/packages/eas-cli/src/build/metadata.ts @@ -64,6 +64,7 @@ export async function collectMetadataAsync( buildMode: ctx.buildProfile.config ? BuildMode.CUSTOM : BuildMode.BUILD, customWorkflowName: ctx.customBuildConfigMetadata?.workflowName, developmentClient: ctx.developmentClient, + requiredPackageManager: ctx.requiredPackageManager ?? undefined, }; return sanitizeMetadata(metadata); } diff --git a/packages/eas-cli/src/graphql/generated.ts b/packages/eas-cli/src/graphql/generated.ts index 271b32a2cd..968602c516 100644 --- a/packages/eas-cli/src/graphql/generated.ts +++ b/packages/eas-cli/src/graphql/generated.ts @@ -1401,19 +1401,16 @@ export type AppInsights = { export type AppInsightsTotalUniqueUsersArgs = { timespan: InsightsTimespan; - useDeprecatedBackend?: InputMaybe; }; export type AppInsightsUniqueUsersByAppVersionOverTimeArgs = { timespan: InsightsTimespan; - useDeprecatedBackend?: InputMaybe; }; export type AppInsightsUniqueUsersByPlatformOverTimeArgs = { timespan: InsightsTimespan; - useDeprecatedBackend?: InputMaybe; }; export type AppMutation = { @@ -2123,6 +2120,7 @@ export type Build = ActivityTimelineProjectActivity & BuildOrBuildJob & { queuePosition?: Maybe; reactNativeVersion?: Maybe; releaseChannel?: Maybe; + requiredPackageManager?: Maybe; /** * The builder resource class requested by the developer * @deprecated Use resourceClassDisplayName instead @@ -2315,6 +2313,7 @@ export type BuildMetadataInput = { message?: InputMaybe; reactNativeVersion?: InputMaybe; releaseChannel?: InputMaybe; + requiredPackageManager?: InputMaybe; runFromCI?: InputMaybe; runWithNoWaitFlag?: InputMaybe; runtimeVersion?: InputMaybe; diff --git a/yarn.lock b/yarn.lock index 145bd81824..5d23708cec 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1403,10 +1403,10 @@ joi "^17.9.2" semver "^7.5.4" -"@expo/eas-build-job@1.0.43": - version "1.0.43" - resolved "https://registry.yarnpkg.com/@expo/eas-build-job/-/eas-build-job-1.0.43.tgz#e331b5039372c31b15aedbadc229efee3dcaefba" - integrity sha512-LMOoDIEax31uGBGux6/ocbCjUbWK3cUHuCxrsYlU+bvba4pGifegYWt2YQ/HC2477paq+K69IGjOUCHvNWG6Yg== +"@expo/eas-build-job@1.0.46": + version "1.0.46" + resolved "https://registry.yarnpkg.com/@expo/eas-build-job/-/eas-build-job-1.0.46.tgz#e99c0c9f2065cfb91b9a382dedb2e14892e47076" + integrity sha512-f1KE3t8uvMKPSVVphXlJ70/zn5wMFB47yYM3orVZiirq2pd/0UfWYF5YiNktgEyGglxqmq3gNV06H9pEDTUJew== dependencies: joi "^17.9.2" semver "^7.5.4" @@ -1428,15 +1428,6 @@ semver "7.3.2" tempy "0.3.0" -"@expo/json-file@8.2.36": - version "8.2.36" - resolved "https://registry.yarnpkg.com/@expo/json-file/-/json-file-8.2.36.tgz#62a505cb7f30a34d097386476794680a3f7385ff" - integrity sha512-tOZfTiIFA5KmMpdW9KF7bc6CFiGjb0xnbieJhTGlHrLL+ps2G0OkqmuZ3pFEXBOMnJYUVpnSy++52LFxvpa5ZQ== - dependencies: - "@babel/code-frame" "~7.10.4" - json5 "^1.0.1" - write-file-atomic "^2.3.0" - "@expo/json-file@8.2.37", "@expo/json-file@^8.2.37", "@expo/json-file@~8.2.37": version "8.2.37" resolved "https://registry.yarnpkg.com/@expo/json-file/-/json-file-8.2.37.tgz#9c02d3b42134907c69cc0a027b18671b69344049" @@ -1471,19 +1462,20 @@ "@expo/spawn-async" "^1.5.0" exec-async "^2.2.0" -"@expo/package-manager@0.0.57": - version "0.0.57" - resolved "https://registry.yarnpkg.com/@expo/package-manager/-/package-manager-0.0.57.tgz#1cd71da0632c52a9a001b45e5d0d7e1e16de97d3" - integrity sha512-Y4RpSL9EqaPF+Vd2GrK6r7Xx7Dv0Xdq3AGAD9C0KwV21WqP/scj/dpjxFY+ABwmdhNsFzYXb8fmDyh4tiKenPQ== +"@expo/package-manager@1.1.1": + version "1.1.1" + resolved "https://registry.yarnpkg.com/@expo/package-manager/-/package-manager-1.1.1.tgz#065326c5684c2acfbfdc290d93eabb7a36225507" + integrity sha512-NxtfIA25iEiNwMT+s8PEmdKzjyfWd2qkCLJkf6jKZGaH9c06YXyOAi2jvCyM8XuSzJz4pcEH8kz1HkJAInjB7Q== dependencies: - "@expo/json-file" "8.2.36" + "@expo/json-file" "^8.2.37" "@expo/spawn-async" "^1.5.0" ansi-regex "^5.0.0" chalk "^4.0.0" find-up "^5.0.0" find-yarn-workspace-root "~2.0.0" + js-yaml "^3.13.1" + micromatch "^4.0.2" npm-package-arg "^7.0.0" - rimraf "^3.0.2" split "^1.0.1" sudo-prompt "9.1.1"