feat!: rewrite as modern TypeScript v2.0.0#202
Merged
Conversation
- TypeScript 5.x source in src/, compiled to dist/ - ESM only (type:module), Node >=18 required - Native fetch, AbortController, URLSearchParams, no polyfills - Replace Mocha/Chai/nock with Vitest + msw v2 - Drop deprecated positional headers params (v2 breaking change) - Remove lib/ and types/, declarations generated by tsc - 141 tests passing Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- README: complete rewrite covering v2 API, @types/fhir type guards,
@reasonhealth/fhir-zod runtime validation, full API reference,
and migration guide from v1
- examples/README.md: updated for ESM / Node 18+ setup
- All 4 example apps converted from CommonJS to ESM:
- confidential-smart-ehr: simple-oauth2 v5 API, EHR launch
- public-smart-ehr: same pattern without CLIENT_SECRET
- smart-standalone: standalone launch with iss+scope query params
- cds-hooks: native fetch replaces axios, express.json() replaces
body-parser, CapabilityTool v2 supportFor() API
- All example package.json files updated: type module,
current dep versions, no devDependencies
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Add Biome for formatting/linting; remove ESLint config
- Add format, format:check, lint, check scripts to package.json
- Update CI workflow: actions v4, Node 20/22, npm ci, typecheck + build + format:check steps
- Rename JSONPatch → jsonPatch in PatchParams interface (idiomatic camelCase)
- Rename SearchParams_ → SearchCallParams, RequestParams → RawRequestParams
- Replace = {} as T anti-patterns in capability-tool.ts with params?: T
- Make FetchJob.resolving private with markResolving() accessor
- Convert numJobs to a getter in FetchQueue
- Fix baseUrl non-null assertion in reference-resolver.ts
- Add comprehensive JSDoc to all public Client and CapabilityTool methods
- Export SupportForParams, CapabilityWhere, splitReference, SplitReference from index.ts
- Update README patch example: JSONPatch → jsonPatch
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Update vitest 1.x → 4.x (fixes esbuild/vite moderate CVEs) - Update @vitest/coverage-v8 to match vitest v4 - Update typescript 5.x → 6.x - Update agentkeepalive, debug, @types/node, @types/debug to latest - Fix brace-expansion, cross-spawn, minimatch ReDoS vulnerabilities (npm audit fix) - Add types: ["node"] to tsconfig.json (required by TypeScript 6.x) All 141 tests pass. npm audit: 0 vulnerabilities. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
3a5a2ad to
61ec5be
Compare
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
A complete ground-up rewrite of
fhir-kit-clientas native TypeScript ESM, targeting v2.0.0.Breaking Changes
require()is no longer supported; all imports use.jsextensionsPatchParams.JSONPatchrenamed toPatchParams.jsonPatch(camelCase consistency)@types/fhir-kit-clientpackage needed — types are bundledWhat's New
TypeScript Rewrite
src/with strict modeHttpMethodunion type for stricter method typingparams?: Tpatterns replace unsafe= {} as TdefaultssplitReference,SplitReference,SupportForParams,CapabilityWhereClientandCapabilityToolmethodsTooling
yarn.lockremoved; project now usesnpmCI/CD
actions/checkout@v4andactions/setup-node@v4typecheck→build→format:check→lint→testDocumentation
@types/fhirand@reasonhealth/fhir-zodTests