You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .charlie/instructions/pull-requests.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,6 +11,7 @@
11
11
- Use `chore(repo): …` in PR titles for any PR that does not modify package source code (implementation) — docs, CI, release scripts, templates, configs, repo maintenance.
12
12
- If a PR is a repository management task (even when it touches a package’s meta files like `package.json`, `.d.ts`, or config), title it with `chore(repo): …`.
13
13
- Before marking a PR ready for review, run locally:
- Prefer a tsc-only build for packages that do not need bundling:
33
36
- In `$PKG/package.json`, set scripts:
34
37
```json
@@ -41,7 +44,9 @@ Upgrade a single plugin under `packages/<name>` to publish ESM-only output with
41
44
- If this package still needs bundling for tests/examples, keep its Rollup config but point inputs at the TypeScript output in `dist/` instead of sources.
42
45
43
46
4. TypeScript config: emit ESM to `dist/`
47
+
44
48
- Create or update `$PKG/tsconfig.json` to extend the shared plugin config and emit declarations:
49
+
45
50
```json
46
51
{
47
52
"extends": "../../.config/tsconfig.base.json",
@@ -55,15 +60,18 @@ Upgrade a single plugin under `packages/<name>` to publish ESM-only output with
55
60
"include": ["src/**/*"]
56
61
}
57
62
```
63
+
58
64
- Delete any package-local `rollup` build scripts that produced CJS, and remove any `types/` folder if declarations were hand-authored (they will now be generated).
59
65
60
66
5. Source: convert to pure ESM and modern Node APIs
67
+
61
68
- Replace `require`, `module.exports`, and `__dirname` patterns with ESM equivalents.
62
69
- Use `node:` specifiers for built-ins (e.g., `import path from 'node:path'`).
63
70
- Prefer URL utilities where needed (`fileURLToPath(new URL('.', import.meta.url))`).
64
71
- Inline and export public types from `src/index.ts`; avoid separate `types/` unless unavoidable.
65
72
66
73
6. Tests: drop CJS branches; ESM everywhere
74
+
67
75
- Remove CJS-specific branches/assertions from tests.
68
76
- Keep the existing runner (AVA) if it already handles ESM in Node 20. If the package already uses Vitest in this repo, keep that pattern.
69
77
- Ensure Rollup bundles created in tests are `await bundle.close()`-d to avoid leaks.
0 commit comments