Skip to content

refactor: organize the modules by the environment, the store, the cli and the utils - #874

Merged
mshima merged 1 commit into
yeoman:mainfrom
mshima:reorganize-modules
Oct 21, 2026
Merged

mshima merged 1 commit into
yeoman:mainfrom
mshima:reorganize-modules

Conversation

@mshima

@mshima mshima commented Oct 21, 2026 •

Copy link
Copy Markdown
Member

Summary

The 17 modules of src were mostly at its root, the store and the lookup importing each other, and a util importing the environment. They are organized by what they are about:

src/
  index.ts, constants.ts
  environment/  environment-base.ts, environment-full.ts, composed-store.ts, commit.ts, package-manager.ts, resolve.ts
  store/        store.ts (Store), lookup.ts, lookup-generator.ts, module-lookup.ts, namespace.ts, index.ts, public.ts
  cli/          index.ts (bin), utils.ts, command.ts, commands.ts
  util/         args.ts, exec.ts, object.ts, regexp.ts
  • store/: the store is implemented in store.ts; index.ts only exports the store and its lookups to the other modules of the package, which import the folder by it; public.ts is the module of yeoman-environment/store (the store as Store and default, and its types), in place of src/store-export.ts. lookupGenerator, which uses a store, moves to lookup-generator.ts, so the lookup no longer imports the store.
  • cli/: the modules of the cli create the environment from environment-full.ts, no longer importing the index that re-exports them.
  • util/: util.ts split by subject.
  • The modules finding the root of the package one folder deeper (the version of the environment, the npm paths next to it) are updated.

No module imports another at runtime in a cycle. The exports of the package are unchanged (the names exported by the index compared), yeoman-environment/store loads 33 modules (32 before, public.js added), and git follows the renames.

Supersedes #872.

Test plan

  • npm test (eslint, prettier, tsc, the tests)
  • npm run build, the bin (--version), the exports of the index, the modules of yeoman-environment/store

🤖 Generated with Claude Code

… and the utils

- environment/: environment-base.ts, environment-full.ts, composed-store.ts,
  commit.ts, package-manager.ts and resolve.ts.
- store/: the store in store.ts, lookup.ts, module-lookup.ts and namespace.ts;
  lookupGenerator, which uses a store, in lookup-generator.ts, so lookup.ts no
  longer imports the store. index.ts exports them to the other modules of the
  package, public.ts is yeoman-environment/store, in place of store-export.ts.
- cli/: command.ts and commands.ts, next to the bin, creating the environment
  without importing the index.
- util/: util.ts split into args.ts, exec.ts, object.ts and regexp.ts.

The modules import no other at runtime in a cycle. The exports of the package
are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mshima
mshima force-pushed the reorganize-modules branch from 4c01a03 to d2f85cd Compare October 21, 2026 13:37
@mshima
mshima merged commit a451233 into yeoman:main Oct 21, 2026
16 checks passed
@mshima
mshima deleted the reorganize-modules branch October 21, 2026 13:42
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