-
-
Notifications
You must be signed in to change notification settings - Fork 19
Shorten script logic for better maintainability #3077
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…iency and consistency across apps
WalkthroughThe changes refactor and standardize npm scripts across multiple Changes
Sequence Diagram(s)sequenceDiagram
participant Dev as Developer
participant App as App Package.json
participant Bun as Bun Runtime
participant DB as Supabase DB Scripts
Dev->>App: Run "devx" or "devrs" script
App->>Bun: Invoke bun sb:stop/start/reset/typegen
Bun->>DB: Execute Supabase operation (stop/start/reset/typegen)
Bun->>App: Return to run "bun dev"
App->>Bun: Start development server
Poem
✨ Finishing Touches🧪 Generate Unit Tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #3077 +/- ##
=======================================
Coverage 0.84% 0.84%
=======================================
Files 2488 2488
Lines 306692 306692
Branches 2990 2990
=======================================
Hits 2577 2577
Misses 301987 301987
Partials 2128 2128 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 4
🧹 Nitpick comments (1)
apps/playground/package.json (1)
12-13
: Extend format scopeConsider including
.js
or.json
in theformat
andlint
globs if Playground contains such files.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (9)
apps/db/package.json
(1 hunks)apps/external/package.json
(1 hunks)apps/famigo/package.json
(1 hunks)apps/nova/package.json
(1 hunks)apps/playground/package.json
(1 hunks)apps/rewise/package.json
(1 hunks)apps/upskii/package.json
(1 hunks)apps/web/package.json
(1 hunks)package.json
(2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (9)
- GitHub Check: Deploy-Preview
- GitHub Check: Analyze (javascript-typescript)
- GitHub Check: Deploy-Preview
- GitHub Check: Verify generated types
- GitHub Check: Deploy-Preview
- GitHub Check: Deploy-Preview
- GitHub Check: Prettier Check (23)
- GitHub Check: Deploy-Preview
- GitHub Check: Deploy-Preview
🔇 Additional comments (27)
apps/upskii/package.json (3)
7-8
: Consolidate Supabase setup indevx
/devrs
using aliases
Thedevx
anddevrs
scripts now leveragebun sb:
aliases to streamline supabase stop/start/reset operations before launching development. This simplifies maintenance and removes redundant directory changes.
11-11
: Remove unnecessarycd
inpreview
script
Dropping thecd ../upskii
command ensurespreview
runs directly and avoids redundant navigation.
14-23
: Unify Supabase commands undersb:
namespace
The addition ofsb:*
scripts centralizes all Supabase operations behindbun sb:
aliases, improving discoverability and consistency across the monorepo.package.json (4)
7-7
: Switchdev
runner from Node to Bun
Movingdev
to usebun scripts/dev-selector.js dev
aligns with the monorepo's adoption of Bun and ensures consistency with other scripts.
15-23
: Standardizedevx:*
workflows across all services
Thedevx:*
scripts now uniformly stop the database, install dependencies, start Supabase, and delegate to the correspondingdev
targets. This DRY refactor enhances maintainability.
24-30
: Streamlinedevrs:*
scripts for full resets
By chainingbun sb:stop
,bun i
,bun sb:start
,bun sb:reset
,bun sb:typegen
, and thedev
command, thedevrs:*
set provides a single command for a full environment reset.
47-47
: Updatesb:diff
to include migration up
Addingbun sb:up
beforebun sb:diff
ensures migrations are applied before generating diffs, preventing stale diff outputs.apps/db/package.json (1)
14-14
: Modularizesb:reset
to usesb:typegen
alias
Replacing the inline typegen command with a call tobun sb:typegen
improves reuse and clarity.apps/web/package.json (3)
7-8
: Leveragebun sb:
aliases indevx
/devrs
Consistent with other apps, thedevx
anddevrs
scripts now chain Supabase operations before launching the Next.js server.
11-11
: Cleanuppreview
script by removingcd
Direct execution ofnext build && next start
on port 7803 simplifies the preview flow.
16-25
: Standardize Supabase commands insb:*
scripts
Centralizing the DB commands underbun sb:
without directory changes aligns with the monorepo pattern and makes scripts more discoverable.apps/external/package.json (3)
6-8
: Aligndev
,devx
, anddevrs
for Supabase integration
Updatingdev
to explicitly set port3000
, and refactoringdevx
/devrs
to use thesb:
aliases ensures a consistent developer experience across services.
11-13
: Add formatting and preview scripts for consistent workflows
Introducingpreview
, reorganizinglint
, and addingformat
align with patterns in other apps, promoting uniformity.
14-23
: Centralize Supabase operations undersb:
namespace
The addition ofstop
,sb:status
,sb:start
, etc., removes dependency on manual directory navigation and direct CLI calls, streamlining DB control.apps/rewise/package.json (3)
7-8
: Consolidated Supabase commands look goodThe
devx
anddevrs
scripts correctly chain the newbun sb:*
aliases beforebun dev
, improving readability and maintainability.
11-11
: Verify if preview should manage the Supabase serviceThe
preview
script now omits anysb:start
invocation; confirm whether a running Supabase instance is required in preview mode or if this is intentional.
24-25
: UI scaffolding scripts are well scopedThe new
ui:add
andui:diff
scripts provide clear helpers for Shadcn-UI operations without overloading existing scripts.apps/nova/package.json (3)
7-8
: Supabase command chaining is consistentUsing
bun sb:stop && bun sb:start
indevx
and addingsb:reset
indevrs
aligns Nova with other apps. This streamlines the dev setup flow.
11-11
: Confirm preview DB requirementsThe
preview
script drops anysb:start
step. Ensure Nova’s preview environment doesn’t need a Supabase instance, or add the necessary alias.
26-27
: Approve new UI helper scriptsAdding
ui:add
andui:diff
for Shadcn-UI operations is a helpful addition and follows the pattern in other apps.apps/playground/package.json (4)
6-6
: Enable Turbopack in devSwitching
dev
to use--turbopack
on port 3002 aligns Playground with performance optimizations adopted elsewhere.
7-8
: Dev orchestration matches monorepo pattern
devx
anddevrs
now chainsb:*
scripts beforebun dev
, mirroring other apps for a unified workflow.
11-11
: Review preview database dependency
preview
no longer starts Supabase; verify whether Playground preview should auto-start the service or if manual start is acceptable.
24-25
: UI scaffolding helpers are on pointThe
ui:add
andui:diff
commands are consistent with other apps and add value.apps/famigo/package.json (3)
7-8
: Unified dev scripts improve consistencyThe
devx
anddevrs
definitions now follow the monorepo convention of orchestratingsb:*
before starting the app.
11-11
: Double-check preview Supabase handlingConfirm whether the
preview
script should include a Supabase start step or if it's purposely omitted.
26-27
: Approve UI command additionsThe new
ui:add
andui:diff
scripts for Shadcn-UI are concise and follow the established pattern.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks @khangronky.
Summary by CodeRabbit