Skip to content

Commit 6faf496

Browse files
Copilotjakebailey
andauthored
Update copilot instructions and setup steps with new stuff (#1350)
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: jakebailey <5341706+jakebailey@users.noreply.github.com>
1 parent fdf79f0 commit 6faf496

File tree

2 files changed

+24
-7
lines changed

2 files changed

+24
-7
lines changed

.github/copilot-instructions.md

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,23 +9,29 @@ Most of our development takes place in the `internal` directory, and most behavi
99

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

1414
```sh
15-
hereby build # Build the project
16-
hereby test # Run tests
17-
hereby format # Format the code
18-
hereby lint # Run linters
15+
npx hereby build # Build the project
16+
npx hereby test # Run tests
17+
npx hereby format # Format the code
18+
npx hereby lint # Run linters
19+
20+
# To run a specific compiler test:
21+
go test -run='TestSubmodule/<test name>' ./internal/testrunner # For submodule tests in _submodules/TypeScript
22+
go test -run='TestLocal/<test name>' ./internal/testrunner # For local tests in testdata/tests/cases
1923
```
2024

21-
Always make sure code is formatted, linted, and tested before sending a pull request.
22-
25+
Always make sure code is formatted, linted, and tested before sending a pull request.
26+
2327
## Compiler Features, Fixes, and Tests
2428

2529
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.
2630
This project primarily uses snapshot/baseline/golden tests rather than unit tests.
2731
New compiler tests are written in `.ts`/`.tsx` files in the directory `testdata/tests/cases/compiler/`, and are written in the following format:
2832

33+
**Note:** Issues with editor features cannot be tested with compiler tests in `testdata/tests/cases/`. Editor functionality requires integration testing with the language server.
34+
2935
```ts
3036
// @target: esnext
3137
// @module: preserve
@@ -79,6 +85,12 @@ It is ideal to implement features and fixes in the following order, and commit c
7985

8086
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.
8187

88+
## Code Porting Reference
89+
90+
The code in `internal` is ported from the code in `_submodules/TypeScript`.
91+
When implementing features or fixing bugs, those files should be searched for similar functions when code is either missing or potentially wrong.
92+
The TypeScript submodule serves as the reference implementation for behavior and functionality.
93+
8294
# Other Instructions
8395

8496
- Do not add or change existing dependencies unless asked to.

.github/workflows/copilot-setup-steps.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,13 @@ jobs:
2323
- uses: dtolnay/rust-toolchain@fcf085fcb4b4b8f63f96906cd713eb52181b5ea4 # stable
2424
- uses: ./.github/actions/setup-go
2525
with:
26+
# Updated to 1.25.0-rc.1 to improve compilation time
27+
go-version: '>=1.25.0-rc.1'
2628
cache-name: copilot-setup-steps
2729
- run: npm i -g @playwright/mcp@0.0.28
2830
- run: npm ci
2931
# pull dprint caches before network access is blocked
3032
- run: npx hereby check:format || true
33+
# cache build and lint operations
34+
- run: npx hereby build || true
35+
- run: npx hereby lint || true

0 commit comments

Comments
 (0)