-
Notifications
You must be signed in to change notification settings - Fork 0
chore(outfitter): sync templates on pack #108
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
base: chore-changesets-ignore-app-package
Are you sure you want to change the base?
chore(outfitter): sync templates on pack #108
Conversation
5d1dc07 to
4a738ba
Compare
84b7b73 to
3056dc9
Compare
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Greptile Summary
|
| Filename | Overview |
|---|---|
scripts/sync-templates.ts |
New script that copies templates from root templates/ to apps/outfitter/templates/ using recursive file operations |
apps/outfitter/package.json |
Added sync:templates script and prepack lifecycle hook to automate template synchronization before packaging |
Confidence score: 4/5
- This PR is safe to merge with minimal risk of breaking functionality
- Score reflects straightforward file operations with proper error handling, though the script lacks explicit error handling for individual operations
- Pay attention to the sync script's file operations to ensure proper permissions and cross-platform compatibility
Sequence Diagram
sequenceDiagram
participant User
participant NPM as "NPM/Bun Pack"
participant Package as "apps/outfitter/package.json"
participant Script as "scripts/sync-templates.ts"
participant FileSystem as "File System"
User->>NPM: "bun pack"
NPM->>Package: "Execute prepack hook"
Package->>Script: "Run sync:templates script"
Script->>FileSystem: "Remove destination directory"
Script->>FileSystem: "Create destination directory"
Script->>FileSystem: "Copy templates recursively"
Script-->>Package: "Templates synced"
Package-->>NPM: "Prepack complete"
NPM-->>User: "Package created with synced templates"
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.
2 files reviewed, 1 comment
scripts/sync-templates.ts
Outdated
| await rm(destination, { recursive: true, force: true }); | ||
| await mkdir(destination, { recursive: true }); | ||
| await cp(source, destination, { recursive: true }); |
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.
logic: The operations run sequentially without error handling - if any step fails, the script will crash and leave the destination in an inconsistent state
Prompt To Fix With AI
This is a comment left during a code review.
Path: scripts/sync-templates.ts
Line: 10:12
Comment:
**logic:** The operations run sequentially without error handling - if any step fails, the script will crash and leave the destination in an inconsistent state
How can I resolve this? If you propose a fix, please make it concise.3056dc9 to
8f17b10
Compare
4a738ba to
d7d426a
Compare
|
Added basic error handling to template sync script (try/catch with non-zero exit code) to make failures explicit. Restacked and resubmitted. |
|
Follow-up: swapped console usage for stderr write + error string to satisfy lint, then resubmitted. |

Summary
Changes
Testing