Repository navigation
MD-2245 Publish an ESM build Node can resolve without a bundler - #32
Conversation
🦋 Changeset detectedLatest commit: 49797da The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
There was a problem hiding this comment.
Pull request overview
Enables the package’s ESM output and declarations to resolve in plain Node.js without a bundler.
Changes:
- Migrates TypeScript to NodeNext and adds explicit
.tssource specifiers. - Adds packaged-consumer verification on Node 22 and 24.
- Updates release automation, documentation, and changeset metadata.
Reviewed changes
Copilot reviewed 57 out of 58 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
tsconfig.json |
Enables NodeNext resolution and import rewriting. |
test/surfaceDecisionCookies.spec.ts |
Updates relative imports. |
test/stages/surfaceDecisions.spec.ts |
Updates relative imports. |
test/stages/surfaceComponents.spec.ts |
Updates relative imports. |
test/stages/surfaceBehavior.spec.ts |
Updates relative imports. |
test/stages/shouldIgnorePath.spec.ts |
Updates relative imports. |
test/stages/pageMetadata.spec.ts |
Updates relative imports. |
test/stages/originRequest.spec.ts |
Updates relative imports. |
test/stages/originLinkRewriter.spec.ts |
Updates relative imports. |
test/stages/linkRewriting.spec.ts |
Updates relative imports. |
test/stages/isRedirectResponse.spec.ts |
Updates relative imports. |
test/stages/getTargetUrl.spec.ts |
Updates relative imports. |
test/stages/fetchSurfaceDecisions.spec.ts |
Updates relative imports. |
test/stages/customEndpoint.spec.ts |
Updates relative imports. |
test/MOSProxy.spec.ts |
Updates imports, including the adapter barrel. |
test/hostPathMatcher.spec.ts |
Updates relative imports. |
test/fakes/PassthroughHtmlRewriter.ts |
Updates adapter type import. |
test/fakes/MockFetcher.ts |
Updates adapter type import. |
test/fakes/MemoryLogger.ts |
Updates logger type import. |
test/fakes/LolHtmlRewriter.ts |
Updates adapter type import. |
test/configResolution.spec.ts |
Updates relative imports. |
test/configOverrides.spec.ts |
Updates relative imports. |
test/config.spec.ts |
Updates relative imports. |
test/clientRuntime.spec.ts |
Updates relative imports. |
test/clientIPProvider.spec.ts |
Updates relative import. |
test/apiRequestHeaders.spec.ts |
Adds JSON import attributes and .ts import. |
test/adapters/IdentityProvider.spec.ts |
Updates relative imports. |
src/stages/surfaceDecisions.ts |
Makes stage imports NodeNext-compatible. |
src/stages/surfaceComponents.ts |
Makes stage imports NodeNext-compatible. |
src/stages/surfaceBehavior.ts |
Makes stage imports NodeNext-compatible. |
src/stages/shouldIgnorePath.ts |
Makes context import NodeNext-compatible. |
src/stages/pageMetadata.ts |
Makes type imports NodeNext-compatible. |
src/stages/originRequest.ts |
Makes stage imports NodeNext-compatible. |
src/stages/mosAuthenticatedApi.ts |
Uses explicit adapter barrel and extensions. |
src/stages/linkRewriting.ts |
Makes stage imports NodeNext-compatible. |
src/stages/findMarkerPositions.ts |
Makes type imports NodeNext-compatible. |
src/stages/fetchSurfaceDecisions.ts |
Makes stage imports NodeNext-compatible. |
src/stages/elements.ts |
Makes type imports NodeNext-compatible. |
src/stages/customEndpoint.ts |
Makes stage imports NodeNext-compatible. |
src/stages/ContentElementHandler.ts |
Makes handler imports NodeNext-compatible. |
src/stages/buildReplacementHandlers.ts |
Makes helper imports NodeNext-compatible. |
src/MOSProxyBuilder.ts |
Updates builder dependencies for NodeNext. |
src/MOSProxy.ts |
Updates orchestrator dependencies for NodeNext. |
src/index.ts |
Updates public barrel specifiers. |
src/hostPathMatcher.ts |
Updates type imports. |
src/context.ts |
Updates type imports. |
src/configResolution.ts |
Updates configuration imports. |
src/config.ts |
Updates configuration imports. |
src/apiRequestHeaders.ts |
Updates runtime helper import. |
src/adapters/ResourceProvider.ts |
Updates shared type import. |
src/adapters/index.ts |
Updates adapter barrel specifiers. |
src/adapters/IdentityProvider.ts |
Updates shared type imports. |
src/adapters/ConfigFactory.ts |
Updates configuration type import. |
scripts/verify-package-resolution.mjs |
Verifies packed runtime and declaration resolution. |
package.json |
Adds package verification to scripts and publishing. |
.github/workflows/ci.yml |
Tests package resolution on supported Node versions. |
.github/copilot-instructions.md |
Documents ESM and verification conventions. |
.changeset/esm-node-resolution.md |
Records the consumer-facing patch. |
e6dcca8 to
c36a9c7
Compare
|
Don't love that |
|
Yeah I need to verify if this breaks v8, but shouldn't |
| registry-url: https://registry.npmjs.org | ||
|
|
||
| - run: pnpm install --frozen-lockfile | ||
| - run: pnpm run typecheck |
There was a problem hiding this comment.
Why would we not do these steps on release?
There was a problem hiding this comment.
They are moved into prepublishOnly, pnpm run release deals with the lifecycle
No description provided.