Skip to content

Commit

Permalink
Use pnpm in build-tools instead of npm (#12236)
Browse files Browse the repository at this point in the history
This PR switches the build-tools release group to use pnpm
instead of npm to install and manage dependencies.

I made fluid-build changes in #12874 to keep it working when some
release groups use pnpm and other release groups use npm. With these
changes you can run `fluid-build --install` and it will install using
pnpm for those release groups that use it, and npm elsewhere.

### Summary of changes

- Added some missing devDeps that pnpm's strictness exposed.
- Removed unneeded node types in tsconfig.
- Update root prettier configs to use import sort plugin.
- Updated scripts in release groups' root package.json to remove excess
`--`.
  • Loading branch information
tylerbutler authored Nov 22, 2022
1 parent ed6edfb commit 45302e4
Show file tree
Hide file tree
Showing 23 changed files with 11,899 additions and 29,646 deletions.
3 changes: 3 additions & 0 deletions build-tools/.npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Temporary, because otherwise pnpm fails due to peer dependencies not being satisfied
# with our current dependency graph.
strict-peer-dependencies=false
20,031 changes: 0 additions & 20,031 deletions build-tools/lerna-package-lock.json

This file was deleted.

7 changes: 3 additions & 4 deletions build-tools/lerna.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"packages": [
"packages/**"
],
"version": "0.6.0"
"version": "0.6.0",
"npmClient": "pnpm",
"useWorkspaces": true
}
9,509 changes: 0 additions & 9,509 deletions build-tools/package-lock.json

This file was deleted.

17 changes: 9 additions & 8 deletions build-tools/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@
"clean:docs": "rimraf **/_api-extractor-temp docs/api/*/**",
"clean:nyc": "rimraf nyc/**",
"commit": "git-cz",
"format": "lerna run format --no-sort --stream -- -- -- --color",
"postinstall": "npm run postinstall:lerna && npm run build:compile",
"install:root": "npm install --ignore-scripts",
"format": "lerna run format --no-sort --stream",
"preinstall": "npx only-allow pnpm",
"install:root": "pnpm install --ignore-scripts",
"layer-check": "node packages/build-tools/dist/layerCheck/layerCheck.js --root ..",
"layer-check:doc": "node packages/build-tools/dist/layerCheck/layerCheck.js --root .. --md",
"lerna": "lerna",
"lint": "lerna run lint --no-sort --stream -- -- -- --color",
"lint:fix": "lerna run lint:fix --no-sort --stream -- -- -- --color",
"lint": "lerna run lint --no-sort --stream",
"lint:fix": "lerna run lint:fix --no-sort --stream",
"policy-check": "cd .. && npm run policy-check",
"policy-check:asserts": "cd .. && npm run policy-check:asserts",
"policy-check:fix": "cd .. && npm run policy-check:fix",
Expand All @@ -53,10 +53,10 @@
"test:bail": "npm run test:mocha:bail && npm run test:jest:bail",
"test:copyresults": "copyfiles --exclude \"**/node_modules/**\" \"**/nyc/**\" nyc",
"test:coverage": "c8 npm run test:report",
"test:jest": "assign-test-ports && lerna run test:jest --concurrency 4 --stream --no-bail --no-sort -- -- --color",
"test:jest": "assign-test-ports && lerna run test:jest --concurrency 4 --stream --no-bail --no-sort",
"test:jest:bail": "assign-test-ports && lerna run test:jest --concurrency 4 --stream",
"test:jest:report": "assign-test-ports && lerna run test:jest --concurrency 4 --stream --no-bail --no-sort -- -- --ci --reporters=default --reporters=jest-junit",
"test:mocha": "lerna run test:mocha --stream --no-bail --no-sort -- -- --color",
"test:mocha": "lerna run test:mocha --stream --no-bail --no-sort",
"test:mocha:bail": "lerna run test:mocha --stream",
"test:mocha:report": "lerna run test:mocha --stream --no-bail --no-sort -- -- --reporter xunit --reporter-option output=nyc/mocha-junit-report.xml",
"test:realsvc": "lerna run test:realsvc --stream --no-bail --no-sort",
Expand Down Expand Up @@ -108,5 +108,6 @@
"rimraf": "^2.6.2",
"run-script-os": "^1.1.6",
"typescript": "~4.5.5"
}
},
"packageManager": "[email protected]"
}
2 changes: 1 addition & 1 deletion build-tools/packages/build-cli/docs/autocomplete.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ EXAMPLES
$ flub autocomplete --refresh-cache
```

_See code: [@oclif/plugin-autocomplete](https://github.com/oclif/plugin-autocomplete/blob/v1.3.5/src/commands/autocomplete/index.ts)_
_See code: [@oclif/plugin-autocomplete](https://github.com/oclif/plugin-autocomplete/blob/v1.3.6/src/commands/autocomplete/index.ts)_
8 changes: 4 additions & 4 deletions build-tools/packages/build-cli/docs/bump.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ Bumps the version of a release group or package to the next minor, major, or pat

```
USAGE
$ flub bump [PACKAGE_OR_RELEASE_GROUP] [-t major|minor|patch | --exact <value>] [--scheme
semver|internal|virtualPatch | ] [-x | --install | --commit | | | ] [-v]
$ flub bump [PACKAGE_OR_RELEASE_GROUP] [-v] [-t major|minor|patch | --exact <value>] [--scheme
semver|internal|virtualPatch | ] [-x | --install | --commit | | | ]
ARGUMENTS
PACKAGE_OR_RELEASE_GROUP The name of a package or a release group.
Expand Down Expand Up @@ -59,9 +59,9 @@ Update the dependency version of a specified package or release group. That is,

