Skip to content

feat: Add per-function granular exports for all groups#1668

Open
nunomarks wants to merge 3 commits into
toss:mainfrom
nunomarks:feat/more-granular-exports
Open

feat: Add per-function granular exports for all groups#1668
nunomarks wants to merge 3 commits into
toss:mainfrom
nunomarks:feat/more-granular-exports

Conversation

@nunomarks

Copy link
Copy Markdown

Context

Changes

Enable deep imports like `es-toolkit/function/debounce` for all main groups (error, function, map, math, object, predicate, promise, set, string, util).

  • Add wildcard entries to both dev and publishConfig exports
  • Filter wildcard patterns from rollup entrypoint resolution
  • Expand .attw.json to validate sample granular entrypoints

Copilot AI review requested due to automatic review settings March 28, 2026 22:03
@vercel

vercel Bot commented Mar 28, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
es-toolkit Ready Ready Preview, Comment Jun 12, 2026 2:50pm

Request Review

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds wildcard subpath exports to support per-function deep imports (e.g. es-toolkit/function/debounce) across the main groups, and updates build/test tooling to accommodate these new export patterns.

Changes:

  • Add ./<group>/* wildcard entries to exports and publishConfig.exports for granular imports.
  • Update Rollup entrypoint resolution to ignore wildcard export targets.
  • Expand .attw.json entrypoint sampling for types validation.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
package.json Adds wildcard subpath exports for each group (and corresponding published dist mappings).
rollup.config.mjs Filters wildcard export targets out of Rollup entrypoint discovery.
tests/check-dist.spec.ts Updates expected export subpaths to include the new wildcards.
.attw.json Adds representative granular entrypoints for type-check tooling.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread package.json
Comment thread tests/check-dist.spec.ts
@niksy

niksy commented May 12, 2026

Copy link
Copy Markdown

@nunomarks does this handle compat namespace granular exports? I don’t see handling for that case, and original issue mentioned Lodash usage where a lot of compat functions usage come from.

@nunomarks

Copy link
Copy Markdown
Author

@nunomarks does this handle compat namespace granular exports? I don’t see handling for that case, and original issue mentioned Lodash usage where a lot of compat functions usage come from.

Made that change, thank you, overlooked that. Please review when you can.

Comment thread .attw.json
{
"format": "table-flipped",
"emoji": false,
"profile": "node16",

@nunomarks nunomarks May 23, 2026

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

node10 does not support subpath exports. It is also very ancient, so I'm not sure you'd want to support it. For now I'm suggesting to ignore it. This profile field is only supported on the 0.17.x version of the attw CLI

@nunomarks

Copy link
Copy Markdown
Author

@niksy can this be reviewed again ?

@niksy niksy left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I think this looks OK, but final word should be from the maintainers.

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.

Allow individual function imports

3 participants