-
Notifications
You must be signed in to change notification settings - Fork 532
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
feat(build-tools): Add build-infrastructure package #22853
Merged
tylerbutler
merged 9 commits into
microsoft:main
from
tylerbutler:bt-build-infra-interfaces-only-01
Oct 22, 2024
Merged
feat(build-tools): Add build-infrastructure package #22853
tylerbutler
merged 9 commits into
microsoft:main
from
tylerbutler:bt-build-infra-interfaces-only-01
Oct 22, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
github-actions
bot
added
area: build
Build related issues
public api change
Changes to a public API
base: main
PRs targeted against main branch
labels
Oct 20, 2024
msfluid-bot
reviewed
Oct 20, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
⯅ @fluid-example/bundle-size-tests: +245 Bytes
Baseline commit: 5c17a9c |
1 task
tylerbutler
changed the title
improvement(build-tools): Add build-infrastructure package
feat(build-tools): Add build-infrastructure package
Oct 22, 2024
tylerbutler
commented
Oct 22, 2024
build-tools/packages/build-infrastructure/api-report/build-infrastructure.api.md
Show resolved
Hide resolved
zhenmichael
approved these changes
Oct 22, 2024
jzaffiro
approved these changes
Oct 22, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved for docs!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
area: build
Build related issues
base: main
PRs targeted against main branch
public api change
Changes to a public API
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Note
This PR is one of several. This PR creates a new private package and establishes some interfaces only. Future changes will add implementations of those interfaces and additional APIs.
@fluid-tools/build-infrastructure
This change introduces a new package containing types and helper functions that will be used across multiple build-tools packages, including
@fluidframework/build-tools
and@fluid-tools/build-cli
.The primary purpose of this package is to provide a common way to enumerate Packages, Release Groups, and Workspaces
across a Fluid repo.
The package is private and nothing depends on it yet, so it should cause no problems when merged in its current state.
Important
I have found it easiest to write this as a new package, but I am not fanatical about this. There are practical reasons why a package is a little easier right now (the direction of dependencies between the packages in particular) but for the purposes of this review, if you think this should be organized into modules within an existing package instead, try and ignore that feedback for now and focus on the function and scope of the code.
Background
Today both fluid-build and build-cli (flub) need to understand the layout of the repo - what packages belong to what release groups, what folders are workspace roots vs. independent packages, etc. We have been using the types and classes from fluid-build in the flub code, but the relationship has always been strange because flub has a concept of release groups while fluid-build uses a MonoRepo class which is analogous to a Workspace.
Conceptually, Release Groups and Workspaces are distinct, but in code there is not a strong representation of the "release group" concept. In flub we use the MonoRepo class and a
type ReleaseGroup = string
together as a stand-in for the ReleaseGroup concept which has meant that release groups and workspaces (the MonoRepo class) are more or less the same thing in practice.That has always been a very weird situation that has gotten complicated as the repo has grown, and now we find that we want the benefits of interdependencies in between packages provided by workspaces but the flexibility of releasing and versioning groups of packages within those workspaces. These changes are a step towards that future.
The goal
The eventual goal state - far beyond this PR - is to have all the shared types and data about the repo layout and other shared code in the build-infrastructure package, and then have flub and fluid-build be in individual packages. They shouldn't depend on each other - all the shared logic - especially the types - should be in the infra package.
How the API and interfaces were developed
The interfaces exposed by this package were extracted from the uses of packages and release groups in build-tools and build-cli. The minimal set of properties and functions necessary by both of those packages was used. In some cases, duplicative properties or functions were removed. For example, the Package type had
dependencies
andcombinedDependencies
; now it just has the latter and the caller can filter out what it doesn't want or extend the shared interface.Tips for reviewers
I generated API docs for the package using TypeDoc (had problems with api-markdown-documenter that I am following up on). To reivew the APIs in a more readable format, I suggest viewing them directly on my fork:
https://github.com/tylerbutler/FluidFramework/blob/bt-build-infra-interfaces-only-01/build-tools/packages/build-infrastructure/docs/README.md#classes