@expo/build-tools 1.0.23 → 1.0.25

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.
Files changed (59) hide show
  1. package/bin/set-env +23 -0
  2. package/dist/builders/android.js +2 -0
  3. package/dist/builders/android.js.map +1 -1
  4. package/dist/builders/common.js +6 -2
  5. package/dist/builders/common.js.map +1 -1
  6. package/dist/builders/custom.js +8 -10
  7. package/dist/builders/custom.js.map +1 -1
  8. package/dist/builders/ios.js +2 -0
  9. package/dist/builders/ios.js.map +1 -1
  10. package/dist/common/prebuild.d.ts +0 -2
  11. package/dist/common/prebuild.js +2 -8
  12. package/dist/common/prebuild.js.map +1 -1
  13. package/dist/context.d.ts +12 -3
  14. package/dist/context.js +42 -8
  15. package/dist/context.js.map +1 -1
  16. package/dist/customBuildContext.d.ts +22 -0
  17. package/dist/customBuildContext.js +42 -0
  18. package/dist/customBuildContext.js.map +1 -0
  19. package/dist/ios/xcodeBuildLogs.d.ts +5 -1
  20. package/dist/ios/xcodeBuildLogs.js +3 -3
  21. package/dist/ios/xcodeBuildLogs.js.map +1 -1
  22. package/dist/steps/easFunctions.d.ts +2 -1
  23. package/dist/steps/easFunctions.js +4 -3
  24. package/dist/steps/easFunctions.js.map +1 -1
  25. package/dist/steps/functions/eas/buildReactNativeApp.js +17 -1
  26. package/dist/steps/functions/eas/buildReactNativeApp.js.map +1 -1
  27. package/dist/steps/functions/eas/checkout.js +1 -1
  28. package/dist/steps/functions/eas/checkout.js.map +1 -1
  29. package/dist/steps/functions/eas/findAndUploadBuildArtifacts.d.ts +2 -3
  30. package/dist/steps/functions/eas/findAndUploadBuildArtifacts.js +57 -10
  31. package/dist/steps/functions/eas/findAndUploadBuildArtifacts.js.map +1 -1
  32. package/dist/steps/functions/eas/installNodeModules.d.ts +5 -4
  33. package/dist/steps/functions/eas/installNodeModules.js +31 -7
  34. package/dist/steps/functions/eas/installNodeModules.js.map +1 -1
  35. package/dist/steps/functions/eas/prebuild.d.ts +2 -3
  36. package/dist/steps/functions/eas/prebuild.js +79 -20
  37. package/dist/steps/functions/eas/prebuild.js.map +1 -1
  38. package/dist/steps/functions/eas/setUpNpmrc.d.ts +2 -3
  39. package/dist/steps/functions/eas/setUpNpmrc.js +28 -3
  40. package/dist/steps/functions/eas/setUpNpmrc.js.map +1 -1
  41. package/dist/steps/functions/utils/uploadArtifact.d.ts +2 -3
  42. package/dist/steps/functions/utils/uploadArtifact.js +1 -1
  43. package/dist/steps/functions/utils/uploadArtifact.js.map +1 -1
  44. package/dist/steps/utils/ios/fastlane.d.ts +11 -0
  45. package/dist/steps/utils/ios/fastlane.js +54 -0
  46. package/dist/steps/utils/ios/fastlane.js.map +1 -0
  47. package/dist/steps/utils/ios/resolve.d.ts +5 -0
  48. package/dist/steps/utils/ios/resolve.js +30 -0
  49. package/dist/steps/utils/ios/resolve.js.map +1 -0
  50. package/dist/steps/utils/ios/tvos.d.ts +5 -0
  51. package/dist/steps/utils/ios/tvos.js +16 -0
  52. package/dist/steps/utils/ios/tvos.js.map +1 -0
  53. package/dist/utils/artifacts.d.ts +3 -1
  54. package/dist/utils/artifacts.js +4 -2
  55. package/dist/utils/artifacts.js.map +1 -1
  56. package/dist/utils/prepareBuildExecutable.d.ts +3 -0
  57. package/dist/utils/prepareBuildExecutable.js +13 -0
  58. package/dist/utils/prepareBuildExecutable.js.map +1 -0
  59. package/package.json +5 -4
