feat(build-tools): Add build-infrastructure package (#22853)

# @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.**

## 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 change - 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` and
`combinedDependencies`; now it just has the latter and the caller can
filter out what it doesn't want or extend the shared interface.
This commit is contained in:
Tyler Butler 2024-10-22 15:44:59 -07:00 коммит произвёл GitHub
Родитель 6251e16cf1
Коммит b8e887ead4
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
82 изменённых файлов: 6687 добавлений и 16 удалений

207
_repoLayout.config.cjs Normal file
Просмотреть файл

@ -0,0 +1,207 @@
/*!
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
* Licensed under the MIT License.
*/
/**
* This file will be renamed to repoLayout.config.cjs in a future change. Right now it is an example of what the
* IFluidRepoLayout config would look like for our main FluidFramework repo.
*/
// Enable TypeScript type-checking for this file.
// See https://www.typescriptlang.org/docs/handbook/intro-to-js-ts.html#ts-check
// @ts-check
/**
* All fluid scopes EXCEPT for @fluid-example
*/
const fluidScopes = [
"@fluidframework",
"@fluid-experimental",
"@fluid-internal",
"@fluid-private",
"@fluid-tools",
];
/**
* The settings in this file configure the repo layout used by build-tools, such as fluid-build and flub.
*
* @type {import("@fluid-tools/build-infrastructure").IFluidRepoLayout}
*/
module.exports = {
version: 1,
repoLayout: {
workspaces: {
"client": {
directory: ".",
releaseGroups: {
client: {
include: [...fluidScopes, "fluid-framework", "@types/jest-environment-puppeteer"],
rootPackageName: "client-release-group-root",
defaultInterdependencyRange: "workspace:~",
},
examples: {
include: ["@fluid-example"],
defaultInterdependencyRange: "workspace:~",
},
},
},
"build-tools": {
directory: "./build-tools",
releaseGroups: {
"build-tools": {
include: [...fluidScopes, "@fluid-example"],
rootPackageName: "build-tools-release-group-root",
defaultInterdependencyRange: "workspace:~",
adoPipelineUrl:
"https://dev.azure.com/fluidframework/internal/_build?definitionId=14",
},
},
},
"server": {
directory: "./server/routerlicious",
releaseGroups: {
"server": {
include: [...fluidScopes, "@fluid-example", "tinylicious"],
rootPackageName: "server-release-group-root",
defaultInterdependencyRange: "workspace:~",
adoPipelineUrl:
"https://dev.azure.com/fluidframework/internal/_build?definitionId=30",
},
},
},
"gitrest": {
directory: "server/gitrest",
releaseGroups: {
"gitrest": {
include: [...fluidScopes, "@fluid-example"],
rootPackageName: "gitrest-release-group-root",
defaultInterdependencyRange: "workspace:~",
adoPipelineUrl:
"https://dev.azure.com/fluidframework/internal/_build?definitionId=26",
},
},
},
"historian": {
directory: "server/historian",
releaseGroups: {
"historian": {
include: [...fluidScopes, "@fluid-example"],
rootPackageName: "historian-release-group-root",
defaultInterdependencyRange: "workspace:~",
adoPipelineUrl:
"https://dev.azure.com/fluidframework/internal/_build?definitionId=25",
},
},
},
// legacy independent packages are all in their own workspaces, and are single-package release groups
"@fluid-tools/api-markdown-documenter": {
directory: "tools/api-markdown-documenter",
releaseGroups: {
"api-markdown-documenter": {
include: ["@fluid-tools/api-markdown-documenter"],
rootPackageName: "@fluid-tools/api-markdown-documenter",
defaultInterdependencyRange: "workspace:~",
adoPipelineUrl:
"https://dev.azure.com/fluidframework/internal/_build?definitionId=97",
},
},
},
"@fluid-tools/benchmark": {
directory: "tools/benchmark",
releaseGroups: {
"benchmark": {
include: ["@fluid-tools/benchmark"],
rootPackageName: "@fluid-tools/benchmark",
defaultInterdependencyRange: "workspace:~",
adoPipelineUrl:
"https://dev.azure.com/fluidframework/internal/_build?definitionId=62",
},
},
},
"@fluidframework/build-common": {
directory: "common/build/build-common",
releaseGroups: {
"build-common": {
include: ["@fluidframework/build-common"],
rootPackageName: "@fluidframework/build-common",
defaultInterdependencyRange: "workspace:~",
adoPipelineUrl:
"https://dev.azure.com/fluidframework/internal/_build?definitionId=3",
},
},
},
"@fluidframework/common-utils": {
directory: "common/lib/common-utils",
releaseGroups: {
"common-utils": {
include: ["@fluidframework/common-utils"],
rootPackageName: "@fluidframework/common-utils",
defaultInterdependencyRange: "workspace:~",
adoPipelineUrl:
"https://dev.azure.com/fluidframework/internal/_build?definitionId=10",
},
},
},
"@fluidframework/eslint-config-fluid": {
directory: "common/build/eslint-config-fluid",
releaseGroups: {
"eslint-config-fluid": {
include: ["@fluidframework/eslint-config-fluid"],
rootPackageName: "@fluidframework/eslint-config-fluid",
defaultInterdependencyRange: "workspace:~",
adoPipelineUrl:
"https://dev.azure.com/fluidframework/internal/_build?definitionId=7",
},
},
},
"@fluid-internal/eslint-plugin-fluid": {
directory: "common/build/eslint-plugin-fluid",
releaseGroups: {
"eslint-plugin-fluid": {
include: ["@fluid-internal/eslint-plugin-fluid"],
rootPackageName: "@fluid-internal/eslint-plugin-fluid",
defaultInterdependencyRange: "workspace:~",
adoPipelineUrl:
"https://dev.azure.com/fluidframework/internal/_build?definitionId=135",
},
},
},
"@fluid-internal/getkeys": {
directory: "tools/getkeys",
releaseGroups: {
"getkeys": {
include: ["@fluid-internal/getkeys"],
rootPackageName: "@fluid-internal/getkeys",
defaultInterdependencyRange: "workspace:~",
},
},
},
"@fluidframework/protocol-definitions": {
directory: "common/lib/protocol-definitions",
releaseGroups: {
"protocol-definitions": {
include: ["@fluidframework/protocol-definitions"],
rootPackageName: "@fluidframework/protocol-definitions",
defaultInterdependencyRange: "workspace:~",
adoPipelineUrl:
"https://dev.azure.com/fluidframework/internal/_build?definitionId=67",
},
},
},
"@fluidframework/test-tools": {
directory: "tools/test-tools",
releaseGroups: {
"test-tools": {
include: ["@fluidframework/test-tools"],
rootPackageName: "@fluidframework/test-tools",
defaultInterdependencyRange: "workspace:~",
adoPipelineUrl:
"https://dev.azure.com/fluidframework/internal/_build?definitionId=13",
},
},
},
},
},
};

Просмотреть файл

@ -1,5 +1,5 @@
{
"name": "root",
"name": "build-tools-release-group-root",
"version": "0.50.0",
"private": true,
"homepage": "https://fluidframework.com",

Просмотреть файл

@ -54,8 +54,8 @@ describe("flub test-only-filter", () => {
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
const output: jsonOutput = JSON.parse(ctx.stdout);
const { selected, filtered } = output;
expect(selected).to.be.ofSize(4);
expect(filtered).to.be.ofSize(4);
expect(selected).to.be.ofSize(5);
expect(filtered).to.be.ofSize(5);
});
test

Просмотреть файл

@ -55,6 +55,7 @@ describe("filterPackages", () => {
const names = actual.map((p) => p.name);
expect(names).to.be.equalTo([
"@fluid-tools/build-cli",
"@fluid-tools/build-infrastructure",
"@fluidframework/build-tools",
"@fluidframework/bundle-size-tools",
"@fluid-tools/version-tools",
@ -117,7 +118,11 @@ describe("filterPackages", () => {
};
const actual = await filterPackages(packages, filters);
const names = actual.map((p) => p.name);
expect(names).to.be.equalTo(["@fluid-tools/build-cli", "@fluid-tools/version-tools"]);
expect(names).to.be.equalTo([
"@fluid-tools/build-cli",
"@fluid-tools/build-infrastructure",
"@fluid-tools/version-tools",
]);
});
it("scope and skipScope", async () => {
@ -151,6 +156,7 @@ describe("selectAndFilterPackages", () => {
expect(names).to.be.containingAllOf([
"@fluid-tools/build-cli",
"@fluid-tools/build-infrastructure",
"@fluidframework/build-tools",
"@fluidframework/bundle-size-tools",
"@fluid-tools/version-tools",
@ -206,6 +212,7 @@ describe("selectAndFilterPackages", () => {
expect(names).to.be.equalTo([
"@fluid-tools/build-cli",
"@fluid-tools/build-infrastructure",
"@fluidframework/build-tools",
"@fluidframework/bundle-size-tools",
"@fluid-tools/version-tools",
@ -330,7 +337,11 @@ describe("selectAndFilterPackages", () => {
const { filtered } = await selectAndFilterPackages(context, selectionOptions, filters);
const names = filtered.map((p) => p.name);
expect(names).to.be.equalTo(["@fluid-tools/build-cli", "@fluid-tools/version-tools"]);
expect(names).to.be.equalTo([
"@fluid-tools/build-cli",
"@fluid-tools/build-infrastructure",
"@fluid-tools/version-tools",
]);
});
it("select release group, filter skipScopes", async () => {

Просмотреть файл

@ -0,0 +1,38 @@
/*!
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
* Licensed under the MIT License.
*/
module.exports = {
plugins: ["@typescript-eslint", "chai-friendly"],
extends: [
// eslint-disable-next-line node/no-extraneous-require
require.resolve("@fluidframework/eslint-config-fluid/recommended"),
"prettier",
],
parserOptions: {
project: ["./tsconfig.json", "./src/test/tsconfig.json"],
},
rules: {
// This package is exclusively used in a Node.js context
"import/no-nodejs-modules": "off",
"tsdoc/syntax": ["warn"],
},
overrides: [
{
// Rules only for test files
files: ["*.spec.ts", "src/test/**"],
rules: {
// Test files can import from anywhere
"import/no-internal-modules": "off",
// Superseded by chai-friendly/no-unused-expressions
"no-unused-expressions": "off",
"@typescript-eslint/no-unused-expressions": "off",
"chai-friendly/no-unused-expressions": "error",
},
},
],
};

11
build-tools/packages/build-infrastructure/.gitignore поставляемый Normal file
Просмотреть файл

@ -0,0 +1,11 @@
*-debug.log
*-error.log
/.nyc_output
/coverage
/dist
/lib
!/src/lib
!/test/lib
/tmp
node_modules
oclif.manifest.json

Просмотреть файл

@ -0,0 +1,7 @@
{
"require": ["ts-node/register"],
"watch-extensions": ["ts", "cts", "mts"],
"recursive": true,
"reporter": "mocha-multi-reporters",
"reporter-options": "configFile=mocha-multi-reporter-config.json"
}

Просмотреть файл

@ -0,0 +1,14 @@
.eslintignore
.eslintrc.cjs
.mocharc.json
.prettierignore
*.log
**/_api-extractor-temp/**
**/*.tsbuildinfo
dist/test
docs
lib/test
nyc
packlist.txt
src
test

Просмотреть файл

@ -0,0 +1,3 @@
# Ignore all files. This package only uses biome for formatting.
**/*.*
*/*

Просмотреть файл

@ -0,0 +1,21 @@
Copyright (c) Microsoft Corporation and contributors. All rights reserved.
MIT License
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

Просмотреть файл

@ -0,0 +1,239 @@
# @fluid-tools/build-infrastructure
This package contains types and helper functions that are 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 organize npm packages into groups called release
groups, and leverages workspaces functionality provided by package managers like npm, yarn, and pnpm to manage
interdependencies between packages across a Fluid repo. It then provides APIs to select, filter, and work with those
package groups.
## API Overview
The API is built around four key types which form a hierarchy: `IFluidRepo`, `IWorkspace`, `IReleaseGroup`, and
`IPackage`. For the purposes of this documentation, the terms "Fluid repo," "workspace," "release group," and "package"
generally refer to these types.
Conceptually, a **Fluid repo** is a way to organize npm packages into groups for versioning, release, and dependency
management. A Fluid repo can contain multiple **workspaces**, each of which may contain one or more **release groups**.
### The Fluid repo
The primary entrypoint for the API is the `IFluidRepo` type. A Fluid repo can contain multiple workspaces and release
groups. Both workspaces and release groups represent ways to organize packages in the repo, but their purpose and
function are different.
### Workspaces
Workspaces are generally a feature provided by the package manager (npm, yarn, pnpm, etc.). A workspace defines the
_physical layout_ of the packages within it. A workspace is rooted in a particular folder, and uses the configuration
within that folder to determine what packages it contains. The config used is specific to the package manager.
The workspace is also the boundary at which dependencies are installed and managed. When you install dependencies for a
package in a workspace, all dependencies for all packages in the workspace will be installed. Within a workspace, it is
trivial to link multiple packages so they can depend on one another. The `IWorkspace` type is a thin wrapper on top of
these package manager features.
Importantly, this package does not attempt to re-implement any features provided by workspaces themselves. Users are
expected to configure their package managers' workspace features in addition to the Fluid repo configuration.
A Fluid repo will only load packages identified by the package manager's workspace feature. That is, any package in the
repo that is not configured as part of a workspace is invisible to tools using the Fluid repo.
### Release groups
While workspaces manage dependencies and physical layout of packages, release groups are focused on groups of packages
that are _versioned and released together_. Release groups are always a subset of a workspace, and must contain at least
one package. **Release groups cannot span multiple workspaces.**
> [!IMPORTANT]
> A workspace _must_ have at least one release group, and all packages must be a part of a release group.
> [!NOTE]
> In the v0 version of build-tools, release groups and workspaces have a 1:1 relationship. In contrast, with the types
> defined here in build-infrastructure, workspaces can contain multiple release groups.
### Packages
Packages are the lowest-level entity in build-infrastructure. A package _must_ be a part of both a release group and
workspace in order to be managed with build-infrastructure. In general, developers should prefer using release groups -
which are ultimately just groups of packages - to working with individual packages.
### What about "independent packages?"
In the v0 version of build-tools, we have the concept of _independent packages_: packages that are not part of a release
group and are released independently. **This concept no longer exists. There are only release groups.** Packages that
release independently can either be part of a single-package workspace (and release group), or they can be part of
another larger workspace, contained within a single-package release group.
## Features
### Git repo capabilities
A Fluid repo is often contained within a Git repository, and some functionality expects to be used within a Git
repository. Features that need to execute Git operations can asynchronously retrieve the SimpleGit instance using the
`IFluidRepo.getGitRepository` API. If the Fluid repo is not within a Git repo, then that call will throw a
`NotInGitRepository` exception that callers should handle appropriately. If they don't, though, the exception makes it
clear what has happened.
> [!NOTE]
>
> This design addresses a major problem with build-tools v0, which was that code often made assumptions that it was
> operating within a Git repo. That's often true, and some fetures can and should only work in that context, but the
> implementation attempted to load the Git functionality blindly and would fail outright outside a Git context. With
> `IFluidRepo`, the Git integration is more loosely coupled and the APIs make it clearer that it is not safe to assume
> the presence of a Git repo.
### Package selection and filtering APIs
The `IFluidRepo` object provides access to workspaces, release groups, and their constituent packages, but often one wants
to operate on a subset of all packages in the repo. To support this, build-infrastructure provides a selection and
filtering API. Packages can be selected based on criteria like workspace and release group, and the lists can be further
filtered by scope or private/not private. Advanced filtering not covered by the built-in filters can be implemented
using `Array.prototype.filter` on the results of package selection.
### Built-in command-line tool to examine repo layout and config
The included CLI tool makes it easy to examine the contents and layout of a Fluid repo. See [the CLI
documentation](./docs/cli.md) for more information.
### Loading old config formats
The `repoPackages` configuration currently used by fluid-build will be loaded if the newer `repoLayout` config can't be
found. This is for back-compat only and will not be maintained indefinitely. Users should convert to `repoLayout` when
possible.
## Configuration
Configuration for the repo layout is stored in a config file at the root of the repo. This can either be part of the
`fluidBuild.config.cjs` file in the `repoLayout` property, or in an independent config file named
`repoLayout.config.cjs` (or mjs).
### Example
The following example configures three workspaces demonstrating the three archetypes - a workspace with multiple release
groups, a workspace with a single release group that contains multiple packages, and a workspace with a single release
group that contains a single package.
```js
repoLayout: {
workspaces: {
// This is the name of the workspace which is how it's referenced in the API. All workspaces in a Fluid repo must
// have a unique name.
"client": {
// This workspace is rooted at the root of the Git repo.
directory: ".",
releaseGroups: {
// This key is the name of the release group. All release groups in a Fluid repo must have a unique name.
client: {
// The include property can contain package names OR package scopes. If
// a scope is provided, all packages with that scope will be a part of
// the release group.
include: [
// Include all the Fluid Framework scopes and packages except for
// @fluid-example.
"@fluidframework",
"@fluid-experimental",
"@fluid-internal",
"@fluid-private",
"@fluid-tools",
// This private package is part of the client release group
"@types/jest-environment-puppeteer"
"fluid-framework",
],
// A release group can have an OPTIONAL root package. This package
// is typically private and is similar to the root package for a workspace.
// This release group root package may be useful to store scripts or other
// configuration that only applies on the release group,
rootPackageName: "client-release-group-root",
// A release group may have an ADO pipeline URL associated with it. This
// URL is used to provide direct links to the pipeline when running releases.
adoPipelineUrl:
"https://dev.azure.com/fluidframework/internal/_build?definitionId=12",
},
examples: {
// This release group contains only the @fluid-example packages.
include: ["@fluid-example"],
// Release group root packages are optional but can be useful to store scripts that are tuned to
// apply to only that release group.
rootPackageName: "examples-release-group-root",
},
// If any packages in the workspace don't match a release group, loading the
// repo layout config will throw an error.
},
},
"build-tools": {
// This workspace is rooted in the build-tools folder. This folder must contain
// a workspace config. The specific config depends on the package manager being used.
directory: "./build-tools",
releaseGroups: {
// Release groups can have the same name as workspaces, but all release group names
// must be unique regardless of the workspace they belong to.
"build-tools": {
include: [
// Include all Fluid Framework scopes. Only packages contained in the workspace
// will be included, so it is safe to use the same scopes in multiple release
// group definitions as long as they're in different workspaces.
"@fluidframework",
"@fluid-example",
"@fluid-experimental",
"@fluid-internal",
"@fluid-private",
"@fluid-tools",
],
rootPackageName: "build-tools-release-group-root",
adoPipelineUrl:
"https://dev.azure.com/fluidframework/internal/_build?definitionId=14",
},
},
},
},
}
```
### Loading a Fluid repo from a configuration file
To load a Fluid repo, you use the `loadFluidRepo` function. You can pass in a path to a Git repository root, or if one
is not provided, then the Git repository nearest to the working directory can be used.
This function will look for a repo layout configuration in that folder and load the workspaces, release groups, and
packages accordingly and return an `IFluidRepo` object that includes Maps of workspaces, release groups, and packages as
properties.
## Other APIs
### Type guards
You can use the `isIPackage` and `isIReleaseGroup` functions to determine if an object is an `IPackage` or
`IReleaseGroup` respectively.
### Base classes
The `PackageBase` abstract class can be used as a base class to create custom `IPackage` classes.
## Miscellaneous improvements
### Fluid repos can be rooted anywhere
Fluid repos are rooted where their config file is located, _not_ at the root of a Git repo. There can be multiple Fluid
repos within a Git repo, though this is usually only needed for testing. In typical use only a single Fluid repo per
Git repo is needed. However, the Fluid repo does _not_ need to be rooted at the root of Git repo, and code should not
assume that the root of the Fluid repo is the same as the root of a Git repo.
### Better testing
There is now a test project within the repo that is a fully functional Fluid repo. There are basic unit tests that verify the
loading of the Fluid repo config and that packages are organized as expected. This is a dramatic improvement from v0
build-tools, in which all package traversal logic was effectively untested.
There are also tests for the selection and filtering APIs.
This infrastructure also provides a foundation for further test improvements, and testing other new features of Fluid
repos. In the past it was challenging to add new features because there was no way to test those features effectively.
That should be much easier now.
## Known gaps
- Inadequate testing of git-related APIs - can we mock git somehow?

Просмотреть файл

@ -0,0 +1,5 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
"extends": "../../api-extractor-base.json",
"mainEntryPointFilePath": "<projectFolder>/lib/index.d.ts"
}

Просмотреть файл

@ -0,0 +1,25 @@
/*!
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
* Licensed under the MIT License.
*/
import path from "node:path";
import { fileURLToPath } from "node:url";
import { MarkdownRenderer, loadModel } from "@fluid-tools/api-markdown-documenter";
const dirname = path.dirname(fileURLToPath(import.meta.url));
const inputDir = path.resolve(dirname, "_api-extractor-temp", "doc-models");
const outputDir = path.resolve(dirname, "docs");
console.debug(dirname, inputDir, outputDir);
// Create the API Model from our API reports
const apiModel = await loadModel(inputDir);
const config = {
apiModel,
uriRoot: ".",
};
await MarkdownRenderer.renderApiModel(config, outputDir);

Просмотреть файл

@ -0,0 +1,190 @@
## API Report File for "@fluid-tools/build-infrastructure"
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
```ts
import type { Opaque } from 'type-fest';
import type { PackageJson as PackageJson_2 } from 'type-fest';
import type { SetRequired } from 'type-fest';
import { SimpleGit } from 'simple-git';
// @public
export type AdditionalPackageProps = Record<string, string> | undefined;
// @public
export interface FluidPackageJsonFields {
pnpm?: {
overrides?: Record<string, string>;
};
}
// @public
export const FLUIDREPO_CONFIG_VERSION = 1;
// @public
export function getFluidRepoLayout(searchPath: string, noCache?: boolean): {
config: IFluidRepoLayout;
configFilePath: string;
};
// @public @deprecated
export interface IFluidBuildDir {
directory: string;
// @deprecated
ignoredDirs?: string[];
}
// @public @deprecated (undocumented)
export type IFluidBuildDirEntry = string | IFluidBuildDir | (string | IFluidBuildDir)[];
// @public @deprecated (undocumented)
export interface IFluidBuildDirs {
// (undocumented)
[name: string]: IFluidBuildDirEntry;
}
// @public
export interface IFluidRepo<P extends IPackage = IPackage> extends Reloadable {
configuration: IFluidRepoLayout;
getGitRepository(): Promise<Readonly<SimpleGit>>;
getPackageReleaseGroup(pkg: Readonly<P>): Readonly<IReleaseGroup>;
getPackageWorkspace(pkg: Readonly<P>): Readonly<IWorkspace>;
packages: Map<PackageName, P>;
relativeToRepo(p: string): string;
releaseGroups: Map<ReleaseGroupName, IReleaseGroup>;
root: string;
upstreamRemotePartialUrl?: string;
workspaces: Map<WorkspaceName, IWorkspace>;
}
// @public
export interface IFluidRepoLayout {
repoLayout?: {
workspaces: {
[name: string]: WorkspaceDefinition;
};
};
// @deprecated
repoPackages?: IFluidBuildDirs;
version: typeof FLUIDREPO_CONFIG_VERSION;
}
// @public
export interface Installable {
checkInstall(): Promise<boolean>;
install(updateLockfile: boolean): Promise<boolean>;
}
// @public
export interface IPackage<J extends PackageJson = PackageJson> extends Installable, Reloadable {
combinedDependencies: Generator<PackageDependency, void>;
readonly directory: string;
getScript(name: string): string | undefined;
isReleaseGroupRoot: boolean;
readonly isWorkspaceRoot: boolean;
readonly name: PackageName;
readonly nameColored: string;
packageJson: J;
readonly packageJsonFilePath: string;
readonly packageManager: IPackageManager;
readonly private: boolean;
releaseGroup: ReleaseGroupName;
savePackageJson(): Promise<void>;
// (undocumented)
toString(): string;
readonly version: string;
readonly workspace: IWorkspace;
}
// @public
export interface IPackageManager {
installCommand(updateLockfile: boolean): string;
readonly lockfileName: string;
readonly name: PackageManagerName;
}
// @public
export interface IReleaseGroup extends Reloadable {
readonly adoPipelineUrl?: string;
readonly name: ReleaseGroupName;
readonly packages: IPackage[];
readonly releaseGroupDependencies: IReleaseGroup[];
readonly rootPackage?: IPackage;
// (undocumented)
toString(): string;
readonly version: string;
readonly workspace: IWorkspace;
}
// @public
export function isIPackage(pkg: any): pkg is IPackage;
// @public
export function isIReleaseGroup(toCheck: Exclude<any, string | number | ReleaseGroupName | PackageName>): toCheck is IReleaseGroup;
// @public
export interface IWorkspace extends Installable, Reloadable {
directory: string;
name: WorkspaceName;
packages: IPackage[];
releaseGroups: Map<ReleaseGroupName, IReleaseGroup>;
rootPackage: IPackage;
// (undocumented)
toString(): string;
}
// @public
export class NotInGitRepository extends Error {
constructor(path: string);
// (undocumented)
readonly path: string;
}
// @public
export interface PackageDependency {
depKind: "prod" | "dev" | "peer";
name: PackageName;
version: string;
}
// @public
export type PackageJson = SetRequired<PackageJson_2 & FluidPackageJsonFields, "name" | "scripts" | "version">;
// @public
export type PackageManagerName = "npm" | "pnpm" | "yarn";
// @public
export type PackageName = Opaque<string, "PackageName">;
// @public
export interface ReleaseGroupDefinition {
adoPipelineUrl?: string;
exclude?: string[];
include: string[];
rootPackageName?: string;
}
// @public
export type ReleaseGroupName = Opaque<string, IReleaseGroup>;
// @public
export interface Reloadable {
// (undocumented)
reload(): void;
}
// @public
export interface WorkspaceDefinition {
directory: string;
releaseGroups: {
[name: string]: ReleaseGroupDefinition;
};
}
// @public
export type WorkspaceName = Opaque<string, "WorkspaceName">;
// (No @packageDocumentation comment for this package)
```

Просмотреть файл

@ -0,0 +1,3 @@
@echo off
node "%~dp0\dev" %*

Просмотреть файл

@ -0,0 +1,9 @@
#!/usr/bin/env -S node --loader ts-node/esm --no-warnings=ExperimentalWarning
/*!
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
* Licensed under the MIT License.
*/
import { execute } from "@oclif/core";
await execute({ development: true, dir: import.meta.url });

Просмотреть файл

@ -0,0 +1,3 @@
@echo off
node "%~dp0\run" %*

Просмотреть файл

@ -0,0 +1,9 @@
#!/usr/bin/env node
/*!
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
* Licensed under the MIT License.
*/
import { execute } from "@oclif/core";
await execute({ dir: import.meta.url });

Просмотреть файл

@ -0,0 +1,7 @@
{
"$schema": "./node_modules/@biomejs/biome/configuration_schema.json",
"extends": ["../../../biome.jsonc"],
"files": {
"ignore": ["src/test/data/biome/empty.jsonc"]
}
}

Просмотреть файл

@ -0,0 +1,290 @@
**@fluid-tools/build-infrastructure** • **Docs**
***
# @fluid-tools/build-infrastructure
This package contains types and helper functions that are 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 organize npm packages into groups called release
groups, and leverages workspaces functionality provided by package managers like npm, yarn, and pnpm to manage
interdependencies between packages across a Fluid repo. It then provides APIs to select, filter, and work with those
package groups.
## API Overview
The API is built around four key types which form a hierarchy: `IFluidRepo`, `IWorkspace`, `IReleaseGroup`, and
`IPackage`. For the purposes of this documentation, the terms "Fluid repo," "workspace," "release group," and "package"
generally refer to these types.
Conceptually, a **Fluid repo** is a way to organize npm packages into groups for versioning, release, and dependency
management. A Fluid repo can contain multiple **workspaces**, each of which may contain one or more **release groups**.
### The Fluid repo
The primary entrypoint for the API is the `IFluidRepo` type. A Fluid repo can contain multiple workspaces and release
groups. Both workspaces and release groups represent ways to organize packages in the repo, but their purpose and
function are different.
### Workspaces
Workspaces are generally a feature provided by the package manager (npm, yarn, pnpm, etc.). A workspace defines the
_physical layout_ of the packages within it. A workspace is rooted in a particular folder, and uses the configuration
within that folder to determine what packages it contains. The config used is specific to the package manager.
The workspace is also the boundary at which dependencies are installed and managed. When you install dependencies for a
package in a workspace, all dependencies for all packages in the workspace will be installed. Within a workspace, it is
trivial to link multiple packages so they can depend on one another. The `IWorkspace` type is a thin wrapper on top of
these package manager features.
Importantly, this package does not attempt to re-implement any features provided by workspaces themselves. Users are
expected to configure their package managers' workspace features in addition to the Fluid repo configuration.
A Fluid repo will only load packages identified by the package manager's workspace feature. That is, any package in the
repo that is not configured as part of a workspace is invisible to tools using the Fluid repo.
### Release groups
While workspaces manage dependencies and physical layout of packages, release groups are focused on groups of packages
that are _versioned and released together_. Release groups are always a subset of a workspace, and must contain at least
one package. **Release groups cannot span multiple workspaces.**
> [!IMPORTANT]
> A workspace _must_ have at least one release group, and all packages must be a part of a release group.
> [!NOTE]
> In the v0 version of build-tools, release groups and workspaces have a 1:1 relationship. In contrast, with the types
> defined here in build-infrastructure, workspaces can contain multiple release groups.
### Packages
Packages are the lowest-level entity in build-infrastructure. A package _must_ be a part of both a release group and
workspace in order to be managed with build-infrastructure. In general, developers should prefer using release groups -
which are ultimately just groups of packages - to working with individual packages.
### What about "independent packages?"
In the v0 version of build-tools, we have the concept of _independent packages_: packages that are not part of a release
group and are released independently. **This concept no longer exists. There are only release groups.** Packages that
release independently can either be part of a single-package workspace (and release group), or they can be part of
another larger workspace, contained within a single-package release group.
## Features
### Git repo capabilities
A Fluid repo is often contained within a Git repository, and some functionality expects to be used within a Git
repository. Features that need to execute Git operations can asynchronously retrieve the SimpleGit instance using the
`IFluidRepo.getGitRepository` API. If the Fluid repo is not within a Git repo, then that call will throw a
`NotInGitRepository` exception that callers should handle appropriately. If they don't, though, the exception makes it
clear what has happened.
> [!NOTE]
>
> This design addresses a major problem with build-tools v0, which was that code often made assumptions that it was
> operating within a Git repo. That's often true, and some fetures can and should only work in that context, but the
> implementation attempted to load the Git functionality blindly and would fail outright outside a Git context. With
> `IFluidRepo`, the Git integration is more loosely coupled and the APIs make it clearer that it is not safe to assume
> the presence of a Git repo.
### Package selection and filtering APIs
The `IFluidRepo` object provides access to workspaces, release groups, and their constituent packages, but often one wants
to operate on a subset of all packages in the repo. To support this, build-infrastructure provides a selection and
filtering API. Packages can be selected based on criteria like workspace and release group, and the lists can be further
filtered by scope or private/not private. Advanced filtering not covered by the built-in filters can be implemented
using `Array.prototype.filter` on the results of package selection.
### Built-in command-line tool to examine repo layout and config
The included CLI tool makes it easy to examine the contents and layout of a Fluid repo. See [the CLI
documentation](./docs/cli.md) for more information.
### Loading old config formats
The `repoPackages` configuration currently used by fluid-build will be loaded if the newer `repoLayout` config can't be
found. This is for back-compat only and will not be maintained indefinitely. Users should convert to `repoLayout` when
possible.
## Configuration
Configuration for the repo layout is stored in a config file at the root of the repo. This can either be part of the
`fluidBuild.config.cjs` file in the `repoLayout` property, or in an independent config file named
`repoLayout.config.cjs` (or mjs).
### Example
The following example configures three workspaces demonstrating the three archetypes - a workspace with multiple release
groups, a workspace with a single release group that contains multiple packages, and a workspace with a single release
group that contains a single package.
```js
repoLayout: {
workspaces: {
// This is the name of the workspace which is how it's referenced in the API. All workspaces in a Fluid repo must
// have a unique name.
"client": {
// This workspace is rooted at the root of the Git repo.
directory: ".",
releaseGroups: {
// This key is the name of the release group. All release groups in a Fluid repo must have a unique name.
client: {
// The include property can contain package names OR package scopes. If
// a scope is provided, all packages with that scope will be a part of
// the release group.
include: [
// Include all the Fluid Framework scopes and packages except for
// @fluid-example.
"@fluidframework",
"@fluid-experimental",
"@fluid-internal",
"@fluid-private",
"@fluid-tools",
// This private package is part of the client release group
"@types/jest-environment-puppeteer"
"fluid-framework",
],
// A release group can have an OPTIONAL root package. This package
// is typically private and is similar to the root package for a workspace.
// This release group root package may be useful to store scripts or other
// configuration that only applies on the release group,
rootPackageName: "client-release-group-root",
// A release group may have an ADO pipeline URL associated with it. This
// URL is used to provide direct links to the pipeline when running releases.
adoPipelineUrl:
"https://dev.azure.com/fluidframework/internal/_build?definitionId=12",
},
examples: {
// This release group contains only the @fluid-example packages.
include: ["@fluid-example"],
// Release group root packages are optional but can be useful to store scripts that are tuned to
// apply to only that release group.
rootPackageName: "examples-release-group-root",
},
// If any packages in the workspace don't match a release group, loading the
// repo layout config will throw an error.
},
},
"build-tools": {
// This workspace is rooted in the build-tools folder. This folder must contain
// a workspace config. The specific config depends on the package manager being used.
directory: "./build-tools",
releaseGroups: {
// Release groups can have the same name as workspaces, but all release group names
// must be unique regardless of the workspace they belong to.
"build-tools": {
include: [
// Include all Fluid Framework scopes. Only packages contained in the workspace
// will be included, so it is safe to use the same scopes in multiple release
// group definitions as long as they're in different workspaces.
"@fluidframework",
"@fluid-example",
"@fluid-experimental",
"@fluid-internal",
"@fluid-private",
"@fluid-tools",
],
rootPackageName: "build-tools-release-group-root",
adoPipelineUrl:
"https://dev.azure.com/fluidframework/internal/_build?definitionId=14",
},
},
},
},
}
```
### Loading a Fluid repo from a configuration file
To load a Fluid repo, you use the `loadFluidRepo` function. You can pass in a path to a Git repository root, or if one
is not provided, then the Git repository nearest to the working directory can be used.
This function will look for a repo layout configuration in that folder and load the workspaces, release groups, and
packages accordingly and return an `IFluidRepo` object that includes Maps of workspaces, release groups, and packages as
properties.
## Other APIs
### Type guards
You can use the `isIPackage` and `isIReleaseGroup` functions to determine if an object is an `IPackage` or
`IReleaseGroup` respectively.
### Base classes
The `PackageBase` abstract class can be used as a base class to create custom `IPackage` classes.
## Miscellaneous improvements
### Fluid repos can be rooted anywhere
Fluid repos are rooted where their config file is located, _not_ at the root of a Git repo. There can be multiple Fluid
repos within a Git repo, though this is usually only needed for testing. In typical use only a single Fluid repo per
Git repo is needed. However, the Fluid repo does _not_ need to be rooted at the root of Git repo, and code should not
assume that the root of the Fluid repo is the same as the root of a Git repo.
### Better testing
There is now a test project within the repo that is a fully functional Fluid repo. There are basic unit tests that verify the
loading of the Fluid repo config and that packages are organized as expected. This is a dramatic improvement from v0
build-tools, in which all package traversal logic was effectively untested.
There are also tests for the selection and filtering APIs.
This infrastructure also provides a foundation for further test improvements, and testing other new features of Fluid
repos. In the past it was challenging to add new features because there was no way to test those features effectively.
That should be much easier now.
## Known gaps
- Inadequate testing of git-related APIs - can we mock git somehow?
This is the main entrypoint to the build-infrastructure API.
The primary purpose of this package is to provide a common way to organize npm packages into groups called release
groups, and leverages workspaces functionality provided by package managers like npm, yarn, and pnpm to manage
interdependencies between packages across a Fluid repo. It then provides APIs to select, filter, and work with those
package groups.
## Classes
- [NotInGitRepository](classes/NotInGitRepository.md)
## Interfaces
- [FluidPackageJsonFields](interfaces/FluidPackageJsonFields.md)
- [IFluidBuildDir](interfaces/IFluidBuildDir.md)
- [IFluidBuildDirs](interfaces/IFluidBuildDirs.md)
- [IFluidRepo](interfaces/IFluidRepo.md)
- [IFluidRepoLayout](interfaces/IFluidRepoLayout.md)
- [Installable](interfaces/Installable.md)
- [IPackage](interfaces/IPackage.md)
- [IPackageManager](interfaces/IPackageManager.md)
- [IReleaseGroup](interfaces/IReleaseGroup.md)
- [IWorkspace](interfaces/IWorkspace.md)
- [PackageDependency](interfaces/PackageDependency.md)
- [ReleaseGroupDefinition](interfaces/ReleaseGroupDefinition.md)
- [Reloadable](interfaces/Reloadable.md)
- [WorkspaceDefinition](interfaces/WorkspaceDefinition.md)
## Type Aliases
- [AdditionalPackageProps](type-aliases/AdditionalPackageProps.md)
- [IFluidBuildDirEntry](type-aliases/IFluidBuildDirEntry.md)
- [PackageJson](type-aliases/PackageJson.md)
- [PackageManagerName](type-aliases/PackageManagerName.md)
- [PackageName](type-aliases/PackageName.md)
- [ReleaseGroupName](type-aliases/ReleaseGroupName.md)
- [WorkspaceName](type-aliases/WorkspaceName.md)
## Variables
- [FLUIDREPO\_CONFIG\_VERSION](variables/FLUIDREPO_CONFIG_VERSION.md)
## Functions
- [getFluidRepoLayout](functions/getFluidRepoLayout.md)
- [isIPackage](functions/isIPackage.md)
- [isIReleaseGroup](functions/isIReleaseGroup.md)

Просмотреть файл

@ -0,0 +1,173 @@
[**@fluid-tools/build-infrastructure**](../README.md) • **Docs**
***
[@fluid-tools/build-infrastructure](../README.md) / NotInGitRepository
# Class: NotInGitRepository
An error thrown when a path is not within a Git repository.
## Extends
- `Error`
## Constructors
### new NotInGitRepository()
```ts
new NotInGitRepository(path): NotInGitRepository
```
#### Parameters
**path**: `string`
#### Returns
[`NotInGitRepository`](NotInGitRepository.md)
#### Overrides
`Error.constructor`
#### Defined in
[packages/build-infrastructure/src/errors.ts:10](https://github.com/microsoft/FluidFramework/blob/main/build-tools/packages/build-infrastructure/src/errors.ts#L10)
## Properties
### message
```ts
message: string;
```
#### Inherited from
`Error.message`
#### Defined in
node\_modules/.pnpm/typescript@5.4.5/node\_modules/typescript/lib/lib.es5.d.ts:1077
***
### name
```ts
name: string;
```
#### Inherited from
`Error.name`
#### Defined in
node\_modules/.pnpm/typescript@5.4.5/node\_modules/typescript/lib/lib.es5.d.ts:1076
***
### path
```ts
readonly path: string;
```
#### Defined in
[packages/build-infrastructure/src/errors.ts:10](https://github.com/microsoft/FluidFramework/blob/main/build-tools/packages/build-infrastructure/src/errors.ts#L10)
***
### stack?
```ts
optional stack: string;
```
#### Inherited from
`Error.stack`
#### Defined in
node\_modules/.pnpm/typescript@5.4.5/node\_modules/typescript/lib/lib.es5.d.ts:1078
***
### prepareStackTrace()?
```ts
static optional prepareStackTrace: (err, stackTraces) => any;
```
Optional override for formatting stack traces
#### Parameters
**err**: `Error`
**stackTraces**: `CallSite`[]
#### Returns
`any`
#### See
https://v8.dev/docs/stack-trace-api#customizing-stack-traces
#### Inherited from
`Error.prepareStackTrace`
#### Defined in
node\_modules/.pnpm/@types+node@18.18.7/node\_modules/@types/node/globals.d.ts:11
***
### stackTraceLimit
```ts
static stackTraceLimit: number;
```
#### Inherited from
`Error.stackTraceLimit`
#### Defined in
node\_modules/.pnpm/@types+node@18.18.7/node\_modules/@types/node/globals.d.ts:13
## Methods
### captureStackTrace()
```ts
static captureStackTrace(targetObject, constructorOpt?): void
```
Create .stack property on a target object
#### Parameters
**targetObject**: `object`
**constructorOpt?**: `Function`
#### Returns
`void`
#### Inherited from
`Error.captureStackTrace`
#### Defined in
node\_modules/.pnpm/@types+node@18.18.7/node\_modules/@types/node/globals.d.ts:4

Просмотреть файл

@ -0,0 +1,49 @@
[**@fluid-tools/build-infrastructure**](../README.md) • **Docs**
***
[@fluid-tools/build-infrastructure](../README.md) / getFluidRepoLayout
# Function: getFluidRepoLayout()
```ts
function getFluidRepoLayout(searchPath, noCache): object
```
Search a path for a repo layout config file, and return the parsed config and the path to the config file.
## Parameters
**searchPath**: `string`
The path to start searching for config files in.
**noCache**: `boolean` = `false`
If true, the config cache will be cleared and the config will be reloaded.
## Returns
`object`
The loaded repoLayout config and the path to the config file.
### config
```ts
config: IFluidRepoLayout;
```
### configFilePath
```ts
configFilePath: string;
```
## Throws
If a config is not found or if the config version is not supported.
## Defined in
[packages/build-infrastructure/src/config.ts:218](https://github.com/microsoft/FluidFramework/blob/main/build-tools/packages/build-infrastructure/src/config.ts#L218)

Просмотреть файл

@ -0,0 +1,25 @@
[**@fluid-tools/build-infrastructure**](../README.md) • **Docs**
***
[@fluid-tools/build-infrastructure](../README.md) / isIPackage
# Function: isIPackage()
```ts
function isIPackage(pkg): pkg is IPackage<Object>
```
A type guard that returns `true` if the item is an [IPackage](../interfaces/IPackage.md).
## Parameters
**pkg**: `any`
## Returns
`pkg is IPackage<Object>`
## Defined in
[packages/build-infrastructure/src/types.ts:430](https://github.com/microsoft/FluidFramework/blob/main/build-tools/packages/build-infrastructure/src/types.ts#L430)

Просмотреть файл

@ -0,0 +1,25 @@
[**@fluid-tools/build-infrastructure**](../README.md) • **Docs**
***
[@fluid-tools/build-infrastructure](../README.md) / isIReleaseGroup
# Function: isIReleaseGroup()
```ts
function isIReleaseGroup(toCheck): toCheck is IReleaseGroup
```
A type guard that returns `true` if the checked item is an [IReleaseGroup](../interfaces/IReleaseGroup.md).
## Parameters
**toCheck**: `any`
## Returns
`toCheck is IReleaseGroup`
## Defined in
[packages/build-infrastructure/src/types.ts:251](https://github.com/microsoft/FluidFramework/blob/main/build-tools/packages/build-infrastructure/src/types.ts#L251)

Просмотреть файл

@ -0,0 +1,34 @@
[**@fluid-tools/build-infrastructure**](../README.md) • **Docs**
***
[@fluid-tools/build-infrastructure](../README.md) / FluidPackageJsonFields
# Interface: FluidPackageJsonFields
Extra package.json fields used by pnpm.
See [https://pnpm.io/package_json](https://pnpm.io/package_json).
## Properties
### pnpm?
```ts
optional pnpm: object;
```
Configuration for pnpm.
See [https://pnpm.io/package_json](https://pnpm.io/package_json).
#### overrides?
```ts
optional overrides: Record<string, string>;
```
Instruct pnpm to override any dependency in the dependency graph.
See [https://pnpm.io/package_json#pnpmoverrides](https://pnpm.io/package_json#pnpmoverrides)
#### Defined in
[packages/build-infrastructure/src/types.ts:20](https://github.com/microsoft/FluidFramework/blob/main/build-tools/packages/build-infrastructure/src/types.ts#L20)

Просмотреть файл

@ -0,0 +1,45 @@
[**@fluid-tools/build-infrastructure**](../README.md) • **Docs**
***
[@fluid-tools/build-infrastructure](../README.md) / IFluidBuildDir
# Interface: ~~IFluidBuildDir~~
Configures a package or release group
## Deprecated
Use repoLayout and associated types instead.
## Properties
### ~~directory~~
```ts
directory: string;
```
The path to the package. For release groups this should be the path to the root of the release group.
#### Defined in
[packages/build-infrastructure/src/config.ts:128](https://github.com/microsoft/FluidFramework/blob/main/build-tools/packages/build-infrastructure/src/config.ts#L128)
***
### ~~ignoredDirs?~~
```ts
optional ignoredDirs: string[];
```
An array of paths under `directory` that should be ignored.
#### Deprecated
This field is unused in all known configs and is ignored by the back-compat loading code.
#### Defined in
[packages/build-infrastructure/src/config.ts:135](https://github.com/microsoft/FluidFramework/blob/main/build-tools/packages/build-infrastructure/src/config.ts#L135)

Просмотреть файл

@ -0,0 +1,15 @@
[**@fluid-tools/build-infrastructure**](../README.md) • **Docs**
***
[@fluid-tools/build-infrastructure](../README.md) / IFluidBuildDirs
# Interface: ~~IFluidBuildDirs~~
## Deprecated
Use repoLayout and associated types instead.
## Indexable
\[`name`: `string`\]: [`IFluidBuildDirEntry`](../type-aliases/IFluidBuildDirEntry.md)

Просмотреть файл

@ -0,0 +1,222 @@
[**@fluid-tools/build-infrastructure**](../README.md) • **Docs**
***
[@fluid-tools/build-infrastructure](../README.md) / IFluidRepo
# Interface: IFluidRepo\<P\>
A Fluid repo organizes a collection of npm packages into workspaces and release groups. A Fluid repo can contain
multiple workspaces, and a workspace can in turn contain multiple release groups. Both workspaces and release groups
represent ways to organize packages in the repo, but their purpose and function are different.
See [IWorkspace](IWorkspace.md) and [IReleaseGroup](IReleaseGroup.md) for more details.
## Extends
- [`Reloadable`](Reloadable.md)
## Type Parameters
**P** *extends* [`IPackage`](IPackage.md) = [`IPackage`](IPackage.md)
The type of [IPackage](IPackage.md) the repo uses. This can be any type that implements [IPackage](IPackage.md).
## Properties
### configuration
```ts
configuration: IFluidRepoLayout;
```
The layout configuration for the repo.
#### Defined in
[packages/build-infrastructure/src/types.ts:82](https://github.com/microsoft/FluidFramework/blob/main/build-tools/packages/build-infrastructure/src/types.ts#L82)
***
### packages
```ts
packages: Map<PackageName, P>;
```
A map of all packages in the Fluid repo.
#### Defined in
[packages/build-infrastructure/src/types.ts:71](https://github.com/microsoft/FluidFramework/blob/main/build-tools/packages/build-infrastructure/src/types.ts#L71)
***
### releaseGroups
```ts
releaseGroups: Map<ReleaseGroupName, IReleaseGroup>;
```
A map of all release groups in the Fluid repo.
#### Defined in
[packages/build-infrastructure/src/types.ts:66](https://github.com/microsoft/FluidFramework/blob/main/build-tools/packages/build-infrastructure/src/types.ts#L66)
***
### root
```ts
root: string;
```
The absolute path to the root of the IFluidRepo. This is the path where the config file is located.
#### Defined in
[packages/build-infrastructure/src/types.ts:56](https://github.com/microsoft/FluidFramework/blob/main/build-tools/packages/build-infrastructure/src/types.ts#L56)
***
### upstreamRemotePartialUrl?
```ts
optional upstreamRemotePartialUrl: string;
```
A partial URL to the upstream (remote) repo. This can be set to the name of the repo on GitHub. For example,
"microsoft/FluidFramework".
#### Defined in
[packages/build-infrastructure/src/types.ts:77](https://github.com/microsoft/FluidFramework/blob/main/build-tools/packages/build-infrastructure/src/types.ts#L77)
***
### workspaces
```ts
workspaces: Map<WorkspaceName, IWorkspace>;
```
A map of all workspaces in the Fluid repo.
#### Defined in
[packages/build-infrastructure/src/types.ts:61](https://github.com/microsoft/FluidFramework/blob/main/build-tools/packages/build-infrastructure/src/types.ts#L61)
## Methods
### getGitRepository()
```ts
getGitRepository(): Promise<Readonly<SimpleGit>>
```
If the FluidRepo is within a Git repository, this function will return a SimpleGit instance rooted at the root of
the Git repository. If the FluidRepo is _not_ within a Git repository, this function will throw a
[NotInGitRepository](../classes/NotInGitRepository.md) error.
#### Returns
`Promise`\<`Readonly`\<`SimpleGit`\>\>
#### Throws
A [NotInGitRepository](../classes/NotInGitRepository.md) error if the path is not within a Git repository.
#### Defined in
[packages/build-infrastructure/src/types.ts:99](https://github.com/microsoft/FluidFramework/blob/main/build-tools/packages/build-infrastructure/src/types.ts#L99)
***
### getPackageReleaseGroup()
```ts
getPackageReleaseGroup(pkg): Readonly<IReleaseGroup>
```
Returns the [IReleaseGroup](IReleaseGroup.md) associated with a package.
#### Parameters
**pkg**: `Readonly`\<`P`\>
#### Returns
`Readonly`\<[`IReleaseGroup`](IReleaseGroup.md)\>
#### Defined in
[packages/build-infrastructure/src/types.ts:104](https://github.com/microsoft/FluidFramework/blob/main/build-tools/packages/build-infrastructure/src/types.ts#L104)
***
### getPackageWorkspace()
```ts
getPackageWorkspace(pkg): Readonly<IWorkspace>
```
Returns the [IWorkspace](IWorkspace.md) associated with a package.
#### Parameters
**pkg**: `Readonly`\<`P`\>
#### Returns
`Readonly`\<[`IWorkspace`](IWorkspace.md)\>
#### Defined in
[packages/build-infrastructure/src/types.ts:109](https://github.com/microsoft/FluidFramework/blob/main/build-tools/packages/build-infrastructure/src/types.ts#L109)
***
### relativeToRepo()
```ts
relativeToRepo(p): string
```
Transforms an absolute path to a path relative to the IFluidRepo root.
#### Parameters
**p**: `string`
The path to make relative to the IFluidRepo root.
#### Returns
`string`
The path relative to the IFluidRepo root.
#### Defined in
[packages/build-infrastructure/src/types.ts:90](https://github.com/microsoft/FluidFramework/blob/main/build-tools/packages/build-infrastructure/src/types.ts#L90)
***
### reload()
```ts
reload(): void
```
#### Returns
`void`
#### Inherited from
[`Reloadable`](Reloadable.md).[`reload`](Reloadable.md#reload)
#### Defined in
[packages/build-infrastructure/src/types.ts:135](https://github.com/microsoft/FluidFramework/blob/main/build-tools/packages/build-infrastructure/src/types.ts#L135)

Просмотреть файл

@ -0,0 +1,67 @@
[**@fluid-tools/build-infrastructure**](../README.md) • **Docs**
***
[@fluid-tools/build-infrastructure](../README.md) / IFluidRepoLayout
# Interface: IFluidRepoLayout
Top-most configuration for repo layout settings.
## Properties
### repoLayout?
```ts
optional repoLayout: object;
```
The layout of repo into workspaces and release groups.
#### workspaces
```ts
workspaces: object;
```
##### Index Signature
\[`name`: `string`\]: [`WorkspaceDefinition`](WorkspaceDefinition.md)
#### Defined in
[packages/build-infrastructure/src/config.ts:41](https://github.com/microsoft/FluidFramework/blob/main/build-tools/packages/build-infrastructure/src/config.ts#L41)
***
### ~~repoPackages?~~
```ts
optional repoPackages: IFluidBuildDirs;
```
**BACK-COMPAT ONLY**
A mapping of package or release group names to metadata about the package or release group.
#### Deprecated
Use the repoLayout property instead.
#### Defined in
[packages/build-infrastructure/src/config.ts:36](https://github.com/microsoft/FluidFramework/blob/main/build-tools/packages/build-infrastructure/src/config.ts#L36)
***
### version
```ts
version: 1;
```
The version of the config.
#### Defined in
[packages/build-infrastructure/src/config.ts:27](https://github.com/microsoft/FluidFramework/blob/main/build-tools/packages/build-infrastructure/src/config.ts#L27)

Просмотреть файл

@ -0,0 +1,339 @@
[**@fluid-tools/build-infrastructure**](../README.md) • **Docs**
***
[@fluid-tools/build-infrastructure](../README.md) / IPackage
# Interface: IPackage\<J\>
A common type representing an npm package. A custom type can be used for the package.json schema, which is useful
when the package.json has custom keys/values.
## Extends
- [`Installable`](Installable.md).[`Reloadable`](Reloadable.md)
## Type Parameters
**J** *extends* [`PackageJson`](../type-aliases/PackageJson.md) = [`PackageJson`](../type-aliases/PackageJson.md)
The package.json type to use. This type must extend the [PackageJson](../type-aliases/PackageJson.md) type defined in this
package.
## Properties
### combinedDependencies
```ts
combinedDependencies: Generator<PackageDependency, void, unknown>;
```
A generator that returns each dependency and the kind of dependency (dev, peer, etc.) for all of the package's
dependencies. This is useful to iterate overall all dependencies of the package.
#### Defined in
[packages/build-infrastructure/src/types.ts:422](https://github.com/microsoft/FluidFramework/blob/main/build-tools/packages/build-infrastructure/src/types.ts#L422)
***
### directory
```ts
readonly directory: string;
```
The absolute path to the directory containing the package (that is, the directory that contains the package.json
for the package).
#### Defined in
[packages/build-infrastructure/src/types.ts:353](https://github.com/microsoft/FluidFramework/blob/main/build-tools/packages/build-infrastructure/src/types.ts#L353)
***
### isReleaseGroupRoot
```ts
isReleaseGroupRoot: boolean;
```
Whether the package is a release group root package or not. A release group may not have a root package, but if it
does, it will only have one.
#### Defined in
[packages/build-infrastructure/src/types.ts:400](https://github.com/microsoft/FluidFramework/blob/main/build-tools/packages/build-infrastructure/src/types.ts#L400)
***
### isWorkspaceRoot
```ts
readonly isWorkspaceRoot: boolean;
```
Whether the package is a workspace root package or not. A workspace will only have one root package.
#### Defined in
[packages/build-infrastructure/src/types.ts:389](https://github.com/microsoft/FluidFramework/blob/main/build-tools/packages/build-infrastructure/src/types.ts#L389)
***
### name
```ts
readonly name: PackageName;
```
The name of the package
#### Defined in
[packages/build-infrastructure/src/types.ts:341](https://github.com/microsoft/FluidFramework/blob/main/build-tools/packages/build-infrastructure/src/types.ts#L341)
***
### nameColored
```ts
readonly nameColored: string;
```
The name of the package color-coded with ANSI color codes for terminal output. The package name will always have
the same color.
#### Defined in
[packages/build-infrastructure/src/types.ts:347](https://github.com/microsoft/FluidFramework/blob/main/build-tools/packages/build-infrastructure/src/types.ts#L347)
***
### packageJson
```ts
packageJson: J;
```
The package.json contents of the package.
#### Defined in
[packages/build-infrastructure/src/types.ts:358](https://github.com/microsoft/FluidFramework/blob/main/build-tools/packages/build-infrastructure/src/types.ts#L358)
***
### packageJsonFilePath
```ts
readonly packageJsonFilePath: string;
```
The absolute path to the package.json file for this package.
#### Defined in
[packages/build-infrastructure/src/types.ts:405](https://github.com/microsoft/FluidFramework/blob/main/build-tools/packages/build-infrastructure/src/types.ts#L405)
***
### packageManager
```ts
readonly packageManager: IPackageManager;
```
The package manager used to manage this package.
#### Defined in
[packages/build-infrastructure/src/types.ts:368](https://github.com/microsoft/FluidFramework/blob/main/build-tools/packages/build-infrastructure/src/types.ts#L368)
***
### private
```ts
readonly private: boolean;
```
`true` if the package is private; `false` otherwise. This is similar to the field in package.json, but always
returns a boolean value. If the package.json is missing the `private` field, this will return false.
#### Defined in
[packages/build-infrastructure/src/types.ts:379](https://github.com/microsoft/FluidFramework/blob/main/build-tools/packages/build-infrastructure/src/types.ts#L379)
***
### releaseGroup
```ts
releaseGroup: ReleaseGroupName;
```
The name of the release group that this package belongs to.
#### Defined in
[packages/build-infrastructure/src/types.ts:394](https://github.com/microsoft/FluidFramework/blob/main/build-tools/packages/build-infrastructure/src/types.ts#L394)
***
### version
```ts
readonly version: string;
```
The version of the package. This is the same as `packageJson.version`.
#### Defined in
[packages/build-infrastructure/src/types.ts:373](https://github.com/microsoft/FluidFramework/blob/main/build-tools/packages/build-infrastructure/src/types.ts#L373)
***
### workspace
```ts
readonly workspace: IWorkspace;
```
The workspace that this package belongs to.
#### Defined in
[packages/build-infrastructure/src/types.ts:384](https://github.com/microsoft/FluidFramework/blob/main/build-tools/packages/build-infrastructure/src/types.ts#L384)
## Methods
### checkInstall()
```ts
checkInstall(): Promise<boolean>
```
Returns `true` if the item is installed. If this returns `false`, then the `install` function can be called to
install.
#### Returns
`Promise`\<`boolean`\>
#### Inherited from
[`Installable`](Installable.md).[`checkInstall`](Installable.md#checkinstall)
#### Defined in
[packages/build-infrastructure/src/types.ts:120](https://github.com/microsoft/FluidFramework/blob/main/build-tools/packages/build-infrastructure/src/types.ts#L120)
***
### getScript()
```ts
getScript(name): undefined | string
```
Returns the value of a script in the package's package.json, or undefined if a script with the provided key is not
found.
#### Parameters
**name**: `string`
#### Returns
`undefined` \| `string`
#### Defined in
[packages/build-infrastructure/src/types.ts:411](https://github.com/microsoft/FluidFramework/blob/main/build-tools/packages/build-infrastructure/src/types.ts#L411)
***
### install()
```ts
install(updateLockfile): Promise<boolean>
```
Installs the item.
#### Parameters
**updateLockfile**: `boolean`
If true, the lockfile will be updated. Otherwise, the lockfile will not be updated. This
may cause the installation to fail.
#### Returns
`Promise`\<`boolean`\>
#### Inherited from
[`Installable`](Installable.md).[`install`](Installable.md#install)
#### Defined in
[packages/build-infrastructure/src/types.ts:128](https://github.com/microsoft/FluidFramework/blob/main/build-tools/packages/build-infrastructure/src/types.ts#L128)
***
### reload()
```ts
reload(): void
```
#### Returns
`void`
#### Inherited from
[`Reloadable`](Reloadable.md).[`reload`](Reloadable.md#reload)
#### Defined in
[packages/build-infrastructure/src/types.ts:135](https://github.com/microsoft/FluidFramework/blob/main/build-tools/packages/build-infrastructure/src/types.ts#L135)
***
### savePackageJson()
```ts
savePackageJson(): Promise<void>
```
Saves any changes to the packageJson property to the package.json file on disk.
#### Returns
`Promise`\<`void`\>
#### Defined in
[packages/build-infrastructure/src/types.ts:416](https://github.com/microsoft/FluidFramework/blob/main/build-tools/packages/build-infrastructure/src/types.ts#L416)
***
### toString()
```ts
toString(): string
```
Returns a string representation of an object.
#### Returns
`string`
#### Defined in
[packages/build-infrastructure/src/types.ts:423](https://github.com/microsoft/FluidFramework/blob/main/build-tools/packages/build-infrastructure/src/types.ts#L423)

Просмотреть файл

@ -0,0 +1,64 @@
[**@fluid-tools/build-infrastructure**](../README.md) • **Docs**
***
[@fluid-tools/build-infrastructure](../README.md) / IPackageManager
# Interface: IPackageManager
A package manager, such as "npm" or "pnpm".
## Properties
### lockfileName
```ts
readonly lockfileName: string;
```
The name of the lockfile used by the package manager.
#### Defined in
[packages/build-infrastructure/src/types.ts:285](https://github.com/microsoft/FluidFramework/blob/main/build-tools/packages/build-infrastructure/src/types.ts#L285)
***
### name
```ts
readonly name: PackageManagerName;
```
The name of the package manager.
#### Defined in
[packages/build-infrastructure/src/types.ts:280](https://github.com/microsoft/FluidFramework/blob/main/build-tools/packages/build-infrastructure/src/types.ts#L280)
## Methods
### installCommand()
```ts
installCommand(updateLockfile): string
```
Returns an install command that can be used to install dependencies using this package manager.
#### Parameters
**updateLockfile**: `boolean`
If `true`, then the returned command will include flags or arguments necessary to update
the lockfile during install. If `false`, such flags or arguments should be omitted. Note that the command will
_not_ include the package manager name istself. For example, the `npm` package manager will return the string
`"install"`, not `"npm install"`.
#### Returns
`string`
#### Defined in
[packages/build-infrastructure/src/types.ts:295](https://github.com/microsoft/FluidFramework/blob/main/build-tools/packages/build-infrastructure/src/types.ts#L295)

Просмотреть файл

@ -0,0 +1,612 @@
[**@fluid-tools/build-infrastructure**](../README.md) • **Docs**
***
[@fluid-tools/build-infrastructure](../README.md) / IReleaseGroup
# Interface: IReleaseGroup
A release group is a collection of packages that are versioned and released together. All packages within a release
group will have the same version, and all packages will be released at the same time.
Release groups are not involved in dependency management. They are used for versioning and releasing packages only.
Workspaces, on the other hand, are used to manage dependencies and interdependencies. See [IWorkspace](IWorkspace.md) for more
information.
## Extends
- [`Reloadable`](Reloadable.md)
## Properties
### adoPipelineUrl?
```ts
readonly optional adoPipelineUrl: string;
```
An optional ADO pipeline URL for the CI pipeline that builds the release group.
#### Defined in
[packages/build-infrastructure/src/types.ts:243](https://github.com/microsoft/FluidFramework/blob/main/build-tools/packages/build-infrastructure/src/types.ts#L243)
***
### name
```ts
readonly name: ReleaseGroupName;
```
The name of the release group. All release groups must have unique names.
#### Defined in
[packages/build-infrastructure/src/types.ts:211](https://github.com/microsoft/FluidFramework/blob/main/build-tools/packages/build-infrastructure/src/types.ts#L211)
***
### packages
```ts
readonly packages: IPackage<object>[];
```
An array of all packages in the release group.
#### Defined in
[packages/build-infrastructure/src/types.ts:226](https://github.com/microsoft/FluidFramework/blob/main/build-tools/packages/build-infrastructure/src/types.ts#L226)
***
### releaseGroupDependencies
```ts
readonly releaseGroupDependencies: IReleaseGroup[];
```
An array of all the release groups that the release group depends on. If any package in a release group has any
dependency on a package in another release group within the same workspace, then the first release group depends
on the second.
#### Defined in
[packages/build-infrastructure/src/types.ts:238](https://github.com/microsoft/FluidFramework/blob/main/build-tools/packages/build-infrastructure/src/types.ts#L238)
***
### rootPackage?
```ts
readonly optional rootPackage: IPackage<object>;
```
The package that is the release group root, if one exists.
#### Type declaration
##### author?
```ts
optional author: Person;
```
##### bin?
```ts
optional bin: string | Partial<Record<string, string>>;
```
The executable files that should be installed into the `PATH`.
##### browser?
```ts
optional browser: string | Partial<Record<string, string | false>>;
```
A hint to JavaScript bundlers or component tools when packaging modules for client side use.
##### bugs?
```ts
optional bugs: BugsLocation;
```
The URL to the package's issue tracker and/or the email address to which issues should be reported.
##### bundledDependencies?
```ts
optional bundledDependencies: string[];
```
Package names that are bundled when the package is published.
##### bundleDependencies?
```ts
optional bundleDependencies: string[];
```
Alias of `bundledDependencies`.
##### config?
```ts
optional config: Record<string, unknown>;
```
Is used to set configuration parameters used in package scripts that persist across upgrades.
##### contributors?
```ts
optional contributors: Person[];
```
A list of people who contributed to the package.
##### cpu?
```ts
optional cpu: LiteralUnion<
| "arm"
| "arm64"
| "ia32"
| "mips"
| "mipsel"
| "ppc"
| "ppc64"
| "s390"
| "s390x"
| "x64"
| "x32"
| "!arm"
| "!arm64"
| "!ia32"
| "!mips"
| "!mipsel"
| "!ppc"
| "!ppc64"
| "!s390"
| "!s390x"
| "!x32"
| "!x64", string>[];
```
CPU architectures the module runs on.
##### dependencies?
```ts
optional dependencies: Partial<Record<string, string>>;
```
The dependencies of the package.
##### description?
```ts
optional description: string;
```
Package description, listed in `npm search`.
##### devDependencies?
```ts
optional devDependencies: Partial<Record<string, string>>;
```
Additional tooling dependencies that are not required for the package to work. Usually test, build, or documentation tooling.
##### directories?
```ts
optional directories: DirectoryLocations;
```
Indicates the structure of the package.
##### engines?
```ts
optional engines: object;
```
Engines that this package runs on.
##### ~~engineStrict?~~
```ts
optional engineStrict: boolean;
```
###### Deprecated
##### esnext?
```ts
optional esnext: string | object;
```
A module ID with untranspiled code that is the primary entry point to the program.
##### exports?
```ts
optional exports: Exports;
```
Subpath exports to define entry points of the package.
[Read more.](https://nodejs.org/api/packages.html#subpath-exports)
##### files?
```ts
optional files: string[];
```
The files included in the package.
##### flat?
```ts
optional flat: boolean;
```
If your package only allows one version of a given dependency, and youd like to enforce the same behavior as `yarn install --flat` on the command-line, set this to `true`.
Note that if your `package.json` contains `"flat": true` and other packages depend on yours (e.g. you are building a library rather than an app), those other packages will also need `"flat": true` in their `package.json` or be installed with `yarn install --flat` on the command-line.
##### funding?
```ts
optional funding: string | object;
```
Describes and notifies consumers of a package's monetary support information.
[Read more.](https://github.com/npm/rfcs/blob/latest/accepted/0017-add-funding-support.md)
##### homepage?
```ts
optional homepage: LiteralUnion<".", string>;
```
The URL to the package's homepage.
##### imports?
```ts
optional imports: Imports;
```
Subpath imports to define internal package import maps that only apply to import specifiers from within the package itself.
[Read more.](https://nodejs.org/api/packages.html#subpath-imports)
##### jspm?
```ts
optional jspm: PackageJson;
```
JSPM configuration.
##### keywords?
```ts
optional keywords: string[];
```
Keywords associated with package, listed in `npm search`.
##### license?
```ts
optional license: string;
```
The license for the package.
##### licenses?
```ts
optional licenses: object[];
```
The licenses for the package.
##### main?
```ts
optional main: string;
```
The module ID that is the primary entry point to the program.
##### maintainers?
```ts
optional maintainers: Person[];
```
A list of people who maintain the package.
##### man?
```ts
optional man: string | string[];
```
Filenames to put in place for the `man` program to find.
##### module?
```ts
optional module: string;
```
An ECMAScript module ID that is the primary entry point to the program.
##### name
```ts
name: string;
```
The name of the package.
##### optionalDependencies?
```ts
optional optionalDependencies: Partial<Record<string, string>>;
```
Dependencies that are skipped if they fail to install.
##### os?
```ts
optional os: LiteralUnion<
| "aix"
| "darwin"
| "freebsd"
| "linux"
| "openbsd"
| "sunos"
| "win32"
| "!aix"
| "!darwin"
| "!freebsd"
| "!linux"
| "!openbsd"
| "!sunos"
| "!win32", string>[];
```
Operating systems the module runs on.
##### peerDependencies?
```ts
optional peerDependencies: Partial<Record<string, string>>;
```
Dependencies that will usually be required by the package user directly or via another dependency.
##### peerDependenciesMeta?
```ts
optional peerDependenciesMeta: Partial<Record<string, object>>;
```
Indicate peer dependencies that are optional.
##### pnpm?
```ts
optional pnpm: object;
```
Configuration for pnpm.
See [https://pnpm.io/package_json](https://pnpm.io/package_json).
##### pnpm.overrides?
```ts
optional overrides: Record<string, string>;
```
Instruct pnpm to override any dependency in the dependency graph.
See [https://pnpm.io/package_json#pnpmoverrides](https://pnpm.io/package_json#pnpmoverrides)
##### ~~preferGlobal?~~
```ts
optional preferGlobal: boolean;
```
If set to `true`, a warning will be shown if package is installed locally. Useful if the package is primarily a command-line application that should be installed globally.
###### Deprecated
##### private?
```ts
optional private: boolean;
```
If set to `true`, then npm will refuse to publish it.
##### publishConfig?
```ts
optional publishConfig: PublishConfig;
```
A set of config values that will be used at publish-time. It's especially handy to set the tag, registry or access, to ensure that a given package is not tagged with 'latest', published to the global public registry or that a scoped module is private by default.
##### repository?
```ts
optional repository: string | object;
```
Location for the code repository.
##### resolutions?
```ts
optional resolutions: Partial<Record<string, string>>;
```
Selective version resolutions. Allows the definition of custom package versions inside dependencies without manual edits in the `yarn.lock` file.
##### scripts
```ts
scripts: Scripts;
```
Script commands that are run at various times in the lifecycle of the package. The key is the lifecycle event, and the value is the command to run at that point.
##### sideEffects?
```ts
optional sideEffects: boolean | string[];
```
Denote which files in your project are "pure" and therefore safe for Webpack to prune if unused.
[Read more.](https://webpack.js.org/guides/tree-shaking/)
##### type?
```ts
optional type: "module" | "commonjs";
```
Resolution algorithm for importing ".js" files from the package's scope.
[Read more.](https://nodejs.org/api/esm.html#esm_package_json_type_field)
##### types?
```ts
optional types: string;
```
Location of the bundled TypeScript declaration file.
##### typesVersions?
```ts
optional typesVersions: Partial<Record<string, Partial<Record<string, string[]>>>>;
```
Version selection map of TypeScript.
##### typings?
```ts
optional typings: string;
```
Location of the bundled TypeScript declaration file. Alias of `types`.
##### version
```ts
version: string;
```
Package version, parseable by [`node-semver`](https://github.com/npm/node-semver).
##### workspaces?
```ts
optional workspaces: string[] | WorkspaceConfig;
```
Used to configure [Yarn workspaces](https://classic.yarnpkg.com/docs/workspaces/).
Workspaces allow you to manage multiple packages within the same repository in such a way that you only need to run `yarn install` once to install all of them in a single pass.
Please note that the top-level `private` property of `package.json` **must** be set to `true` in order to use workspaces.
#### Defined in
[packages/build-infrastructure/src/types.ts:221](https://github.com/microsoft/FluidFramework/blob/main/build-tools/packages/build-infrastructure/src/types.ts#L221)
***
### version
```ts
readonly version: string;
```
The version of the release group.
#### Defined in
[packages/build-infrastructure/src/types.ts:216](https://github.com/microsoft/FluidFramework/blob/main/build-tools/packages/build-infrastructure/src/types.ts#L216)
***
### workspace
```ts
readonly workspace: IWorkspace;
```
The workspace that the release group belongs to.
#### Defined in
[packages/build-infrastructure/src/types.ts:231](https://github.com/microsoft/FluidFramework/blob/main/build-tools/packages/build-infrastructure/src/types.ts#L231)
## Methods
### reload()
```ts
reload(): void
```
#### Returns
`void`
#### Inherited from
[`Reloadable`](Reloadable.md).[`reload`](Reloadable.md#reload)
#### Defined in
[packages/build-infrastructure/src/types.ts:135](https://github.com/microsoft/FluidFramework/blob/main/build-tools/packages/build-infrastructure/src/types.ts#L135)
***
### toString()
```ts
toString(): string
```
Returns a string representation of an object.
#### Returns
`string`
#### Defined in
[packages/build-infrastructure/src/types.ts:245](https://github.com/microsoft/FluidFramework/blob/main/build-tools/packages/build-infrastructure/src/types.ts#L245)

Просмотреть файл

@ -0,0 +1,649 @@
[**@fluid-tools/build-infrastructure**](../README.md) • **Docs**
***
[@fluid-tools/build-infrastructure](../README.md) / IWorkspace
# Interface: IWorkspace
A workspace is a collection of packages, including a root package, that is managed using a package manager's
"workspaces" functionality. A Fluid repo can contain multiple workspaces. Workspaces are defined and managed using
the package manager directly. A Fluid repo builds on top of workspaces and relies on the package manager to install
and manage dependencies and interdependencies within the workspace.
A workspace defines the _physical layout_ of the packages within it. Workspaces are a generally a feature provided by
the package manager (npm, yarn, pnpm, etc.). A workspace is rooted in a particular folder, and uses the configuration
within that folder to determine what packages it contains. The configuration used is specific to the package manager.
The workspace is also the boundary at which dependencies are installed and managed. When you install dependencies for
a package in a workspace, all dependencies for all packages in the workspace will be installed. Within a workspace,
it is trivial to link multiple packages so they can depend on one another. The `IWorkspace` type is a thin wrapper on
top of these package manager features.
A Fluid repo will only load packages identified by the package manager's workspace feature. That is, any package in
the repo that is not configured as part of a workspace is invisible to tools using the Fluid repo.
Workspaces are not involved in versioning or releasing packages. They are used for dependency management only.
Release groups, on the other hand, are used to group packages into releasable groups. See [IReleaseGroup](IReleaseGroup.md) for
more information.
## Extends
- [`Installable`](Installable.md).[`Reloadable`](Reloadable.md)
## Properties
### directory
```ts
directory: string;
```
The root directory of the workspace. This directory will contain the workspace root package.
#### Defined in
[packages/build-infrastructure/src/types.ts:174](https://github.com/microsoft/FluidFramework/blob/main/build-tools/packages/build-infrastructure/src/types.ts#L174)
***
### name
```ts
name: WorkspaceName;
```
The name of the workspace.
#### Defined in
[packages/build-infrastructure/src/types.ts:169](https://github.com/microsoft/FluidFramework/blob/main/build-tools/packages/build-infrastructure/src/types.ts#L169)
***
### packages
```ts
packages: IPackage<object>[];
```
An array of all the packages in the workspace. This includes the workspace root and any release group roots and
constituent packages as well.
#### Defined in
[packages/build-infrastructure/src/types.ts:190](https://github.com/microsoft/FluidFramework/blob/main/build-tools/packages/build-infrastructure/src/types.ts#L190)
***
### releaseGroups
```ts
releaseGroups: Map<ReleaseGroupName, IReleaseGroup>;
```
A map of all the release groups in the workspace.
#### Defined in
[packages/build-infrastructure/src/types.ts:184](https://github.com/microsoft/FluidFramework/blob/main/build-tools/packages/build-infrastructure/src/types.ts#L184)
***
### rootPackage
```ts
rootPackage: IPackage<object>;
```
The root package of the workspace.
#### Type declaration
##### author?
```ts
optional author: Person;
```
##### bin?
```ts
optional bin: string | Partial<Record<string, string>>;
```
The executable files that should be installed into the `PATH`.
##### browser?
```ts
optional browser: string | Partial<Record<string, string | false>>;
```
A hint to JavaScript bundlers or component tools when packaging modules for client side use.
##### bugs?
```ts
optional bugs: BugsLocation;
```
The URL to the package's issue tracker and/or the email address to which issues should be reported.
##### bundledDependencies?
```ts
optional bundledDependencies: string[];
```
Package names that are bundled when the package is published.
##### bundleDependencies?
```ts
optional bundleDependencies: string[];
```
Alias of `bundledDependencies`.
##### config?
```ts
optional config: Record<string, unknown>;
```
Is used to set configuration parameters used in package scripts that persist across upgrades.
##### contributors?
```ts
optional contributors: Person[];
```
A list of people who contributed to the package.
##### cpu?
```ts
optional cpu: LiteralUnion<
| "arm"
| "arm64"
| "ia32"
| "mips"
| "mipsel"
| "ppc"
| "ppc64"
| "s390"
| "s390x"
| "x64"
| "x32"
| "!arm"
| "!arm64"
| "!ia32"
| "!mips"
| "!mipsel"
| "!ppc"
| "!ppc64"
| "!s390"
| "!s390x"
| "!x32"
| "!x64", string>[];
```
CPU architectures the module runs on.
##### dependencies?
```ts
optional dependencies: Partial<Record<string, string>>;
```
The dependencies of the package.
##### description?
```ts
optional description: string;
```
Package description, listed in `npm search`.
##### devDependencies?
```ts
optional devDependencies: Partial<Record<string, string>>;
```
Additional tooling dependencies that are not required for the package to work. Usually test, build, or documentation tooling.
##### directories?
```ts
optional directories: DirectoryLocations;
```
Indicates the structure of the package.
##### engines?
```ts
optional engines: object;
```
Engines that this package runs on.
##### ~~engineStrict?~~
```ts
optional engineStrict: boolean;
```
###### Deprecated
##### esnext?
```ts
optional esnext: string | object;
```
A module ID with untranspiled code that is the primary entry point to the program.
##### exports?
```ts
optional exports: Exports;
```
Subpath exports to define entry points of the package.
[Read more.](https://nodejs.org/api/packages.html#subpath-exports)
##### files?
```ts
optional files: string[];
```
The files included in the package.
##### flat?
```ts
optional flat: boolean;
```
If your package only allows one version of a given dependency, and youd like to enforce the same behavior as `yarn install --flat` on the command-line, set this to `true`.
Note that if your `package.json` contains `"flat": true` and other packages depend on yours (e.g. you are building a library rather than an app), those other packages will also need `"flat": true` in their `package.json` or be installed with `yarn install --flat` on the command-line.
##### funding?
```ts
optional funding: string | object;
```
Describes and notifies consumers of a package's monetary support information.
[Read more.](https://github.com/npm/rfcs/blob/latest/accepted/0017-add-funding-support.md)
##### homepage?
```ts
optional homepage: LiteralUnion<".", string>;
```
The URL to the package's homepage.
##### imports?
```ts
optional imports: Imports;
```
Subpath imports to define internal package import maps that only apply to import specifiers from within the package itself.
[Read more.](https://nodejs.org/api/packages.html#subpath-imports)
##### jspm?
```ts
optional jspm: PackageJson;
```
JSPM configuration.
##### keywords?
```ts
optional keywords: string[];
```
Keywords associated with package, listed in `npm search`.
##### license?
```ts
optional license: string;
```
The license for the package.
##### licenses?
```ts
optional licenses: object[];
```
The licenses for the package.
##### main?
```ts
optional main: string;
```
The module ID that is the primary entry point to the program.
##### maintainers?
```ts
optional maintainers: Person[];
```
A list of people who maintain the package.
##### man?
```ts
optional man: string | string[];
```
Filenames to put in place for the `man` program to find.
##### module?
```ts
optional module: string;
```
An ECMAScript module ID that is the primary entry point to the program.
##### name
```ts
name: string;
```
The name of the package.
##### optionalDependencies?
```ts
optional optionalDependencies: Partial<Record<string, string>>;
```
Dependencies that are skipped if they fail to install.
##### os?
```ts
optional os: LiteralUnion<
| "aix"
| "darwin"
| "freebsd"
| "linux"
| "openbsd"
| "sunos"
| "win32"
| "!aix"
| "!darwin"
| "!freebsd"
| "!linux"
| "!openbsd"
| "!sunos"
| "!win32", string>[];
```
Operating systems the module runs on.
##### peerDependencies?
```ts
optional peerDependencies: Partial<Record<string, string>>;
```
Dependencies that will usually be required by the package user directly or via another dependency.
##### peerDependenciesMeta?
```ts
optional peerDependenciesMeta: Partial<Record<string, object>>;
```
Indicate peer dependencies that are optional.
##### pnpm?
```ts
optional pnpm: object;
```
Configuration for pnpm.
See [https://pnpm.io/package_json](https://pnpm.io/package_json).
##### pnpm.overrides?
```ts
optional overrides: Record<string, string>;
```
Instruct pnpm to override any dependency in the dependency graph.
See [https://pnpm.io/package_json#pnpmoverrides](https://pnpm.io/package_json#pnpmoverrides)
##### ~~preferGlobal?~~
```ts
optional preferGlobal: boolean;
```
If set to `true`, a warning will be shown if package is installed locally. Useful if the package is primarily a command-line application that should be installed globally.
###### Deprecated
##### private?
```ts
optional private: boolean;
```
If set to `true`, then npm will refuse to publish it.
##### publishConfig?
```ts
optional publishConfig: PublishConfig;
```
A set of config values that will be used at publish-time. It's especially handy to set the tag, registry or access, to ensure that a given package is not tagged with 'latest', published to the global public registry or that a scoped module is private by default.
##### repository?
```ts
optional repository: string | object;
```
Location for the code repository.
##### resolutions?
```ts
optional resolutions: Partial<Record<string, string>>;
```
Selective version resolutions. Allows the definition of custom package versions inside dependencies without manual edits in the `yarn.lock` file.
##### scripts
```ts
scripts: Scripts;
```
Script commands that are run at various times in the lifecycle of the package. The key is the lifecycle event, and the value is the command to run at that point.
##### sideEffects?
```ts
optional sideEffects: boolean | string[];
```
Denote which files in your project are "pure" and therefore safe for Webpack to prune if unused.
[Read more.](https://webpack.js.org/guides/tree-shaking/)
##### type?
```ts
optional type: "module" | "commonjs";
```
Resolution algorithm for importing ".js" files from the package's scope.
[Read more.](https://nodejs.org/api/esm.html#esm_package_json_type_field)
##### types?
```ts
optional types: string;
```
Location of the bundled TypeScript declaration file.
##### typesVersions?
```ts
optional typesVersions: Partial<Record<string, Partial<Record<string, string[]>>>>;
```
Version selection map of TypeScript.
##### typings?
```ts
optional typings: string;
```
Location of the bundled TypeScript declaration file. Alias of `types`.
##### version
```ts
version: string;
```
Package version, parseable by [`node-semver`](https://github.com/npm/node-semver).
##### workspaces?
```ts
optional workspaces: string[] | WorkspaceConfig;
```
Used to configure [Yarn workspaces](https://classic.yarnpkg.com/docs/workspaces/).
Workspaces allow you to manage multiple packages within the same repository in such a way that you only need to run `yarn install` once to install all of them in a single pass.
Please note that the top-level `private` property of `package.json` **must** be set to `true` in order to use workspaces.
#### Defined in
[packages/build-infrastructure/src/types.ts:179](https://github.com/microsoft/FluidFramework/blob/main/build-tools/packages/build-infrastructure/src/types.ts#L179)
## Methods
### checkInstall()
```ts
checkInstall(): Promise<boolean>
```
Returns `true` if the item is installed. If this returns `false`, then the `install` function can be called to
install.
#### Returns
`Promise`\<`boolean`\>
#### Inherited from
[`Installable`](Installable.md).[`checkInstall`](Installable.md#checkinstall)
#### Defined in
[packages/build-infrastructure/src/types.ts:120](https://github.com/microsoft/FluidFramework/blob/main/build-tools/packages/build-infrastructure/src/types.ts#L120)
***
### install()
```ts
install(updateLockfile): Promise<boolean>
```
Installs the item.
#### Parameters
**updateLockfile**: `boolean`
If true, the lockfile will be updated. Otherwise, the lockfile will not be updated. This
may cause the installation to fail.
#### Returns
`Promise`\<`boolean`\>
#### Inherited from
[`Installable`](Installable.md).[`install`](Installable.md#install)
#### Defined in
[packages/build-infrastructure/src/types.ts:128](https://github.com/microsoft/FluidFramework/blob/main/build-tools/packages/build-infrastructure/src/types.ts#L128)
***
### reload()
```ts
reload(): void
```
#### Returns
`void`
#### Inherited from
[`Reloadable`](Reloadable.md).[`reload`](Reloadable.md#reload)
#### Defined in
[packages/build-infrastructure/src/types.ts:135](https://github.com/microsoft/FluidFramework/blob/main/build-tools/packages/build-infrastructure/src/types.ts#L135)
***
### toString()
```ts
toString(): string
```
Returns a string representation of an object.
#### Returns
`string`
#### Defined in
[packages/build-infrastructure/src/types.ts:191](https://github.com/microsoft/FluidFramework/blob/main/build-tools/packages/build-infrastructure/src/types.ts#L191)

Просмотреть файл

@ -0,0 +1,58 @@
[**@fluid-tools/build-infrastructure**](../README.md) • **Docs**
***
[@fluid-tools/build-infrastructure](../README.md) / Installable
# Interface: Installable
A common interface for installable things, like packages, release groups, and workspaces.
## Extended by
- [`IPackage`](IPackage.md)
- [`IWorkspace`](IWorkspace.md)
## Methods
### checkInstall()
```ts
checkInstall(): Promise<boolean>
```
Returns `true` if the item is installed. If this returns `false`, then the `install` function can be called to
install.
#### Returns
`Promise`\<`boolean`\>
#### Defined in
[packages/build-infrastructure/src/types.ts:120](https://github.com/microsoft/FluidFramework/blob/main/build-tools/packages/build-infrastructure/src/types.ts#L120)
***
### install()
```ts
install(updateLockfile): Promise<boolean>
```
Installs the item.
#### Parameters
**updateLockfile**: `boolean`
If true, the lockfile will be updated. Otherwise, the lockfile will not be updated. This
may cause the installation to fail.
#### Returns
`Promise`\<`boolean`\>
#### Defined in
[packages/build-infrastructure/src/types.ts:128](https://github.com/microsoft/FluidFramework/blob/main/build-tools/packages/build-infrastructure/src/types.ts#L128)

Просмотреть файл

@ -0,0 +1,56 @@
[**@fluid-tools/build-infrastructure**](../README.md) • **Docs**
***
[@fluid-tools/build-infrastructure](../README.md) / PackageDependency
# Interface: PackageDependency
Information about a package dependency. That is, en extry in the "dependencies", "devDependencies", or
"peerDependencies" fields in package.json.
## Properties
### depKind
```ts
depKind: "prod" | "dev" | "peer";
```
The kind of dependency, based on the field that the dependency comes from.
- prod corresponds to the dependencies field.
- dev corresponds to the devDependencies field.
- peer corresponds to the peerDependencies field.
#### Defined in
[packages/build-infrastructure/src/types.ts:320](https://github.com/microsoft/FluidFramework/blob/main/build-tools/packages/build-infrastructure/src/types.ts#L320)
***
### name
```ts
name: PackageName;
```
The name of the dependency.
#### Defined in
[packages/build-infrastructure/src/types.ts:306](https://github.com/microsoft/FluidFramework/blob/main/build-tools/packages/build-infrastructure/src/types.ts#L306)
***
### version
```ts
version: string;
```
The version or version range of the dependency.
#### Defined in
[packages/build-infrastructure/src/types.ts:311](https://github.com/microsoft/FluidFramework/blob/main/build-tools/packages/build-infrastructure/src/types.ts#L311)

Просмотреть файл

@ -0,0 +1,76 @@
[**@fluid-tools/build-infrastructure**](../README.md) • **Docs**
***
[@fluid-tools/build-infrastructure](../README.md) / ReleaseGroupDefinition
# Interface: ReleaseGroupDefinition
The definition of a release group ih configuration.
## Properties
### adoPipelineUrl?
```ts
optional adoPipelineUrl: string;
```
A URL to the ADO CI pipeline that builds the release group.
#### Defined in
[packages/build-infrastructure/src/config.ts:104](https://github.com/microsoft/FluidFramework/blob/main/build-tools/packages/build-infrastructure/src/config.ts#L104)
***
### exclude?
```ts
optional exclude: string[];
```
An array of scopes or package names that should be excluded. Exclusions are applied AFTER inclusions, so
this can be used to exclude specific packages in a certain scope.
#### Defined in
[packages/build-infrastructure/src/config.ts:87](https://github.com/microsoft/FluidFramework/blob/main/build-tools/packages/build-infrastructure/src/config.ts#L87)
***
### include
```ts
include: string[];
```
An array of scopes or package names that should be included in the release group. Each package must
belong to a single release group.
To include all packages, set this value to a single element: `["*"]`.
#### Defined in
[packages/build-infrastructure/src/config.ts:81](https://github.com/microsoft/FluidFramework/blob/main/build-tools/packages/build-infrastructure/src/config.ts#L81)
***
### rootPackageName?
```ts
optional rootPackageName: string;
```
The name of the package that should be considered the root package for the release group. If not provided, the
release group is considered "rootless."
#### Remarks
A release group may have a "root package" that is part of the workspace but fills a similar role to the
workspace-root package: it is a convenient place to store release-group-wide scripts as opposed to workspace-wide
scripts.
#### Defined in
[packages/build-infrastructure/src/config.ts:99](https://github.com/microsoft/FluidFramework/blob/main/build-tools/packages/build-infrastructure/src/config.ts#L99)

Просмотреть файл

@ -0,0 +1,32 @@
[**@fluid-tools/build-infrastructure**](../README.md) • **Docs**
***
[@fluid-tools/build-infrastructure](../README.md) / Reloadable
# Interface: Reloadable
An interface for things that can be reloaded,
## Extended by
- [`IFluidRepo`](IFluidRepo.md)
- [`IPackage`](IPackage.md)
- [`IReleaseGroup`](IReleaseGroup.md)
- [`IWorkspace`](IWorkspace.md)
## Methods
### reload()
```ts
reload(): void
```
#### Returns
`void`
#### Defined in
[packages/build-infrastructure/src/types.ts:135](https://github.com/microsoft/FluidFramework/blob/main/build-tools/packages/build-infrastructure/src/types.ts#L135)

Просмотреть файл

@ -0,0 +1,41 @@
[**@fluid-tools/build-infrastructure**](../README.md) • **Docs**
***
[@fluid-tools/build-infrastructure](../README.md) / WorkspaceDefinition
# Interface: WorkspaceDefinition
The definition of a workspace ih configuration.
## Properties
### directory
```ts
directory: string;
```
The root directory of the workspace. This folder should contain a workspace config file (e.g. pnpm-workspace.yaml).
#### Defined in
[packages/build-infrastructure/src/config.ts:58](https://github.com/microsoft/FluidFramework/blob/main/build-tools/packages/build-infrastructure/src/config.ts#L58)
***
### releaseGroups
```ts
releaseGroups: object;
```
Definitions of the release groups within the workspace.
#### Index Signature
\[`name`: `string`\]: [`ReleaseGroupDefinition`](ReleaseGroupDefinition.md)
#### Defined in
[packages/build-infrastructure/src/config.ts:63](https://github.com/microsoft/FluidFramework/blob/main/build-tools/packages/build-infrastructure/src/config.ts#L63)

Просмотреть файл

@ -0,0 +1,17 @@
[**@fluid-tools/build-infrastructure**](../README.md) • **Docs**
***
[@fluid-tools/build-infrastructure](../README.md) / AdditionalPackageProps
# Type Alias: AdditionalPackageProps
```ts
type AdditionalPackageProps: Record<string, string> | undefined;
```
Additional properties that can be added to an [IPackage](../interfaces/IPackage.md).
## Defined in
[packages/build-infrastructure/src/types.ts:41](https://github.com/microsoft/FluidFramework/blob/main/build-tools/packages/build-infrastructure/src/types.ts#L41)

Просмотреть файл

@ -0,0 +1,19 @@
[**@fluid-tools/build-infrastructure**](../README.md) • **Docs**
***
[@fluid-tools/build-infrastructure](../README.md) / IFluidBuildDirEntry
# Type Alias: ~~IFluidBuildDirEntry~~
```ts
type IFluidBuildDirEntry: string | IFluidBuildDir | (string | IFluidBuildDir)[];
```
## Deprecated
Use repoLayout and associated types instead.
## Defined in
[packages/build-infrastructure/src/config.ts:117](https://github.com/microsoft/FluidFramework/blob/main/build-tools/packages/build-infrastructure/src/config.ts#L117)

Просмотреть файл

@ -0,0 +1,18 @@
[**@fluid-tools/build-infrastructure**](../README.md) • **Docs**
***
[@fluid-tools/build-infrastructure](../README.md) / PackageJson
# Type Alias: PackageJson
```ts
type PackageJson: SetRequired<StandardPackageJson & FluidPackageJsonFields, "name" | "scripts" | "version">;
```
All known package.json fields including those that are specific to build-infrastructure.
The `name`, `scripts`, and `version` fields are required, unlike standard package.json.
## Defined in
[packages/build-infrastructure/src/types.ts:33](https://github.com/microsoft/FluidFramework/blob/main/build-tools/packages/build-infrastructure/src/types.ts#L33)

Просмотреть файл

@ -0,0 +1,17 @@
[**@fluid-tools/build-infrastructure**](../README.md) • **Docs**
***
[@fluid-tools/build-infrastructure](../README.md) / PackageManagerName
# Type Alias: PackageManagerName
```ts
type PackageManagerName: "npm" | "pnpm" | "yarn";
```
Known package managers supported by build-infrastructure.
## Defined in
[packages/build-infrastructure/src/types.ts:271](https://github.com/microsoft/FluidFramework/blob/main/build-tools/packages/build-infrastructure/src/types.ts#L271)

Просмотреть файл

@ -0,0 +1,17 @@
[**@fluid-tools/build-infrastructure**](../README.md) • **Docs**
***
[@fluid-tools/build-infrastructure](../README.md) / PackageName
# Type Alias: PackageName
```ts
type PackageName: Opaque<string, "PackageName">;
```
A tagged type representing package names.
## Defined in
[packages/build-infrastructure/src/types.ts:326](https://github.com/microsoft/FluidFramework/blob/main/build-tools/packages/build-infrastructure/src/types.ts#L326)

Просмотреть файл

@ -0,0 +1,17 @@
[**@fluid-tools/build-infrastructure**](../README.md) • **Docs**
***
[@fluid-tools/build-infrastructure](../README.md) / ReleaseGroupName
# Type Alias: ReleaseGroupName
```ts
type ReleaseGroupName: Opaque<string, IReleaseGroup>;
```
A tagged type representing release group names.
## Defined in
[packages/build-infrastructure/src/types.ts:197](https://github.com/microsoft/FluidFramework/blob/main/build-tools/packages/build-infrastructure/src/types.ts#L197)

Просмотреть файл

@ -0,0 +1,17 @@
[**@fluid-tools/build-infrastructure**](../README.md) • **Docs**
***
[@fluid-tools/build-infrastructure](../README.md) / WorkspaceName
# Type Alias: WorkspaceName
```ts
type WorkspaceName: Opaque<string, "WorkspaceName">;
```
A tagged type representing workspace names.
## Defined in
[packages/build-infrastructure/src/types.ts:141](https://github.com/microsoft/FluidFramework/blob/main/build-tools/packages/build-infrastructure/src/types.ts#L141)

Просмотреть файл

@ -0,0 +1,17 @@
[**@fluid-tools/build-infrastructure**](../README.md) • **Docs**
***
[@fluid-tools/build-infrastructure](../README.md) / FLUIDREPO\_CONFIG\_VERSION
# Variable: FLUIDREPO\_CONFIG\_VERSION
```ts
const FLUIDREPO_CONFIG_VERSION: 1 = 1;
```
The version of the fluidRepo configuration currently used.
## Defined in
[packages/build-infrastructure/src/config.ts:18](https://github.com/microsoft/FluidFramework/blob/main/build-tools/packages/build-infrastructure/src/config.ts#L18)

Просмотреть файл

@ -0,0 +1,6 @@
{
"reporterEnabled": "xunit,spec",
"xunitReporterOptions": {
"output": "nyc/junit-report.xml"
}
}

Просмотреть файл

@ -0,0 +1,126 @@
{
"name": "@fluid-tools/build-infrastructure",
"version": "0.45.0",
"private": true,
"description": "Fluid build infrastructure",
"homepage": "https://fluidframework.com",
"repository": {
"type": "git",
"url": "https://github.com/microsoft/FluidFramework.git",
"directory": "build-tools/packages/build-infrastructure"
},
"license": "MIT",
"author": "Microsoft and contributors",
"type": "module",
"exports": {
".": {
"import": {
"types": "./lib/index.d.ts",
"default": "./lib/index.js"
},
"require": {
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
}
}
},
"main": "lib/index.js",
"bin": {
"repo-layout": "./bin/run.mjs"
},
"files": [
"/bin",
"/dist",
"!dist/test",
"/lib",
"!lib/test",
"/oclif.manifest.json"
],
"scripts": {
"build": "fluid-build . --task build",
"build:commonjs": "npm run tsc && npm run build:test",
"build:compile": "npm run build:commonjs",
"build:docs": "api-extractor run --local && typedoc",
"build:esnext": "tsc --project ./tsconfig.json",
"build:manifest": "oclif manifest",
"build:test": "npm run build:test:esm && npm run build:test:cjs",
"build:test:cjs": "fluid-tsc commonjs --project ./src/test/tsconfig.cjs.json",
"build:test:esm": "tsc --project ./src/test/tsconfig.json",
"check:biome": "biome check .",
"check:format": "npm run check:biome",
"clean": "rimraf --glob dist lib \"**/*.tsbuildinfo\" \"**/*.build.log\" nyc _api-extractor-temp",
"compile": "fluid-build . --task compile",
"eslint": "eslint --format stylish src",
"eslint:fix": "eslint --format stylish src --fix --fix-type problem,suggestion,layout",
"format": "npm run format:biome",
"format:biome": "biome check --write .",
"lint": "npm run eslint",
"lint:fix": "npm run eslint:fix",
"test": "npm run test:mocha",
"test:coverage": "c8 npm run test",
"test:mocha": "mocha --recursive lib/test",
"tsc": "fluid-tsc commonjs --project ./tsconfig.cjs.json && copyfiles -f ../../../common/build/build-common/src/cjs/package.json ./dist"
},
"dependencies": {
"@fluid-tools/version-tools": "workspace:^",
"@manypkg/get-packages": "^2.2.0",
"@oclif/core": "^4.0.14",
"cosmiconfig": "^8.3.6",
"detect-indent": "^6.1.0",
"execa": "^5.1.1",
"fs-extra": "^11.2.0",
"globby": "^11.1.0",
"micromatch": "^4.0.8",
"oclif": "^4.14.9",
"picocolors": "^1.1.0",
"read-pkg-up": "^7.0.1",
"semver": "^7.5.4",
"simple-git": "^3.19.1",
"sort-package-json": "1.57.0",
"type-fest": "^2.19.0",
"typescript": "~5.4.5"
},
"devDependencies": {
"@biomejs/biome": "~1.9.3",
"@fluid-tools/api-markdown-documenter": "^0.17.1",
"@fluidframework/build-common": "^2.0.3",
"@fluidframework/build-tools-bin": "npm:@fluidframework/build-tools@~0.44.0",
"@fluidframework/eslint-config-fluid": "^5.3.0",
"@microsoft/api-extractor": "^7.45.1",
"@types/chai": "^4.3.5",
"@types/chai-arrays": "^2.0.0",
"@types/fs-extra": "^11.0.4",
"@types/micromatch": "^4.0.9",
"@types/mocha": "^9.1.1",
"@types/node": "^18.18.6",
"@types/semver": "^7.5.0",
"c8": "^7.14.0",
"chai": "^4.5.0",
"chai-arrays": "^2.2.0",
"concurrently": "^8.2.1",
"copyfiles": "^2.4.1",
"eslint": "~8.57.0",
"eslint-plugin-chai-friendly": "~1.0.1",
"memfs": "^4.14.0",
"mocha": "^10.2.0",
"rimraf": "^4.4.1",
"ts-node": "^10.9.1",
"typedoc": "^0.26.10",
"typedoc-plugin-markdown": "^4.2.9",
"unionfs": "^4.5.4"
},
"oclif": {
"bin": "repo-layout",
"dirname": "repo-layout",
"commands": "./lib/commands",
"additionalHelpFlags": [
"-h"
],
"additionalVersionFlags": [
"-V"
],
"plugins": [],
"repositoryPrefix": "<%- repo %>/blob/main/build-tools/packages/build-infrastructure/<%- commandPath %>",
"topicSeparator": " "
}
}

Просмотреть файл

@ -0,0 +1,240 @@
/*!
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
* Licensed under the MIT License.
*/
import { cosmiconfigSync } from "cosmiconfig";
import {
type IPackage,
type PackageName,
type ReleaseGroupName,
isIPackage,
} from "./types.js";
/**
* The version of the fluidRepo configuration currently used.
*/
export const FLUIDREPO_CONFIG_VERSION = 1;
/**
* Top-most configuration for repo layout settings.
*/
export interface IFluidRepoLayout {
/**
* The version of the config.
*/
version: typeof FLUIDREPO_CONFIG_VERSION;
/**
* **BACK-COMPAT ONLY**
*
* A mapping of package or release group names to metadata about the package or release group.
*
* @deprecated Use the repoLayout property instead.
*/
repoPackages?: IFluidBuildDirs;
/**
* The layout of repo into workspaces and release groups.
*/
repoLayout?: {
workspaces: {
/**
* A mapping of workspace name to folder containing a workspace config file (e.g. pnpm-workspace.yaml).
*/
[name: string]: WorkspaceDefinition;
};
};
}
/**
* The definition of a workspace ih configuration.
*/
export interface WorkspaceDefinition {
/**
* The root directory of the workspace. This folder should contain a workspace config file (e.g. pnpm-workspace.yaml).
*/
directory: string;
/**
* Definitions of the release groups within the workspace.
*/
releaseGroups: {
/**
* A mapping of release group name to a definition for the release group.
*/
[name: string]: ReleaseGroupDefinition;
};
}
/**
* The definition of a release group ih configuration.
*/
export interface ReleaseGroupDefinition {
/**
* An array of scopes or package names that should be included in the release group. Each package must
* belong to a single release group.
*
* To include all packages, set this value to a single element: `["*"]`.
*/
include: string[];
/**
* An array of scopes or package names that should be excluded. Exclusions are applied AFTER inclusions, so
* this can be used to exclude specific packages in a certain scope.
*/
exclude?: string[];
/**
* The name of the package that should be considered the root package for the release group. If not provided, the
* release group is considered "rootless."
*
* @remarks
*
* A release group may have a "root package" that is part of the workspace but fills a similar role to the
* workspace-root package: it is a convenient place to store release-group-wide scripts as opposed to workspace-wide
* scripts.
*/
rootPackageName?: string;
/**
* A URL to the ADO CI pipeline that builds the release group.
*/
adoPipelineUrl?: string;
}
/**
* @deprecated Use repoLayout and associated types instead.
*/
export interface IFluidBuildDirs {
[name: string]: IFluidBuildDirEntry;
}
/**
* @deprecated Use repoLayout and associated types instead.
*/
export type IFluidBuildDirEntry = string | IFluidBuildDir | (string | IFluidBuildDir)[];
/**
* Configures a package or release group
*
* @deprecated Use repoLayout and associated types instead.
*/
export interface IFluidBuildDir {
/**
* The path to the package. For release groups this should be the path to the root of the release group.
*/
directory: string;
/**
* An array of paths under `directory` that should be ignored.
*
* @deprecated This field is unused in all known configs and is ignored by the back-compat loading code.
*/
ignoredDirs?: string[];
}
/**
* Checks if a package matches a given {@link ReleaseGroupDefinition}.
*
* @returns `true` if the package matches the release group definition; `false` otherwise.
*/
export function matchesReleaseGroupDefinition(
pkg: IPackage | PackageName,
{ include, exclude, rootPackageName }: ReleaseGroupDefinition,
): boolean {
const name = isIPackage(pkg) ? pkg.name : pkg;
let shouldInclude = false;
if (
// Special case: an include value with a single element, "*", should include all packages.
(include.length === 1 && include[0] === "*") ||
// If the package name matches an entry in the include list, it should be included
include.includes(name) ||
// If the package name starts with any of the include list entries, it should be included
include.some((scope) => name.startsWith(scope))
) {
shouldInclude = true;
}
const shouldExclude = exclude?.includes(name) ?? false;
return (
(shouldInclude && !shouldExclude) ||
// If the package name matches the root name, it's definitely part of the release group.
name === rootPackageName
);
}
/**
* Finds the name of the release group that a package belongs to.
*
* @param pkg - The package for which to fina a release group.
* @param definition - The "releaseGroups" config from the RepoLayout config/
* @returns The name of the package's release group.
*/
export function findReleaseGroupForPackage(
pkg: IPackage | PackageName,
definition: Exclude<WorkspaceDefinition["releaseGroups"], undefined>,
): ReleaseGroupName | undefined {
for (const [rgName, def] of Object.entries(definition)) {
if (matchesReleaseGroupDefinition(pkg, def)) {
return rgName as ReleaseGroupName;
}
}
}
const configName = "repoLayout";
/**
* A cosmiconfig explorer to find the repoLayout config. First looks for JavaScript config files and falls back to the
* `repoLayout` property in package.json. We create a single explorer here because cosmiconfig internally caches configs
* for performance. The cache is per-explorer, so re-using the same explorer is a minor perf improvement.
*/
const configExplorer = cosmiconfigSync(configName, {
searchPlaces: [
`${configName}.config.cjs`,
`${configName}.config.js`,
// Load from the fluidBuild config files as a fallback.
"fluidBuild.config.cjs",
"fluidBuild.config.js",
// Or the repoLayout property in package.json
"package.json",
],
packageProp: [configName],
});
/**
* Search a path for a repo layout config file, and return the parsed config and the path to the config file.
*
* @param searchPath - The path to start searching for config files in.
* @param noCache - If true, the config cache will be cleared and the config will be reloaded.
* @returns The loaded repoLayout config and the path to the config file.
*
* @throws If a config is not found or if the config version is not supported.
*/
export function getFluidRepoLayout(
searchPath: string,
noCache = false,
): { config: IFluidRepoLayout; configFilePath: string } {
if (noCache === true) {
configExplorer.clearCaches();
}
const configResult = configExplorer.search(searchPath);
if (configResult === null || configResult === undefined) {
throw new Error("No fluidRepo configuration found.");
}
const config = configResult.config as IFluidRepoLayout;
// Only version 1 of the config is supported. If any other value is provided, throw an error.
if (config.version !== FLUIDREPO_CONFIG_VERSION) {
throw new Error(
`Configuration version is not supported: ${config?.version}. Config version must be ${FLUIDREPO_CONFIG_VERSION}.`,
);
}
return { config, configFilePath: configResult.filepath };
}

Просмотреть файл

@ -0,0 +1,13 @@
/*!
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
* Licensed under the MIT License.
*/
/**
* An error thrown when a path is not within a Git repository.
*/
export class NotInGitRepository extends Error {
constructor(public readonly path: string) {
super(`Path is not in a Git repository: ${path}`);
}
}

Просмотреть файл

@ -0,0 +1,72 @@
/*!
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
* Licensed under the MIT License.
*/
/**
* This is the main entrypoint to the build-infrastructure API.
*
* The primary purpose of this package is to provide a common way to organize npm packages into groups called release
* groups, and leverages workspaces functionality provided by package managers like npm, yarn, and pnpm to manage
* interdependencies between packages across a Fluid repo. It then provides APIs to select, filter, and work with those
* package groups.
*
* @module default entrypoint
*/
export {
type ReleaseGroupDefinition,
type WorkspaceDefinition,
type IFluidBuildDir,
type IFluidBuildDirs,
type IFluidBuildDirEntry,
type IFluidRepoLayout,
FLUIDREPO_CONFIG_VERSION,
getFluidRepoLayout,
} from "./config.js";
export { NotInGitRepository } from "./errors.js";
export type {
AdditionalPackageProps,
Installable,
IFluidRepo,
IPackage,
IReleaseGroup,
IWorkspace,
PackageJson,
PackageManagerName,
PackageName,
ReleaseGroupName,
Reloadable,
WorkspaceName,
PnpmPackageJsonFields as FluidPackageJsonFields,
PackageDependency,
IPackageManager,
} from "./types.js";
export { isIPackage, isIReleaseGroup } from "./types.js";
// export {
// filterPackages,
// type FilterablePackage,
// selectAndFilterPackages,
// type GlobString,
// AllPackagesSelectionCriteria,
// EmptySelectionCriteria,
// type PackageSelectionCriteria,
// type PackageFilterOptions,
// } from "./filter.js";
// export {
// FluidRepo as FluidRepoBase,
// getAllDependenciesInRepo,
// loadFluidRepo,
// } from "./fluidRepo.js";
// export {
// getFiles,
// findGitRootSync,
// getMergeBaseRemote,
// getRemote,
// getChangedSinceRef,
// } from "./git.js";
// export { PackageBase } from "./package.js";
// export { updatePackageJsonFile, updatePackageJsonFileAsync } from "./packageJsonUtils.js";
// export { createPackageManager } from "./packageManagers.js";
// export { setVersion } from "./versions.js";

Просмотреть файл

@ -0,0 +1,11 @@
# Changesets
This folder contains changesets, which are markdown files that hold two key bits of information:
1. a version type (following semver), and
2. change information to be added to a changelog. You can find the full documentation for it
[in the changesets section of our wiki](https://github.com/microsoft/FluidFramework/wiki/Changesets) or in [the official changesets documentation.](https://github.com/changesets/changesets)
There is also a list of [frequently asked questions](https://github.com/microsoft/FluidFramework/wiki/Changesets-FAQ) in
the wiki.

Просмотреть файл

@ -0,0 +1,5 @@
---
"pkg-a": minor
---
An example changeset.

Просмотреть файл

@ -0,0 +1,34 @@
{
"$schema": "https://unpkg.com/@changesets/config@2.3.0/schema.json",
"access": "public",
"baseBranch": "main",
"changelog": [
"@fluid-private/changelog-generator-wrapper",
{
"repoBaseUrl": "https://github.com/microsoft/FluidFramework",
"issueTemplate": " ([#$issue]($repoBaseUrl/pull/$issue))",
"commitTemplate": " [$abbrevHash]($repoBaseUrl/commit/$hash)"
}
],
"commit": false,
"fixed": [
[
"pkg-a",
"pkg-b",
"@private/pkg-c",
"@shared/shared"
],
[
"@group2/pkg-d",
"@group2/pkg-e"
],
[
"@group3/pkg-f",
"@group3/pkg-g"
]
],
"ignore": [],
"linked": [],
"updateInternalDependencies": "minor",
"bumpVersionsWithWorkspaceProtocolOnly": true
}

Просмотреть файл

@ -0,0 +1,61 @@
/*!
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
* Licensed under the MIT License.
*/
// Enable TypeScript type-checking for this file.
// See https://www.typescriptlang.org/docs/handbook/intro-to-js-ts.html#ts-check
// @ts-check
/**
* @type {import("@fluid-tools/build-infrastructure").IFluidRepoLayout & import("@fluid-tools/build-cli").FlubConfig}
*/
const config = {
version: 1,
repoLayout: {
workspaces: {
main: {
directory: ".",
releaseGroups: {
main: {
include: ["pkg-a", "pkg-b", "@shared", "@private"],
rootPackageName: "main-release-group-root",
},
group2: {
include: ["@group2"],
},
group3: {
include: ["@group3"],
},
},
},
second: {
directory: "./second",
releaseGroups: {
"second-release-group": {
include: ["*"],
rootPackageName: "second-release-group-root",
},
},
},
},
},
// The configuration used by the `flub generate changeset-config` command.
changesetConfig: {
changelog: [
"@fluid-private/changelog-generator-wrapper",
{
repoBaseUrl: "https://github.com/microsoft/FluidFramework",
issueTemplate: " ([#$issue]($repoBaseUrl/pull/$issue))",
commitTemplate: " [$abbrevHash]($repoBaseUrl/commit/$hash)",
},
],
commit: false,
access: "public",
baseBranch: "main",
updateInternalDependencies: "patch",
},
};
module.exports = config;

Просмотреть файл

@ -0,0 +1,20 @@
{
"name": "main-release-group-root",
"version": "1.0.0",
"description": "Test package",
"homepage": "https://fluidframework.com",
"repository": {
"type": "git",
"url": "https://github.com/microsoft/FluidFramework.git",
"directory": "build-tools/packages/build-infrastructure/src/test/data/testRepo"
},
"license": "MIT",
"author": "Microsoft and contributors",
"dependencies": {
"@fluid-private/changelog-generator-wrapper": "link:../../../../../../../packages/tools/changelog-generator-wrapper",
"@fluid-tools/build-infrastructure": "link:../../../../../build-infrastructure"
},
"devDependencies": {
"@changesets/cli": "^2.27.9"
}
}

Просмотреть файл

@ -0,0 +1,16 @@
{
"name": "@group2/pkg-d",
"version": "1.0.0",
"description": "Test package",
"homepage": "https://fluidframework.com",
"repository": {
"type": "git",
"url": "https://github.com/microsoft/FluidFramework.git",
"directory": "build-tools/packages/build-infrastructure/src/test/data/testRepo/packages/group2/pkg-d"
},
"license": "MIT",
"author": "Microsoft and contributors",
"dependencies": {
"@group2/pkg-e": "workspace:~"
}
}

Просмотреть файл

@ -0,0 +1,14 @@
{
"name": "@group2/pkg-e",
"version": "1.0.0",
"description": "Test package",
"homepage": "https://fluidframework.com",
"repository": {
"type": "git",
"url": "https://github.com/microsoft/FluidFramework.git",
"directory": "build-tools/packages/build-infrastructure/src/test/data/testRepo/packages/group2/pkg-e"
},
"license": "MIT",
"author": "Microsoft and contributors",
"dependencies": {}
}

Просмотреть файл

@ -0,0 +1,17 @@
{
"name": "@group3/pkg-f",
"version": "1.0.0",
"description": "Test package",
"homepage": "https://fluidframework.com",
"repository": {
"type": "git",
"url": "https://github.com/microsoft/FluidFramework.git",
"directory": "build-tools/packages/build-infrastructure/src/test/data/testRepo/packages/group3/pkg-f"
},
"license": "MIT",
"author": "Microsoft and contributors",
"dependencies": {
"@group2/pkg-e": "workspace:~",
"@group3/pkg-g": "workspace:~"
}
}

Просмотреть файл

@ -0,0 +1 @@
export const FOO = 1;

Просмотреть файл

@ -0,0 +1,13 @@
{
"name": "@group3/pkg-g",
"version": "1.0.0",
"description": "Test package",
"homepage": "https://fluidframework.com",
"repository": {
"type": "git",
"url": "https://github.com/microsoft/FluidFramework.git",
"directory": "build-tools/packages/build-infrastructure/src/test/data/testRepo/packages/group3/pkg-g"
},
"license": "MIT",
"author": "Microsoft and contributors"
}

Просмотреть файл

@ -0,0 +1,17 @@
{
"name": "pkg-a",
"version": "1.0.0",
"description": "Test package",
"homepage": "https://fluidframework.com",
"repository": {
"type": "git",
"url": "https://github.com/microsoft/FluidFramework.git",
"directory": "build-tools/packages/build-infrastructure/src/test/data/testRepo/packages/pkg-a"
},
"license": "MIT",
"author": "Microsoft and contributors",
"dependencies": {
"@shared/shared": "workspace:~",
"pkg-b": "workspace:~"
}
}

Просмотреть файл

@ -0,0 +1,16 @@
{
"name": "pkg-b",
"version": "1.0.0",
"description": "Test package",
"homepage": "https://fluidframework.com",
"repository": {
"type": "git",
"url": "https://github.com/microsoft/FluidFramework.git",
"directory": "build-tools/packages/build-infrastructure/src/test/data/testRepo/packages/pkg-b"
},
"license": "MIT",
"author": "Microsoft and contributors",
"dependencies": {
"pkg-b": "workspace:~"
}
}

Просмотреть файл

@ -0,0 +1,17 @@
{
"name": "@private/pkg-c",
"version": "1.0.0",
"private": true,
"description": "Test package",
"homepage": "https://fluidframework.com",
"repository": {
"type": "git",
"url": "https://github.com/microsoft/FluidFramework.git",
"directory": "build-tools/packages/build-infrastructure/src/test/data/testRepo/packages/pkg-c"
},
"license": "MIT",
"author": "Microsoft and contributors",
"dependencies": {
"pkg-b": "workspace:~"
}
}

Просмотреть файл

@ -0,0 +1,16 @@
{
"name": "@shared/shared",
"version": "1.0.0",
"description": "Test package",
"homepage": "https://fluidframework.com",
"repository": {
"type": "git",
"url": "https://github.com/microsoft/FluidFramework.git",
"directory": "build-tools/packages/build-infrastructure/src/test/data/testRepo/packages/shared"
},
"license": "MIT",
"author": "Microsoft and contributors",
"dependencies": {
"@group2/pkg-d": "1.0.0"
}
}

Просмотреть файл

@ -0,0 +1,763 @@
lockfileVersion: '6.0'
settings:
autoInstallPeers: true
excludeLinksFromLockfile: false
importers:
.:
dependencies:
'@fluid-private/changelog-generator-wrapper':
specifier: link:../../../../../../../packages/tools/changelog-generator-wrapper
version: link:../../../../../../../packages/tools/changelog-generator-wrapper
'@fluid-tools/build-infrastructure':
specifier: link:../../../../../build-infrastructure
version: link:../../../..
devDependencies:
'@changesets/cli':
specifier: ^2.27.9
version: 2.27.9
packages/group2/pkg-d:
dependencies:
'@group2/pkg-e':
specifier: workspace:~
version: link:../pkg-e
packages/group2/pkg-e: {}
packages/group3/pkg-f:
dependencies:
'@group2/pkg-e':
specifier: workspace:~
version: link:../../group2/pkg-e
'@group3/pkg-g':
specifier: workspace:~
version: link:../pkg-g
packages/group3/pkg-g: {}
packages/pkg-a:
dependencies:
'@shared/shared':
specifier: workspace:~
version: link:../shared
pkg-b:
specifier: workspace:~
version: link:../pkg-b
packages/pkg-b:
dependencies:
pkg-b:
specifier: workspace:~
version: 'link:'
packages/pkg-c:
dependencies:
pkg-b:
specifier: workspace:~
version: link:../pkg-b
packages/shared:
dependencies:
'@group2/pkg-d':
specifier: 1.0.0
version: link:../group2/pkg-d
packages:
/@babel/runtime@7.25.7:
resolution: {integrity: sha512-FjoyLe754PMiYsFaN5C94ttGiOmBNYTf6pLr4xXHAT5uctHb092PBszndLDR5XA/jghQvn4n7JMHl7dmTgbm9w==}
engines: {node: '>=6.9.0'}
dependencies:
regenerator-runtime: 0.14.1
dev: true
/@changesets/apply-release-plan@7.0.5:
resolution: {integrity: sha512-1cWCk+ZshEkSVEZrm2fSj1Gz8sYvxgUL4Q78+1ZZqeqfuevPTPk033/yUZ3df8BKMohkqqHfzj0HOOrG0KtXTw==}
dependencies:
'@changesets/config': 3.0.3
'@changesets/get-version-range-type': 0.4.0
'@changesets/git': 3.0.1
'@changesets/should-skip-package': 0.1.1
'@changesets/types': 6.0.0
'@manypkg/get-packages': 1.1.3
detect-indent: 6.1.0
fs-extra: 7.0.1
lodash.startcase: 4.4.0
outdent: 0.5.0
prettier: 2.8.8
resolve-from: 5.0.0
semver: 7.6.3
dev: true
/@changesets/assemble-release-plan@6.0.4:
resolution: {integrity: sha512-nqICnvmrwWj4w2x0fOhVj2QEGdlUuwVAwESrUo5HLzWMI1rE5SWfsr9ln+rDqWB6RQ2ZyaMZHUcU7/IRaUJS+Q==}
dependencies:
'@changesets/errors': 0.2.0
'@changesets/get-dependents-graph': 2.1.2
'@changesets/should-skip-package': 0.1.1
'@changesets/types': 6.0.0
'@manypkg/get-packages': 1.1.3
semver: 7.6.3
dev: true
/@changesets/changelog-git@0.2.0:
resolution: {integrity: sha512-bHOx97iFI4OClIT35Lok3sJAwM31VbUM++gnMBV16fdbtBhgYu4dxsphBF/0AZZsyAHMrnM0yFcj5gZM1py6uQ==}
dependencies:
'@changesets/types': 6.0.0
dev: true
/@changesets/cli@2.27.9:
resolution: {integrity: sha512-q42a/ZbDnxPpCb5Wkm6tMVIxgeI9C/bexntzTeCFBrQEdpisQqk8kCHllYZMDjYtEc1ZzumbMJAG8H0Z4rdvjg==}
hasBin: true
dependencies:
'@changesets/apply-release-plan': 7.0.5
'@changesets/assemble-release-plan': 6.0.4
'@changesets/changelog-git': 0.2.0
'@changesets/config': 3.0.3
'@changesets/errors': 0.2.0
'@changesets/get-dependents-graph': 2.1.2
'@changesets/get-release-plan': 4.0.4
'@changesets/git': 3.0.1
'@changesets/logger': 0.1.1
'@changesets/pre': 2.0.1
'@changesets/read': 0.6.1
'@changesets/should-skip-package': 0.1.1
'@changesets/types': 6.0.0
'@changesets/write': 0.3.2
'@manypkg/get-packages': 1.1.3
ansi-colors: 4.1.3
ci-info: 3.9.0
enquirer: 2.4.1
external-editor: 3.1.0
fs-extra: 7.0.1
mri: 1.2.0
p-limit: 2.3.0
package-manager-detector: 0.2.1
picocolors: 1.1.0
resolve-from: 5.0.0
semver: 7.6.3
spawndamnit: 2.0.0
term-size: 2.2.1
dev: true
/@changesets/config@3.0.3:
resolution: {integrity: sha512-vqgQZMyIcuIpw9nqFIpTSNyc/wgm/Lu1zKN5vECy74u95Qx/Wa9g27HdgO4NkVAaq+BGA8wUc/qvbvVNs93n6A==}
dependencies:
'@changesets/errors': 0.2.0
'@changesets/get-dependents-graph': 2.1.2
'@changesets/logger': 0.1.1
'@changesets/types': 6.0.0
'@manypkg/get-packages': 1.1.3
fs-extra: 7.0.1
micromatch: 4.0.8
dev: true
/@changesets/errors@0.2.0:
resolution: {integrity: sha512-6BLOQUscTpZeGljvyQXlWOItQyU71kCdGz7Pi8H8zdw6BI0g3m43iL4xKUVPWtG+qrrL9DTjpdn8eYuCQSRpow==}
dependencies:
extendable-error: 0.1.7
dev: true
/@changesets/get-dependents-graph@2.1.2:
resolution: {integrity: sha512-sgcHRkiBY9i4zWYBwlVyAjEM9sAzs4wYVwJUdnbDLnVG3QwAaia1Mk5P8M7kraTOZN+vBET7n8KyB0YXCbFRLQ==}
dependencies:
'@changesets/types': 6.0.0
'@manypkg/get-packages': 1.1.3
picocolors: 1.1.0
semver: 7.6.3
dev: true
/@changesets/get-release-plan@4.0.4:
resolution: {integrity: sha512-SicG/S67JmPTrdcc9Vpu0wSQt7IiuN0dc8iR5VScnnTVPfIaLvKmEGRvIaF0kcn8u5ZqLbormZNTO77bCEvyWw==}
dependencies:
'@changesets/assemble-release-plan': 6.0.4
'@changesets/config': 3.0.3
'@changesets/pre': 2.0.1
'@changesets/read': 0.6.1
'@changesets/types': 6.0.0
'@manypkg/get-packages': 1.1.3
dev: true
/@changesets/get-version-range-type@0.4.0:
resolution: {integrity: sha512-hwawtob9DryoGTpixy1D3ZXbGgJu1Rhr+ySH2PvTLHvkZuQ7sRT4oQwMh0hbqZH1weAooedEjRsbrWcGLCeyVQ==}
dev: true
/@changesets/git@3.0.1:
resolution: {integrity: sha512-pdgHcYBLCPcLd82aRcuO0kxCDbw/yISlOtkmwmE8Odo1L6hSiZrBOsRl84eYG7DRCab/iHnOkWqExqc4wxk2LQ==}
dependencies:
'@changesets/errors': 0.2.0
'@manypkg/get-packages': 1.1.3
is-subdir: 1.2.0
micromatch: 4.0.8
spawndamnit: 2.0.0
dev: true
/@changesets/logger@0.1.1:
resolution: {integrity: sha512-OQtR36ZlnuTxKqoW4Sv6x5YIhOmClRd5pWsjZsddYxpWs517R0HkyiefQPIytCVh4ZcC5x9XaG8KTdd5iRQUfg==}
dependencies:
picocolors: 1.1.0
dev: true
/@changesets/parse@0.4.0:
resolution: {integrity: sha512-TS/9KG2CdGXS27S+QxbZXgr8uPsP4yNJYb4BC2/NeFUj80Rni3TeD2qwWmabymxmrLo7JEsytXH1FbpKTbvivw==}
dependencies:
'@changesets/types': 6.0.0
js-yaml: 3.14.1
dev: true
/@changesets/pre@2.0.1:
resolution: {integrity: sha512-vvBJ/If4jKM4tPz9JdY2kGOgWmCowUYOi5Ycv8dyLnEE8FgpYYUo1mgJZxcdtGGP3aG8rAQulGLyyXGSLkIMTQ==}
dependencies:
'@changesets/errors': 0.2.0
'@changesets/types': 6.0.0
'@manypkg/get-packages': 1.1.3
fs-extra: 7.0.1
dev: true
/@changesets/read@0.6.1:
resolution: {integrity: sha512-jYMbyXQk3nwP25nRzQQGa1nKLY0KfoOV7VLgwucI0bUO8t8ZLCr6LZmgjXsiKuRDc+5A6doKPr9w2d+FEJ55zQ==}
dependencies:
'@changesets/git': 3.0.1
'@changesets/logger': 0.1.1
'@changesets/parse': 0.4.0
'@changesets/types': 6.0.0
fs-extra: 7.0.1
p-filter: 2.1.0
picocolors: 1.1.0
dev: true
/@changesets/should-skip-package@0.1.1:
resolution: {integrity: sha512-H9LjLbF6mMHLtJIc/eHR9Na+MifJ3VxtgP/Y+XLn4BF7tDTEN1HNYtH6QMcjP1uxp9sjaFYmW8xqloaCi/ckTg==}
dependencies:
'@changesets/types': 6.0.0
'@manypkg/get-packages': 1.1.3
dev: true
/@changesets/types@4.1.0:
resolution: {integrity: sha512-LDQvVDv5Kb50ny2s25Fhm3d9QSZimsoUGBsUioj6MC3qbMUCuC8GPIvk/M6IvXx3lYhAs0lwWUQLb+VIEUCECw==}
dev: true
/@changesets/types@6.0.0:
resolution: {integrity: sha512-b1UkfNulgKoWfqyHtzKS5fOZYSJO+77adgL7DLRDr+/7jhChN+QcHnbjiQVOz/U+Ts3PGNySq7diAItzDgugfQ==}
dev: true
/@changesets/write@0.3.2:
resolution: {integrity: sha512-kDxDrPNpUgsjDbWBvUo27PzKX4gqeKOlhibaOXDJA6kuBisGqNHv/HwGJrAu8U/dSf8ZEFIeHIPtvSlZI1kULw==}
dependencies:
'@changesets/types': 6.0.0
fs-extra: 7.0.1
human-id: 1.0.2
prettier: 2.8.8
dev: true
/@manypkg/find-root@1.1.0:
resolution: {integrity: sha512-mki5uBvhHzO8kYYix/WRy2WX8S3B5wdVSc9D6KcU5lQNglP2yt58/VfLuAK49glRXChosY8ap2oJ1qgma3GUVA==}
dependencies:
'@babel/runtime': 7.25.7
'@types/node': 12.20.55
find-up: 4.1.0
fs-extra: 8.1.0
dev: true
/@manypkg/get-packages@1.1.3:
resolution: {integrity: sha512-fo+QhuU3qE/2TQMQmbVMqaQ6EWbMhi4ABWP+O4AM1NqPBuy0OrApV5LO6BrrgnhtAHS2NH6RrVk9OL181tTi8A==}
dependencies:
'@babel/runtime': 7.25.7
'@changesets/types': 4.1.0
'@manypkg/find-root': 1.1.0
fs-extra: 8.1.0
globby: 11.1.0
read-yaml-file: 1.1.0
dev: true
/@nodelib/fs.scandir@2.1.5:
resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==}
engines: {node: '>= 8'}
dependencies:
'@nodelib/fs.stat': 2.0.5
run-parallel: 1.2.0
dev: true
/@nodelib/fs.stat@2.0.5:
resolution: {integrity: sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==}
engines: {node: '>= 8'}
dev: true
/@nodelib/fs.walk@1.2.8:
resolution: {integrity: sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==}
engines: {node: '>= 8'}
dependencies:
'@nodelib/fs.scandir': 2.1.5
fastq: 1.17.1
dev: true
/@types/node@12.20.55:
resolution: {integrity: sha512-J8xLz7q2OFulZ2cyGTLE1TbbZcjpno7FaN6zdJNrgAdrJ+DZzh/uFR6YrTb4C+nXakvud8Q4+rbhoIWlYQbUFQ==}
dev: true
/ansi-colors@4.1.3:
resolution: {integrity: sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==}
engines: {node: '>=6'}
dev: true
/ansi-regex@5.0.1:
resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==}
engines: {node: '>=8'}
dev: true
/argparse@1.0.10:
resolution: {integrity: sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==}
dependencies:
sprintf-js: 1.0.3
dev: true
/array-union@2.1.0:
resolution: {integrity: sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==}
engines: {node: '>=8'}
dev: true
/better-path-resolve@1.0.0:
resolution: {integrity: sha512-pbnl5XzGBdrFU/wT4jqmJVPn2B6UHPBOhzMQkY/SPUPB6QtUXtmBHBIwCbXJol93mOpGMnQyP/+BB19q04xj7g==}
engines: {node: '>=4'}
dependencies:
is-windows: 1.0.2
dev: true
/braces@3.0.3:
resolution: {integrity: sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==}
engines: {node: '>=8'}
dependencies:
fill-range: 7.1.1
dev: true
/chardet@0.7.0:
resolution: {integrity: sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==}
dev: true
/ci-info@3.9.0:
resolution: {integrity: sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ==}
engines: {node: '>=8'}
dev: true
/cross-spawn@5.1.0:
resolution: {integrity: sha512-pTgQJ5KC0d2hcY8eyL1IzlBPYjTkyH72XRZPnLyKus2mBfNjQs3klqbJU2VILqZryAZUt9JOb3h/mWMy23/f5A==}
dependencies:
lru-cache: 4.1.5
shebang-command: 1.2.0
which: 1.3.1
dev: true
/detect-indent@6.1.0:
resolution: {integrity: sha512-reYkTUJAZb9gUuZ2RvVCNhVHdg62RHnJ7WJl8ftMi4diZ6NWlciOzQN88pUhSELEwflJht4oQDv0F0BMlwaYtA==}
engines: {node: '>=8'}
dev: true
/dir-glob@3.0.1:
resolution: {integrity: sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==}
engines: {node: '>=8'}
dependencies:
path-type: 4.0.0
dev: true
/enquirer@2.4.1:
resolution: {integrity: sha512-rRqJg/6gd538VHvR3PSrdRBb/1Vy2YfzHqzvbhGIQpDRKIa4FgV/54b5Q1xYSxOOwKvjXweS26E0Q+nAMwp2pQ==}
engines: {node: '>=8.6'}
dependencies:
ansi-colors: 4.1.3
strip-ansi: 6.0.1
dev: true
/esprima@4.0.1:
resolution: {integrity: sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==}
engines: {node: '>=4'}
hasBin: true
dev: true
/extendable-error@0.1.7:
resolution: {integrity: sha512-UOiS2in6/Q0FK0R0q6UY9vYpQ21mr/Qn1KOnte7vsACuNJf514WvCCUHSRCPcgjPT2bAhNIJdlE6bVap1GKmeg==}
dev: true
/external-editor@3.1.0:
resolution: {integrity: sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==}
engines: {node: '>=4'}
dependencies:
chardet: 0.7.0
iconv-lite: 0.4.24
tmp: 0.0.33
dev: true
/fast-glob@3.3.2:
resolution: {integrity: sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==}
engines: {node: '>=8.6.0'}
dependencies:
'@nodelib/fs.stat': 2.0.5
'@nodelib/fs.walk': 1.2.8
glob-parent: 5.1.2
merge2: 1.4.1
micromatch: 4.0.8
dev: true
/fastq@1.17.1:
resolution: {integrity: sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==}
dependencies:
reusify: 1.0.4
dev: true
/fill-range@7.1.1:
resolution: {integrity: sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==}
engines: {node: '>=8'}
dependencies:
to-regex-range: 5.0.1
dev: true
/find-up@4.1.0:
resolution: {integrity: sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==}
engines: {node: '>=8'}
dependencies:
locate-path: 5.0.0
path-exists: 4.0.0
dev: true
/fs-extra@7.0.1:
resolution: {integrity: sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw==}
engines: {node: '>=6 <7 || >=8'}
dependencies:
graceful-fs: 4.2.11
jsonfile: 4.0.0
universalify: 0.1.2
dev: true
/fs-extra@8.1.0:
resolution: {integrity: sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==}
engines: {node: '>=6 <7 || >=8'}
dependencies:
graceful-fs: 4.2.11
jsonfile: 4.0.0
universalify: 0.1.2
dev: true
/glob-parent@5.1.2:
resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==}
engines: {node: '>= 6'}
dependencies:
is-glob: 4.0.3
dev: true
/globby@11.1.0:
resolution: {integrity: sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==}
engines: {node: '>=10'}
dependencies:
array-union: 2.1.0
dir-glob: 3.0.1
fast-glob: 3.3.2
ignore: 5.3.2
merge2: 1.4.1
slash: 3.0.0
dev: true
/graceful-fs@4.2.11:
resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==}
dev: true
/human-id@1.0.2:
resolution: {integrity: sha512-UNopramDEhHJD+VR+ehk8rOslwSfByxPIZyJRfV739NDhN5LF1fa1MqnzKm2lGTQRjNrjK19Q5fhkgIfjlVUKw==}
dev: true
/iconv-lite@0.4.24:
resolution: {integrity: sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==}
engines: {node: '>=0.10.0'}
dependencies:
safer-buffer: 2.1.2
dev: true
/ignore@5.3.2:
resolution: {integrity: sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==}
engines: {node: '>= 4'}
dev: true
/is-extglob@2.1.1:
resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==}
engines: {node: '>=0.10.0'}
dev: true
/is-glob@4.0.3:
resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==}
engines: {node: '>=0.10.0'}
dependencies:
is-extglob: 2.1.1
dev: true
/is-number@7.0.0:
resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==}
engines: {node: '>=0.12.0'}
dev: true
/is-subdir@1.2.0:
resolution: {integrity: sha512-2AT6j+gXe/1ueqbW6fLZJiIw3F8iXGJtt0yDrZaBhAZEG1raiTxKWU+IPqMCzQAXOUCKdA4UDMgacKH25XG2Cw==}
engines: {node: '>=4'}
dependencies:
better-path-resolve: 1.0.0
dev: true
/is-windows@1.0.2:
resolution: {integrity: sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==}
engines: {node: '>=0.10.0'}
dev: true
/isexe@2.0.0:
resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==}
dev: true
/js-yaml@3.14.1:
resolution: {integrity: sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==}
hasBin: true
dependencies:
argparse: 1.0.10
esprima: 4.0.1
dev: true
/jsonfile@4.0.0:
resolution: {integrity: sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg==}
optionalDependencies:
graceful-fs: 4.2.11
dev: true
/locate-path@5.0.0:
resolution: {integrity: sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==}
engines: {node: '>=8'}
dependencies:
p-locate: 4.1.0
dev: true
/lodash.startcase@4.4.0:
resolution: {integrity: sha512-+WKqsK294HMSc2jEbNgpHpd0JfIBhp7rEV4aqXWqFr6AlXov+SlcgB1Fv01y2kGe3Gc8nMW7VA0SrGuSkRfIEg==}
dev: true
/lru-cache@4.1.5:
resolution: {integrity: sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==}
dependencies:
pseudomap: 1.0.2
yallist: 2.1.2
dev: true
/merge2@1.4.1:
resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==}
engines: {node: '>= 8'}
dev: true
/micromatch@4.0.8:
resolution: {integrity: sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==}
engines: {node: '>=8.6'}
dependencies:
braces: 3.0.3
picomatch: 2.3.1
dev: true
/mri@1.2.0:
resolution: {integrity: sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA==}
engines: {node: '>=4'}
dev: true
/os-tmpdir@1.0.2:
resolution: {integrity: sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==}
engines: {node: '>=0.10.0'}
dev: true
/outdent@0.5.0:
resolution: {integrity: sha512-/jHxFIzoMXdqPzTaCpFzAAWhpkSjZPF4Vsn6jAfNpmbH/ymsmd7Qc6VE9BGn0L6YMj6uwpQLxCECpus4ukKS9Q==}
dev: true
/p-filter@2.1.0:
resolution: {integrity: sha512-ZBxxZ5sL2HghephhpGAQdoskxplTwr7ICaehZwLIlfL6acuVgZPm8yBNuRAFBGEqtD/hmUeq9eqLg2ys9Xr/yw==}
engines: {node: '>=8'}
dependencies:
p-map: 2.1.0
dev: true
/p-limit@2.3.0:
resolution: {integrity: sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==}
engines: {node: '>=6'}
dependencies:
p-try: 2.2.0
dev: true
/p-locate@4.1.0:
resolution: {integrity: sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==}
engines: {node: '>=8'}
dependencies:
p-limit: 2.3.0
dev: true
/p-map@2.1.0:
resolution: {integrity: sha512-y3b8Kpd8OAN444hxfBbFfj1FY/RjtTd8tzYwhUqNYXx0fXx2iX4maP4Qr6qhIKbQXI02wTLAda4fYUbDagTUFw==}
engines: {node: '>=6'}
dev: true
/p-try@2.2.0:
resolution: {integrity: sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==}
engines: {node: '>=6'}
dev: true
/package-manager-detector@0.2.1:
resolution: {integrity: sha512-/hVW2fZvAdEas+wyKh0SnlZ2mx0NIa1+j11YaQkogEJkcMErbwchHCuo8z7lEtajZJQZ6rgZNVTWMVVd71Bjng==}
dev: true
/path-exists@4.0.0:
resolution: {integrity: sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==}
engines: {node: '>=8'}
dev: true
/path-type@4.0.0:
resolution: {integrity: sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==}
engines: {node: '>=8'}
dev: true
/picocolors@1.1.0:
resolution: {integrity: sha512-TQ92mBOW0l3LeMeyLV6mzy/kWr8lkd/hp3mTg7wYK7zJhuBStmGMBG0BdeDZS/dZx1IukaX6Bk11zcln25o1Aw==}
dev: true
/picomatch@2.3.1:
resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==}
engines: {node: '>=8.6'}
dev: true
/pify@4.0.1:
resolution: {integrity: sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==}
engines: {node: '>=6'}
dev: true
/prettier@2.8.8:
resolution: {integrity: sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==}
engines: {node: '>=10.13.0'}
hasBin: true
dev: true
/pseudomap@1.0.2:
resolution: {integrity: sha512-b/YwNhb8lk1Zz2+bXXpS/LK9OisiZZ1SNsSLxN1x2OXVEhW2Ckr/7mWE5vrC1ZTiJlD9g19jWszTmJsB+oEpFQ==}
dev: true
/queue-microtask@1.2.3:
resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==}
dev: true
/read-yaml-file@1.1.0:
resolution: {integrity: sha512-VIMnQi/Z4HT2Fxuwg5KrY174U1VdUIASQVWXXyqtNRtxSr9IYkn1rsI6Tb6HsrHCmB7gVpNwX6JxPTHcH6IoTA==}
engines: {node: '>=6'}
dependencies:
graceful-fs: 4.2.11
js-yaml: 3.14.1
pify: 4.0.1
strip-bom: 3.0.0
dev: true
/regenerator-runtime@0.14.1:
resolution: {integrity: sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw==}
dev: true
/resolve-from@5.0.0:
resolution: {integrity: sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==}
engines: {node: '>=8'}
dev: true
/reusify@1.0.4:
resolution: {integrity: sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==}
engines: {iojs: '>=1.0.0', node: '>=0.10.0'}
dev: true
/run-parallel@1.2.0:
resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==}
dependencies:
queue-microtask: 1.2.3
dev: true
/safer-buffer@2.1.2:
resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==}
dev: true
/semver@7.6.3:
resolution: {integrity: sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==}
engines: {node: '>=10'}
hasBin: true
dev: true
/shebang-command@1.2.0:
resolution: {integrity: sha512-EV3L1+UQWGor21OmnvojK36mhg+TyIKDh3iFBKBohr5xeXIhNBcx8oWdgkTEEQ+BEFFYdLRuqMfd5L84N1V5Vg==}
engines: {node: '>=0.10.0'}
dependencies:
shebang-regex: 1.0.0
dev: true
/shebang-regex@1.0.0:
resolution: {integrity: sha512-wpoSFAxys6b2a2wHZ1XpDSgD7N9iVjg29Ph9uV/uaP9Ex/KXlkTZTeddxDPSYQpgvzKLGJke2UU0AzoGCjNIvQ==}
engines: {node: '>=0.10.0'}
dev: true
/signal-exit@3.0.7:
resolution: {integrity: sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==}
dev: true
/slash@3.0.0:
resolution: {integrity: sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==}
engines: {node: '>=8'}
dev: true
/spawndamnit@2.0.0:
resolution: {integrity: sha512-j4JKEcncSjFlqIwU5L/rp2N5SIPsdxaRsIv678+TZxZ0SRDJTm8JrxJMjE/XuiEZNEir3S8l0Fa3Ke339WI4qA==}
dependencies:
cross-spawn: 5.1.0
signal-exit: 3.0.7
dev: true
/sprintf-js@1.0.3:
resolution: {integrity: sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==}
dev: true
/strip-ansi@6.0.1:
resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==}
engines: {node: '>=8'}
dependencies:
ansi-regex: 5.0.1
dev: true
/strip-bom@3.0.0:
resolution: {integrity: sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==}
engines: {node: '>=4'}
dev: true
/term-size@2.2.1:
resolution: {integrity: sha512-wK0Ri4fOGjv/XPy8SBHZChl8CM7uMc5VML7SqiQ0zG7+J5Vr+RMQDoHa2CNT6KHUnTGIXH34UDMkPzAUyapBZg==}
engines: {node: '>=8'}
dev: true
/tmp@0.0.33:
resolution: {integrity: sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==}
engines: {node: '>=0.6.0'}
dependencies:
os-tmpdir: 1.0.2
dev: true
/to-regex-range@5.0.1:
resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==}
engines: {node: '>=8.0'}
dependencies:
is-number: 7.0.0
dev: true
/universalify@0.1.2:
resolution: {integrity: sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==}
engines: {node: '>= 4.0.0'}
dev: true
/which@1.3.1:
resolution: {integrity: sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==}
hasBin: true
dependencies:
isexe: 2.0.0
dev: true
/yallist@2.1.2:
resolution: {integrity: sha512-ncTzHV7NvsQZkYe1DW7cbDLm0YpzHmZF5r/iyP3ZnQtMiJ+pjzisCiMNI+Sj+xQF5pXhSHxSB3uDbsBTzY/c2A==}
dev: true

Просмотреть файл

@ -0,0 +1,2 @@
packages:
- "packages/**"

Просмотреть файл

@ -0,0 +1,16 @@
{
"name": "second-release-group-root",
"version": "2.0.0",
"description": "Test package",
"homepage": "https://fluidframework.com",
"repository": {
"type": "git",
"url": "https://github.com/microsoft/FluidFramework.git",
"directory": "build-tools/packages/build-infrastructure/src/test/data/testRepo/second"
},
"license": "MIT",
"author": "Microsoft and contributors",
"dependencies": {
"@fluid-tools/build-infrastructure": "link:../../../../../../build-infrastructure"
}
}

Просмотреть файл

@ -0,0 +1,16 @@
{
"name": "other-pkg-a",
"version": "2.0.0",
"description": "Test package",
"homepage": "https://fluidframework.com",
"repository": {
"type": "git",
"url": "https://github.com/microsoft/FluidFramework.git",
"directory": "build-tools/packages/build-infrastructure/src/test/data/testRepo/second/packages/other-pkg-a"
},
"license": "MIT",
"author": "Microsoft and contributors",
"dependencies": {
"other-pkg-b": "workspace:~"
}
}

Просмотреть файл

@ -0,0 +1,13 @@
{
"name": "other-pkg-b",
"version": "2.0.0",
"description": "Test package",
"homepage": "https://fluidframework.com",
"repository": {
"type": "git",
"url": "https://github.com/microsoft/FluidFramework.git",
"directory": "build-tools/packages/build-infrastructure/src/test/data/testRepo/second/packages/other-pkg-b"
},
"license": "MIT",
"author": "Microsoft and contributors"
}

Просмотреть файл

@ -0,0 +1,21 @@
lockfileVersion: '6.0'
settings:
autoInstallPeers: true
excludeLinksFromLockfile: false
importers:
.:
dependencies:
'@fluid-tools/build-infrastructure':
specifier: link:../../../../../../build-infrastructure
version: link:../../../../..
packages/other-pkg-a:
dependencies:
other-pkg-b:
specifier: workspace:~
version: link:../other-pkg-b
packages/other-pkg-b: {}

Просмотреть файл

@ -0,0 +1,2 @@
packages:
- "packages/*"

Просмотреть файл

@ -0,0 +1,14 @@
/*!
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
* Licensed under the MIT License.
*/
// Problem:
// - `__dirname` is not defined in ESM
// - `import.meta.url` is not defined in CJS
// Solution:
// - Export '__dirname' from a .cjs file in the same directory.
//
// Note that *.cjs files are always CommonJS, but can be imported from ESM.
// eslint-disable-next-line unicorn/prefer-module -- this is used for ESM/CJS interop
export const _dirname = __dirname;

Просмотреть файл

@ -0,0 +1,20 @@
/*!
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
* Licensed under the MIT License.
*/
import path from "node:path";
import { _dirname } from "./dirname.cjs";
export const packageRootPath = path.resolve(_dirname, "../..");
/**
* Absolute path to the test data. It's rooted two directories up because the tests get executed from lib/.
*/
export const testDataPath = path.resolve(_dirname, packageRootPath, "src/test/data");
/**
* Absolute path to the test repo.
*/
export const testRepoRoot = path.join(testDataPath, "testRepo");

Просмотреть файл

@ -0,0 +1,12 @@
{
// This config must be used in a "type": "commonjs" environment. (Use fluid-tsc commonjs.)
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "../../dist/test",
},
"references": [
{
"path": "../../tsconfig.cjs.json",
},
],
}

Просмотреть файл

@ -0,0 +1,14 @@
{
"extends": "../../../../../common/build/build-common/tsconfig.test.node16.json",
"include": ["./**/*"],
"compilerOptions": {
"rootDir": "./",
"outDir": "../../lib/test",
"types": ["node", "mocha", "chai"],
},
"references": [
{
"path": "../..",
},
],
}

Просмотреть файл

@ -0,0 +1,435 @@
/*!
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
* Licensed under the MIT License.
*/
import { SimpleGit } from "simple-git";
import type { Opaque, SetRequired, PackageJson as StandardPackageJson } from "type-fest";
import type { IFluidRepoLayout } from "./config.js";
/**
* Extra package.json fields used by pnpm.
* See {@link https://pnpm.io/package_json}.
*/
export interface PnpmPackageJsonFields {
/**
* Configuration for pnpm.
* See {@link https://pnpm.io/package_json}.
*/
pnpm?: {
/**
* Instruct pnpm to override any dependency in the dependency graph.
* See {@link https://pnpm.io/package_json#pnpmoverrides}
*/
overrides?: Record<string, string>;
};
}
/**
* All known package.json fields including those that are specific to build-infrastructure.
* The `name`, `scripts`, and `version` fields are required, unlike standard package.json.
*/
export type PackageJson = SetRequired<
StandardPackageJson & PnpmPackageJsonFields,
"name" | "scripts" | "version"
>;
/**
* Additional properties that can be added to an {@link IPackage}.
*/
export type AdditionalPackageProps = Record<string, string> | undefined;
/**
* A Fluid repo organizes a collection of npm packages into workspaces and release groups. A Fluid repo can contain
* multiple workspaces, and a workspace can in turn contain multiple release groups. Both workspaces and release groups
* represent ways to organize packages in the repo, but their purpose and function are different.
*
* See {@link IWorkspace} and {@link IReleaseGroup} for more details.
*
* @typeParam P - The type of {@link IPackage} the repo uses. This can be any type that implements {@link IPackage}.
*/
export interface IFluidRepo<P extends IPackage = IPackage> extends Reloadable {
/**
* The absolute path to the root of the IFluidRepo. This is the path where the config file is located.
*/
root: string;
/**
* A map of all workspaces in the Fluid repo.
*/
workspaces: Map<WorkspaceName, IWorkspace>;
/**
* A map of all release groups in the Fluid repo.
*/
releaseGroups: Map<ReleaseGroupName, IReleaseGroup>;
/**
* A map of all packages in the Fluid repo.
*/
packages: Map<PackageName, P>;
/**
* A partial URL to the upstream (remote) repo. This can be set to the name of the repo on GitHub. For example,
* "microsoft/FluidFramework".
*/
upstreamRemotePartialUrl?: string;
/**
* The layout configuration for the repo.
*/
configuration: IFluidRepoLayout;
/**
* Transforms an absolute path to a path relative to the IFluidRepo root.
*
* @param p - The path to make relative to the IFluidRepo root.
* @returns The path relative to the IFluidRepo root.
*/
relativeToRepo(p: string): string;
/**
* If the FluidRepo is within a Git repository, this function will return a SimpleGit instance rooted at the root of
* the Git repository. If the FluidRepo is _not_ within a Git repository, this function will throw a
* {@link NotInGitRepository} error.
*
* @throws A {@link NotInGitRepository} error if the path is not within a Git repository.
*/
getGitRepository(): Promise<Readonly<SimpleGit>>;
/**
* Returns the {@link IReleaseGroup} associated with a package.
*/
getPackageReleaseGroup(pkg: Readonly<P>): Readonly<IReleaseGroup>;
/**
* Returns the {@link IWorkspace} associated with a package.
*/
getPackageWorkspace(pkg: Readonly<P>): Readonly<IWorkspace>;
}
/**
* A common interface for installable things, like packages, release groups, and workspaces.
*/
export interface Installable {
/**
* Returns `true` if the item is installed. If this returns `false`, then the `install` function can be called to
* install.
*/
checkInstall(): Promise<boolean>;
/**
* Installs the item.
*
* @param updateLockfile - If true, the lockfile will be updated. Otherwise, the lockfile will not be updated. This
* may cause the installation to fail.
*/
install(updateLockfile: boolean): Promise<boolean>;
}
/**
* An interface for things that can be reloaded,
*/
export interface Reloadable {
reload(): void;
}
/**
* A tagged type representing workspace names.
*/
export type WorkspaceName = Opaque<string, "WorkspaceName">;
/**
* A workspace is a collection of packages, including a root package, that is managed using a package manager's
* "workspaces" functionality. A Fluid repo can contain multiple workspaces. Workspaces are defined and managed using
* the package manager directly. A Fluid repo builds on top of workspaces and relies on the package manager to install
* and manage dependencies and interdependencies within the workspace.
*
* A workspace defines the _physical layout_ of the packages within it. Workspaces are a generally a feature provided by
* the package manager (npm, yarn, pnpm, etc.). A workspace is rooted in a particular folder, and uses the configuration
* within that folder to determine what packages it contains. The configuration used is specific to the package manager.
*
* The workspace is also the boundary at which dependencies are installed and managed. When you install dependencies for
* a package in a workspace, all dependencies for all packages in the workspace will be installed. Within a workspace,
* it is trivial to link multiple packages so they can depend on one another. The `IWorkspace` type is a thin wrapper on
* top of these package manager features.
*
* A Fluid repo will only load packages identified by the package manager's workspace feature. That is, any package in
* the repo that is not configured as part of a workspace is invisible to tools using the Fluid repo.
*
* Workspaces are not involved in versioning or releasing packages. They are used for dependency management only.
* Release groups, on the other hand, are used to group packages into releasable groups. See {@link IReleaseGroup} for
* more information.
*/
export interface IWorkspace extends Installable, Reloadable {
/**
* The name of the workspace.
*/
name: WorkspaceName;
/**
* The root directory of the workspace. This directory will contain the workspace root package.
*/
directory: string;
/**
* The root package of the workspace.
*/
rootPackage: IPackage;
/**
* A map of all the release groups in the workspace.
*/
releaseGroups: Map<ReleaseGroupName, IReleaseGroup>;
/**
* An array of all the packages in the workspace. This includes the workspace root and any release group roots and
* constituent packages as well.
*/
packages: IPackage[];
toString(): string;
}
/**
* A tagged type representing release group names.
*/
export type ReleaseGroupName = Opaque<string, IReleaseGroup>;
/**
* A release group is a collection of packages that are versioned and released together. All packages within a release
* group will have the same version, and all packages will be released at the same time.
*
* Release groups are not involved in dependency management. They are used for versioning and releasing packages only.
* Workspaces, on the other hand, are used to manage dependencies and interdependencies. See {@link IWorkspace} for more
* information.
*/
export interface IReleaseGroup extends Reloadable {
/**
* The name of the release group. All release groups must have unique names.
*/
readonly name: ReleaseGroupName;
/**
* The version of the release group.
*/
readonly version: string;
/**
* The package that is the release group root, if one exists.
*/
readonly rootPackage?: IPackage;
/**
* An array of all packages in the release group.
*/
readonly packages: IPackage[];
/**
* The workspace that the release group belongs to.
*/
readonly workspace: IWorkspace;
/**
* An array of all the release groups that the release group depends on. If any package in a release group has any
* dependency on a package in another release group within the same workspace, then the first release group depends
* on the second.
*/
readonly releaseGroupDependencies: IReleaseGroup[];
/**
* An optional ADO pipeline URL for the CI pipeline that builds the release group.
*/
readonly adoPipelineUrl?: string;
toString(): string;
}
/**
* A type guard that returns `true` if the checked item is an {@link IReleaseGroup}.
*/
export function isIReleaseGroup(
// eslint-disable-next-line @typescript-eslint/no-explicit-any
toCheck: Exclude<any, string | number | ReleaseGroupName | PackageName>,
): toCheck is IReleaseGroup {
if (!("name" in toCheck)) {
return false;
}
if (typeof toCheck === "object") {
// TODO: is there a better way to implement a type guard than unique names of properties? Maybe something with the
// opaque types?
return "workspace" in toCheck && "packages" in toCheck;
}
return false;
}
/**
* Known package managers supported by build-infrastructure.
*/
export type PackageManagerName = "npm" | "pnpm" | "yarn";
/**
* A package manager, such as "npm" or "pnpm".
*/
export interface IPackageManager {
/**
* The name of the package manager.
*/
readonly name: PackageManagerName;
/**
* The name of the lockfile used by the package manager.
*/
readonly lockfileName: string;
/**
* Returns an install command that can be used to install dependencies using this package manager.
*
* @param updateLockfile - If `true`, then the returned command will include flags or arguments necessary to update
* the lockfile during install. If `false`, such flags or arguments should be omitted. Note that the command will
* _not_ include the package manager name istself. For example, the `npm` package manager will return the string
* `"install"`, not `"npm install"`.
*/
installCommand(updateLockfile: boolean): string;
}
/**
* Information about a package dependency. That is, en extry in the "dependencies", "devDependencies", or
* "peerDependencies" fields in package.json.
*/
export interface PackageDependency {
/**
* The name of the dependency.
*/
name: PackageName;
/**
* The version or version range of the dependency.
*/
version: string;
/**
* The kind of dependency, based on the field that the dependency comes from.
*
* - prod corresponds to the dependencies field.
* - dev corresponds to the devDependencies field.
* - peer corresponds to the peerDependencies field.
*/
depKind: "prod" | "dev" | "peer";
}
/**
* A tagged type representing package names.
*/
export type PackageName = Opaque<string, "PackageName">;
/**
* A common type representing an npm package. A custom type can be used for the package.json schema, which is useful
* when the package.json has custom keys/values.
*
* @typeParam J - The package.json type to use. This type must extend the {@link PackageJson} type defined in this
* package.
*/
export interface IPackage<J extends PackageJson = PackageJson>
extends Installable,
Reloadable {
/**
* The name of the package
*/
readonly name: PackageName;
/**
* The name of the package color-coded with ANSI color codes for terminal output. The package name will always have
* the same color.
*/
readonly nameColored: string;
/**
* The absolute path to the directory containing the package (that is, the directory that contains the package.json
* for the package).
*/
readonly directory: string;
/**
* The package.json contents of the package.
*/
packageJson: J;
/**
* The package manager used to manage this package.
*
* @privateRemarks
*
* If this is needed at the package level, perhaps it should instead be retrieved from the package's workspace,
* since the package manager is defined at the workspace level.
*/
readonly packageManager: IPackageManager;
/**
* The version of the package. This is the same as `packageJson.version`.
*/
readonly version: string;
/**
* `true` if the package is private; `false` otherwise. This is similar to the field in package.json, but always
* returns a boolean value. If the package.json is missing the `private` field, this will return false.
*/
readonly private: boolean;
/**
* The workspace that this package belongs to.
*/
readonly workspace: IWorkspace;
/**
* Whether the package is a workspace root package or not. A workspace will only have one root package.
*/
readonly isWorkspaceRoot: boolean;
/**
* The name of the release group that this package belongs to.
*/
releaseGroup: ReleaseGroupName;
/**
* Whether the package is a release group root package or not. A release group may not have a root package, but if it
* does, it will only have one.
*/
isReleaseGroupRoot: boolean;
/**
* The absolute path to the package.json file for this package.
*/
readonly packageJsonFilePath: string;
/**
* Returns the value of a script in the package's package.json, or undefined if a script with the provided key is not
* found.
*/
getScript(name: string): string | undefined;
/**
* Saves any changes to the packageJson property to the package.json file on disk.
*/
savePackageJson(): Promise<void>;
/**
* A generator that returns each dependency and the kind of dependency (dev, peer, etc.) for all of the package's
* dependencies. This is useful to iterate overall all dependencies of the package.
*/
combinedDependencies: Generator<PackageDependency, void>;
toString(): string;
}
/**
* A type guard that returns `true` if the item is an {@link IPackage}.
*/
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types -- this is a type guard
export function isIPackage(pkg: any): pkg is IPackage {
if (typeof pkg === "object") {
return "getScript" in pkg;
}
return false;
}

Просмотреть файл

@ -0,0 +1,7 @@
{
// This config must be used in a "type": "commonjs" environment. (Use fluid-tsc commonjs.)
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "./dist",
},
}

Просмотреть файл

@ -0,0 +1,12 @@
{
"extends": "../../../common/build/build-common/tsconfig.node16.json",
"include": ["src/**/*"],
"exclude": ["src/test/**/*"],
"compilerOptions": {
"rootDir": "./src",
"outDir": "./lib",
"types": ["node"],
"exactOptionalPropertyTypes": false,
"noUnusedLocals": false,
},
}

Просмотреть файл

@ -0,0 +1,30 @@
/*!
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
* Licensed under the MIT License.
*/
// Enable TypeScript type-checking for this file.
// See https://www.typescriptlang.org/docs/handbook/intro-to-js-ts.html#ts-check
// @ts-check
/** @type {import('typedoc').TypeDocOptions} */
module.exports = {
entryPoints: ["./src/index.ts"],
plugin: ["typedoc-plugin-markdown"],
gitRevision: "main",
sourceLinkTemplate:
"https://github.com/microsoft/FluidFramework/blob/{gitRevision}/{path}#L{line}",
outputFileStrategy: "members",
out: "docs",
readme: "./README.md",
mergeReadme: true,
// projectDocuments: ["./src/docs/cli.md"],
defaultCategory: "API",
categorizeByGroup: true,
navigation: {
includeCategories: false,
includeGroups: false,
includeFolders: false,
},
useCodeBlocks: true,
};

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -433,6 +433,14 @@ module.exports = {
"package.json",
],
"npm-package-json-script-dep": [],
"npm-package-license": [
// test packages
"^build-tools/packages/build-infrastructure/src/test/data/testRepo/",
],
"npm-private-packages": [
// test packages
"^build-tools/packages/build-infrastructure/src/test/data/testRepo/",
],
"npm-public-package-requirements": [
// Test packages published only for the purpose of running tests in CI.
"^azure/packages/test/",
@ -462,6 +470,10 @@ module.exports = {
"^tools/telemetry-generator/",
"^packages/tools/webpack-fluid-loader/",
],
"pnpm-npm-package-json-preinstall": [
// test packages
"^build-tools/packages/build-infrastructure/src/test/data/testRepo/",
],
},
packageNames: {
// The allowed package scopes for the repo.