Skip to content

Update copilot instructions and setup steps with new stuff #1350

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

Merged
merged 6 commits into from
Jul 2, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 19 additions & 7 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,29 @@ Most of our development takes place in the `internal` directory, and most behavi

Most development on the codebase is in Go.
Standard Go commands and practices apply, but we primarily use a tool called `hereby` to build, run tests, and other tasks.
Feel free to install `hereby` globally (`npm install -g hereby`) if it is easier, and run `hereby --list` to see all available commands.
Run `npx hereby --list` to see all available commands.

```sh
hereby build # Build the project
hereby test # Run tests
hereby format # Format the code
hereby lint # Run linters
npx hereby build # Build the project
npx hereby test # Run tests
npx hereby format # Format the code
npx hereby lint # Run linters

# To run a specific compiler test:
go test -run='TestSubmodule/<test name>' ./internal/testrunner # For submodule tests in _submodules/TypeScript
go test -run='TestLocal/<test name>' ./internal/testrunner # For local tests in testdata/tests/cases
```

Always make sure code is formatted, linted, and tested before sending a pull request.
Always make sure code is formatted, linted, and tested before sending a pull request.

## Compiler Features, Fixes, and Tests

When fixing a bug or implementing a new feature, at least one minimal test case should always be added in advance to verify the fix.
This project primarily uses snapshot/baseline/golden tests rather than unit tests.
New compiler tests are written in `.ts`/`.tsx` files in the directory `testdata/tests/cases/compiler/`, and are written in the following format:

**Note:** Issues with editor features cannot be tested with compiler tests in `testdata/tests/cases/`. Editor functionality requires integration testing with the language server.

```ts
// @target: esnext
// @module: preserve
Expand Down Expand Up @@ -79,6 +85,12 @@ It is ideal to implement features and fixes in the following order, and commit c

It is fine to implement more and more of a feature across commits, but be sure to update baselines every time so that reviewers can measure progress.

## Code Porting Reference

The code in `internal` is ported from the code in `_submodules/TypeScript`.
When implementing features or fixing bugs, those files should be searched for similar functions when code is either missing or potentially wrong.
The TypeScript submodule serves as the reference implementation for behavior and functionality.

# Other Instructions

- Do not add or change existing dependencies unless asked to.
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/copilot-setup-steps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,13 @@ jobs:
- uses: dtolnay/rust-toolchain@fcf085fcb4b4b8f63f96906cd713eb52181b5ea4 # stable
- uses: ./.github/actions/setup-go
with:
# Updated to 1.25.0-rc.1 to improve compilation time
go-version: '>=1.25.0-rc.1'
cache-name: copilot-setup-steps
- run: npm i -g @playwright/mcp@0.0.28
- run: npm ci
# pull dprint caches before network access is blocked
- run: npx hereby check:format || true
# cache build and lint operations
- run: npx hereby build || true
- run: npx hereby lint || true