@@ -0,0 +1 @@
1
+ {"version":3,"file":"customBuildContext.js","sourceRoot":"","sources":["../src/customBuildContext.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAwB;AAExB,uDAAqE;AAErE,uCAAiF;AAIjF,MAAM,8BAA8B,GAA2C;IAC7E,CAAC,wBAAQ,CAAC,OAAO,CAAC,EAAE,4BAAoB,CAAC,KAAK;IAC9C,CAAC,wBAAQ,CAAC,GAAG,CAAC,EAAE,4BAAoB,CAAC,MAAM;CAC5C,CAAC;AAMF,MAAa,kBAAkB;IAsB7B,YAAY,QAA2B;QACrC,IAAI,CAAC,IAAI,GAAG,QAAQ,CAAC,GAAG,CAAC;QACzB,IAAI,CAAC,GAAG,GAAG,QAAQ,CAAC,GAAG,CAAC;QAExB,IAAI,CAAC,MAAM,GAAG,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,KAAK,EAAE,0BAAU,CAAC,MAAM,EAAE,CAAC,CAAC;QAClE,IAAI,CAAC,sBAAsB,GAAG,cAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,UAAU,EAAE,wBAAwB,CAAC,CAAC;QACvF,IAAI,CAAC,sBAAsB,GAAG,cAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;QACtE,IAAI,CAAC,uBAAuB,GAAG,QAAQ,CAAC,8BAA8B,EAAE,CAAC;QACzE,IAAI,CAAC,UAAU,GAAG;YAChB,eAAe,EAAE,CAAC,GAAG,IAAI,EAAE,EAAE,CAAC,QAAQ,CAAC,iBAAiB,CAAC,CAAC,GAAG,IAAI,CAAC;SACnE,CAAC;IACJ,CAAC;IAED,IAAW,eAAe;QACxB,OAAO,8BAA8B,CAAC,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IAC3D,CAAC;IAED,IAAW,GAAG;QACZ,OAAO,IAAI,CAAC,IAAI,CAAC;IACnB,CAAC;IAEM,aAAa;QAClB,OAAO;YACL,GAAG,EAAE,IAAI,CAAC,GAAG;SACd,CAAC;IACJ,CAAC;IAEM,SAAS,CAAC,GAAQ;QACvB,IAAI,CAAC,IAAI,GAAG,GAAG,CAAC;IAClB,CAAC;CACF;AApDD,gDAoDC","sourcesContent":["import path from 'path';\n\nimport { BuildPhase, Env, Job, Platform } from '@expo/eas-build-job';\nimport { bunyan } from '@expo/logger';\nimport { ExternalBuildContextProvider, BuildRuntimePlatform } from '@expo/steps';\n\nimport { ArtifactType, BuildContext } from './context';\n\nconst platformToBuildRuntimePlatform: Record<Platform, BuildRuntimePlatform> = {\n [Platform.ANDROID]: BuildRuntimePlatform.LINUX,\n [Platform.IOS]: BuildRuntimePlatform.DARWIN,\n};\n\nexport interface BuilderRuntimeApi {\n uploadArtifacts: (type: ArtifactType, paths: string[], logger: bunyan) => Promise<void>;\n}\n\nexport class CustomBuildContext implements ExternalBuildContextProvider {\n /*\n * Directory that contains project sources before eas/checkout.\n */\n public readonly projectSourceDirectory: string;\n\n /*\n * Directory where build is executed. eas/checkout will copy sources here.\n */\n public readonly projectTargetDirectory: string;\n\n /*\n * Directory where all build steps will be executed unless configured otherwise.\n */\n public readonly defaultWorkingDirectory: string;\n\n public readonly logger: bunyan;\n public readonly runtimeApi: BuilderRuntimeApi;\n public readonly job: Job;\n\n private _env: Env;\n\n constructor(buildCtx: BuildContext<Job>) {\n this._env = buildCtx.env;\n this.job = buildCtx.job;\n\n this.logger = buildCtx.logger.child({ phase: BuildPhase.CUSTOM });\n this.projectSourceDirectory = path.join(buildCtx.workingdir, 'temporary-custom-build');\n this.projectTargetDirectory = path.join(buildCtx.workingdir, 'build');\n this.defaultWorkingDirectory = buildCtx.getReactNativeProjectDirectory();\n this.runtimeApi = {\n uploadArtifacts: (...args) => buildCtx['uploadArtifacts'](...args),\n };\n }\n\n public get runtimePlatform(): BuildRuntimePlatform {\n return platformToBuildRuntimePlatform[this.job.platform];\n }\n\n public get env(): Env {\n return this._env;\n }\n\n public staticContext(): any {\n return {\n job: this.job,\n };\n }\n\n public updateEnv(env: Env): void {\n this._env = env;\n }\n}\n"]}
@@ -1,4 +1,8 @@
1
+ /// <reference types="bunyan" />
1
2
  import { Ios } from '@expo/eas-build-job';
3
+ import { bunyan } from '@expo/logger';
2
4
  import { BuildContext } from '../context';
3
- export declare function findAndUploadXcodeBuildLogsAsync(ctx: BuildContext<Ios.Job>): Promise<void>;
5
+ export declare function findAndUploadXcodeBuildLogsAsync(ctx: BuildContext<Ios.Job>, { logger }: {
6
+ logger: bunyan;
7
+ }): Promise<void>;
4
8
  export declare function findXcodeBuildLogsPathAsync(buildLogsDirectory: string): Promise<string | undefined>;
@@ -8,15 +8,15 @@ const os_1 = __importDefault(require("os"));
8
8
  const path_1 = __importDefault(require("path"));
9
9
  const fast_glob_1 = __importDefault(require("fast-glob"));
10
10
  const context_1 = require("../context");
11
- async function findAndUploadXcodeBuildLogsAsync(ctx) {
11
+ async function findAndUploadXcodeBuildLogsAsync(ctx, { logger }) {
12
12
  try {
13
13
  const xcodeBuildLogsPath = await findXcodeBuildLogsPathAsync(ctx.buildLogsDirectory);
14
14
  if (xcodeBuildLogsPath) {
15
- await ctx.uploadArtifacts(context_1.ArtifactType.XCODE_BUILD_LOGS, [xcodeBuildLogsPath], ctx.logger);
15
+ await ctx.uploadArtifacts(context_1.ArtifactType.XCODE_BUILD_LOGS, [xcodeBuildLogsPath], logger);
16
16
  }
17
17
  }
18
18
  catch (err) {
19
- ctx.logger.debug({ err }, 'Failed to upload Xcode build logs');
19
+ logger.debug({ err }, 'Failed to upload Xcode build logs');
20
20
  }
21
21
  }
22
22
  exports.findAndUploadXcodeBuildLogsAsync = findAndUploadXcodeBuildLogsAsync;
@@ -1 +1 @@
1
- {"version":3,"file":"xcodeBuildLogs.js","sourceRoot":"","sources":["../../src/ios/xcodeBuildLogs.ts"],"names":[],"mappings":";;;;;;AAAA,4CAAoB;AACpB,gDAAwB;AAGxB,0DAA2B;AAE3B,wCAAwD;AAEjD,KAAK,UAAU,gCAAgC,CAAC,GAA0B;IAC/E,IAAI;QACF,MAAM,kBAAkB,GAAG,MAAM,2BAA2B,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC;QACrF,IAAI,kBAAkB,EAAE;YACtB,MAAM,GAAG,CAAC,eAAe,CAAC,sBAAY,CAAC,gBAAgB,EAAE,CAAC,kBAAkB,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;SAC5F;KACF;IAAC,OAAO,GAAQ,EAAE;QACjB,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,GAAG,EAAE,EAAE,mCAAmC,CAAC,CAAC;KAChE;AACH,CAAC;AATD,4EASC;AAEM,KAAK,UAAU,2BAA2B,CAC/C,kBAA0B;;IAE1B,MAAM,cAAc,GAAG,CAAC,MAAM,IAAA,mBAAE,EAAC,OAAO,EAAE,EAAE,GAAG,EAAE,kBAAkB,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CACvF,cAAI,CAAC,IAAI,CAAC,kBAAkB,EAAE,QAAQ,CAAC,CACxC,CAAC;IACF,IAAI,cAAc,CAAC,CAAC,CAAC,EAAE;QACrB,OAAO,cAAc,CAAC,CAAC,CAAC,CAAC;KAC1B;IACD,MAAM,gBAAgB,GAAG,CAAC,MAAM,IAAA,mBAAE,EAAC,wBAAwB,EAAE,EAAE,GAAG,EAAE,YAAE,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,CACtF,CAAC,YAAY,EAAE,EAAE,CAAC,cAAI,CAAC,IAAI,CAAC,YAAE,CAAC,OAAO,EAAE,EAAE,YAAY,CAAC,CACxD,CAAC;IAEF,OAAO,MAAA,MAAA,cAAc,CAAC,CAAC,CAAC,mCAAI,gBAAgB,CAAC,CAAC,CAAC,mCAAI,SAAS,CAAC;AAC/D,CAAC;AAdD,kEAcC","sourcesContent":["import os from 'os';\nimport path from 'path';\n\nimport { Ios } from '@expo/eas-build-job';\nimport fg from 'fast-glob';\n\nimport { ArtifactType, BuildContext } from '../context';\n\nexport async function findAndUploadXcodeBuildLogsAsync(ctx: BuildContext<Ios.Job>): Promise<void> {\n try {\n const xcodeBuildLogsPath = await findXcodeBuildLogsPathAsync(ctx.buildLogsDirectory);\n if (xcodeBuildLogsPath) {\n await ctx.uploadArtifacts(ArtifactType.XCODE_BUILD_LOGS, [xcodeBuildLogsPath], ctx.logger);\n }\n } catch (err: any) {\n ctx.logger.debug({ err }, 'Failed to upload Xcode build logs');\n }\n}\n\nexport async function findXcodeBuildLogsPathAsync(\n buildLogsDirectory: string\n): Promise<string | undefined> {\n const customLogPaths = (await fg('*.log', { cwd: buildLogsDirectory })).map((filename) =>\n path.join(buildLogsDirectory, filename)\n );\n if (customLogPaths[0]) {\n return customLogPaths[0];\n }\n const fallbackLogPaths = (await fg('Library/Logs/gym/*.log', { cwd: os.homedir() })).map(\n (relativePath) => path.join(os.homedir(), relativePath)\n );\n\n return customLogPaths[0] ?? fallbackLogPaths[0] ?? undefined;\n}\n"]}
1
+ {"version":3,"file":"xcodeBuildLogs.js","sourceRoot":"","sources":["../../src/ios/xcodeBuildLogs.ts"],"names":[],"mappings":";;;;;;AAAA,4CAAoB;AACpB,gDAAwB;AAGxB,0DAA2B;AAG3B,wCAAwD;AAEjD,KAAK,UAAU,gCAAgC,CACpD,GAA0B,EAC1B,EAAE,MAAM,EAAsB;IAE9B,IAAI;QACF,MAAM,kBAAkB,GAAG,MAAM,2BAA2B,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC;QACrF,IAAI,kBAAkB,EAAE;YACtB,MAAM,GAAG,CAAC,eAAe,CAAC,sBAAY,CAAC,gBAAgB,EAAE,CAAC,kBAAkB,CAAC,EAAE,MAAM,CAAC,CAAC;SACxF;KACF;IAAC,OAAO,GAAQ,EAAE;QACjB,MAAM,CAAC,KAAK,CAAC,EAAE,GAAG,EAAE,EAAE,mCAAmC,CAAC,CAAC;KAC5D;AACH,CAAC;AAZD,4EAYC;AAEM,KAAK,UAAU,2BAA2B,CAC/C,kBAA0B;;IAE1B,MAAM,cAAc,GAAG,CAAC,MAAM,IAAA,mBAAE,EAAC,OAAO,EAAE,EAAE,GAAG,EAAE,kBAAkB,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CACvF,cAAI,CAAC,IAAI,CAAC,kBAAkB,EAAE,QAAQ,CAAC,CACxC,CAAC;IACF,IAAI,cAAc,CAAC,CAAC,CAAC,EAAE;QACrB,OAAO,cAAc,CAAC,CAAC,CAAC,CAAC;KAC1B;IACD,MAAM,gBAAgB,GAAG,CAAC,MAAM,IAAA,mBAAE,EAAC,wBAAwB,EAAE,EAAE,GAAG,EAAE,YAAE,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,CACtF,CAAC,YAAY,EAAE,EAAE,CAAC,cAAI,CAAC,IAAI,CAAC,YAAE,CAAC,OAAO,EAAE,EAAE,YAAY,CAAC,CACxD,CAAC;IAEF,OAAO,MAAA,MAAA,cAAc,CAAC,CAAC,CAAC,mCAAI,gBAAgB,CAAC,CAAC,CAAC,mCAAI,SAAS,CAAC;AAC/D,CAAC;AAdD,kEAcC","sourcesContent":["import os from 'os';\nimport path from 'path';\n\nimport { Ios } from '@expo/eas-build-job';\nimport fg from 'fast-glob';\nimport { bunyan } from '@expo/logger';\n\nimport { ArtifactType, BuildContext } from '../context';\n\nexport async function findAndUploadXcodeBuildLogsAsync(\n ctx: BuildContext<Ios.Job>,\n { logger }: { logger: bunyan }\n): Promise<void> {\n try {\n const xcodeBuildLogsPath = await findXcodeBuildLogsPathAsync(ctx.buildLogsDirectory);\n if (xcodeBuildLogsPath) {\n await ctx.uploadArtifacts(ArtifactType.XCODE_BUILD_LOGS, [xcodeBuildLogsPath], logger);\n }\n } catch (err: any) {\n logger.debug({ err }, 'Failed to upload Xcode build logs');\n }\n}\n\nexport async function findXcodeBuildLogsPathAsync(\n buildLogsDirectory: string\n): Promise<string | undefined> {\n const customLogPaths = (await fg('*.log', { cwd: buildLogsDirectory })).map((filename) =>\n path.join(buildLogsDirectory, filename)\n );\n if (customLogPaths[0]) {\n return customLogPaths[0];\n }\n const fallbackLogPaths = (await fg('Library/Logs/gym/*.log', { cwd: os.homedir() })).map(\n (relativePath) => path.join(os.homedir(), relativePath)\n );\n\n return customLogPaths[0] ?? fallbackLogPaths[0] ?? undefined;\n}\n"]}
@@ -1,4 +1,5 @@
1
1
  import { Job } from '@expo/eas-build-job';
2
2
  import { BuildFunction } from '@expo/steps';
3
3
  import { BuildContext } from '../context';
4
- export declare function getEasFunctions<T extends Job>(ctx: BuildContext<T>): BuildFunction[];
4
+ import { CustomBuildContext } from '../customBuildContext';
5
+ export declare function getEasFunctions(ctx: CustomBuildContext, oldCtx: BuildContext<Job>): BuildFunction[];
@@ -9,15 +9,16 @@ const runGradle_1 = require("./functions/utils/runGradle");
9
9
  const prebuild_1 = require("./functions/eas/prebuild");
10
10
  const buildReactNativeApp_1 = require("./functions/eas/buildReactNativeApp");
11
11
  const findAndUploadBuildArtifacts_1 = require("./functions/eas/findAndUploadBuildArtifacts");
12
- function getEasFunctions(ctx) {
12
+ function getEasFunctions(ctx, oldCtx // TODO: remove
13
+ ) {
13
14
  return [
14
15
  (0, checkout_1.createCheckoutBuildFunction)(),
15
16
  (0, uploadArtifact_1.createUploadArtifactBuildFunction)(ctx),
16
17
  (0, setUpNpmrc_1.createSetUpNpmrcBuildFunction)(ctx),
17
18
  (0, installNodeModules_1.createInstallNodeModulesBuildFunction)(ctx),
18
19
  (0, prebuild_1.createPrebuildBuildFunction)(ctx),
19
- (0, runGradle_1.createRunGradleBuildFunction)(ctx),
20
- (0, buildReactNativeApp_1.createBuildReactNativeAppBuildFunction)(ctx),
20
+ (0, runGradle_1.createRunGradleBuildFunction)(oldCtx),
21
+ (0, buildReactNativeApp_1.createBuildReactNativeAppBuildFunction)(oldCtx),
21
22
  (0, findAndUploadBuildArtifacts_1.createFindAndUploadBuildArtifactsBuildFunction)(ctx),
22
23
  ];
23
24
  }
@@ -1 +1 @@
1
- {"version":3,"file":"easFunctions.js","sourceRoot":"","sources":["../../src/steps/easFunctions.ts"],"names":[],"mappings":";;;AAKA,qEAAqF;AACrF,uDAAuE;AACvE,2DAA2E;AAC3E,2EAA2F;AAC3F,2DAA2E;AAC3E,uDAAuE;AACvE,6EAA6F;AAC7F,6FAA6G;AAE7G,SAAgB,eAAe,CAAgB,GAAoB;IACjE,OAAO;QACL,IAAA,sCAA2B,GAAE;QAC7B,IAAA,kDAAiC,EAAC,GAAG,CAAC;QACtC,IAAA,0CAA6B,EAAC,GAAG,CAAC;QAClC,IAAA,0DAAqC,EAAC,GAAG,CAAC;QAC1C,IAAA,sCAA2B,EAAC,GAAG,CAAC;QAChC,IAAA,wCAA4B,EAAC,GAAG,CAAC;QACjC,IAAA,4DAAsC,EAAC,GAAG,CAAC;QAC3C,IAAA,4EAA8C,EAAC,GAAG,CAAC;KACpD,CAAC;AACJ,CAAC;AAXD,0CAWC","sourcesContent":["import { Job } from '@expo/eas-build-job';\nimport { BuildFunction } from '@expo/steps';\n\nimport { BuildContext } from '../context';\n\nimport { createUploadArtifactBuildFunction } from './functions/utils/uploadArtifact';\nimport { createCheckoutBuildFunction } from './functions/eas/checkout';\nimport { createSetUpNpmrcBuildFunction } from './functions/eas/setUpNpmrc';\nimport { createInstallNodeModulesBuildFunction } from './functions/eas/installNodeModules';\nimport { createRunGradleBuildFunction } from './functions/utils/runGradle';\nimport { createPrebuildBuildFunction } from './functions/eas/prebuild';\nimport { createBuildReactNativeAppBuildFunction } from './functions/eas/buildReactNativeApp';\nimport { createFindAndUploadBuildArtifactsBuildFunction } from './functions/eas/findAndUploadBuildArtifacts';\n\nexport function getEasFunctions<T extends Job>(ctx: BuildContext<T>): BuildFunction[] {\n return [\n createCheckoutBuildFunction(),\n createUploadArtifactBuildFunction(ctx),\n createSetUpNpmrcBuildFunction(ctx),\n createInstallNodeModulesBuildFunction(ctx),\n createPrebuildBuildFunction(ctx),\n createRunGradleBuildFunction(ctx),\n createBuildReactNativeAppBuildFunction(ctx),\n createFindAndUploadBuildArtifactsBuildFunction(ctx),\n ];\n}\n"]}
1
+ {"version":3,"file":"easFunctions.js","sourceRoot":"","sources":["../../src/steps/easFunctions.ts"],"names":[],"mappings":";;;AAMA,qEAAqF;AACrF,uDAAuE;AACvE,2DAA2E;AAC3E,2EAA2F;AAC3F,2DAA2E;AAC3E,uDAAuE;AACvE,6EAA6F;AAC7F,6FAA6G;AAE7G,SAAgB,eAAe,CAC7B,GAAuB,EACvB,MAAyB,CAAC,eAAe;;IAEzC,OAAO;QACL,IAAA,sCAA2B,GAAE;QAC7B,IAAA,kDAAiC,EAAC,GAAG,CAAC;QACtC,IAAA,0CAA6B,EAAC,GAAG,CAAC;QAClC,IAAA,0DAAqC,EAAC,GAAG,CAAC;QAC1C,IAAA,sCAA2B,EAAC,GAAG,CAAC;QAChC,IAAA,wCAA4B,EAAC,MAAM,CAAC;QACpC,IAAA,4DAAsC,EAAC,MAAM,CAAC;QAC9C,IAAA,4EAA8C,EAAC,GAAG,CAAC;KACpD,CAAC;AACJ,CAAC;AAdD,0CAcC","sourcesContent":["import { Job } from '@expo/eas-build-job';\nimport { BuildFunction } from '@expo/steps';\n\nimport { BuildContext } from '../context';\nimport { CustomBuildContext } from '../customBuildContext';\n\nimport { createUploadArtifactBuildFunction } from './functions/utils/uploadArtifact';\nimport { createCheckoutBuildFunction } from './functions/eas/checkout';\nimport { createSetUpNpmrcBuildFunction } from './functions/eas/setUpNpmrc';\nimport { createInstallNodeModulesBuildFunction } from './functions/eas/installNodeModules';\nimport { createRunGradleBuildFunction } from './functions/utils/runGradle';\nimport { createPrebuildBuildFunction } from './functions/eas/prebuild';\nimport { createBuildReactNativeAppBuildFunction } from './functions/eas/buildReactNativeApp';\nimport { createFindAndUploadBuildArtifactsBuildFunction } from './functions/eas/findAndUploadBuildArtifacts';\n\nexport function getEasFunctions(\n ctx: CustomBuildContext,\n oldCtx: BuildContext<Job> // TODO: remove\n): BuildFunction[] {\n return [\n createCheckoutBuildFunction(),\n createUploadArtifactBuildFunction(ctx),\n createSetUpNpmrcBuildFunction(ctx),\n createInstallNodeModulesBuildFunction(ctx),\n createPrebuildBuildFunction(ctx),\n createRunGradleBuildFunction(oldCtx),\n createBuildReactNativeAppBuildFunction(oldCtx),\n createFindAndUploadBuildArtifactsBuildFunction(ctx),\n ];\n}\n"]}
@@ -9,6 +9,8 @@ const eas_build_job_1 = require("@expo/eas-build-job");
9
9
  const steps_1 = require("@expo/steps");
10
10
  const fs_extra_1 = __importDefault(require("fs-extra"));
11
11
  const gradle_1 = require("../../../android/gradle");
12
+ const resolve_1 = require("../../utils/ios/resolve");
13
+ const fastlane_1 = require("../../utils/ios/fastlane");
12
14
  function createBuildReactNativeAppBuildFunction(ctx) {
13
15
  return new steps_1.BuildFunction({
14
16
  namespace: 'eas',
@@ -28,7 +30,21 @@ function createBuildReactNativeAppBuildFunction(ctx) {
28
30
  });
29
31
  }
30
32
  else {
31
- throw new steps_1.errors.BuildStepRuntimeError('iOS builds are not supported yet');
33
+ const iosCtx = ctx;
34
+ const iosDir = path_1.default.join(stepsCtx.workingDirectory, 'ios');
35
+ if (!(await fs_extra_1.default.exists(iosDir))) {
36
+ throw new steps_1.errors.BuildStepRuntimeError(`iOS project directory (${iosDir}) does not exist. Make sure that the working directory for this step (${stepsCtx.workingDirectory}) is set to the root of your React Native project. If you are on a managed workflow, make sure that you have run "eas/prebuild" step to generate your native code.`);
37
+ }
38
+ const scheme = (0, resolve_1.resolveScheme)(iosCtx.job, { workingDir: stepsCtx.workingDirectory });
39
+ const buildConfiguration = (0, resolve_1.resolveBuildConfiguration)(iosCtx.job);
40
+ await (0, fastlane_1.runFastlaneGym)({
41
+ scheme,
42
+ buildConfiguration,
43
+ workingDir: stepsCtx.workingDirectory,
44
+ logger: stepsCtx.logger,
45
+ buildLogsDirectory: ctx.buildLogsDirectory,
46
+ env: ctx.env,
47
+ });
32
48
  }
33
49
  },
34
50
  });
@@ -1 +1 @@
1
- {"version":3,"file":"buildReactNativeApp.js","sourceRoot":"","sources":["../../../../src/steps/functions/eas/buildReactNativeApp.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAwB;AAExB,uDAA6D;AAC7D,uCAAoD;AACpD,wDAA0B;AAG1B,oDAAiF;AAEjF,SAAgB,sCAAsC,CACpD,GAAoB;IAEpB,OAAO,IAAI,qBAAa,CAAC;QACvB,SAAS,EAAE,KAAK;QAChB,EAAE,EAAE,wBAAwB;QAC5B,IAAI,EAAE,wBAAwB;QAC9B,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE;YACrB,IAAI,GAAG,CAAC,GAAG,CAAC,QAAQ,KAAK,wBAAQ,CAAC,OAAO,EAAE;gBACzC,MAAM,UAAU,GAAG,cAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,gBAAgB,EAAE,SAAS,CAAC,CAAC;gBACnE,IAAI,CAAC,CAAC,MAAM,kBAAE,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,EAAE;oBAClC,MAAM,IAAI,cAAM,CAAC,qBAAqB,CACpC,8BAA8B,UAAU,yEAAyE,QAAQ,CAAC,gBAAgB,oKAAoK,CAC/S,CAAC;iBACH;gBACD,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,0BAA0B,CAAC,CAAC;gBACjD,MAAM,IAAA,yBAAgB,EAAC,GAAgC,EAAE;oBACvD,MAAM,EAAE,QAAQ,CAAC,MAAM;oBACvB,aAAa,EAAE,IAAA,6BAAoB,EAAC,GAAG,CAAC,GAAG,CAAC;oBAC5C,UAAU;iBACX,CAAC,CAAC;aACJ;iBAAM;gBACL,MAAM,IAAI,cAAM,CAAC,qBAAqB,CAAC,kCAAkC,CAAC,CAAC;aAC5E;QACH,CAAC;KACF,CAAC,CAAC;AACL,CAAC;AA1BD,wFA0BC","sourcesContent":["import path from 'path';\n\nimport { Android, Job, Platform } from '@expo/eas-build-job';\nimport { BuildFunction, errors } from '@expo/steps';\nimport fs from 'fs-extra';\n\nimport { BuildContext } from '../../../context';\nimport { resolveGradleCommand, runGradleCommand } from '../../../android/gradle';\n\nexport function createBuildReactNativeAppBuildFunction<T extends Job>(\n ctx: BuildContext<T>\n): BuildFunction {\n return new BuildFunction({\n namespace: 'eas',\n id: 'build_react_native_app',\n name: 'Build React Native app',\n fn: async (stepsCtx) => {\n if (ctx.job.platform === Platform.ANDROID) {\n const androidDir = path.join(stepsCtx.workingDirectory, 'android');\n if (!(await fs.exists(androidDir))) {\n throw new errors.BuildStepRuntimeError(\n `Android project directory (${androidDir}) does not exist. Make sure that the working directory for this step (${stepsCtx.workingDirectory}) is set to the root of your React Native project. If you are on a managed workflow, make sure that you have run \"eas/prebuild\" step to generate your native code.`\n );\n }\n stepsCtx.logger.info('Building Android project');\n await runGradleCommand(ctx as BuildContext<Android.Job>, {\n logger: stepsCtx.logger,\n gradleCommand: resolveGradleCommand(ctx.job),\n androidDir,\n });\n } else {\n throw new errors.BuildStepRuntimeError('iOS builds are not supported yet');\n }\n },\n });\n}\n"]}
1
+ {"version":3,"file":"buildReactNativeApp.js","sourceRoot":"","sources":["../../../../src/steps/functions/eas/buildReactNativeApp.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAwB;AAExB,uDAAkE;AAClE,uCAAoD;AACpD,wDAA0B;AAG1B,oDAAiF;AACjF,qDAAmF;AACnF,uDAA0D;AAE1D,SAAgB,sCAAsC,CACpD,GAAoB;IAEpB,OAAO,IAAI,qBAAa,CAAC;QACvB,SAAS,EAAE,KAAK;QAChB,EAAE,EAAE,wBAAwB;QAC5B,IAAI,EAAE,wBAAwB;QAC9B,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE;YACrB,IAAI,GAAG,CAAC,GAAG,CAAC,QAAQ,KAAK,wBAAQ,CAAC,OAAO,EAAE;gBACzC,MAAM,UAAU,GAAG,cAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,gBAAgB,EAAE,SAAS,CAAC,CAAC;gBACnE,IAAI,CAAC,CAAC,MAAM,kBAAE,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,EAAE;oBAClC,MAAM,IAAI,cAAM,CAAC,qBAAqB,CACpC,8BAA8B,UAAU,yEAAyE,QAAQ,CAAC,gBAAgB,oKAAoK,CAC/S,CAAC;iBACH;gBACD,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,0BAA0B,CAAC,CAAC;gBACjD,MAAM,IAAA,yBAAgB,EAAC,GAAgC,EAAE;oBACvD,MAAM,EAAE,QAAQ,CAAC,MAAM;oBACvB,aAAa,EAAE,IAAA,6BAAoB,EAAC,GAAG,CAAC,GAAG,CAAC;oBAC5C,UAAU;iBACX,CAAC,CAAC;aACJ;iBAAM;gBACL,MAAM,MAAM,GAAG,GAA4B,CAAC;gBAC5C,MAAM,MAAM,GAAG,cAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,gBAAgB,EAAE,KAAK,CAAC,CAAC;gBAC3D,IAAI,CAAC,CAAC,MAAM,kBAAE,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE;oBAC9B,MAAM,IAAI,cAAM,CAAC,qBAAqB,CACpC,0BAA0B,MAAM,yEAAyE,QAAQ,CAAC,gBAAgB,oKAAoK,CACvS,CAAC;iBACH;gBACD,MAAM,MAAM,GAAG,IAAA,uBAAa,EAAC,MAAM,CAAC,GAAG,EAAE,EAAE,UAAU,EAAE,QAAQ,CAAC,gBAAgB,EAAE,CAAC,CAAC;gBACpF,MAAM,kBAAkB,GAAG,IAAA,mCAAyB,EAAC,MAAM,CAAC,GAAG,CAAC,CAAC;gBACjE,MAAM,IAAA,yBAAc,EAAC;oBACnB,MAAM;oBACN,kBAAkB;oBAClB,UAAU,EAAE,QAAQ,CAAC,gBAAgB;oBACrC,MAAM,EAAE,QAAQ,CAAC,MAAM;oBACvB,kBAAkB,EAAE,GAAG,CAAC,kBAAkB;oBAC1C,GAAG,EAAE,GAAG,CAAC,GAAG;iBACb,CAAC,CAAC;aACJ;QACH,CAAC;KACF,CAAC,CAAC;AACL,CAAC;AA1CD,wFA0CC","sourcesContent":["import path from 'path';\n\nimport { Android, Ios, Job, Platform } from '@expo/eas-build-job';\nimport { BuildFunction, errors } from '@expo/steps';\nimport fs from 'fs-extra';\n\nimport { BuildContext } from '../../../context';\nimport { resolveGradleCommand, runGradleCommand } from '../../../android/gradle';\nimport { resolveBuildConfiguration, resolveScheme } from '../../utils/ios/resolve';\nimport { runFastlaneGym } from '../../utils/ios/fastlane';\n\nexport function createBuildReactNativeAppBuildFunction<T extends Job>(\n ctx: BuildContext<T>\n): BuildFunction {\n return new BuildFunction({\n namespace: 'eas',\n id: 'build_react_native_app',\n name: 'Build React Native app',\n fn: async (stepsCtx) => {\n if (ctx.job.platform === Platform.ANDROID) {\n const androidDir = path.join(stepsCtx.workingDirectory, 'android');\n if (!(await fs.exists(androidDir))) {\n throw new errors.BuildStepRuntimeError(\n `Android project directory (${androidDir}) does not exist. Make sure that the working directory for this step (${stepsCtx.workingDirectory}) is set to the root of your React Native project. If you are on a managed workflow, make sure that you have run \"eas/prebuild\" step to generate your native code.`\n );\n }\n stepsCtx.logger.info('Building Android project');\n await runGradleCommand(ctx as BuildContext<Android.Job>, {\n logger: stepsCtx.logger,\n gradleCommand: resolveGradleCommand(ctx.job),\n androidDir,\n });\n } else {\n const iosCtx = ctx as BuildContext<Ios.Job>;\n const iosDir = path.join(stepsCtx.workingDirectory, 'ios');\n if (!(await fs.exists(iosDir))) {\n throw new errors.BuildStepRuntimeError(\n `iOS project directory (${iosDir}) does not exist. Make sure that the working directory for this step (${stepsCtx.workingDirectory}) is set to the root of your React Native project. If you are on a managed workflow, make sure that you have run \"eas/prebuild\" step to generate your native code.`\n );\n }\n const scheme = resolveScheme(iosCtx.job, { workingDir: stepsCtx.workingDirectory });\n const buildConfiguration = resolveBuildConfiguration(iosCtx.job);\n await runFastlaneGym({\n scheme,\n buildConfiguration,\n workingDir: stepsCtx.workingDirectory,\n logger: stepsCtx.logger,\n buildLogsDirectory: ctx.buildLogsDirectory,\n env: ctx.env,\n });\n }\n },\n });\n}\n"]}
@@ -13,7 +13,7 @@ function createCheckoutBuildFunction() {
13
13
  name: 'Checkout',
14
14
  fn: async (stepsCtx) => {
15
15
  stepsCtx.logger.info('Checking out project directory');
16
- await fs_extra_1.default.move(stepsCtx.projectSourceDirectory, stepsCtx.projectTargetDirectory, {
16
+ await fs_extra_1.default.move(stepsCtx.global.projectSourceDirectory, stepsCtx.global.projectTargetDirectory, {
17
17
  overwrite: true,
18
18
  });
19
19
  },
@@ -1 +1 @@
1
- {"version":3,"file":"checkout.js","sourceRoot":"","sources":["../../../../src/steps/functions/eas/checkout.ts"],"names":[],"mappings":";;;;;;AAAA,uCAA4C;AAC5C,wDAA0B;AAE1B,SAAgB,2BAA2B;IACzC,OAAO,IAAI,qBAAa,CAAC;QACvB,SAAS,EAAE,KAAK;QAChB,EAAE,EAAE,UAAU;QACd,IAAI,EAAE,UAAU;QAChB,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE;YACrB,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,gCAAgC,CAAC,CAAC;YACvD,MAAM,kBAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,sBAAsB,EAAE,QAAQ,CAAC,sBAAsB,EAAE;gBAC9E,SAAS,EAAE,IAAI;aAChB,CAAC,CAAC;QACL,CAAC;KACF,CAAC,CAAC;AACL,CAAC;AAZD,kEAYC","sourcesContent":["import { BuildFunction } from '@expo/steps';\nimport fs from 'fs-extra';\n\nexport function createCheckoutBuildFunction(): BuildFunction {\n return new BuildFunction({\n namespace: 'eas',\n id: 'checkout',\n name: 'Checkout',\n fn: async (stepsCtx) => {\n stepsCtx.logger.info('Checking out project directory');\n await fs.move(stepsCtx.projectSourceDirectory, stepsCtx.projectTargetDirectory, {\n overwrite: true,\n });\n },\n });\n}\n"]}
1
+ {"version":3,"file":"checkout.js","sourceRoot":"","sources":["../../../../src/steps/functions/eas/checkout.ts"],"names":[],"mappings":";;;;;;AAAA,uCAA4C;AAC5C,wDAA0B;AAE1B,SAAgB,2BAA2B;IACzC,OAAO,IAAI,qBAAa,CAAC;QACvB,SAAS,EAAE,KAAK;QAChB,EAAE,EAAE,UAAU;QACd,IAAI,EAAE,UAAU;QAChB,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE;YACrB,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,gCAAgC,CAAC,CAAC;YACvD,MAAM,kBAAE,CAAC,IAAI,CACX,QAAQ,CAAC,MAAM,CAAC,sBAAsB,EACtC,QAAQ,CAAC,MAAM,CAAC,sBAAsB,EACtC;gBACE,SAAS,EAAE,IAAI;aAChB,CACF,CAAC;QACJ,CAAC;KACF,CAAC,CAAC;AACL,CAAC;AAhBD,kEAgBC","sourcesContent":["import { BuildFunction } from '@expo/steps';\nimport fs from 'fs-extra';\n\nexport function createCheckoutBuildFunction(): BuildFunction {\n return new BuildFunction({\n namespace: 'eas',\n id: 'checkout',\n name: 'Checkout',\n fn: async (stepsCtx) => {\n stepsCtx.logger.info('Checking out project directory');\n await fs.move(\n stepsCtx.global.projectSourceDirectory,\n stepsCtx.global.projectTargetDirectory,\n {\n overwrite: true,\n }\n );\n },\n });\n}\n"]}
@@ -1,4 +1,3 @@
1
- import { Job } from '@expo/eas-build-job';
2
1
  import { BuildFunction } from '@expo/steps';
3
- import { BuildContext } from '../../../context';
4
- export declare function createFindAndUploadBuildArtifactsBuildFunction<T extends Job>(ctx: BuildContext<T>): BuildFunction;
2
+ import { CustomBuildContext } from '../../../customBuildContext';
3
+ export declare function createFindAndUploadBuildArtifactsBuildFunction(ctx: CustomBuildContext): BuildFunction;
@@ -1,28 +1,75 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
6
  exports.createFindAndUploadBuildArtifactsBuildFunction = void 0;
7
+ const path_1 = __importDefault(require("path"));
4
8
  const eas_build_job_1 = require("@expo/eas-build-job");
5
9
  const steps_1 = require("@expo/steps");
10
+ const context_1 = require("../../../context");
6
11
  const artifacts_1 = require("../../../utils/artifacts");
7
- const resolve_1 = require("../../../ios/resolve");
12
+ const xcodeBuildLogs_1 = require("../../../ios/xcodeBuildLogs");
8
13
  function createFindAndUploadBuildArtifactsBuildFunction(ctx) {
9
14
  return new steps_1.BuildFunction({
10
15
  namespace: 'eas',
11
16
  id: 'find_and_upload_build_artifacts',
12
17
  name: 'Find and upload build artifacts',
13
- fn: async (stepsCtx) => {
14
- var _a;
18
+ fn: async (stepCtx) => {
19
+ var _a, _b;
20
+ const { logger } = stepCtx;
15
21
  const applicationArchivePatternOrPath = ctx.job.platform === eas_build_job_1.Platform.ANDROID
16
22
  ? (_a = ctx.job.applicationArchivePath) !== null && _a !== void 0 ? _a : 'android/app/build/outputs/**/*.{apk,aab}'
17
- : (0, resolve_1.resolveArtifactPath)(ctx);
18
- await (0, artifacts_1.uploadApplicationArchive)(ctx, {
19
- logger: stepsCtx.logger,
20
- rootDir: stepsCtx.workingDirectory,
21
- patternOrPath: applicationArchivePatternOrPath,
22
- });
23
- await (0, artifacts_1.maybeFindAndUploadBuildArtifacts)(ctx, stepsCtx.logger);
23
+ : resolveIosArtifactPath(ctx.job);
24
+ const applicationArchives = await (0, artifacts_1.findArtifacts)(stepCtx.workingDirectory, applicationArchivePatternOrPath, logger);
25
+ logger.info(`Application archive${applicationArchives.length > 1 ? 's' : ''}: ${applicationArchives.join(', ')}`);
26
+ const buildArtifacts = (await Promise.all(((_b = ctx.job.buildArtifactPaths) !== null && _b !== void 0 ? _b : []).map((path) => (0, artifacts_1.findArtifacts)(ctx.projectTargetDirectory, path, logger)))).flat();
27
+ if (buildArtifacts.length > 0) {
28
+ logger.info(`Found additional build artifacts: ${buildArtifacts.join(', ')}`);
29
+ }
30
+ logger.info('Uploading...');
31
+ const [archiveUpload, artifactsUpload, xcodeBuildLogsUpload] = await Promise.allSettled([
32
+ ctx.runtimeApi.uploadArtifacts(context_1.ArtifactType.APPLICATION_ARCHIVE, applicationArchives, logger),
33
+ (async () => {
34
+ if (buildArtifacts.length > 0) {
35
+ await ctx.runtimeApi.uploadArtifacts(context_1.ArtifactType.BUILD_ARTIFACTS, buildArtifacts, logger);
36
+ }
37
+ })(),
38
+ (async () => {
39
+ if (ctx.job.platform !== eas_build_job_1.Platform.IOS) {
40
+ return;
41
+ }
42
+ const xcodeBuildLogsPath = await (0, xcodeBuildLogs_1.findXcodeBuildLogsPathAsync)(path_1.default.resolve(ctx.projectTargetDirectory, '../logs'));
43
+ if (xcodeBuildLogsPath) {
44
+ await ctx.runtimeApi.uploadArtifacts(context_1.ArtifactType.XCODE_BUILD_LOGS, [xcodeBuildLogsPath], logger);
45
+ }
46
+ })(),
47
+ ]);
48
+ if (archiveUpload.status === 'rejected') {
49
+ logger.error('Failed to upload application archive.');
50
+ throw archiveUpload.reason;
51
+ }
52
+ if (artifactsUpload.status === 'rejected') {
53
+ logger.error('Failed to upload build artifacts.');
54
+ throw artifactsUpload.reason;
55
+ }
56
+ if (xcodeBuildLogsUpload.status === 'rejected') {
57
+ logger.error(`Failed to upload Xcode build logs. ${xcodeBuildLogsUpload.reason}`);
58
+ }
59
+ logger.info('Upload finished');
24
60
  },
25
61
  });
26
62
  }
27
63
  exports.createFindAndUploadBuildArtifactsBuildFunction = createFindAndUploadBuildArtifactsBuildFunction;
64
+ function resolveIosArtifactPath(job) {
65
+ if (job.applicationArchivePath) {
66
+ return job.applicationArchivePath;
67
+ }
68
+ else if (job.simulator) {
69
+ return 'ios/build/Build/Products/*simulator/*.app';
70
+ }
71
+ else {
72
+ return 'ios/build/*.ipa';
73
+ }
74
+ }
28
75
  //# sourceMappingURL=findAndUploadBuildArtifacts.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"findAndUploadBuildArtifacts.js","sourceRoot":"","sources":["../../../../src/steps/functions/eas/findAndUploadBuildArtifacts.ts"],"names":[],"mappings":";;;AAAA,uDAAyD;AACzD,uCAA4C;AAG5C,wDAGkC;AAClC,kDAA2D;AAE3D,SAAgB,8CAA8C,CAC5D,GAAoB;IAEpB,OAAO,IAAI,qBAAa,CAAC;QACvB,SAAS,EAAE,KAAK;QAChB,EAAE,EAAE,iCAAiC;QACrC,IAAI,EAAE,iCAAiC;QACvC,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE;;YACrB,MAAM,+BAA+B,GACnC,GAAG,CAAC,GAAG,CAAC,QAAQ,KAAK,wBAAQ,CAAC,OAAO;gBACnC,CAAC,CAAC,MAAA,GAAG,CAAC,GAAG,CAAC,sBAAsB,mCAAI,0CAA0C;gBAC9E,CAAC,CAAC,IAAA,6BAAmB,EAAC,GAA4B,CAAC,CAAC;YACxD,MAAM,IAAA,oCAAwB,EAAC,GAAG,EAAE;gBAClC,MAAM,EAAE,QAAQ,CAAC,MAAM;gBACvB,OAAO,EAAE,QAAQ,CAAC,gBAAgB;gBAClC,aAAa,EAAE,+BAA+B;aAC/C,CAAC,CAAC;YACH,MAAM,IAAA,4CAAgC,EAAC,GAAG,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;QAC/D,CAAC;KACF,CAAC,CAAC;AACL,CAAC;AApBD,wGAoBC","sourcesContent":["import { Ios, Job, Platform } from '@expo/eas-build-job';\nimport { BuildFunction } from '@expo/steps';\n\nimport { BuildContext } from '../../../context';\nimport {\n maybeFindAndUploadBuildArtifacts,\n uploadApplicationArchive,\n} from '../../../utils/artifacts';\nimport { resolveArtifactPath } from '../../../ios/resolve';\n\nexport function createFindAndUploadBuildArtifactsBuildFunction<T extends Job>(\n ctx: BuildContext<T>\n): BuildFunction {\n return new BuildFunction({\n namespace: 'eas',\n id: 'find_and_upload_build_artifacts',\n name: 'Find and upload build artifacts',\n fn: async (stepsCtx) => {\n const applicationArchivePatternOrPath =\n ctx.job.platform === Platform.ANDROID\n ? ctx.job.applicationArchivePath ?? 'android/app/build/outputs/**/*.{apk,aab}'\n : resolveArtifactPath(ctx as BuildContext<Ios.Job>);\n await uploadApplicationArchive(ctx, {\n logger: stepsCtx.logger,\n rootDir: stepsCtx.workingDirectory,\n patternOrPath: applicationArchivePatternOrPath,\n });\n await maybeFindAndUploadBuildArtifacts(ctx, stepsCtx.logger);\n },\n });\n}\n"]}
1
+ {"version":3,"file":"findAndUploadBuildArtifacts.js","sourceRoot":"","sources":["../../../../src/steps/functions/eas/findAndUploadBuildArtifacts.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAwB;AAExB,uDAAoD;AACpD,uCAA4C;AAE5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BAC9C,MAAM,CAAC,KAAK,CAAC,sCAAsC,oBAAoB,CAAC,MAAM,EAAE,CAAC,CAAC;aACnF;YACD,MAAM,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC;QACjC,CAAC;KACF,CAAC,CAAC;AACL,CAAC;AAhFD,wGAgFC;AAED,SAAS,sBAAsB,CAAC,GAAY;IAC1C,IAAI,GAAG,CAAC,sBAAsB,EAAE;QAC9B,OAAO,GAAG,CAAC,sBAAsB,CAAC;KACnC;SAAM,IAAI,GAAG,CAAC,SAAS,EAAE;QACxB,OAAO,2CAA2C,CAAC;KACpD;SAAM;QACL,OAAO,iBAAiB,CAAC;KAC1B;AACH,CAAC","sourcesContent":["import path from 'path';\n\nimport { Ios, Platform } from '@expo/eas-build-job';\nimport { BuildFunction } from '@expo/steps';\n\nimport { ArtifactType } from '../../../context';\nimport { findArtifacts } from '../../../utils/artifacts';\nimport { findXcodeBuildLogsPathAsync } from '../../../ios/xcodeBuildLogs';\nimport { CustomBuildContext } from '../../../customBuildContext';\n\nexport function createFindAndUploadBuildArtifactsBuildFunction(\n ctx: CustomBuildContext\n): BuildFunction {\n return new BuildFunction({\n namespace: 'eas',\n id: 'find_and_upload_build_artifacts',\n name: 'Find and upload build artifacts',\n fn: async (stepCtx) => {\n const { logger } = stepCtx;\n const applicationArchivePatternOrPath =\n ctx.job.platform === Platform.ANDROID\n ? ctx.job.applicationArchivePath ?? 'android/app/build/outputs/**/*.{apk,aab}'\n : resolveIosArtifactPath(ctx.job);\n const applicationArchives = await findArtifacts(\n stepCtx.workingDirectory,\n applicationArchivePatternOrPath,\n logger\n );\n logger.info(\n `Application archive${\n applicationArchives.length > 1 ? 's' : ''\n }: ${applicationArchives.join(', ')}`\n );\n const buildArtifacts = (\n await Promise.all(\n (ctx.job.buildArtifactPaths ?? []).map((path) =>\n findArtifacts(ctx.projectTargetDirectory, path, logger)\n )\n )\n ).flat();\n if (buildArtifacts.length > 0) {\n logger.info(`Found additional build artifacts: ${buildArtifacts.join(', ')}`);\n }\n\n logger.info('Uploading...');\n const [archiveUpload, artifactsUpload, xcodeBuildLogsUpload] = await Promise.allSettled([\n ctx.runtimeApi.uploadArtifacts(\n ArtifactType.APPLICATION_ARCHIVE,\n applicationArchives,\n logger\n ),\n (async () => {\n if (buildArtifacts.length > 0) {\n await ctx.runtimeApi.uploadArtifacts(\n ArtifactType.BUILD_ARTIFACTS,\n buildArtifacts,\n logger\n );\n }\n })(),\n (async () => {\n if (ctx.job.platform !== Platform.IOS) {\n return;\n }\n const xcodeBuildLogsPath = await findXcodeBuildLogsPathAsync(\n path.resolve(ctx.projectTargetDirectory, '../logs')\n );\n if (xcodeBuildLogsPath) {\n await ctx.runtimeApi.uploadArtifacts(\n ArtifactType.XCODE_BUILD_LOGS,\n [xcodeBuildLogsPath],\n logger\n );\n }\n })(),\n ]);\n if (archiveUpload.status === 'rejected') {\n logger.error('Failed to upload application archive.');\n throw archiveUpload.reason;\n }\n if (artifactsUpload.status === 'rejected') {\n logger.error('Failed to upload build artifacts.');\n throw artifactsUpload.reason;\n }\n if (xcodeBuildLogsUpload.status === 'rejected') {\n logger.error(`Failed to upload Xcode build logs. ${xcodeBuildLogsUpload.reason}`);\n }\n logger.info('Upload finished');\n },\n });\n}\n\nfunction resolveIosArtifactPath(job: Ios.Job): string {\n if (job.applicationArchivePath) {\n return job.applicationArchivePath;\n } else if (job.simulator) {\n return 'ios/build/Build/Products/*simulator/*.app';\n } else {\n return 'ios/build/*.ipa';\n }\n}\n"]}
@@ -1,4 +1,5 @@
1
- import { Job } from '@expo/eas-build-job';
2
- import { BuildFunction } from '@expo/steps';
3
- import { BuildContext } from '../../../context';
4
- export declare function createInstallNodeModulesBuildFunction<T extends Job>(ctx: BuildContext<T>): BuildFunction;
1
+ import { BuildFunction, BuildStepEnv } from '@expo/steps';
2
+ import { BuildStepContext } from '@expo/steps/dist_esm/BuildStepContext';
3
+ import { CustomBuildContext } from '../../../customBuildContext';
4
+ export declare function createInstallNodeModulesBuildFunction(ctx: CustomBuildContext): BuildFunction;
5
+ export declare function installNodeModules(stepCtx: BuildStepContext, ctx: CustomBuildContext, env: BuildStepEnv): Promise<void>;
@@ -1,20 +1,44 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createInstallNodeModulesBuildFunction = void 0;
6
+ exports.installNodeModules = exports.createInstallNodeModulesBuildFunction = void 0;
4
7
  const steps_1 = require("@expo/steps");
5
- const installDependencies_1 = require("../../../common/installDependencies");
8
+ const turtle_spawn_1 = __importDefault(require("@expo/turtle-spawn"));
9
+ const packageManager_1 = require("../../../utils/packageManager");
10
+ const project_1 = require("../../../utils/project");
6
11
  function createInstallNodeModulesBuildFunction(ctx) {
7
12
  return new steps_1.BuildFunction({
8
13
  namespace: 'eas',
9
14
  id: 'install_node_modules',
10
15
  name: 'Install node modules',
11
- fn: async (stepsCtx) => {
12
- await (0, installDependencies_1.installDependenciesAsync)(ctx, {
13
- logger: stepsCtx.logger,
14
- workingDir: stepsCtx.workingDirectory,
15
- });
16
+ fn: async (stepCtx, { env }) => {
17
+ await installNodeModules(stepCtx, ctx, env);
16
18
  },
17
19
  });
18
20
  }
19
21
  exports.createInstallNodeModulesBuildFunction = createInstallNodeModulesBuildFunction;
22
+ async function installNodeModules(stepCtx, ctx, env) {
23
+ const { logger } = stepCtx;
24
+ const packageManager = (0, packageManager_1.resolvePackageManager)(ctx.projectTargetDirectory);
25
+ const packagerRunDir = (0, packageManager_1.findPackagerRootDir)(stepCtx.workingDirectory);
26
+ let args = ['install'];
27
+ if (packageManager === packageManager_1.PackageManager.PNPM) {
28
+ args = ['install', '--no-frozen-lockfile'];
29
+ }
30
+ else if (packageManager === packageManager_1.PackageManager.YARN) {
31
+ const isYarn2 = await (0, project_1.isUsingYarn2)(stepCtx.workingDirectory);
32
+ if (isYarn2) {
33
+ args = ['install', '--no-immutable'];
34
+ }
35
+ }
36
+ logger.info(`Running "${packageManager} ${args.join(' ')}" in ${packagerRunDir} directory`);
37
+ await (0, turtle_spawn_1.default)(packageManager, args, {
38
+ cwd: packagerRunDir,
39
+ logger: stepCtx.logger,
40
+ env,
41
+ });
42
+ }
43
+ exports.installNodeModules = installNodeModules;
20
44
  //# sourceMappingURL=installNodeModules.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"installNodeModules.js","sourceRoot":"","sources":["../../../../src/steps/functions/eas/installNodeModules.ts"],"names":[],"mappings":";;;AACA,uCAA4C;AAG5C,6EAA+E;AAE/E,SAAgB,qCAAqC,CACnD,GAAoB;IAEpB,OAAO,IAAI,qBAAa,CAAC;QACvB,SAAS,EAAE,KAAK;QAChB,EAAE,EAAE,sBAAsB;QAC1B,IAAI,EAAE,sBAAsB;QAC5B,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE;YACrB,MAAM,IAAA,8CAAwB,EAAC,GAAG,EAAE;gBAClC,MAAM,EAAE,QAAQ,CAAC,MAAM;gBACvB,UAAU,EAAE,QAAQ,CAAC,gBAAgB;aACtC,CAAC,CAAC;QACL,CAAC;KACF,CAAC,CAAC;AACL,CAAC;AAdD,sFAcC","sourcesContent":["import { Job } from '@expo/eas-build-job';\nimport { BuildFunction } from '@expo/steps';\n\nimport { BuildContext } from '../../../context';\nimport { installDependenciesAsync } from '../../../common/installDependencies';\n\nexport function createInstallNodeModulesBuildFunction<T extends Job>(\n ctx: BuildContext<T>\n): BuildFunction {\n return new BuildFunction({\n namespace: 'eas',\n id: 'install_node_modules',\n name: 'Install node modules',\n fn: async (stepsCtx) => {\n await installDependenciesAsync(ctx, {\n logger: stepsCtx.logger,\n workingDir: stepsCtx.workingDirectory,\n });\n },\n });\n}\n"]}
1
+ {"version":3,"file":"installNodeModules.js","sourceRoot":"","sources":["../../../../src/steps/functions/eas/installNodeModules.ts"],"names":[],"mappings":";;;;;;AAAA,uCAA0D;AAE1D,sEAAuC;A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,EAAE,OAAO,CAAC,MAAM;QACtB,GAAG;KACJ,CAAC,CAAC;AACL,CAAC;AAvBD,gDAuBC","sourcesContent":["import { BuildFunction, BuildStepEnv } from '@expo/steps';\nimport { BuildStepContext } from '@expo/steps/dist_esm/BuildStepContext';\nimport spawn from '@expo/turtle-spawn';\n\nimport { CustomBuildContext } from '../../../customBuildContext';\nimport {\n findPackagerRootDir,\n PackageManager,\n resolvePackageManager,\n} from '../../../utils/packageManager';\nimport { isUsingYarn2 } from '../../../utils/project';\n\nexport function createInstallNodeModulesBuildFunction(ctx: CustomBuildContext): BuildFunction {\n return new BuildFunction({\n namespace: 'eas',\n id: 'install_node_modules',\n name: 'Install node modules',\n fn: async (stepCtx, { env }) => {\n await installNodeModules(stepCtx, ctx, env);\n },\n });\n}\n\nexport async function installNodeModules(\n stepCtx: BuildStepContext,\n ctx: CustomBuildContext,\n env: BuildStepEnv\n): Promise<void> {\n const { logger } = stepCtx;\n const packageManager = resolvePackageManager(ctx.projectTargetDirectory);\n const packagerRunDir = findPackagerRootDir(stepCtx.workingDirectory);\n let args = ['install'];\n if (packageManager === PackageManager.PNPM) {\n args = ['install', '--no-frozen-lockfile'];\n } else if (packageManager === PackageManager.YARN) {\n const isYarn2 = await isUsingYarn2(stepCtx.workingDirectory);\n if (isYarn2) {\n args = ['install', '--no-immutable'];\n }\n }\n logger.info(`Running \"${packageManager} ${args.join(' ')}\" in ${packagerRunDir} directory`);\n await spawn(packageManager, args, {\n cwd: packagerRunDir,\n logger: stepCtx.logger,\n env,\n });\n}\n"]}
@@ -1,4 +1,3 @@
1
- import { Job } from '@expo/eas-build-job';
2
1
  import { BuildFunction } from '@expo/steps';
3
- import { BuildContext } from '../../../context';
4
- export declare function createPrebuildBuildFunction<T extends Job>(ctx: BuildContext<T>): BuildFunction;
2
+ import { CustomBuildContext } from '../../../customBuildContext';
3
+ export declare function createPrebuildBuildFunction(ctx: CustomBuildContext): BuildFunction;
@@ -1,8 +1,13 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
6
  exports.createPrebuildBuildFunction = void 0;
4
7
  const steps_1 = require("@expo/steps");
5
- const prebuild_1 = require("../../../common/prebuild");
8
+ const turtle_spawn_1 = __importDefault(require("@expo/turtle-spawn"));
9
+ const packageManager_1 = require("../../../utils/packageManager");
10
+ const installNodeModules_1 = require("./installNodeModules");
6
11
  function createPrebuildBuildFunction(ctx) {
7
12
  return new steps_1.BuildFunction({
8
13
  namespace: 'eas',
@@ -11,36 +16,90 @@ function createPrebuildBuildFunction(ctx) {
11
16
  inputProviders: [
12
17
  steps_1.BuildStepInput.createProvider({
13
18
  id: 'skip_dependency_update',
14
- defaultValue: false,
15
- allowedValueTypeName: steps_1.BuildStepInputValueTypeName.BOOLEAN,
19
+ required: false,
20
+ allowedValueTypeName: steps_1.BuildStepInputValueTypeName.STRING,
16
21
  }),
17
22
  steps_1.BuildStepInput.createProvider({
18
23
  id: 'clean',
19
24
  defaultValue: false,
20
25
  allowedValueTypeName: steps_1.BuildStepInputValueTypeName.BOOLEAN,
21
26
  }),
22
- steps_1.BuildStepInput.createProvider({
23
- id: 'apple_team_id',
24
- required: false,
25
- }),
26
27
  ],
27
- fn: async (stepsCtx, { inputs }) => {
28
- var _a;
28
+ fn: async (stepCtx, { inputs, env }) => {
29
+ const { logger } = stepCtx;
29
30
  // TODO: make sure we can pass Apple Team ID to prebuild when adding credentials for custom builds
30
- const extraEnvs = inputs.apple_team_id.value
31
- ? { APPLE_TEAM_ID: inputs.apple_team_id.value.toString() }
32
- : {};
33
- await (0, prebuild_1.prebuildAsync)(ctx, {
34
- logger: stepsCtx.logger,
35
- workingDir: stepsCtx.workingDirectory,
36
- options: {
37
- extraEnvs,
38
- clean: !!inputs.clean.value,
39
- skipDependencyUpdate: (_a = inputs.skip_dependency_update.value) === null || _a === void 0 ? void 0 : _a.toString(),
40
- },
31
+ const packageManager = (0, packageManager_1.resolvePackageManager)(ctx.projectTargetDirectory);
32
+ const prebuildCommandArgs = getPrebuildCommandArgs(ctx.job, {
33
+ clean: inputs.clean.value,
34
+ skipDependencyUpdate: inputs.skip_dependency_update.value,
41
35
  });
36
+ const argsWithExpo = ['expo', ...prebuildCommandArgs];
37
+ const options = {
38
+ cwd: stepCtx.workingDirectory,
39
+ logger,
40
+ env: {
41
+ EXPO_IMAGE_UTILS_NO_SHARP: '1',
42
+ ...env,
43
+ },
44
+ };
45
+ if (packageManager === packageManager_1.PackageManager.NPM) {
46
+ await (0, turtle_spawn_1.default)('npx', argsWithExpo, options);
47
+ }
48
+ else if (packageManager === packageManager_1.PackageManager.YARN) {
49
+ await (0, turtle_spawn_1.default)('yarn', argsWithExpo, options);
50
+ }
51
+ else if (packageManager === packageManager_1.PackageManager.PNPM) {
52
+ await (0, turtle_spawn_1.default)('pnpm', argsWithExpo, options);
53
+ }
54
+ else {
55
+ throw new Error(`Unsupported package manager: ${packageManager}`);
56
+ }
57
+ await (0, installNodeModules_1.installNodeModules)(stepCtx, ctx, env);
42
58
  },
43
59
  });
44
60
  }
45
61
  exports.createPrebuildBuildFunction = createPrebuildBuildFunction;
62
+ function getPrebuildCommandArgs(job, { clean, skipDependencyUpdate }) {
63
+ var _a;
64
+ if ((_a = job.experimental) === null || _a === void 0 ? void 0 : _a.prebuildCommand) {
65
+ return sanitizeUserDefinedPrebuildCommand(job.experimental.prebuildCommand, job.platform, {
66
+ clean,
67
+ skipDependencyUpdate,
68
+ });
69
+ }
70
+ return [
71
+ 'prebuild',
72
+ '--no-install',
73
+ '--platform',
74
+ job.platform,
75
+ ...(skipDependencyUpdate ? ['--skip-dependency-update', skipDependencyUpdate] : []),
76
+ ...(clean ? ['--clean'] : []),
77
+ ];
78
+ }
79
+ // TODO: deprecate prebuildCommand in eas.json
80
+ function sanitizeUserDefinedPrebuildCommand(userDefinedPrebuildCommand, platform, { clean, skipDependencyUpdate }) {
81
+ let prebuildCommand = userDefinedPrebuildCommand;
82
+ if (!prebuildCommand.match(/(?:--platform| -p)/)) {
83
+ prebuildCommand = `${prebuildCommand} --platform ${platform}`;
84
+ }
85
+ if (skipDependencyUpdate) {
86
+ prebuildCommand = `${prebuildCommand} --skip-dependency-update ${skipDependencyUpdate}`;
87
+ }
88
+ if (clean) {
89
+ prebuildCommand = `${prebuildCommand} --clean`;
90
+ }
91
+ const npxCommandPrefix = 'npx ';
92
+ const expoCommandPrefix = 'expo ';
93
+ const expoCliCommandPrefix = 'expo-cli ';
94
+ if (prebuildCommand.startsWith(npxCommandPrefix)) {
95
+ prebuildCommand = prebuildCommand.substring(npxCommandPrefix.length).trim();
96
+ }
97
+ if (prebuildCommand.startsWith(expoCommandPrefix)) {
98
+ prebuildCommand = prebuildCommand.substring(expoCommandPrefix.length).trim();
99
+ }
100
+ if (prebuildCommand.startsWith(expoCliCommandPrefix)) {
101
+ prebuildCommand = prebuildCommand.substring(expoCliCommandPrefix.length).trim();
102
+ }
103
+ return prebuildCommand.split(' ');
104
+ }
46
105
  //# sourceMappingURL=prebuild.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"prebuild.js","sourceRoot":"","sources":["../../../../src/steps/functions/eas/prebuild.ts"],"names":[],"mappings":";;;AACA,uCAAyF;AAGzF,uDAAyD;AAEzD,SAAgB,2BAA2B,CAAgB,GAAoB;IAC7E,OAAO,IAAI,qBAAa,CAAC;QACvB,SAAS,EAAE,KAAK;QAChB,EAAE,EAAE,UAAU;QACd,IAAI,EAAE,UAAU;QAChB,cAAc,EAAE;YACd,sBAAc,CAAC,cAAc,CAAC;gBAC5B,EAAE,EAAE,wBAAwB;gBAC5B,YAAY,EAAE,KAAK;gBACnB,oBAAoB,EAAE,mCAA2B,CAAC,OAAO;aAC1D,CAAC;YACF,sBAAc,CAAC,cAAc,CAAC;gBAC5B,EAAE,EAAE,OAAO;gBACX,YAAY,EAAE,KAAK;gBACnB,oBAAoB,EAAE,mCAA2B,CAAC,OAAO;aAC1D,CAAC;YACF,sBAAc,CAAC,cAAc,CAAC;gBAC5B,EAAE,EAAE,eAAe;gBACnB,QAAQ,EAAE,KAAK;aAChB,CAAC;SACH;QACD,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE;;YACjC,kGAAkG;YAClG,MAAM,SAAS,GAA2B,MAAM,CAAC,aAAa,CAAC,KAAK;gBAClE,CAAC,CAAC,EAAE,aAAa,EAAE,MAAM,CAAC,aAAa,CAAC,KAAK,CAAC,QAAQ,EAAE,EAAE;gBAC1D,CAAC,CAAC,EAAE,CAAC;YACP,MAAM,IAAA,wBAAa,EAAC,GAAG,EAAE;gBACvB,MAAM,EAAE,QAAQ,CAAC,MAAM;gBACvB,UAAU,EAAE,QAAQ,CAAC,gBAAgB;gBACrC,OAAO,EAAE;oBACP,SAAS;oBACT,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK;oBAC3B,oBAAoB,EAAE,MAAA,MAAM,CAAC,sBAAsB,CAAC,KAAK,0CAAE,QAAQ,EAAE;iBACtE;aACF,CAAC,CAAC;QACL,CAAC;KACF,CAAC,CAAC;AACL,CAAC;AArCD,kEAqCC","sourcesContent":["import { Job } from '@expo/eas-build-job';\nimport { BuildFunction, BuildStepInput, BuildStepInputValueTypeName } from '@expo/steps';\n\nimport { BuildContext } from '../../../context';\nimport { prebuildAsync } from '../../../common/prebuild';\n\nexport function createPrebuildBuildFunction<T extends Job>(ctx: BuildContext<T>): BuildFunction {\n return new BuildFunction({\n namespace: 'eas',\n id: 'prebuild',\n name: 'Prebuild',\n inputProviders: [\n BuildStepInput.createProvider({\n id: 'skip_dependency_update',\n defaultValue: false,\n allowedValueTypeName: BuildStepInputValueTypeName.BOOLEAN,\n }),\n BuildStepInput.createProvider({\n id: 'clean',\n defaultValue: false,\n allowedValueTypeName: BuildStepInputValueTypeName.BOOLEAN,\n }),\n BuildStepInput.createProvider({\n id: 'apple_team_id',\n required: false,\n }),\n ],\n fn: async (stepsCtx, { inputs }) => {\n // TODO: make sure we can pass Apple Team ID to prebuild when adding credentials for custom builds\n const extraEnvs: Record<string, string> = inputs.apple_team_id.value\n ? { APPLE_TEAM_ID: inputs.apple_team_id.value.toString() }\n : {};\n await prebuildAsync(ctx, {\n logger: stepsCtx.logger,\n workingDir: stepsCtx.workingDirectory,\n options: {\n extraEnvs,\n clean: !!inputs.clean.value,\n skipDependencyUpdate: inputs.skip_dependency_update.value?.toString(),\n },\n });\n },\n });\n}\n"]}
1
+ {"version":3,"file":"prebuild.js","sourceRoot":"","sources":["../../../../src/steps/functions/eas/prebuild.ts"],"names":[],"mappings":";;;;;;AAEA,uCAAyF;AACzF,sEAAuC;AAGvC,kEAAsF;AAEtF,6DAA0D;AAO1D,SAAgB,2BAA2B,CAAC,GAAuB;IACjE,OAAO,IAAI,qBAAa,CAAC;QACvB,SAAS,EAAE,KAAK;QAChB,EAAE,EAAE,UAAU;QACd,IAAI,EAAE,UAAU;QAChB,cAAc,EAAE;YACd,sBAAc,CAAC,cAAc,CAAC;gBAC5B,EAAE,EAAE,wBAAwB;gBAC5B,QAAQ,EAAE,KAAK;gBACf,oBAAoB,EAAE,mCAA2B,CAAC,MAAM;aACzD,CAAC;YACF,sBAAc,CAAC,cAAc,CAAC;gBAC5B,EAAE,EAAE,OAAO;gBACX,YAAY,EAAE,KAAK;gBACnB,oBAAoB,EAAE,mCAA2B,CAAC,OAAO;aAC1D,CAAC;SACH;QACD,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,EAAE,EAAE;YACrC,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC;YAC3B,kGAAkG;YAClG,MAAM,cAAc,GAAG,IAAA,sCAAqB,EAAC,GAAG,CAAC,sBAAsB,CAAC,CAAC;YACzE,MAAM,mBAAmB,GAAG,sBAAsB,CAAC,GAAG,CAAC,GAAG,EAAE;gBAC1D,KAAK,EAA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CAAC,CAAC,IAAI,EAAE,CAAC;KACjF;IACD,OAAO,eAAe,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;AACpC,CAAC","sourcesContent":["import { Platform } from '@expo/config';\nimport { Job } from '@expo/eas-build-job';\nimport { BuildFunction, BuildStepInput, BuildStepInputValueTypeName } from '@expo/steps';\nimport spawn from '@expo/turtle-spawn';\n\nimport { CustomBuildContext } from '../../../customBuildContext';\nimport { PackageManager, resolvePackageManager } from '../../../utils/packageManager';\n\nimport { installNodeModules } from './installNodeModules';\n\ntype PrebuildOptions = {\n clean?: boolean;\n skipDependencyUpdate?: string;\n};\n\nexport function createPrebuildBuildFunction(ctx: CustomBuildContext): BuildFunction {\n return new BuildFunction({\n namespace: 'eas',\n id: 'prebuild',\n name: 'Prebuild',\n inputProviders: [\n BuildStepInput.createProvider({\n id: 'skip_dependency_update',\n required: false,\n allowedValueTypeName: BuildStepInputValueTypeName.STRING,\n }),\n BuildStepInput.createProvider({\n id: 'clean',\n defaultValue: false,\n allowedValueTypeName: BuildStepInputValueTypeName.BOOLEAN,\n }),\n ],\n fn: async (stepCtx, { inputs, env }) => {\n const { logger } = stepCtx;\n // TODO: make sure we can pass Apple Team ID to prebuild when adding credentials for custom builds\n const packageManager = resolvePackageManager(ctx.projectTargetDirectory);\n const prebuildCommandArgs = getPrebuildCommandArgs(ctx.job, {\n clean: inputs.clean.value as boolean,\n skipDependencyUpdate: inputs.skip_dependency_update.value as string,\n });\n const argsWithExpo = ['expo', ...prebuildCommandArgs];\n const options = {\n cwd: stepCtx.workingDirectory,\n logger,\n env: {\n EXPO_IMAGE_UTILS_NO_SHARP: '1',\n ...env,\n },\n };\n if (packageManager === PackageManager.NPM) {\n await spawn('npx', argsWithExpo, options);\n } else if (packageManager === PackageManager.YARN) {\n await spawn('yarn', argsWithExpo, options);\n } else if (packageManager === PackageManager.PNPM) {\n await spawn('pnpm', argsWithExpo, options);\n } else {\n throw new Error(`Unsupported package manager: ${packageManager}`);\n }\n await installNodeModules(stepCtx, ctx, env);\n },\n });\n}\n\nfunction getPrebuildCommandArgs(\n job: Job,\n { clean, skipDependencyUpdate }: PrebuildOptions\n): string[] {\n if (job.experimental?.prebuildCommand) {\n return sanitizeUserDefinedPrebuildCommand(job.experimental.prebuildCommand, job.platform, {\n clean,\n skipDependencyUpdate,\n });\n }\n return [\n 'prebuild',\n '--no-install',\n '--platform',\n job.platform,\n ...(skipDependencyUpdate ? ['--skip-dependency-update', skipDependencyUpdate] : []),\n ...(clean ? ['--clean'] : []),\n ];\n}\n\n// TODO: deprecate prebuildCommand in eas.json\nfunction sanitizeUserDefinedPrebuildCommand(\n userDefinedPrebuildCommand: string,\n platform: Platform,\n { clean, skipDependencyUpdate }: PrebuildOptions\n): string[] {\n let prebuildCommand = userDefinedPrebuildCommand;\n if (!prebuildCommand.match(/(?:--platform| -p)/)) {\n prebuildCommand = `${prebuildCommand} --platform ${platform}`;\n }\n if (skipDependencyUpdate) {\n prebuildCommand = `${prebuildCommand} --skip-dependency-update ${skipDependencyUpdate}`;\n }\n if (clean) {\n prebuildCommand = `${prebuildCommand} --clean`;\n }\n const npxCommandPrefix = 'npx ';\n const expoCommandPrefix = 'expo ';\n const expoCliCommandPrefix = 'expo-cli ';\n if (prebuildCommand.startsWith(npxCommandPrefix)) {\n prebuildCommand = prebuildCommand.substring(npxCommandPrefix.length).trim();\n }\n if (prebuildCommand.startsWith(expoCommandPrefix)) {\n prebuildCommand = prebuildCommand.substring(expoCommandPrefix.length).trim();\n }\n if (prebuildCommand.startsWith(expoCliCommandPrefix)) {\n prebuildCommand = prebuildCommand.substring(expoCliCommandPrefix.length).trim();\n }\n return prebuildCommand.split(' ');\n}\n"]}
@@ -1,4 +1,3 @@
1
- import { Job } from '@expo/eas-build-job';
2
1
  import { BuildFunction } from '@expo/steps';
3
- import { BuildContext } from '../../../context';
4
- export declare function createSetUpNpmrcBuildFunction<T extends Job>(ctx: BuildContext<T>): BuildFunction;
2
+ import { CustomBuildContext } from '../../../customBuildContext';
3
+ export declare function createSetUpNpmrcBuildFunction(ctx: CustomBuildContext): BuildFunction;
@@ -1,15 +1,40 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
6
  exports.createSetUpNpmrcBuildFunction = void 0;
7
+ const path_1 = __importDefault(require("path"));
8
+ const fs_extra_1 = __importDefault(require("fs-extra"));
4
9
  const steps_1 = require("@expo/steps");
5
- const npmrc_1 = require("../../../utils/npmrc");
10
+ const packageManager_1 = require("../../../utils/packageManager");
11
+ const NPMRC_TEMPLATE_PATH = path_1.default.join(__dirname, '../../templates/npmrc');
6
12
  function createSetUpNpmrcBuildFunction(ctx) {
7
13
  return new steps_1.BuildFunction({
8
14
  namespace: 'eas',
9
15
  id: 'use_npm_token',
10
16
  name: 'Use NPM_TOKEN',
11
- fn: async (stepsCtx) => {
12
- await (0, npmrc_1.setUpNpmrcAsync)(ctx, stepsCtx.logger);
17
+ fn: async (stepCtx, { env }) => {
18
+ const { logger } = stepCtx;
19
+ if (env.NPM_TOKEN) {
20
+ logger.info('We detected that you set the NPM_TOKEN environment variable');
21
+ const projectNpmrcPath = path_1.default.join(ctx.projectTargetDirectory, '.npmrc');
22
+ if (await fs_extra_1.default.pathExists(projectNpmrcPath)) {
23
+ logger.info('.npmrc already exists in your project directory, skipping generation');
24
+ }
25
+ else {
26
+ const npmrcContents = await fs_extra_1.default.readFile(NPMRC_TEMPLATE_PATH, 'utf8');
27
+ logger.info('Creating .npmrc in your project directory with the following contents:');
28
+ logger.info(npmrcContents);
29
+ await fs_extra_1.default.copy(NPMRC_TEMPLATE_PATH, projectNpmrcPath);
30
+ }
31
+ }
32
+ else {
33
+ const projectNpmrcPath = path_1.default.join((0, packageManager_1.findPackagerRootDir)(stepCtx.workingDirectory), '.npmrc');
34
+ if (await fs_extra_1.default.pathExists(projectNpmrcPath)) {
35
+ logger.info(`.npmrc found at ${path_1.default.relative(ctx.projectTargetDirectory, projectNpmrcPath)}`);
36
+ }
37
+ }
13
38
  },
14
39
  });
15
40
  }
@@ -1 +1 @@
1
- {"version":3,"file":"setUpNpmrc.js","sourceRoot":"","sources":["../../../../src/steps/functions/eas/setUpNpmrc.ts"],"names":[],"mappings":";;;AACA,uCAA4C;AAG5C,gDAAuD;AAEvD,SAAgB,6BAA6B,CAAgB,GAAoB;IAC/E,OAAO,IAAI,qBAAa,CAAC;QACvB,SAAS,EAAE,KAAK;QAChB,EAAE,EAAE,eAAe;QACnB,IAAI,EAAE,eAAe;QACrB,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE;YACrB,MAAM,IAAA,uBAAe,EAAC,GAAG,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;QAC9C,CAAC;KACF,CAAC,CAAC;AACL,CAAC;AATD,sEASC","sourcesContent":["import { Job } from '@expo/eas-build-job';\nimport { BuildFunction } from '@expo/steps';\n\nimport { BuildContext } from '../../../context';\nimport { setUpNpmrcAsync } from '../../../utils/npmrc';\n\nexport function createSetUpNpmrcBuildFunction<T extends Job>(ctx: BuildContext<T>): BuildFunction {\n return new BuildFunction({\n namespace: 'eas',\n id: 'use_npm_token',\n name: 'Use NPM_TOKEN',\n fn: async (stepsCtx) => {\n await setUpNpmrcAsync(ctx, stepsCtx.logger);\n },\n });\n}\n"]}
1
+ {"version":3,"file":"setUpNpmrc.js","sourceRoot":"","sources":["../../../../src/steps/functions/eas/setUpNpmrc.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAwB;AAExB,wDAA0B;AAC1B,uCAA4C;AAG5C,kEAAoE;AAEpE,MAAM,mBAAmB,GAAG,cAAI,CAAC,IAAI,CAAC,SAAS,EAAE,uBAAuB,CAAC,CAAC;AAE1E,SAAgB,6BAA6B,CAAC,GAAuB;IACnE,OAAO,IAAI,qBAAa,CAAC;QACvB,SAAS,EAAE,KAAK;QAChB,EAAE,EAAE,eAAe;QACnB,IAAI,EAAE,eAAe;QACrB,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE;YAC7B,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC;YAC3B,IAAI,GAAG,CAAC,SAAS,EAAE;gBACjB,MAAM,CAAC,IAAI,CAAC,6DAA6D,CAAC,CAAC;gBAC3E,MAAM,gBAAgB,GAAG,cAAI,CAAC,IAAI,CAAC,GAAG,CAAC,sBAAsB,EAAE,QAAQ,CAAC,CAAC;gBACzE,IAAI,MAAM,kBAAE,CAAC,UAAU,CAAC,gBAAgB,CAAC,EAAE;oBACzC,MAAM,CAAC,IAAI,CAAC,sEAAsE,CAAC,CAAC;iBACrF;qBAAM;oBACL,MAAM,aAAa,GAAG,MAAM,kBAAE,CAAC,QAAQ,CAAC,mBAAmB,EAAE,MAAM,CAAC,CAAC;oBACrE,MAAM,CAAC,IAAI,CAAC,wEAAwE,CAAC,CAAC;oBACtF,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;oBAC3B,MAAM,kBAAE,CAAC,IAAI,CAAC,mBAAmB,EAAE,gBAAgB,CAAC,CAAC;iBACtD;aACF;iBAAM;gBACL,MAAM,gBAAgB,GAAG,cAAI,CAAC,IAAI,CAAC,IAAA,oCAAmB,EAAC,OAAO,CAAC,gBAAgB,CAAC,EAAE,QAAQ,CAAC,CAAC;gBAC5F,IAAI,MAAM,kBAAE,CAAC,UAAU,CAAC,gBAAgB,CAAC,EAAE;oBACzC,MAAM,CAAC,IAAI,CACT,mBAAmB,cAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,sBAAsB,EAAE,gBAAgB,CAAC,EAAE,CACjF,CAAC;iBACH;aACF;QACH,CAAC;KACF,CAAC,CAAC;AACL,CAAC;AA5BD,sEA4BC","sourcesContent":["import path from 'path';\n\nimport fs from 'fs-extra';\nimport { BuildFunction } from '@expo/steps';\n\nimport { CustomBuildContext } from '../../../customBuildContext';\nimport { findPackagerRootDir } from '../../../utils/packageManager';\n\nconst NPMRC_TEMPLATE_PATH = path.join(__dirname, '../../templates/npmrc');\n\nexport function createSetUpNpmrcBuildFunction(ctx: CustomBuildContext): BuildFunction {\n return new BuildFunction({\n namespace: 'eas',\n id: 'use_npm_token',\n name: 'Use NPM_TOKEN',\n fn: async (stepCtx, { env }) => {\n const { logger } = stepCtx;\n if (env.NPM_TOKEN) {\n logger.info('We detected that you set the NPM_TOKEN environment variable');\n const projectNpmrcPath = path.join(ctx.projectTargetDirectory, '.npmrc');\n if (await fs.pathExists(projectNpmrcPath)) {\n logger.info('.npmrc already exists in your project directory, skipping generation');\n } else {\n const npmrcContents = await fs.readFile(NPMRC_TEMPLATE_PATH, 'utf8');\n logger.info('Creating .npmrc in your project directory with the following contents:');\n logger.info(npmrcContents);\n await fs.copy(NPMRC_TEMPLATE_PATH, projectNpmrcPath);\n }\n } else {\n const projectNpmrcPath = path.join(findPackagerRootDir(stepCtx.workingDirectory), '.npmrc');\n if (await fs.pathExists(projectNpmrcPath)) {\n logger.info(\n `.npmrc found at ${path.relative(ctx.projectTargetDirectory, projectNpmrcPath)}`\n );\n }\n }\n },\n });\n}\n"]}