```
USAGE
$ flub bump deps [PACKAGE_OR_RELEASE_GROUP] [--prerelease -t
$ flub bump deps [PACKAGE_OR_RELEASE_GROUP] [-v] [--prerelease -t
latest|newest|greatest|minor|patch|@next|@canary] [--onlyBumpPrerelease] [-g client|server|azure|build-tools | -p
<value>] [-x | --install | --commit | | | ] [-v]
<value>] [-x | --install | --commit | | | ]
ARGUMENTS
PACKAGE_OR_RELEASE_GROUP The name of a package or a release group.
Expand Down
4 changes: 2 additions & 2 deletions build-tools/packages/build-cli/docs/check.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Checks that the dependencies between Fluid Framework packages are properly layer

```
USAGE
$ flub check layers --info <value> [--md <value>] [--dot <value>] [--logtime] [-v]
$ flub check layers --info <value> [-v] [--md <value>] [--dot <value>] [--logtime]
FLAGS
-v, --verbose Verbose logging.
Expand All @@ -31,7 +31,7 @@ Checks and applies policies to the files in the repository, such as ensuring a c

```
USAGE
$ flub check policy -e <value> [-D <value> | -d <value>] [--listHandlers | --stdin | -p <value> | -f | ] [-v]
$ flub check policy -e <value> [-v] [-D <value> | -d <value>] [--listHandlers | --stdin | -p <value> | -f | ]
FLAGS
-D, --excludeHandler=<value>... Exclude handler by name. Can be specified multiple times to exclude multiple
Expand Down
6 changes: 3 additions & 3 deletions build-tools/packages/build-cli/docs/generate.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ This command is used to compute the version number of Fluid packages. The releas

```
USAGE
$ flub generate buildVersion --build <value> [--testBuild <value>] [--release release|prerelease|none] [--patch <value>]
[--base <value>] [--tag <value>] [-i <value>] [-v]
$ flub generate buildVersion --build <value> [-v] [--testBuild <value>] [--release release|prerelease|none] [--patch
<value>] [--base <value>] [--tag <value>] [-i <value>]
FLAGS
-i, --includeInternalVersions=<value> Include Fluid internal versions.
Expand Down Expand Up @@ -45,7 +45,7 @@ Find all bundle analysis artifacts and copy them into a central location to uplo

```
USAGE
$ flub generate bundleStats [--smallestAssetSize <value>] [-v]
$ flub generate bundleStats [-v] [--smallestAssetSize <value>]
FLAGS
-v, --verbose Verbose logging.
Expand Down
2 changes: 1 addition & 1 deletion build-tools/packages/build-cli/docs/help.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ DESCRIPTION
Display help for flub.
```

_See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v5.1.12/src/commands/help.ts)_
_See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v5.1.14/src/commands/help.ts)_
2 changes: 1 addition & 1 deletion build-tools/packages/build-cli/docs/info.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Get info about the repo, release groups, and packages.

```
USAGE
$ flub info [-g client|server|azure|build-tools] [-p] [-v]
$ flub info [-v] [-g client|server|azure|build-tools] [-p]
FLAGS
-g, --releaseGroup=<option> Name of the release group
Expand Down
4 changes: 2 additions & 2 deletions build-tools/packages/build-cli/docs/merge.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Sync branches depending on the batch size passed

```
USAGE
$ flub merge branches -a <value> -s <value> -t <value> -b <value> [-p <value>] [-v]
$ flub merge branches -a <value> -s <value> -t <value> -b <value> [-v] [-p <value>]
FLAGS
-a, --auth=<value> (required) GitHub authentication token
Expand All @@ -32,7 +32,7 @@ Get info about the merge status of branches in the repo. Uses "main" and "next"

```
USAGE
$ flub merge info [--json] [-b <value>] [-v]
$ flub merge info [-v] [--json] [-b <value>]
FLAGS
-b, --branch=<value>... A branch name. Use this argument multiple times to provide multiple branch names.
Expand Down
11 changes: 7 additions & 4 deletions build-tools/packages/build-cli/docs/release.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ Releases a package or release group.

```
USAGE
$ flub release [-g client|server|azure|build-tools | -p <value>] [-t major|minor|patch] [-x | --install |
--commit | --branchCheck | --updateCheck | --policyCheck] [-v]
$ flub release [-v] [-g client|server|azure|build-tools | -p <value>] [-t major|minor|patch] [-x |
--install | --commit | --branchCheck | --updateCheck | --policyCheck]
FLAGS
-g, --releaseGroup=<option> Name of the release group
Expand Down Expand Up @@ -53,7 +53,7 @@ Prints a list of released versions of a package or release group. Releases are g

```
USAGE
$ flub release history [-g client|server|azure|build-tools | -p <value>] [-l <value>] [-v]
$ flub release history [-v] [-g client|server|azure|build-tools | -p <value>] [-l <value>] [--json]
FLAGS
-g, --releaseGroup=<option> Name of the release group
Expand All @@ -63,6 +63,9 @@ FLAGS
-p, --package=<value> Name of package.
-v, --verbose Verbose logging.
GLOBAL FLAGS
--json Format output as json.
DESCRIPTION
Prints a list of released versions of a package or release group. Releases are gathered from the git tags in repo
containing the working directory.
Expand All @@ -87,7 +90,7 @@ Generates a report of Fluid Framework releases.

```
USAGE
$ flub release report [--json] [-i | -r | -s] [-g client|server|azure|build-tools] [-o <value>] [-v]
$ flub release report [-v] [--json] [-i | -r | -s] [-g client|server|azure|build-tools] [-o <value>]
FLAGS
-g, --releaseGroup=<option>
Expand Down
2 changes: 1 addition & 1 deletion build-tools/packages/build-cli/docs/run.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Generate a report from input bundle stats collected through the collect bundleSt

```
USAGE
$ flub run bundleStats [--dirname <value>] [-v]
$ flub run bundleStats [-v] [--dirname <value>]
FLAGS
-v, --verbose Verbose logging.
Expand Down
2 changes: 1 addition & 1 deletion build-tools/packages/build-cli/src/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export abstract class BaseCommand<T extends typeof BaseCommand.flags>
}),
};

protected parsedOutput?: ParserOutput<any, any>;
protected parsedOutput?: ParserOutput;

/**
* The processed arguments that were passed to the CLI.
Expand Down
52 changes: 26 additions & 26 deletions build-tools/packages/build-cli/src/machines/FluidRelease.fsl.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions build-tools/packages/version-tools/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ EXAMPLES
$ fluv autocomplete --refresh-cache
```

_See code: [@oclif/plugin-autocomplete](https://github.com/oclif/plugin-autocomplete/blob/v1.3.5/src/commands/autocomplete/index.ts)_
_See code: [@oclif/plugin-autocomplete](https://github.com/oclif/plugin-autocomplete/blob/v1.3.6/src/commands/autocomplete/index.ts)_

## `fluv help [COMMAND]`

Expand All @@ -137,7 +137,7 @@ DESCRIPTION
Display help for fluv.
```

_See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v5.1.12/src/commands/help.ts)_
_See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v5.1.14/src/commands/help.ts)_

## `fluv version VERSION`

Expand Down
Loading

0 comments on commit 45302e4

Please sign in to comment.