|
| 1 | +# Copilot Instructions for Unity Changeset Project |
| 2 | + |
| 3 | +## Overview |
| 4 | +This project is a TypeScript library and CLI tool for retrieving and listing Unity editor changesets. It supports both Deno and Node.js environments, using Deno for development and building npm packages via dnt. The codebase follows Deno's conventions and uses modern TypeScript features. |
| 5 | + |
| 6 | +## Coding Standards |
| 7 | +- **Language**: TypeScript with Deno runtime |
| 8 | +- **Style**: Follow Deno's linting rules (`deno lint`) and formatting (`deno fmt`) |
| 9 | +- **Imports**: Use Deno-style imports from `deno.land` or npm specifiers |
| 10 | +- **Error Handling**: Use explicit error handling with try-catch blocks; prefer throwing errors over returning error objects |
| 11 | +- **Naming**: Use camelCase for variables/functions, PascalCase for classes/interfaces |
| 12 | +- **Async/Await**: Prefer async/await over promises for asynchronous operations |
| 13 | +- **Types**: Use strict TypeScript typing; avoid `any` unless necessary |
| 14 | +- **Modules**: Keep modules focused and single-responsible; export only what's needed |
| 15 | + |
| 16 | +## Testing |
| 17 | +- Use Deno's built-in testing framework (`deno test`) |
| 18 | +- Write tests in `.test.ts` files alongside source files |
| 19 | +- Use `std/testing/asserts` for assertions |
| 20 | +- Cover both unit tests and integration tests where applicable |
| 21 | +- Run tests with `deno task test` before committing |
| 22 | + |
| 23 | +## Build and Deployment |
| 24 | +- Build npm packages using dnt (Deno to Node Transform) |
| 25 | +- Run `deno task build` to generate npm distribution |
| 26 | +- Follow semantic versioning for releases |
| 27 | +- Use conventional commit messages for automated releases |
| 28 | + |
| 29 | +## Dependencies |
| 30 | +- Core: Deno standard library (`std/path`, `std/testing/asserts`) |
| 31 | +- CLI: Cliffy for command-line interface |
| 32 | +- GraphQL: graphql-request for Unity API interactions |
| 33 | +- Build: dnt for npm package generation |
| 34 | + |
| 35 | +## Communication |
| 36 | +- **Ask Questions When Needed**: If user requirements are unclear, ask clarifying questions to ensure accurate implementation |
| 37 | +- **Think in English**: All internal reasoning and planning should be conducted in English to maintain consistency and clarity |
| 38 | + |
| 39 | +## Best Practices |
| 40 | +- Keep code modular and reusable |
| 41 | +- Document complex logic with comments |
| 42 | +- Ensure cross-platform compatibility (macOS, Windows, Linux) |
| 43 | +- Validate inputs and handle edge cases |
| 44 | +- Follow security best practices, especially when handling external data |
0 commit comments