Skip to content

Add TypeScript build pipeline and fix package distribution - #1

Open
magicspon wants to merge 1 commit into
PassKit:mainfrom
magicspon:main
Open

Add TypeScript build pipeline and fix package distribution#1
magicspon wants to merge 1 commit into
PassKit:mainfrom
magicspon:main

Conversation

@magicspon

Copy link
Copy Markdown

Previously this package shipped only TypeScript source with no compiled output, making it unusable in projects that do not transpile node_modules. It also lacked type declarations for consumers and was missing required runtime/type dependencies.

Changes:

  • Add tsconfig.json targeting ES2022 (required for private class fields used in generated proto files), emitting CommonJS JS + .d.ts to dist/ with skipLibCheck and strict disabled to handle existing generated-code type issues
  • Add build (tsc) and typecheck (tsc --noEmit) scripts to package.json
  • Add google-protobuf as a runtime dependency (was imported but missing)
  • Add @types/google-protobuf as a dependency so consumers receive type declarations for the protobuf base classes used throughout the SDK
  • Add files: ["dist"] so only compiled output is published to npm
  • Add exports: { "./*": "./dist/*" } wildcard mapping so consumers can import subpaths (e.g. passkit-typescript-sdk/io/member/member) and get both JS execution and TypeScript types without any build-step workaround
  • Add .gitignore excluding node_modules/, dist/, and package-lock.json

Previously this package shipped only TypeScript source with no compiled
output, making it unusable in projects that do not transpile node_modules.
It also lacked type declarations for consumers and was missing required
runtime/type dependencies.

Changes:
- Add tsconfig.json targeting ES2022 (required for private class fields
  used in generated proto files), emitting CommonJS JS + .d.ts to dist/
  with skipLibCheck and strict disabled to handle existing generated-code
  type issues
- Add `build` (tsc) and `typecheck` (tsc --noEmit) scripts to package.json
- Add `google-protobuf` as a runtime dependency (was imported but missing)
- Add `@types/google-protobuf` as a dependency so consumers receive type
  declarations for the protobuf base classes used throughout the SDK
- Add `files: ["dist"]` so only compiled output is published to npm
- Add `exports: { "./*": "./dist/*" }` wildcard mapping so consumers can
  import subpaths (e.g. passkit-typescript-sdk/io/member/member) and get
  both JS execution and TypeScript types without any build-step workaround
- Add .gitignore excluding node_modules/, dist/, and package-lock.json

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant