Skip to content

Conversation

jyecusch
Copy link
Member

@jyecusch jyecusch commented Jul 9, 2025

Refactors the CLI commands (access-token, login/logout, templates, and build) to utilise dependency injection for authentication and the nitric client.

  • Introduces a Dependencies struct to encapsulate dependencies such as the WorkOS authentication client and Nitric API client.
  • Modifies the command constructors (e.g., NewAccessTokenCmd) to accept a Dependencies instance.
  • Removes direct imports of auth and config packages from the commands.
  • Deletes unused templates commands and related files.
  • Implements token storage in the keyring using a pluggable TokenStore interface
  • Implements token refresh in the Nitric client using a pluggable TokenProvider interface

@jyecusch jyecusch requested a review from tjholm as a code owner July 9, 2025 08:18
Copy link

vercel bot commented Jul 9, 2025

@jyecusch is attempting to deploy a commit to the Nitric Team on Vercel.

A member of the Team first needs to authorize it.

@jyecusch
Copy link
Member Author

jyecusch commented Jul 9, 2025

Also fixes errors that occurred when the user is logged out but used commands that require auth tokens.

Before:
Cursor_and_zsh_in_flow

After:
zsh_in_flow

jyecusch added 2 commits July 10, 2025 08:11
To enable more granular testing
Copy link

codecov bot commented Jul 10, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Please upload report for BASE (next@2d7365d). Learn more about missing BASE report.

Additional details and impacted files
@@           Coverage Diff           @@
##             next     #859   +/-   ##
=======================================
  Coverage        ?   47.57%           
=======================================
  Files           ?       23           
  Lines           ?     2804           
  Branches        ?        0           
=======================================
  Hits            ?     1334           
  Misses          ?     1380           
  Partials        ?       90           
Flag Coverage Δ
aws 44.89% <ø> (?)
core 60.76% <ø> (?)
gcp 47.19% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link

vercel bot commented Jul 10, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
nitric-docs ⬜️ Ignored (Inspect) Visit Preview Jul 10, 2025 5:46am

further reduces coupling between cli services
@jyecusch jyecusch merged commit 04b85c5 into nitrictech:next Jul 10, 2025
2 of 3 checks passed
@jyecusch jyecusch deleted the fix-unauthenticated-flow branch July 10, 2025 08:17
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.

2 participants