Background
The @guildpass/env package is a critical shared configuration module imported by multiple downstream packages (apps/dashboard, apps/access-api, apps/discord-bot). Build failures in downstream packages indicate that @guildpass/env is not emitting expected output files (.js alongside .d.ts).
Problem
Three scenarios are possible:
@guildpass/env is configured to emit only .d.ts files (via emitDeclarationOnly: true)
- Output files are being emitted to an incorrect or unmapped directory
- The package.json
main or exports field doesn't point to the correct output location
Without clarity on what @guildpass/env should emit and where, fixes are speculative and errors recur.
Expected Outcome
- Clear documentation of
@guildpass/env's build output expectations
package.json entry points (main, exports, types) correctly map to output files
- TypeScript configuration and package.json are in sync
- Downstream consumers reliably resolve both
.js and .d.ts files
Suggested Implementation
-
Review packages/env/package.json:
- Check the
main field (should point to compiled .js entry, e.g., "main": "./dist/index.js")
- Check the
types field (should point to .d.ts, e.g., "types": "./dist/index.d.ts")
- Check the
exports field if using ESM-style exports
-
Review packages/env/tsconfig.json:
- Confirm
outDir is set to ./dist
- Confirm
declaration is true
- Confirm
emitDeclarationOnly is false (or absent, since false is the default)
-
After building (pnpm build -r --filter @guildpass/env), verify the output:
ls -la packages/env/dist/
Should show .js, .d.ts, and .d.ts.map files.
-
Document findings in packages/env/README.md or a BUILD.md file:
## Build Output
- TypeScript emits to `./dist/`
- Entry point: `dist/index.js`
- Types: `dist/index.d.ts`
- Consumers should import from `@guildpass/env` (via package.json#exports)
-
Test downstream imports:
pnpm -r build --filter apps/dashboard
Acceptance Criteria
Affected Files/Directories
packages/env/package.json
packages/env/tsconfig.json
packages/env/README.md (create or update)
packages/env/dist/ (output)
Background
The
@guildpass/envpackage is a critical shared configuration module imported by multiple downstream packages (apps/dashboard,apps/access-api,apps/discord-bot). Build failures in downstream packages indicate that@guildpass/envis not emitting expected output files (.jsalongside.d.ts).Problem
Three scenarios are possible:
@guildpass/envis configured to emit only.d.tsfiles (viaemitDeclarationOnly: true)mainorexportsfield doesn't point to the correct output locationWithout clarity on what
@guildpass/envshould emit and where, fixes are speculative and errors recur.Expected Outcome
@guildpass/env's build output expectationspackage.jsonentry points (main,exports,types) correctly map to output files.jsand.d.tsfilesSuggested Implementation
Review
packages/env/package.json:mainfield (should point to compiled.jsentry, e.g.,"main": "./dist/index.js")typesfield (should point to.d.ts, e.g.,"types": "./dist/index.d.ts")exportsfield if using ESM-style exportsReview
packages/env/tsconfig.json:outDiris set to./distdeclarationistrueemitDeclarationOnlyisfalse(or absent, sincefalseis the default)After building (
pnpm build -r --filter @guildpass/env), verify the output:Should show
.js,.d.ts, and.d.ts.mapfiles.Document findings in
packages/env/README.mdor aBUILD.mdfile:Test downstream imports:
Acceptance Criteria
packages/env/package.jsonhas correctmain,types, and/orexportsfieldspackages/env/tsconfig.jsonemits.jsfiles to./dist/packages/env/dist/contains both.jsand.d.tsfilesapps/dashboardbuild no longer reports "Module not found" for@guildpass/envimportspackages/env/README.mdor similarAffected Files/Directories
packages/env/package.jsonpackages/env/tsconfig.jsonpackages/env/README.md(create or update)packages/env/dist/(output)