Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
@copilot remove shebang |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Migrates copilot-client from tsc-emitted per-file output to a tsup-bundled ESM build targeting Node 24/ES2024, aligning the package’s distribution artifacts and build command with the new bundling approach.
Changes:
- Add
tsupbuild configuration to produce bundled ESM outputs for both library and CLI entries. - Switch
npm run buildfromtsctotsupand addtsupas a dev dependency (lockfile updated accordingly). - Remove the source shebang from the CLI entry and update README build documentation.
Reviewed changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
copilot-client/tsup.config.ts |
Introduces a unified tsup config for bundling index + cli as ESM targeting ES2024. |
copilot-client/src/cli.ts |
Removes the source shebang from the CLI entry point. |
copilot-client/package.json |
Updates build script to tsup and adds tsup to devDependencies. |
copilot-client/package-lock.json |
Locks newly added tsup dependency graph. |
copilot-client/README.md |
Documents the new tsup-based build and dist artifacts (but has a shebang mismatch). |
Files not reviewed (1)
- copilot-client/package-lock.json: Language not supported
Comments suppressed due to low confidence (1)
copilot-client/README.md:12
- The new “single-file distribution” wording is misleading given the build keeps external dependencies (e.g.,
@github/copilot-sdk,debug) unbundled. Consider clarifying that tsup bundles the project’s own source into single-file outputs per entry, but still requires installing runtime dependencies.
- ESM module format
- Bundled with tsup for single-file distribution
- JSONL event logging with timestamps
- Debug package for logging
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
copilot-client/README.md
Outdated
| The build uses [tsup](https://tsup.egoist.dev/) to bundle the TypeScript source into optimized ESM JavaScript files targeting Node 24 (ES2024). The compiled output will be in the `dist/` directory: | ||
|
|
||
| - `dist/index.js` - Main library entry point | ||
| - `dist/cli.js` - CLI executable with shebang |
There was a problem hiding this comment.
README now claims dist/cli.js is a “CLI executable with shebang”, but the shebang was removed from src/cli.ts and tsup.config.ts does not add a banner shebang. Either update this line to reflect that the CLI is invoked via node dist/cli.js / the npm bin shim, or add a shebang banner in the tsup build if direct execution (./dist/cli.js) is intended.
This issue also appears on line 9 of the same file.
| - `dist/cli.js` - CLI executable with shebang | |
| - `dist/cli.js` - CLI entry point (run with `node dist/cli.js` or via the npm `bin` shim) |
|
@copilot use typescript to rebuild. |
|
@copilot add copilot-client build as part of recompile |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
@copilot add post build to copy cli.js as actions/setup/js/copilot-client.js |
…build into recompile target Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Switched from tsup to TypeScript compiler (tsc) for building in commit d9756e0. The build now uses
Added copilot-client build as dependency of recompile target in commit d9756e0. The Makefile now runs |
…t.js Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
@copilot delete cli.js and copy index.js instead |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
@copilot make sure the resulting JavaScript is fully bundled with dependencies |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Configured tsup to fully bundle all dependencies in commit 5f79d93. The output file (actions/setup/js/copilot-client.js) is now ~190KB and includes all npm dependencies (@github/copilot-sdk, debug) bundled inline. Only Node.js built-in modules (child_process, fs, net, path, url) remain as imports. |
Updates the copilot-client build system to use tsup for bundling into a fully self-contained ESM JavaScript file with all npm dependencies included, targeting ES2024/Node 24, and integrates the build into the recompile workflow.
Changes
Build system (
package.json,tsup.config.ts)noExternal: [/.*/]to bundle all npm dependenciesBundler configuration (
tsup.config.ts)Source cleanup (
src/cli.ts)Makefile integration
copilot-clientas dependency ofrecompiletargetmake recompilebuilds copilot-client before recompiling workflowsDocumentation (
README.md)Library deployment (
actions/setup/js/copilot-client.js)Output artifacts
dist/index.js(~190KB) - fully bundled library with all dependenciesdist/index.d.ts- TypeScript type declarationsdist/index.js.map- Source map for debuggingCompatibility
Existing workflows unchanged:
npm run build,make copilot-client, and CI continue working. Tests pass. Therecompiletarget now builds copilot-client automatically, and the postbuild script ensures the fully bundled library is always available in actions/setup/js.✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.