Skip to content

Verify and document TypeScript output expectations for @guildpass/env package #336

Description

@Lakes41

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:

  1. @guildpass/env is configured to emit only .d.ts files (via emitDeclarationOnly: true)
  2. Output files are being emitted to an incorrect or unmapped directory
  3. 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

  1. 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
  2. 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)
  3. 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.

  4. 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)
  5. Test downstream imports:

    pnpm -r build --filter apps/dashboard

Acceptance Criteria

  • packages/env/package.json has correct main, types, and/or exports fields
  • packages/env/tsconfig.json emits .js files to ./dist/
  • After building, packages/env/dist/ contains both .js and .d.ts files
  • apps/dashboard build no longer reports "Module not found" for @guildpass/env imports
  • Build behavior is documented in packages/env/README.md or similar

Affected Files/Directories

  • packages/env/package.json
  • packages/env/tsconfig.json
  • packages/env/README.md (create or update)
  • packages/env/dist/ (output)

Metadata

Metadata

Assignees

Labels

Third CampaignOfficial FWC26 campaign issue — eligible for campaign scoring and rewardsbuildUser interface or user experience improvements and design workdocumentationDocumentation improvements, additions, or correctionsintermediateIntermediate difficulty tasks requiring solid experience and some context

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions