Skip to content

Commit

Permalink
build(build-tools): Update API-Extractor configs and docs build patte…
Browse files Browse the repository at this point in the history
…rn (microsoft#17779)

Updates configs to use the new shared api-extractor config (from
`build-common`), which is stricter and enables trimmed type-rollup
generation. Nothing consumes these types yet.

For now, it disables the `explicit-release-tags` rule but fixes
violations of other rules. This rule can be enabled if/when desired.

Also updates the release group's `build:docs` script to copy the
metadata reports to the repo root like other release groups.


[AB#5694](https://dev.azure.com/fluidframework/235294da-091d-4c29-84fc-cdfc3d90890b/_workitems/edit/5694)
  • Loading branch information
Josmithr authored Oct 16, 2023
1 parent eebb3b2 commit 1a0100e
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 60 deletions.
14 changes: 14 additions & 0 deletions build-tools/api-extractor-base.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// Base API-Extractor config for build-tools
{
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
"extends": "@fluidframework/build-common/api-extractor-base.json",

// TODO: Consider enabling these in the future.
"messages": {
"extractorMessageReporting": {
"ae-missing-release-tag": {
"logLevel": "none"
}
}
}
}
20 changes: 2 additions & 18 deletions build-tools/packages/build-cli/api-extractor.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,5 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
"extends": "@fluidframework/build-common/api-extractor-common-report.json",
"mainEntryPointFilePath": "<projectFolder>/lib/index.d.ts",
"apiReport": {
"enabled": true,
"reportFolder": "<projectFolder>/api-report/"
},
"messages": {
"extractorMessageReporting": {
"ae-unresolved-link": {
"logLevel": "warning",
"addToApiReportFile": true
},
"ae-internal-missing-underscore": {
"logLevel": "none",
"addToApiReportFile": false
}
}
}
"extends": "../../api-extractor-base.json",
"mainEntryPointFilePath": "<projectFolder>/lib/index.d.ts"
}
14 changes: 1 addition & 13 deletions build-tools/packages/bundle-size-tools/api-extractor.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,4 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
"extends": "@fluidframework/build-common/api-extractor-common-report.json",
"apiReport": {
"enabled": true,
"reportFolder": "<projectFolder>/api-report/"
},
"messages": {
"extractorMessageReporting": {
"ae-unresolved-link": {
"logLevel": "warning",
"addToApiReportFile": false
}
}
}
"extends": "../../api-extractor-base.json"
}
20 changes: 2 additions & 18 deletions build-tools/packages/readme-command/api-extractor.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,5 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
"extends": "@fluidframework/build-common/api-extractor-common-report.json",
"mainEntryPointFilePath": "<projectFolder>/lib/index.d.ts",
"apiReport": {
"enabled": true,
"reportFolder": "<projectFolder>/api-report/"
},
"messages": {
"extractorMessageReporting": {
"ae-unresolved-link": {
"logLevel": "warning",
"addToApiReportFile": true
},
"ae-internal-missing-underscore": {
"logLevel": "none",
"addToApiReportFile": false
}
}
}
"extends": "../../api-extractor-base.json",
"mainEntryPointFilePath": "<projectFolder>/lib/index.d.ts"
}
11 changes: 4 additions & 7 deletions build-tools/packages/version-tools/api-extractor.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
"extends": "@fluidframework/build-common/api-extractor-common-report.json",
"extends": "../../api-extractor-base.json",
"mainEntryPointFilePath": "<projectFolder>/lib/index.d.ts",
"apiReport": {
"enabled": true,
"reportFolder": "<projectFolder>/api-report/"
},
// TODO: Fix violations and remove this rule override
"messages": {
"extractorMessageReporting": {
"ae-unresolved-link": {
"ae-forgotten-export": {
"logLevel": "warning",
"addToApiReportFile": false
"addToApiReportFile": true
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export const REQUIRED_PRERELEASE_IDENTIFIER = "internal";
* @param internalVersion - A version in the Fluid internal version scheme.
* @param allowPrereleases - If true, allow prerelease Fluid internal versions.
* @param allowAnyPrereleaseId - If true, allows any prerelease identifier string. When false, only allows
* {@link REQUIRED_PRERELEASE_IDENTIFIER}.
* `REQUIRED_PRERELEASE_IDENTIFIER`.
*
* @returns A tuple of [publicVersion, internalVersion, prereleaseIdentifier]
*/
Expand Down Expand Up @@ -112,7 +112,7 @@ export function fromInternalScheme(
* @param version - The internal version.
* @param allowPrereleases - If true, allow prerelease Fluid internal versions.
* @param prereleaseIdentifier - The prerelease indentifier to use in the Fluid internal version. Defaults to
* {@link REQUIRED_PRERELEASE_IDENTIFIER}.
* `REQUIRED_PRERELEASE_IDENTIFIER`.
*
* @returns A version in the Fluid internal version scheme.
*/
Expand Down Expand Up @@ -221,7 +221,7 @@ export function validateVersionScheme(
* @param version - The version to check. If it is `undefined`, returns false.
* @param allowPrereleases - If true, allow prerelease Fluid internal versions.
* @param allowAnyPrereleaseId - If true, allows any prerelease identifier string. When false, only allows
* {@link REQUIRED_PRERELEASE_IDENTIFIER}.
* `REQUIRED_PRERELEASE_IDENTIFIER`.
* @returns True if the version matches the Fluid internal version scheme.
*/
export function isInternalVersionScheme(
Expand All @@ -246,7 +246,7 @@ export function isInternalVersionScheme(
*
* @param range - The range string to check.
* @param allowAnyPrereleaseId - If true, allows any prerelease identifier string. When false, only allows
* {@link REQUIRED_PRERELEASE_IDENTIFIER}.
* `REQUIRED_PRERELEASE_IDENTIFIER`.
* @returns True if the range string matches the Fluid internal version scheme.
*/
export function isInternalVersionRange(range: string, allowAnyPrereleaseId = false): boolean {
Expand Down

0 comments on commit 1a0100e

Please sign in to comment.