Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ This is the log of notable changes to EAS CLI and related packages.
### 🎉 New features

- [eas-cli] Make `eas simulator` the canonical command and keep `eas simulator:start` as an alias. ([#4112](https://github.com/expo/eas-cli/pull/4112) by [@szdziedzic](https://github.com/szdziedzic))
- [eas-cli] Validate local composite functions referenced from workflow job hooks during `eas workflow:validate`. ([#4064](https://github.com/expo/eas-cli/pull/4064) by [@sswrk](https://github.com/sswrk))

### 🐛 Bug fixes

Expand Down
14 changes: 7 additions & 7 deletions packages/build-tools/src/builders/custom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import {
BuildStepGlobalContext,
BuildWorkflow,
StepsConfigParser,
buildLocalCompositeFunctionCatalogAsync,
createLocalCompositeFunctionLoader,
errors,
} from '@expo/steps';
import assert from 'assert';
Expand All @@ -17,10 +19,6 @@ import { Artifacts, BuildContext } from '../context';
import { CustomBuildContext } from '../customBuildContext';
import { Datadog } from '../datadog';
import { findAndUploadXcodeBuildLogsAsync } from '../ios/xcodeBuildLogs';
import {
buildCompositeFunctionCatalogAsync,
createCompositeFunctionLoader,
} from '../steps/compositeFunctions';
import { getEasFunctionGroups } from '../steps/easFunctionGroups';
import { getEasFunctions } from '../steps/easFunctions';
import { retryAsync } from '../utils/retry';
Expand Down Expand Up @@ -72,11 +70,13 @@ export async function runCustomBuildAsync(ctx: BuildContext<BuildJob>): Promise<
steps: ctx.job.steps,
hooks: ctx.job.hooks,
// Eager for job steps (always run), lazy loader for hooks (running anchors only).
compositeFunctionCatalog: await buildCompositeFunctionCatalogAsync(projectRoot, {
steps: ctx.job.steps,
compositeFunctionCatalog: await buildLocalCompositeFunctionCatalogAsync(projectRoot, {
rootSteps: ctx.job.steps,
logger: ctx.logger,
}),
loadCompositeFunction: createLocalCompositeFunctionLoader(projectRoot, {
logger: ctx.logger,
}),
loadCompositeFunction: createCompositeFunctionLoader(projectRoot, ctx.logger),
})
: new BuildConfigParser(globalContext, {
externalFunctions: easFunctions,
Expand Down
6 changes: 3 additions & 3 deletions packages/build-tools/src/common/jobHooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ import {
BuildStepGlobalContext,
HookEntry,
constructHookEntriesAsync,
createLocalCompositeFunctionLoader,
extendCompositeFunctionCatalogFromStepsAsync,
validateHookStepsAsync,
} from '@expo/steps';

import { BuildContext } from '../context';
import { CustomBuildContext } from '../customBuildContext';
import { createCompositeFunctionLoader } from '../steps/compositeFunctions';
import { getEasFunctionGroups } from '../steps/easFunctionGroups';
import { getEasFunctions } from '../steps/easFunctions';

Expand Down Expand Up @@ -99,9 +99,9 @@ export async function parseJobHooksAsync<TJob extends BuildJob>(
const hookEntriesByKey: Partial<Record<HookKey, HookEntry[]>> = {};
const orderedSteps: BuildStep[] = [];
const compositeFunctionCatalog: CompositeFunctionCatalog = {};
const loadCompositeFunction = createCompositeFunctionLoader(
const loadCompositeFunction = createLocalCompositeFunctionLoader(
ctx.getReactNativeProjectDirectory(),
ctx.logger
{ logger: ctx.logger }
);
for (const anchor of wrappedAnchors) {
for (const side of ['before', 'after'] as const) {
Expand Down
21 changes: 13 additions & 8 deletions packages/build-tools/src/generic.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
import { BuildPhase, Generic } from '@expo/eas-build-job';
import { Result, asyncResult } from '@expo/results';
import { BuildStepGlobalContext, BuildWorkflow, StepsConfigParser, errors } from '@expo/steps';
import {
BuildStepGlobalContext,
BuildWorkflow,
StepsConfigParser,
buildLocalCompositeFunctionCatalogAsync,
createLocalCompositeFunctionLoader,
errors,
} from '@expo/steps';
import fs from 'fs/promises';
import nullthrows from 'nullthrows';

import { prepareProjectSourcesAsync } from './common/projectSources';
import { BuildContext } from './context';
import { CustomBuildContext } from './customBuildContext';
import {
buildCompositeFunctionCatalogAsync,
createCompositeFunctionLoader,
} from './steps/compositeFunctions';
import { getEasFunctionGroups } from './steps/easFunctionGroups';
import { getEasFunctions } from './steps/easFunctions';
import { uploadJobOutputsToWwwAsync } from './utils/outputs';
Expand Down Expand Up @@ -51,8 +54,8 @@ export async function runGenericJobAsync(
try {
const projectRoot = ctx.getReactNativeProjectDirectory(customBuildCtx.projectSourceDirectory);
// Eager for job steps (always run), lazy loader for hooks (running anchors only).
const compositeFunctionCatalog = await buildCompositeFunctionCatalogAsync(projectRoot, {
steps: ctx.job.steps,
const compositeFunctionCatalog = await buildLocalCompositeFunctionCatalogAsync(projectRoot, {
rootSteps: ctx.job.steps,
logger: ctx.logger,
});

Expand All @@ -62,7 +65,9 @@ export async function runGenericJobAsync(
steps: ctx.job.steps,
hooks: ctx.job.hooks,
compositeFunctionCatalog,
loadCompositeFunction: createCompositeFunctionLoader(projectRoot, ctx.logger),
loadCompositeFunction: createLocalCompositeFunctionLoader(projectRoot, {
logger: ctx.logger,
}),
});

return await parser.parseAsync();
Expand Down
201 changes: 0 additions & 201 deletions packages/build-tools/src/steps/__tests__/compositeFunctions.test.ts

This file was deleted.

Loading
Loading