Skip to content

fix!: remove unsound enum-to-tuple helper (CORE-04) - #17

Draft
YLfjuk wants to merge 3 commits into
mainfrom
fix/core-04-remove-enum-to-tuple
Draft

YLfjuk wants to merge 3 commits into
mainfrom
fix/core-04-remove-enum-to-tuple

Conversation

@YLfjuk

@YLfjuk YLfjuk commented Oct 18, 2026 •

Copy link
Copy Markdown
Owner

Remove Enum.toTuple, its enumToTuple alias, and the otherwise empty Enum namespace from @ylfjuk-core/utils and the @ylfjuk/core re-exports. The implementation cast Object.values to a tuple whose positions could disagree with runtime order and whose length could omit duplicate values.

The utils README migration guide uses Object.values(enumLikeObject) for arrays and an explicit as const tuple when exact positions matter. UnionToTuple remains public, with an unspecified, unstable order warning and an example showing membership and length.

  • Keep the breaking-change notice and migration paragraph in the changeset, with the shared changelog wording free of package cross-references. Retain the linked utils README migration guide. The core README has no added migration section; further core README guidance is deferred to the CORE-24 docs-site issue.
  • Delete only the helper's obsolete test and implementation/export files.
  • Use two changesets: utils + core receive the explicit BREAKING CHANGE and migration guidance; types receives a documentation-only note about UnionToTuple ordering and duplicate collapse. The example names are Name and NameTuple.
  • Keep all three bumps at patch, consistent with pre-1.0 breaking patches in types 0.0.11/0.0.14 and utils 0.0.7. This rationale belongs here rather than in consumer changelogs. No version or publication commands were run for this implementation.
  • Start directly from main commit e195ff7d9aca4e702b098744a52d5ca29bd3e9cc. This is independent of CORE-01 and intended to land before CORE-01 is rebased. No CORE-01 changes are included.

Validation of revision e1ce15e5570e5d3dc0623595f748c35b4ff973e3:

  • pnpm install --frozen-lockfile, pnpm run fmt:check, git diff --check, and pnpm exec changeset status passed. The release plan remains exactly three patches: types, utils, and core.
  • This follow-up changes only the shared changeset sentence and removes the core README migration section. Changeset frontmatter, migration paragraph, utils migration guide, source, tests, package versions, and bump scope are unchanged.
  • The full suite was not repeated for this two-file documentation edit. HQ owns fresh independent review.

Previous validation of revision d69f6940c346e6b6f1c9e4f78834bf46402d1f89:

  • pnpm install --frozen-lockfile, pnpm run fmt:check, git diff --check, and pnpm exec changeset status passed. The release plan still contains exactly three patches.
  • pnpm exec turbo run test:types --filter=@ylfjuk-core/types --force, pnpm --filter @ylfjuk-core/types exec publint, and pnpm --filter @ylfjuk-core/types exec attw --pack --profile esm-only passed. attw's CommonJS resolution is excluded by the repository's ESM-only profile.
  • A separate fixture extracted the revised JSDoc example and both unchanged README migration examples. Direct TypeScript 7 checks with --ignoreConfig --noEmit --strict --target ES2024 --allowImportingTsExtensions passed using both ESNext/bundler and NodeNext/NodeNext. The fixture imports the current source public entry point and checks membership, length, rejection of an invalid length, duplicate collapse, array inference, and exact readonly-tuple inference. Node runtime checks confirmed duplicate preservation.
  • Source searches across all three packages found no Enum, toTuple, enumToTuple, or ./enum references. Unrelated MappedEnum test locals and historical/migration documentation remain.

Earlier validation at c0a2a5a1fe337f9001e67e4c93f9e3280f9bdd44:

  • Author and independent reviewers reported passing formatting, lint, full test/type tasks, coverage, build, publint, and attw. Runtime tests reported 339 passes and five TODOs; coverage was 100% statements/branches/lines and 96.29% functions. Lint had ten existing warnings.
  • Direct source/built compiler fixtures checked removed imports, preserved types, migration inference, membership/length, and duplicate collapse. Built utils/core export checks and source/dist searches confirmed removal.
  • The independent Tests reviewer temporarily combined that head with CORE-01 25fe42b7412f6b63ff017577cefc96623ae073e9: test:types, test, test:discovery, and coverage passed with 652 passes, nine TODOs, and no type errors. Those results cover the earlier heads, not this documentation revision.

Limits: the full runtime/build/coverage suite was not repeated for these documentation revisions. Main's existing test configuration does not compile .spec.ts assertions; the focused compiler fixture checks the examples independently. The stale exact-order test remains for CORE-01. Existing dependency audit failures belong to CORE-02; dependencies and lockfile are unchanged. HQ owns current-head independent re-review and combined validation.

@changeset-bot

changeset-bot Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: e1ce15e

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@ylfjuk-core/types Patch
@ylfjuk-core/utils Patch
@ylfjuk/core Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Comment thread .changeset/remove-enum-to-tuple.md Outdated
"@ylfjuk/core": patch
---

BREAKING CHANGE: remove `Enum.toTuple`, its `enumToTuple` alias, and the otherwise empty `Enum` namespace from `@ylfjuk-core/utils` and the `@ylfjuk/core` umbrella re-exports. Imports of these APIs must be removed.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
BREAKING CHANGE: remove `Enum.toTuple`, its `enumToTuple` alias, and the otherwise empty `Enum` namespace from `@ylfjuk-core/utils` and the `@ylfjuk/core` umbrella re-exports. Imports of these APIs must be removed.
BREAKING CHANGE: remove `Enum.toTuple`, its `enumToTuple` alias, and the otherwise empty `Enum` namespace. Imports of these APIs must be removed.

they shouldn't reference each other in their changelogs

Comment thread packages/core/README.md Outdated
Comment on lines +19 to +22
## Migration

BREAKING CHANGE: the `Enum` namespace, `Enum.toTuple`, and `enumToTuple` re-exports have been removed. Use `Object.values` for an array, or define an explicit tuple when positions matter. See the [migration guide](../utils/README.md#migrate-from-enumtotuple) for examples and the ordering and duplicate-value limitations. `UnionToTuple` remains public with unspecified, unstable element order.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unnecessary

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

defer to the docs site issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant