Skip to content

chore: upgrade to typescript v6.0.2 and others updated#146

Merged
gurgunday merged 3 commits intomainfrom
chore/upgrade-typescript-v6
Apr 6, 2026
Merged

chore: upgrade to typescript v6.0.2 and others updated#146
gurgunday merged 3 commits intomainfrom
chore/upgrade-typescript-v6

Conversation

@Tony133
Copy link
Copy Markdown
Member

@Tony133 Tony133 commented Mar 24, 2026

Proposals:

  • Upgrades TypeScript to v6, modernizes the compiler configuration, and refactors the flash plugin implementation to be compatible with stricter type checking and node16 module resolution.

    • Changes made

      • Update tsconfig.json:
        • Updated moduleResolution from node to node16
        • Updated target from es2017 to es2022
        • Updated module from commonjs to node16
        • Removed experimentalDecorators and emitDecoratorMetadata ( no longer needed )
    • Update tsconfig.build.json

      • Refactored to extend tsconfig.json and add compilerOptions for build output (outDir: dist, rootDir: src)
      • Replaced include: ["./src/**/*.ts"] with include: ["src"]
  • Update src/index.ts:

    • Added explicit FastifyRequest and FastifyReply type annotations to plugin methods, replacing implicit this typing
    • Added FlashData type alias for { [k: string]: string[] }
    • Exported ReplyReturn type (was previously internal)
    • Added module augmentation for @fastify/secure-session to declare SessionData with flash field
    • Simplified session handling: replaced manual null checks with nullish coalescing (|| {})
    • Refactored reply() method to use destructuring for cleaner flash message removal
    • Fixed return type of reply() to use ?? 0 instead of || [] for empty flash count

see reference PR: fastify/fastify#6605

Note:

@Tony133 Tony133 marked this pull request as ready for review March 24, 2026 16:27
Comment thread tsconfig.build.json Outdated
Co-authored-by: KaKa <23028015+climba03003@users.noreply.github.com>
Signed-off-by: Antonio Tripodi <Tony133@users.noreply.github.com>
@Tony133 Tony133 requested a review from climba03003 March 28, 2026 20:10
Copy link
Copy Markdown
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Copy link
Copy Markdown
Member

@gurgunday gurgunday left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@gurgunday gurgunday merged commit 85f4ee6 into main Apr 6, 2026
17 checks passed
@gurgunday gurgunday deleted the chore/upgrade-typescript-v6 branch April 6, 2026 09:43
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.

4 participants