Skip to content

Commit b582dcb

Browse files
committed
chore: sync convention docs from template
1 parent fdd9e55 commit b582dcb

3 files changed

Lines changed: 35 additions & 46 deletions

File tree

AGENTS.md

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,10 @@
22

33
## After Making Changes
44

5-
After modifying code, ensure to run the following commands to maintain code quality:
5+
After modifying code, run:
66

7-
- `npm run ci` - Run all checks (tests + lint + format check)
7+
- `npm run ci` tests + lint + format check
88

9-
Or run individually:
9+
See [DEVELOPMENT.md](DEVELOPMENT.md) for all available scripts.
1010

11-
- `npm run lint` - Lint code (ESLint)
12-
- `npm run lint:fix` - Lint and auto-fix
13-
- `npm run format` - Format code with Prettier
14-
- `npm run format:check` - Check formatting without writing
15-
16-
Refer to [DEVELOPMENT.md](DEVELOPMENT.md) for project setup, scripts, and technical details.
17-
Refer to [RELEASE.md](RELEASE.md) for the release process and versioning conventions.
11+
See [RELEASE.md](RELEASE.md) for the release process.

DEVELOPMENT.md

Lines changed: 22 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,7 @@
1515

1616
## Running the Extension
1717

18-
Open the project in VS Code and press **F5** to launch the Extension Development Host. The extension activates automatically on startup and shows Copilot usage in the status bar.
19-
20-
You must be signed in to GitHub (`githubCopilotUsage.signIn`) and have an active Copilot subscription.
18+
Open the project in VS Code and press **F5** to launch the Extension Development Host. The extension activates automatically on startup.
2119

2220
## Scripts
2321

@@ -29,16 +27,7 @@ You must be signed in to GitHub (`githubCopilotUsage.signIn`) and have an active
2927
| `npm run lint:fix` | Lint and auto-fix |
3028
| `npm run format` | Format code with Prettier |
3129
| `npm run format:check` | Check code formatting |
32-
33-
## Project Structure
34-
35-
```
36-
src/
37-
├── api.js # GitHub API call: fetch Copilot usage
38-
└── extension.js # VS Code extension: status bar, commands, timer
39-
tests/
40-
└── api.test.js # Unit tests for api.js
41-
```
30+
| `npm run package` | Package extension as `.vsix` |
4231

4332
## Testing
4433

@@ -47,29 +36,33 @@ npm test # Run all tests
4736
npm run ci # Run tests + lint + format check in one step
4837
```
4938

50-
Tests use [Vitest](https://vitest.dev/) and mock `fetch` globally — no network calls are made.
51-
52-
## Key Technical Notes
53-
54-
- **API endpoint**: `GET https://api.github.com/copilot_internal/user`
55-
- **Auth**: VS Code `authentication.getSession('github', ...)` — uses the user's existing GitHub session; cancellation handled gracefully via inner try/catch
56-
- **Auto-refresh**: Configurable interval (1–60 min, default 5 min) via `githubCopilotUsage.refreshIntervalMinutes`
57-
- **Status bar position**: Priority `100.099999` — places the indicator just to the right of the Copilot icon (`chat.statusBarEntry` at `100.1`)
39+
Tests use [Vitest](https://vitest.dev/).
5840

5941
## Local Packaging
6042

61-
To build a `.vsix` file for local installation:
62-
6343
```bash
64-
npx @vscode/vsce package --no-dependencies
44+
npm run package
6545
```
6646

67-
This generates `github-copilot-usage-<version>.vsix` in the project root.
68-
69-
To install it locally in VS Code:
47+
This produces a `.vsix` file. To install it locally:
7048

7149
```bash
72-
code --install-extension github-copilot-usage-<version>.vsix
50+
code --install-extension my-extension-0.0.1.vsix
7351
```
7452

75-
Or in VS Code: **Extensions****···** (top-right) → **Install from VSIX…**
53+
Or use **Extensions: Install from VSIX** in the VS Code UI.
54+
55+
<!-- END-SHARED -->
56+
57+
## Notes
58+
59+
You must be signed in to GitHub (`githubCopilotUsage.signIn`) and have an active Copilot subscription.
60+
61+
Tests mock `fetch` globally — no network calls are made.
62+
63+
### Key Technical Notes
64+
65+
- **API endpoint**: `GET https://api.github.com/copilot_internal/user`
66+
- **Auth**: VS Code `authentication.getSession('github', ...)` — uses the user's existing GitHub session; cancellation handled gracefully via inner try/catch
67+
- **Auto-refresh**: Configurable interval (1–60 min, default 5 min) via `githubCopilotUsage.refreshIntervalMinutes`
68+
- **Status bar position**: Priority `100.099999` — places the indicator just to the right of the Copilot icon (`chat.statusBarEntry` at `100.1`)

RELEASE.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,36 +7,38 @@
77

88
2. Update version in `package.json`:
99

10-
```sh
10+
```bash
1111
# Edit package.json to set "version": "X.Y.Z"
1212
npm install # sync package-lock.json
1313
```
1414

1515
3. Commit and push:
1616

17-
```sh
17+
```bash
1818
git add CHANGELOG.md package.json package-lock.json
1919
git commit -m "chore: update version to vX.Y.Z"
2020
git push origin main
2121
```
2222

2323
4. Run the release workflow:
2424

25-
```sh
25+
```bash
2626
gh workflow run release.yml
2727
```
2828

29-
This will run tests, package the extension as `.vsix`, and create a GitHub Release with the file attached.
29+
This runs tests, packages the extension as `.vsix`, and creates a GitHub Release with the file attached.
3030

31-
5. Verify the release was created successfully:
31+
5. Verify the release:
3232

33-
```sh
33+
```bash
3434
gh release view vX.Y.Z
3535
```
3636

37+
<!-- END-SHARED -->
38+
3739
6. Update the release notes on GitHub to match `CHANGELOG.md`:
3840

39-
```sh
41+
```bash
4042
gh release edit vX.Y.Z --notes "## What's Changed
4143
- Change 1
4244
- Change 2

0 commit comments

Comments
 (0)