Skip to content

refactor(project): Add TaskDefinitions and task-level build signatures#1412

Merged
matz3 merged 4 commits into
mainfrom
refactor/add-task-build-sig
Jun 16, 2026
Merged

refactor(project): Add TaskDefinitions and task-level build signatures#1412
matz3 merged 4 commits into
mainfrom
refactor/add-task-build-sig

Conversation

@RandomByte

@RandomByte RandomByte commented Jun 15, 2026

Copy link
Copy Markdown
Member

Extract the task-list construction out of TaskRunner into a new
TaskDefinitions class which owns the project-type to build-definition
switch, the standard task map, and the custom task validation and
de-duplication loop.

Each standard task in a build definition can expose an async
determineBuildSignature() returning a string contribution; the
fallback is JSON.stringify(taskDef.options). Custom tasks expose the
same via the determineBuildSignature named export of their module,
surfaced through Task#getDetermineBuildSignatureCallback, and must
declare specVersion >= 5.0 to use it. getProjectSignature mixes the
aggregated string in alongside the existing inputs.

Split ProjectBuildContext into a synchronous wiring phase (logger,
TaskUtil, TaskDefinitions) and a static create() that resolves task
signatures, computes the project signature, and constructs the
ProjectBuildCache. create() parameters are reordered to
(buildContext, project, baseSignature, cacheManager).

Add TaskUtil#getReadOnlyInterface(specVersion) for passing into the
determineBuildSignature callback before the task has run.

Also Include builder and fs version into project build signature.

@RandomByte RandomByte requested a review from a team June 15, 2026 12:36
@RandomByte RandomByte changed the title refactor/add task build sig refactor(project): Add TaskDefinitions and task-level build signatures Jun 15, 2026
@RandomByte RandomByte force-pushed the refactor/add-task-build-sig branch 2 times, most recently from a35ade0 to 250e4fc Compare June 15, 2026 13:21
Comment thread packages/project/lib/build/helpers/ProjectBuildContext.js Outdated
Comment thread packages/project/lib/build/TaskDefinitions.js
Extract the task-list construction out of TaskRunner into a new
TaskDefinitions class which owns the project-type to build-definition
switch, the standard task map, and the custom task validation and
de-duplication loop.

Each standard task in a build definition can expose an async
`determineBuildSignature()` returning a string contribution; the
fallback is `JSON.stringify(taskDef.options)`. Custom tasks expose the
same via the `determineBuildSignature` named export of their module,
surfaced through `Task#getDetermineBuildSignatureCallback`, and must
declare specVersion >= 5.0 to use it. `getProjectSignature` mixes the
aggregated string in alongside the existing inputs.

Split ProjectBuildContext into a synchronous wiring phase (logger,
TaskUtil, TaskDefinitions) and a static `create()` that resolves task
signatures, computes the project signature, and constructs the
ProjectBuildCache. `create()` parameters are reordered to
`(buildContext, project, baseSignature, cacheManager)`.

Add `TaskUtil#getReadOnlyInterface(specVersion)` for passing into the
`determineBuildSignature` callback before the task has run.
@RandomByte RandomByte force-pushed the refactor/add-task-build-sig branch from 8ebbe9c to ee6d9e2 Compare June 16, 2026 09:25
…er-safe

The API sidebar in .vitepress/config.ts is built by walking
fs.readdirSync("docs/api") and merging entries into a tree. Two issues
were causing failures and inconsistencies:

- readdirSync returns entries in filesystem order (insertion order on
  Linux, alphabetical on macOS APFS). When a "module-..." leaf file
  was processed before a sibling that needed to nest under the same
  name (e.g. module-@ui5_logger.md before @ui5_logger_Logger.md), the
  recursion crashed with "Cannot read properties of undefined (reading
  'push')" because the leaf had no items array. This broke the
  build:vitepress step on GitHub Actions.
- Even when it succeeded, sibling order in the generated sidebar
  varied across platforms.

Fixes:
- Sort the readdir result so the input order — and therefore the
  resulting tree — is identical across filesystems.
- Make appendToTree defensive: when a leaf and a branch share a name,
  merge them by promoting the leaf to a branch and attaching the
  module doc as a 'main' child, in either order. This keeps the build
  working even if the sort is removed or the file set changes.
@matz3 matz3 merged commit 3f9dce7 into main Jun 16, 2026
59 checks passed
@matz3 matz3 deleted the refactor/add-task-build-sig branch June 16, 2026 13:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants