Skip to content

Commit

Permalink
revert(build-cli): Configurable type test generation (#12507)
Browse files Browse the repository at this point in the history
This reverts commit e3506f8.
  • Loading branch information
tylerbutler committed Oct 19, 2022
1 parent 6d67935 commit 8b75253
Show file tree
Hide file tree
Showing 10 changed files with 59 additions and 718 deletions.
68 changes: 0 additions & 68 deletions build-tools/packages/build-cli/docs/generate.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ Generate commands are used to create/update code, docs, readmes, etc.
* [`flub generate bundleStats`](#flub-generate-bundlestats)
* [`flub generate packageJson`](#flub-generate-packagejson)
* [`flub generate readme`](#flub-generate-readme)
* [`flub generate typetests`](#flub-generate-typetests)

## `flub generate buildVersion`

Expand Down Expand Up @@ -106,70 +105,3 @@ DESCRIPTION
Customize the code URL prefix by setting oclif.repositoryPrefix in package.json.
```

## `flub generate typetests`

Generates type tests based on the individual package settings in package.json.

```
USAGE
$ flub generate typetests [-d <value> | --packages | -g client|server|azure|build-tools] [--prepare | --generate]
[--exact <value> | | [-s
^previousMajor|^previousMinor|~previousMajor|~previousMinor|previousMajor|previousMinor|baseMinor|baseMajor | ]]
[--reset | ] [-v]
FLAGS
-d, --dir=<value> Run on the package in this directory.
-g, --releaseGroup=<option> Run on all packages within this release group.
<options: client|server|azure|build-tools>
-s, --versionConstraint=<option> [default: baseMinor] The type of version constraint to use for previous versions.
Only applies to the prepare phase.
<options: ^previousMajor|^previousMinor|~previousMajor|~previousMinor|previousMajor|
previousMinor|baseMinor|baseMajor>
-v, --verbose Verbose logging.
--exact=<value> An exact string to use as the previous version constraint. The string will be used
as-is. Only applies to the prepare phase.
--generate Generates tests only. Doesn't prepare the package.json.
--packages Run on all independent packages in the repo.
--prepare Prepares the package.json only. Doesn't generate tests. Note that npm install may
need to be run after preparation.
--reset Resets the broken type test settings in package.json. Only applies to the prepare
phase.
DESCRIPTION
Generates type tests based on the individual package settings in package.json.
Generating type tests has two parts: preparing package.json and generating test modules. By default, both steps are
run for each package. You can run only one part at a time using the --prepare and --generate flags.
Preparing package.json determines the baseline previous version to use, then sets that version in package.json. If the
previous version changes after running preparation, then npm install must be run before the generate step will run
correctly.
Optionally, any type tests that are marked "broken" in package.json can be reset using the --reset flag during
preparation. This is useful when resetting the type tests to a clean state, such as after a major release.
Generating test modules takes the type test information from package.json, most notably any known broken type tests,
and generates an appropriate
EXAMPLES
Prepare the package.json for all packages in the client release group.
$ flub generate typetests --prepare -g client
Reset all broken type tests across the client release group.
$ flub generate typetests --prepare -g client --reset
Pin the type tests to the previous major version.
$ flub generate typetests --prepare -s previousMajor
Pin the type tests to the current base major version.
$ flub generate typetests --prepare -s baseMajor
Regenerate type tests for the client release group.
$ flub generate typetests --generate -g client
```
237 changes: 0 additions & 237 deletions build-tools/packages/build-cli/src/commands/generate/typetests.ts

This file was deleted.

2 changes: 0 additions & 2 deletions build-tools/packages/build-tools/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,3 @@ export {
export { Handler } from "./repoPolicyCheck/common";
export { policyHandlers } from "./repoPolicyCheck/handlers";
export { generateMonoRepoInstallPackageJson } from "./genMonoRepoPackageJson/lib";
export { findPackagesUnderPath, getAndUpdatePackageDetails } from "./typeValidator/packageJson";
export { generateTests } from "./typeValidator/testGeneration";
Loading

0 comments on commit 8b75253

Please sign in to comment.