Skip to content

Conversation

@ihsankahveci
Copy link
Collaborator

Description

Updated .github/copilot-instructions.md to add explicit guidance about running admin scripts from the server/ directory.

Changes

  • Added "Running Admin Scripts" section explaining that npm scripts must be run from server/ directory
  • Included examples of correct script execution (super-admin, generate-seeds, generate-coupons)
  • Clarified script definitions in server/package.json

Why

AI agents and developers need clear guidance on where to execute scripts to avoid path-related errors.

Testing

  • Verified documentation accuracy against existing server/package.json
  • Confirmed scripts run correctly when executed from server/ directory

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds documentation to guide developers and AI agents on running admin scripts from the correct directory. The changes clarify that npm scripts must be executed from the server/ directory and document the module loading pattern used by standalone scripts.

Key Changes

  • Added "Critical Module Loading Pattern for Scripts" section explaining the createRequire pattern needed for scripts in the scripts/ directory to access server dependencies
  • Added "Running Admin Scripts" section with execution examples for admin commands
  • Updated .gitignore to exclude generated coupon PDFs (alongside existing seed PDFs)

Reviewed Changes

Copilot reviewed 1 out of 2 changed files in this pull request and generated 1 comment.

File Description
.github/copilot-instructions.md Added two new sections documenting script module loading patterns and execution instructions from the server directory
.gitignore Added scripts/coupons/ to ignore generated coupon PDF files

npm run super-admin -- list # List all super admins
npm run super-admin -- create John Doe [email protected] +15551234567 <locationId>
npm run generate-seeds -- "Hub Name" 10 # Generate 10 seed QR codes
npm run generate-coupons -- 5 # Generate 5 blank coupon pages
Copy link

Copilot AI Nov 18, 2025

Choose a reason for hiding this comment

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

The generate-coupons script referenced in this documentation does not exist in server/package.json. Only super-admin and generate-seeds scripts are currently defined. Either remove this example or add the missing script definition to server/package.json.

Suggested change
npm run generate-coupons -- 5 # Generate 5 blank coupon pages

Copilot uses AI. Check for mistakes.
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