feat!: split cloud transports into ./google and ./sharepoint subpath exports#21
Merged
Conversation
…exports
Three entry points now exist instead of one:
- `.` — conversion core, the Transport contract, and LocalFileTransport.
No third-party SDK in the dependency graph.
- `./google` — GoogleDriveTransport and Google-specific types.
- `./sharepoint` — SharePointTransport and SharePoint-specific types.
BREAKING CHANGE: the cloud transports are no longer exported from the
root entry point. Import them from their subpaths instead:
import { GoogleDriveTransport } from "polydoc-core/google"
import { SharePointTransport } from "polydoc-core/sharepoint"
This is safe to do now because the package has never been published,
so there are no existing consumers to migrate.
Measured result: the root entry point dropped from 164 modules /
~497ms to 44 modules / ~133ms, and no longer loads `@azure/msal-node`.
Both transport subpaths re-export the shared contract (`Transport`,
`TransportError`, `TransportErrorCode`, `DOCX_MIME_TYPE`) so a
subpath-only consumer can catch and inspect errors without reaching
into the root package.
package.json now declares `typesVersions` for node10-era type
resolution, `default` conditions on each export, and an explicit
`./package.json` export.
CI gains a `check:package` step running `attw --pack` and `publint
--strict`, since packaging breakage (wrong export map, missing
types, dual-package hazards) is invisible to lint, typecheck, and
unit tests, and only surfaces for a consumer after publish.
Added a regression guard, tests/entrypoints.test.ts, that walks both
the built JS and declaration graphs from each entry point. It fails
the suite if an SDK ever leaks back into the root — including via a
lazy `await import()` or a type-only re-export.
BREAKING CHANGE: cloud transports moved out of the package root.
`GoogleDriveTransport` and `SharePointTransport` (and their
associated types) must now be imported from `polydoc-core/google`
and `polydoc-core/sharepoint` respectively instead of `polydoc-core`.
Closes #13
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
.(conversion core,Transportcontract,LocalFileTransport— no third-party SDK),./google, and./sharepoint.GoogleDriveTransportfrompolydoc-core/googleandSharePointTransportfrompolydoc-core/sharepoint. Safe to do now since the package has never published.attw --pack+publint --strict) to CI and a regression guard that walks the built JS/declaration graphs to keep SDKs out of the root.Changes
Subpath Exports
Transportcontract, andLocalFileTransport. Cloud transports removed../googlesubpath entry point exportingGoogleDriveTransportand Google-specific types, plus a re-export of the shared contract (Transport,TransportError,TransportErrorCode,DOCX_MIME_TYPE)../sharepointsubpath entry point exportingSharePointTransportand SharePoint-specific types, plus the same shared-contract re-export.exportsmap for the three entry points withdefaultconditions,typesVersionsfor node10-era type resolution, and an explicit./package.jsonexport. Bundle size measurement: root entry point dropped from 164 modules / ~497ms to 44 modules / ~133ms, and no longer loads@azure/msal-node.Build System
check:packagestep runningattw --packandpublint --strict. Packaging breakage (wrong export map, missing types, dual-package hazards) is invisible to lint/typecheck/tests and only surfaces for a consumer after publish.Tests
await import()or a type-only re-export.Documentation
Dependencies
attwandpublintdev dependencies.Notes
Follow-up not addressed here: the tarball ships
.js.map/.d.ts.mapbut notsrc/, sosourcesdangles anddeclarationMapgo-to-definition is dead for consumers. Pre-existing, being filed separately.Test plan
pnpm checkpasses (biome, tsc, 235 vitest tests, build,attw --pack,publint --strict)js-ts-code-reviewerPASS after two review roundsCloses #13