Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
207 changes: 207 additions & 0 deletions _repoLayout.config.cjs
Original file line number Diff line number Diff line change
@@ -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",
},
},
},
},
},
};
2 changes: 1 addition & 1 deletion build-tools/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "root",
"name": "build-tools-release-group-root",
"version": "0.50.0",
"private": true,
"homepage": "https://fluidframework.com",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
15 changes: 13 additions & 2 deletions build-tools/packages/build-cli/src/test/filter.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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 () => {
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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 () => {
Expand Down
38 changes: 38 additions & 0 deletions build-tools/packages/build-infrastructure/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -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 changes: 11 additions & 0 deletions build-tools/packages/build-infrastructure/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
*-debug.log
*-error.log
/.nyc_output
/coverage
/dist
/lib
!/src/lib
!/test/lib
/tmp
node_modules
oclif.manifest.json
7 changes: 7 additions & 0 deletions build-tools/packages/build-infrastructure/.mocharc.json
Original file line number Diff line number Diff line change
@@ -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"
}
14 changes: 14 additions & 0 deletions build-tools/packages/build-infrastructure/.npmignore
Original file line number Diff line number Diff line change
@@ -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
3 changes: 3 additions & 0 deletions build-tools/packages/build-infrastructure/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Ignore all files. This package only uses biome for formatting.
**/*.*
*/*
21 changes: 21 additions & 0 deletions build-tools/packages/build-infrastructure/LICENSE
Original file line number Diff line number Diff line change
@@ -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.
Loading
Loading