-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
fix: add all accessor tags to exported symbols #2649
Conversation
ffe74e7
to
9d67c5d
Compare
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.
There were a lot of changes from internal => public or from public => internal in this PR that I don't fully understand. For example, AbstractCursor became public but ChangeStreamCursorOptions became internal.
Could you update the description to explain the general reasoning behind why these had to change?
9d67c5d
to
d93e6df
Compare
"build:dts": "npm run build:ts && api-extractor run --typescript-compiler-folder node_modules/typescript --local && rimraf 'lib/**/*.d.ts*'", | ||
"build:dts": "npm run build:ts && api-extractor run && rimraf 'lib/**/*.d.ts*'", | ||
"build:docs": "npm run build:dts && typedoc", | ||
"check:bench": "node test/benchmarks/driverBench", | ||
"check:coverage": "nyc npm run check:test", | ||
"check:lint": "npm run check:ts && eslint -v && eslint --max-warnings=0 --ext '.js,.ts' src test", | ||
"check:lint": "npm run build:dts && npm run check:eslint", | ||
"check:eslint": "eslint -v && eslint --max-warnings=0 --ext '.js,.ts' src test", |
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.
The mongodb.d.ts now only includes the public API. NODE-2783
d93e6df
to
32c37f7
Compare
The mongodb.d.ts now only includes the public API.
NODE-2783
API-extractor enforces that things that are public can only depend upon types and symbols that are also public unless stated otherwise. So for example our ChangeStreams API hides the underlying cursor it uses from the public API so we can make both the ChangeStreamsCursor and its Options type internal which deletes them from the final type definition, implicitly (but not literally) making them inaccessible to type checking users.
Some symbols needed to be made public since they are exposed to users. For example
BulkWriteResult
has a result property that had an internalBulkResult
type but since the public definitions file would have that removed you would get a compilation error when it tries to type the publicresult
property as the deletedBulkResult
type.