Skip to content

Commit 926f837

Browse files
committed
Fix instructions
1 parent 4354a1f commit 926f837

File tree

4 files changed

+16
-15
lines changed

4 files changed

+16
-15
lines changed

.github/copilot-instructions.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ This is the official Prettier VS Code extension (`prettier.prettier-vscode`). It
66

77
- Use `pnpm` as the package manager
88
- Run `pnpm install` to install dependencies
9-
- Run `pnpm webpack` to build for development
9+
- Run `pnpm compile` to build for development
1010
- Run `pnpm test` to run tests (no VS Code instance can be running)
1111
- Run `pnpm lint` to check linting
1212
- Run `pnpm prettier` to format code
@@ -23,9 +23,9 @@ Core components:
2323
- `src/extension.ts` - Extension activation, creates ModuleResolver, PrettierEditService, and StatusBar
2424
- `src/PrettierEditService.ts` - Registers VS Code document formatting providers, handles format requests
2525
- `src/ModuleResolver.ts` - Resolves local/global Prettier installations, falls back to bundled Prettier
26-
- `src/PrettierInstance.ts` - Loads Prettier using dynamic `import()` (works with v2 and v3+)
26+
- `src/PrettierInstance.ts` - Interface for Prettier loading, with `PrettierMainThreadInstance` and `PrettierWorkerInstance` implementations
2727

28-
Webpack produces two bundles:
28+
esbuild produces two bundles:
2929

3030
- Node bundle (`dist/extension.js`) for desktop VS Code
3131
- Web bundle (`dist/web-extension.js`) for vscode.dev/browser
@@ -69,7 +69,7 @@ When reviewing pull requests, focus on:
6969
### Performance
7070

7171
- Avoid blocking the extension host main thread
72-
- Prettier is loaded asynchronously using dynamic `import()`
72+
- `PrettierWorkerInstance` runs Prettier in a worker thread to avoid blocking
7373
- Module and config resolution results are cached appropriately
7474

7575
### Browser Compatibility

.github/instructions/typescript.instructions.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ This is a VS Code extension. Follow these patterns:
2727

2828
## Prettier Integration
2929

30-
- Support both Prettier v2 (CJS) and v3+ (ESM) via `PrettierModuleInstance`
31-
- Uses dynamic `import()` for ESM compatibility
30+
- Support both Prettier v2 and v3+ via `PrettierInstance` interface
31+
- `PrettierMainThreadInstance` loads directly, `PrettierWorkerInstance` uses worker thread
3232
- Module resolution: local install → global install → bundled Prettier
3333
- Handle `.prettierrc`, `.prettierignore`, and `package.json` prettier config
3434

CLAUDE.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,12 @@ Web tests are located in `src/test/web/suite/` and test the extension's browser
8686
- Caches resolved modules and configurations
8787
- Handles Workspace Trust restrictions
8888

89-
**Prettier Instance** (`PrettierInstance.ts`):
89+
**Prettier Instance** (`PrettierInstance.ts`, `PrettierMainThreadInstance.ts`, `PrettierWorkerInstance.ts`):
9090

91-
- `PrettierModuleInstance` loads Prettier using dynamic `import()` for ESM support
92-
- Works with both Prettier v2 (CJS) and v3+ (ESM)
91+
- `PrettierInstance` is an interface with two implementations
92+
- `PrettierMainThreadInstance` loads Prettier directly via `require()`
93+
- `PrettierWorkerInstance` loads Prettier in a worker thread to avoid blocking
94+
- Works with both Prettier v2 and v3+
9395

9496
### Bundling
9597

CONTRIBUTING.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Thank you for your interest in contributing to the Prettier VS Code extension! F
2525

2626
3. Build the extension:
2727
```bash
28-
pnpm webpack
28+
pnpm compile
2929
```
3030

3131
## Development
@@ -34,9 +34,8 @@ Thank you for your interest in contributing to the Prettier VS Code extension! F
3434

3535
```bash
3636
pnpm install # Install dependencies
37-
pnpm webpack # Build for development
38-
pnpm webpack-dev # Build and watch for changes
39-
pnpm watch # TypeScript watch mode (without webpack)
37+
pnpm compile # Build for development (esbuild + type checking)
38+
pnpm watch # Build and watch for changes
4039
pnpm lint # Run ESLint
4140
pnpm prettier # Format code with Prettier
4241
pnpm test # Run tests
@@ -46,7 +45,7 @@ pnpm test-compile # Compile tests only
4645
### Running the Extension
4746

4847
1. Open this repository in VS Code
49-
2. Run `pnpm webpack` to build
48+
2. Run `pnpm compile` to build
5049
3. Press `F5` or go to Debug sidebar → "Run Extension"
5150
4. A new VS Code window will open with the extension loaded
5251

@@ -92,7 +91,7 @@ Key components:
9291

9392
- `PrettierEditService.ts` - Handles document formatting
9493
- `ModuleResolver.ts` - Resolves Prettier installations (local, global, or bundled)
95-
- `PrettierInstance.ts` - Loads and wraps Prettier using dynamic `import()` (works with v2 and v3+)
94+
- `PrettierInstance.ts` - Interface for Prettier, with `PrettierMainThreadInstance` and `PrettierWorkerInstance` implementations
9695

9796
## Submitting Changes
9897

0 commit comments

Comments
 (0)