Repository navigation
fix: emit the HoldMyTask declaration before its export - #91
Merged
Merged
Conversation
katex 0.19.1+ and minimatch 11.0.3+ clear the dev-only advisories that come in through eslint and @eslint/markdown; the same overrides fix-headers carries.
… isn't complete yet
Contributor
Author
|
Auto-normalized PR title: rewrote PR title to match the highest-priority commit type (
If this isn't what you want, edit the title — the normalizer won't re-fire as long as the title stays conventional. |
The examples aren't published (package files ships types/src only), and TypeScript 6 emits their imports after the classes that extend them, which CodeQL flags.
Shinrai
approved these changes
Nov 1, 2026
cldmv-bot Bot
added a commit
that referenced
this pull request
Nov 2, 2026
# HoldMyTask v2.1.0 Changelog **Release Date**: November 2026 **Release Type**: Minor **Branch**: `release/2.1.0` --- ## Overview v2.1.0 moves the package to the CLDMV library layout. The published entries are now built by tsup from `src/index.mjs` and `src/index.cjs` into `dist/`, the `holdmytask-dev` export condition moves onto the package root, the development-only `devcheck.mjs` is gone, and `@cldmv/holdmytask/main` stays as a deprecated alias of the root. The queue itself (`src/hold-my-task.mjs`, `src/utils.mjs`) is unchanged, and the root import and `require()` return the same exports as v2.0.6. The supported Node.js range changes: `engines.node` goes from `>=18.12` to `>=22.22.0`. That is a real requirement change even though it ships in a minor release; see [Breaking Changes](#-breaking-changes) and the upgrade notes. --- ## 💥 Breaking Changes ### Node.js `>=22.22.0` is now required ([#89](#89)) `engines.node` was `>=18.12` in v2.0.6, with CommonJS `require()` documented as needing `^20.19.0` or `>=22.12.0`. Both are now `>=22.22.0`. The new build toolchain no longer runs on Node.js 18 or 20 (tsup 9 alone declares `^22.18.0 || ^24.11.0 || >=26.0.0`), so older versions can't be built or tested any more. The floor is set to 22.22.0, the oldest version the CI matrix now builds and tests. The `ERR_REQUIRE_ESM` message that `require()` throws on a Node.js without `require(esm)` now names `>=22.22.0`. The queue code has no new runtime dependency on Node.js 22.22, but older versions are no longer tested or supported. npm prints an `EBADENGINE` warning when installing on an older Node.js, and the install fails when `engine-strict` is set. --- ## ✨ Features ### Library layout: `src/` entries and a tsup build ([#89](#89)) The root `index.mjs` / `index.cjs` moved to `src/index.mjs` / `src/index.cjs`. The ESM entry now imports `./hold-my-task.mjs` directly instead of importing the package by its own name (`@cldmv/holdmytask/main`), so nothing in the package imports itself. The old `build.mjs` only copied `src/` into `dist/`; it is replaced by tsup (`tsup.config.mjs`): - `dist/index.mjs` is the ESM bundle, minified with function and class names kept, so `HoldMyTask.name` and stack traces read the same. - `dist/index.cjs` is not a second bundle. It is a verbatim copy of `src/index.cjs`, a thin wrapper that loads `./index.mjs` through Node's synchronous `require(esm)` and maps it to the historical CommonJS shape (the class as `module.exports`, plus the aliases as properties). - `dist/main.mjs` is the deprecated `./main` alias, built with `./index.mjs` external so it imports `dist/index.mjs` instead of carrying its own copy. `package.json` follows: `main` / `module` point at `dist/`, `types` at `types/src/index.d.mts`, `files` ships `dist/` (without source maps) and `types/src/`, and `prepack` runs the build so `dist/` is never committed. The stray `test:run` / `test:coverage` scripts that called vitest directly are gone. ### `holdmytask-dev` export condition on the package root ([#89](#89)) The `holdmytask-dev` condition used to sit only on `./main`. It is now on `"."`, for both `import` (`./src/index.mjs`) and `require` (`./src/index.cjs`). Running Node.js with `--conditions=holdmytask-dev` in a checkout of this repository loads the unbuilt source; without it, the root resolves to the built `dist/` files. Installed copies are unaffected, since they only ship `dist/`. ### `@cldmv/holdmytask/main` is a deprecated alias ([#89](#89)) `./main` still resolves, but it now re-exports the package root and emits a one-time `DeprecationWarning` with the code `CLDMV_HOLDMYTASK_MAIN`. Its `HoldMyTask` is the same class the root exports, as it was before; the alias also exposes the root's factories and class aliases, which the old `./main` did not. It stays ESM-only, as before. `node --no-deprecation` silences the warning, and the code lets an application filter it. `package.json` `sideEffects` now lists `src/main.mjs` and `dist/main.mjs`, so bundlers keep the warning instead of tree-shaking it away. The alias will be removed in the next major version; import `@cldmv/holdmytask` instead. ### `devcheck.mjs` removed ([#89](#89)) The root entry used to start a fire-and-forget `devcheck.mjs` import that, in a checkout of this repository, exited with setup instructions when `src/` was present but the `holdmytask-dev` condition was not set. It is gone, along with its test. The condition already chooses between `src/` and `dist/`, and both are valid; a checkout with no build and no condition now fails with `ERR_MODULE_NOT_FOUND` naming `dist/`, which `npm run build` fixes. The published package never shipped `devcheck.mjs`, so installed copies see no difference. --- ## 🔧 CI & tooling - Coverage builds with `npm run build:ci` (`coverage_build_command`), and `build:ci` now runs `lint` and `format:check` before the type and tsup builds ([#89](#89)). - The bundle-size check measures the real `dist/**.mjs` / `dist/**.cjs` output ([#89](#89)). - The CI and publish test matrices start at Node.js 22.22.0, the new package floor ([#89](#89)). - A `.prettierignore` keeps `format:check` off generated `types/`, the lockfile, `dist/`, `coverage/` and workflow YAML ([#90](#90)). - Declarations are generated from `src/` into `types/src/`. The stale root `types/index.d.mts` and `types/build.*` files are gone, and `dist/`, `tmp/`, `coverage/`, `examples/` and `tsup.config.mjs` are excluded from declaration output. The generated `index.d.mts` now declares `HoldMyTask` before exporting it, which CodeQL flagged ([#91](#91)). - Tests: the `node --test` CommonJS suite builds first and checks both `dist/` and `src/`, the CommonJS export shape and the condition routing; new vitest cases cover the `./main` alias (same class, one warning with the right code) and the async factories ([#89](#89)). ## 📚 Documentation - The README imports `@cldmv/holdmytask` instead of the `./main` subpath, documents the `holdmytask-dev` condition for `import` and `require()`, adds a section on the deprecated `./main` alias, and states the `>=22.22.0` requirement ([#89](#89)). - **NEW:** [docs/changelog/v2/v2.1.0.md](./v2.1.0.md) — this changelog. ## 🔧 Dependencies All of these are development dependencies; the package still has no runtime dependencies. - `tsup` `^9.0.0` added as the build tool ([#89](#89)). - `typescript` `^7.0.2` → `^6.0.3`. TypeScript 7's JavaScript declaration emit isn't complete yet, so the declarations are generated with TypeScript 6 ([#91](#91)). - `overrides` for `katex` (`>=0.19.1 <1.0.0`, 0.16.47 → 0.19.1) and `minimatch` (`^11.0.3`, 10.2.6 → 11.0.3) clear the dev-only advisories that come in through `eslint` and `@eslint/markdown` ([#91](#91)). - Toolchain refresh ([#90](#90)): `@cldmv/configs` 1.2.4 → 1.3.0, `@cldmv/fix-headers` 2.2.0 → 2.2.4, `@cldmv/vitest-runner` 1.5.3 → 1.5.6, `vitest` / `@vitest/coverage-v8` / `@vitest/ui` 5.0.3 → 5.0.5, `eslint` 10.12.0 → 10.14.0, `@eslint/css` 2.0.0 → 2.0.1, `@eslint/json` 2.1.0 → 2.1.1, `@html-eslint/eslint-plugin` and `@html-eslint/parser` 0.66.1 → 0.67.0, `@types/node` 26.6.4 → 26.6.6, `globals` 17.13.0 → 17.14.0, plus transitive fixes from `npm audit fix` (`vite` 8.3.2 → 8.3.5 among them). - `prettier` 3.9.9 → 3.9.10 ([#72](#72)). --- ## Upgrade notes - **Node.js `>=22.22.0` is required.** Upgrade Node.js before upgrading the package. On an older Node.js, stay on [v2.0.6](./v2.0.6.md). - Replace `import … from "@cldmv/holdmytask/main"` with `import … from "@cldmv/holdmytask"`. The old subpath keeps working until the next major, but prints a `DeprecationWarning` (`CLDMV_HOLDMYTASK_MAIN`) once per process. - No other API change: the root import, `require()` and the TypeScript declarations resolved through `exports` expose the same names as v2.0.6. Code that deep-imported a file path such as `types/index.d.mts` or `dist/hold-my-task.mjs` instead of using `exports` must switch to the package root. Closes [#81](#81). <details> <summary>👥 Contributors</summary> - @Shinrai </details> --- <!-- coverage-start -->  | Metric | Coverage | |--------|----------| | Statements | 80.8% | | Branches | 75.4% | | Functions | 73.4% | | Lines | 81.9% | *Avg: **77.8%** · `238f433` · Node lts/** <!-- coverage-end --> <!-- co-authors --> Co-authored-by: Shinrai <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🚀 What's Changed
💥 Breaking Changes
No breaking changes
✨ Features
No new features
🐛 Bug Fixes
📦 Dependencies
🔧 Other Changes
👥 Contributors