[PR #3777] [MERGED] chore(cli): emit bundle in ESM format #4521

Closed
opened 2026-03-17 02:03:07 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/hoppscotch/hoppscotch/pull/3777
Author: @jamesgeorge007
Created: 1/25/2024
Status: Merged
Merged: 2/5/2024
Merged by: @AndrewBastin

Base: release/2024.3.0Head: cli-esm-bundle


📝 Commits (1)

  • 5177dac chore: emit CLI bundle in ESM format

📊 Changes

11 files changed (+232 additions, -188 deletions)

View changed files

packages/hoppscotch-cli/bin/hopp (+0 -3)
packages/hoppscotch-cli/bin/hopp.js (+6 -0)
📝 packages/hoppscotch-cli/package.json (+20 -19)
📝 packages/hoppscotch-cli/src/index.ts (+3 -1)
📝 packages/hoppscotch-cli/src/utils/collections.ts (+3 -3)
📝 packages/hoppscotch-cli/src/utils/display.ts (+3 -3)
📝 packages/hoppscotch-cli/src/utils/functions/array.ts (+1 -1)
📝 packages/hoppscotch-cli/src/utils/getters.ts (+1 -1)
📝 packages/hoppscotch-cli/tsconfig.json (+2 -2)
📝 packages/hoppscotch-cli/tsup.config.ts (+2 -5)
📝 pnpm-lock.yaml (+191 -150)

📄 Description

Description

This PR brings the necessary updates to the build system for the CLI to emit an ESM-only bundle. Along with that, the dependencies are bumped, and the following are removed:

Follow up of #3441.

Closes HFE-278.

Checks

  • My pull request adheres to the code style of this project
  • All the tests have passed

Note to reviewers

The dependencies, while inlined in the bundle, caused issues relating to the usage of require in the ESM context; hence they're no longer inlined (officially recommended) and moved under dependencies. For fp-ts, it's inlined as part of the bundle and kept under devDependencies since the import paths were expected to specify the extensions import * as TE from fp-ts/lib/TaskEither.js.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/hoppscotch/hoppscotch/pull/3777 **Author:** [@jamesgeorge007](https://github.com/jamesgeorge007) **Created:** 1/25/2024 **Status:** ✅ Merged **Merged:** 2/5/2024 **Merged by:** [@AndrewBastin](https://github.com/AndrewBastin) **Base:** `release/2024.3.0` ← **Head:** `cli-esm-bundle` --- ### 📝 Commits (1) - [`5177dac`](https://github.com/hoppscotch/hoppscotch/commit/5177dac2926430ec90d4494aff9ae9f802178c1a) chore: emit CLI bundle in ESM format ### 📊 Changes **11 files changed** (+232 additions, -188 deletions) <details> <summary>View changed files</summary> ➖ `packages/hoppscotch-cli/bin/hopp` (+0 -3) ➕ `packages/hoppscotch-cli/bin/hopp.js` (+6 -0) 📝 `packages/hoppscotch-cli/package.json` (+20 -19) 📝 `packages/hoppscotch-cli/src/index.ts` (+3 -1) 📝 `packages/hoppscotch-cli/src/utils/collections.ts` (+3 -3) 📝 `packages/hoppscotch-cli/src/utils/display.ts` (+3 -3) 📝 `packages/hoppscotch-cli/src/utils/functions/array.ts` (+1 -1) 📝 `packages/hoppscotch-cli/src/utils/getters.ts` (+1 -1) 📝 `packages/hoppscotch-cli/tsconfig.json` (+2 -2) 📝 `packages/hoppscotch-cli/tsup.config.ts` (+2 -5) 📝 `pnpm-lock.yaml` (+191 -150) </details> ### 📄 Description ### Description This PR brings the necessary updates to the build system for the CLI to emit an ESM-only bundle. Along with that, the dependencies are bumped, and the following are removed: - [esm](https://www.npmjs.com/package/esm) - [io-ts](https://www.npmjs.com/package/io-ts) Follow up of #3441. Closes HFE-278. ### Checks - [x] My pull request adheres to the code style of this project - [x] All the tests have passed ### Note to reviewers The dependencies, while inlined in the bundle, caused issues relating to the usage of `require` in the ESM context; hence they're no longer inlined ([officially recommended](https://tsup.egoist.dev/#excluding-all-packages)) and moved under `dependencies`. For `fp-ts`, it's inlined as part of the bundle and kept under `devDependencies` since the import paths were expected to specify the extensions `import * as TE from fp-ts/lib/TaskEither.js`. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-17 02:03:07 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/hoppscotch#4521
No description provided.