Skip to content

Conversation

@galligan
Copy link
Contributor

@galligan galligan commented Jan 23, 2026

Summary

  • Sync templates during pack to keep published artifacts up to date.
  • Add script wiring for template sync.

Changes

  • apps/outfitter/package.json
  • scripts/sync-templates.ts

Testing

  • Not run (not requested).

Copy link
Contributor Author

galligan commented Jan 23, 2026

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

@chatgpt-codex-connector
Copy link

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@greptile-apps
Copy link

greptile-apps bot commented Jan 23, 2026

Greptile Summary

  • Adds template synchronization automation to ensure the outfitter CLI package includes up-to-date templates when published
  • Introduces a new sync script (scripts/sync-templates.ts) and package lifecycle hooks (prepack) to automatically copy templates from root to app directory
  • Establishes single source of truth for templates in root /templates/ while maintaining app-local copies for publishing

Important Files Changed

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"
Loading

Copy link

@greptile-apps greptile-apps bot left a 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

Edit Code Review Agent Settings | Greptile

Comment on lines 10 to 12
await rm(destination, { recursive: true, force: true });
await mkdir(destination, { recursive: true });
await cp(source, destination, { recursive: true });
Copy link

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.

@galligan galligan changed the base branch from chore-changesets-ignore-app-package to graphite-base/108 January 23, 2026 23:29
@galligan galligan force-pushed the chore-outfitter-sync-templates-on-pack branch from 4a738ba to d7d426a Compare January 23, 2026 23:30
@galligan galligan changed the base branch from graphite-base/108 to chore-changesets-ignore-app-package January 23, 2026 23:30
@galligan
Copy link
Contributor Author

Added basic error handling to template sync script (try/catch with non-zero exit code) to make failures explicit. Restacked and resubmitted.

@galligan
Copy link
Contributor Author

Follow-up: swapped console usage for stderr write + error string to satisfy lint, then resubmitted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants