Skip to content

feat: export the store alone as yeoman-environment/store, without execa - #871

Merged
mshima merged 1 commit into
yeoman:mainfrom
mshima:store-subpath
Oct 21, 2026
Merged

mshima merged 1 commit into
yeoman:mainfrom
mshima:store-subpath

Conversation

@mshima

@mshima mshima commented Oct 21, 2026

Copy link
Copy Markdown
Member

Summary

Importing the Store from the package loads the whole index: the environment, mem-fs-editor, the adapter and inquirer, the conflicter, commander… A tool that only looks up and reads generators (lookupSync, getMeta, requireSibling) does not need them.

  • yeoman-environment/store: a subpath exporting the Store (as Store and as default) and the types of the store (StoreGeneratorMeta, StoreLookupOptions, …), without the environment.
  • execa out of the store: the store imported execa through the lookup of the global npm paths (yarn global dir, npm root -g). execaOutput now loads it at its first command: a lookup given the paths of its packages does not load it. execa is kept rather than child_process, for the .cmd of npm and yarn on Windows.

Benchmark

Modules loaded by an import:

before after
dist/store.js 179 31
yeoman-environment/store – 32
yeoman-environment 400 400 (the environment uses execa to install)

Test plan

  • npm test (eslint, prettier, tsc, the tests)
  • The exports of the store entry; a lookupSync with packagePaths and a requireSibling through yeoman-environment/store, without loading execa

🤖 Generated with Claude Code

`yeoman-environment/store` exports the Store and its types without the
environment: importing the store loads 32 modules, the index 400. execa,
which the store imported through the lookup of the global npm paths, is
loaded at the first command only: a lookup given the paths of its packages
does not load it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mshima
mshima merged commit 503fa16 into yeoman:main Oct 21, 2026
14 of 16 checks passed
@mshima
mshima deleted the store-subpath branch October 21, 2026 13:20
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