Repository navigation
fix: keep a generator- inside a package or generator name in the namespace - #860
Merged
Merged
Conversation
…space - asNamespace removes the path up to the last folder starting with `generator-` and its prefix, instead of everything up to the last `generator-`: `generator-foo-generator-bar` is `foo-generator-bar`, and a generator in `my-generator-thing` is `foo:my-generator-thing`. - asNamespace throws for a path in a scoped package that is not a `generator-` one, which gave `@scope/@scope:plain:app`. - A lookup does not register such a generator and goes on with the others. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Summary
asNamespaceremoved everything up to the lastgenerator-of the path, wherever it was:generator-foo-generator-bar/generators/app/index.jsbar:appfoo-generator-bar:app@scope/generator-foo-generator-bar/generators/app/index.js@scope/bar:app@scope/foo-generator-bar:appgenerator-foo/generators/my-generator-thing/index.jsthingfoo:my-generator-thing@scope/plain/generators/app/index.js@scope/@scope:plain:appgenerator-is the package: the path up to it and itsgenerator-prefix are removed, agenerator-inside a package or generator name is kept. The existing cases (absolute paths,node_modules, Windows paths,generator-backbone/generator-backbone/all.js) are unchanged.generator-one has no namespace:asNamespace(andEnvironment#namespace) throws instead of returning a broken one.Store#lookupSynccomputes the namespace inside itstry: such a generator is reported as not registered (and logged) and the lookup goes on with the other generators.Behavior change
Packages with
generator-inside their name (generator-foo-generator-bar) are now registered under their full name (foo-generator-bar), likenamespaceFromPackageNamegives it.Test plan
eslint,tscesmocha: tests forgenerator-inside package and generator names, the throw for scoped nongenerator-packages, and a lookup going on after such a package🤖 Generated with Claude Code