fix(env): align package.json exports with emitted build output and document it - #357
Merged
Lakes41 merged 1 commit intoAug 22, 2026
Merged
Conversation
…cument it
The exports map declared `require` conditions pointing at dist/index.cjs and
dist/cli/index.cjs, but the package is ESM-only ("type": "module") and tsc
never emits .cjs files, so those entry points resolved to nothing. Drop the
require conditions (matching @guildpass/webhook-utils) and prefix main/types
with ./ for consistency with the exports paths.
Also document the build output contract in README.md: tsc emits .js, .d.ts and
.js.map to dist/, dist is gitignored and rebuilt via the prepare script, and
downstream consumers resolve @guildpass/env through package.json#exports.
Closes Adamantine-guild#336
5 tasks
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
Verifies and documents the TypeScript build output expectations for
@guildpass/env(issue #336), and fixes the one real mismatch found betweenpackage.jsonand whattscactually emits.Findings
packages/env/tsconfig.jsonis correct:outDir: "dist",rootDir: "src",declaration: true,emitDeclarationOnly: false,sourceMap: true. Building (pnpm --filter @guildpass/env build) emits.js,.d.ts, and.js.mapfiles for every source file — noemitDeclarationOnlyproblem.packages/env/package.jsonwas out of sync: theexportsmap declaredrequireconditions pointing at./dist/index.cjsand./dist/cli/index.cjs, but the package is ESM-only ("type": "module") andtscnever emits.cjsfiles. Those entry points resolved to nothing for any CJS consumer. Removed them (matching the sibling@guildpass/webhook-utils), and prefixedmain/typeswith./for consistency with theexportspaths.dist/is gitignored and rebuilt automatically bypnpm installvia thepreparescript, which is what fixed the downstream "Module not found" errors.Changes
packages/env/package.json: entry points now map to real emitted files.packages/env/README.md: added a Build Output section documenting the emitted artifacts, the tsconfig contract, how consumers should import, and how to recover from a staledist/.Verification
pnpm --filter @guildpass/env build→dist/containsindex.js,index.d.ts,index.js.map, pluscli/andschemas/equivalents.import('@guildpass/env')resolves all exports; theguildpass-env-checkCLI runs successfully.pnpm --filter @guildpass/env test→ 7/7 pass.pnpm --filter @guildpass/dashboard build(Next.js) succeeds with no "Module not found" for@guildpass/env.@guildpass/env(a pre-existing, unrelated@guildpass/metricsresolution error exists onmain).Closes #336