diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index 9be89da690..0e084ab482 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -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/' ./internal/testrunner # For submodule tests in _submodules/TypeScript +go test -run='TestLocal/' ./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 @@ -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. diff --git a/.github/workflows/copilot-setup-steps.yml b/.github/workflows/copilot-setup-steps.yml index 1aef70e6c2..222d1f5108 100644 --- a/.github/workflows/copilot-setup-steps.yml +++ b/.github/workflows/copilot-setup-steps.yml @@ -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