-
Notifications
You must be signed in to change notification settings - Fork 311
fix: make api:check pass across the workspace #1829
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
base: 1.5.0
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -60,7 +60,11 @@ | |
| * This would direct API Extractor to embed those types directly in the .d.ts rollup, as if they had been | ||
| * local files for library1. | ||
| */ | ||
| "bundledPackages": [], | ||
| // Workspace packages are bundled so API Extractor can resolve the namespace | ||
| // re-exports (e.g. `voice`, `llm`) that plugins consume from `@livekit/agents`. | ||
| // Without this, API Extractor errors with "ts.SyntaxKind.SourceFile declaration | ||
| // which is not (yet?) supported" when a plugin references those namespaces. | ||
| "bundledPackages": ["@livekit/agents", "@livekit/agents-plugin-*"], | ||
|
|
||
| /** | ||
| * Specifies what type of newlines API Extractor should use when writing output files. By default, the output files | ||
|
|
@@ -134,8 +138,12 @@ | |
| "apiReport": { | ||
| /** | ||
| * (REQUIRED) Whether to generate an API report. | ||
| * | ||
| * Disabled: this repo gitignores `*.md` and does not track per-package | ||
| * `etc/*.api.md` reports, so `api:check` is used purely to validate that the | ||
| * public API type-checks and rolls up cleanly (not to diff a committed report). | ||
| */ | ||
| "enabled": true | ||
| "enabled": false | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why wouldn't we want to enable this?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good question. I disabled it mainly because of how it interacts with That said, I think it's genuinely valuable for the core
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ok, I think it makes sense to stay disabled for now. I had opened a PR to fix the underlying issue of api-extractor with the namespace export here microsoft/rushstack#5810 Once that gets merged we can revert the |
||
|
|
||
| /** | ||
| * The filename for the API report files. It will be combined with "reportFolder" or "reportTempFolder" to produce | ||
|
|
@@ -390,17 +398,28 @@ | |
| * DEFAULT VALUE: See api-extractor-defaults.json for the complete table of extractorMessageReporting mappings | ||
| */ | ||
| "extractorMessageReporting": { | ||
| // `api:check` is used as a structural gate: it fails on hard errors | ||
| // (unresolvable types, the SourceFile-namespace error, a missing entry | ||
| // point) but not on lint-style advice. This repo does not adopt API | ||
| // Extractor's conventions (release tags, doc-comment placement, forgotten | ||
| // exports, @internal underscores), so those messages are silenced here. | ||
| // Each message id is set explicitly because API Extractor's built-in | ||
| // per-message defaults take precedence over the "default" entry. | ||
| "default": { | ||
| "logLevel": "warning" | ||
| // "addToApiReportFile": false | ||
| } | ||
|
|
||
| // "ae-extra-release-tag": { | ||
| // "logLevel": "warning", | ||
| // "addToApiReportFile": true | ||
| // }, | ||
| // | ||
| // . . . | ||
| "logLevel": "none" | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this seems a bit excessive with all the logs underneath also be setting to none. What's your thinking behind it?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fair — it is heavy-handed. Two parts:
Happy to trim to just the release-tag + link families and fix those 4 forgotten exports if you'd prefer the gate to stay meaningful — let me know.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yeah, forgotten export sounds useful to keep |
||
| }, | ||
| "ae-forgotten-export": { "logLevel": "none" }, | ||
| "ae-internal-missing-underscore": { "logLevel": "none" }, | ||
| "ae-missing-release-tag": { "logLevel": "none" }, | ||
| "ae-incompatible-release-tags": { "logLevel": "none" }, | ||
| "ae-different-release-tags": { "logLevel": "none" }, | ||
| "ae-extra-release-tag": { "logLevel": "none" }, | ||
| "ae-misplaced-package-tag": { "logLevel": "none" }, | ||
| "ae-missing-getter": { "logLevel": "none" }, | ||
| "ae-setter-with-docs": { "logLevel": "none" }, | ||
| "ae-unresolved-link": { "logLevel": "none" }, | ||
| "ae-unresolved-inheritdoc-base": { "logLevel": "none" }, | ||
| "ae-unresolved-inheritdoc-reference": { "logLevel": "none" } | ||
| }, | ||
|
|
||
| /** | ||
|
|
@@ -412,8 +431,7 @@ | |
| */ | ||
| "tsdocMessageReporting": { | ||
| "default": { | ||
| "logLevel": "warning" | ||
| // "addToApiReportFile": false | ||
| "logLevel": "none" | ||
| } | ||
|
|
||
| // "tsdoc-link-tag-unescaped-text": { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| { | ||
| "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", | ||
| "extends": "../../api-extractor-shared.json", | ||
| "mainEntryPointFilePath": "./dist/index.d.ts" | ||
|
toubatbrian marked this conversation as resolved.
|
||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| { | ||
| "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", | ||
| "extends": "../../api-extractor-shared.json", | ||
| "mainEntryPointFilePath": "./dist/index.d.ts" | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice workaround!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! 😄 Took a while to find — the older api-extractor just hard-errored on
export * as ns, the newer one resolves it once the workspace packages are bundled.