-
Notifications
You must be signed in to change notification settings - Fork 242
Add Copilot coding agent instructions #712
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
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
ea7ffc0
Initial plan
Copilot 6c92344
Add .github/copilot-instructions.md with repo overview, structure, co…
Copilot 3fca3be
Update copilot-instructions: JSR-only distribution, note deno.json ex…
Copilot 41b55b8
Exclude copilot-instructions.md from deno fmt to fix CI
Copilot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| # Copilot Instructions for oak | ||
|
|
||
| ## Overview | ||
|
|
||
| oak is a middleware framework for Deno's native HTTP server, | ||
| [Deno Deploy](https://deno.com/deploy), Node.js, [Bun](https://bun.sh/), and | ||
| [Cloudflare Workers](https://workers.cloudflare.com/). It is inspired by | ||
| [Koa](https://github.com/koajs/koa/) and includes a middleware router inspired | ||
| by [@koa/router](https://github.com/koajs/router/). The package is distributed | ||
| via [JSR](https://jsr.io/@oak/oak). | ||
|
|
||
| ## Repository Structure | ||
|
|
||
| - **Root-level `.ts` files** — Core framework modules (e.g., `application.ts`, | ||
| `router.ts`, `context.ts`, `request.ts`, `response.ts`, `body.ts`, `send.ts`). | ||
| - **`middleware/`** — Built-in middleware (etag, proxy, serve). | ||
| - **`utils/`** — Internal utility functions and type guards. | ||
| - **`*.test.ts`** — Test files co-located with source files. | ||
| - **`deps.ts`** — Centralized runtime dependencies (always import shared deps from here). | ||
| - **`deps_test.ts`** — Centralized test-only dependencies. | ||
| - **`mod.ts`** — Public entry point that re-exports the full public API. | ||
| - **`types.ts`** — Shared TypeScript types and interfaces. | ||
| - **`examples/`** — Example usage scripts (not published). | ||
| - **`fixtures/`** — Test fixtures (not published). | ||
| - **`docs/`** — Documentation site source (not published). | ||
|
|
||
| ## Development Commands | ||
|
|
||
| All commands use the [Deno](https://deno.com/) toolchain (no `npm` or build step needed). | ||
|
|
||
| | Task | Command | | ||
| |---|---| | ||
| | Run tests | `deno task test` | | ||
| | Run tests with coverage | `deno task test:coverage` | | ||
| | Generate lcov report | `deno task coverage` | | ||
| | Format code | `deno fmt` | | ||
| | Check formatting | `deno fmt --check` | | ||
| | Lint code | `deno lint` | | ||
|
|
||
| ## Coding Conventions | ||
|
|
||
| - **Language**: TypeScript, targeting Deno-first with cross-runtime support (Node.js, Bun). | ||
| - **Copyright header**: Every source file begins with: | ||
| ```ts | ||
| // Copyright 2018-2025 the oak authors. All rights reserved. MIT license. | ||
| ``` | ||
| - **Imports**: Use relative imports with `.ts` extensions (e.g., `import { foo } from "./bar.ts"`). | ||
| Shared dependencies are imported via `deps.ts`; test-only dependencies via `deps_test.ts`. | ||
| - **JSDoc**: Public APIs are documented with JSDoc. Module-level doc comments end with a `@module` tag. | ||
| - **Formatting**: Enforced by `deno fmt`. Do not manually adjust whitespace or indentation. | ||
| - **Linting**: Enforced by `deno lint`. The `no-import-prefix` rule is disabled (see `deno.json`). | ||
| - **Tests**: Co-located `*.test.ts` files. Use `assertEquals`, `assertStrictEquals`, and | ||
| `assertRejects` from `deps_test.ts`. Mock helpers are defined locally within test files. | ||
| - **Error handling**: Use the `errors` object from `deps.ts` for HTTP error classes. | ||
| - **Exports**: All public symbols are re-exported from `mod.ts`. The `deno.json` | ||
| `exports` field also defines the package entry points for JSR publishing. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.