Repository navigation
fix(@schematics/angular): migrate ng-packagr glob string assets in use-library-builder - #34406
Conversation
…e-library-builder
ng-packagr treats an `assets` string that is neither a file nor a directory as a glob relative to
the package root. The migration copied every string as a path, and the library builder treats such
a path as a directory, so glob assets like `docs/**/*.md` copied nothing after the migration.
Migrate strings that are neither a file nor a directory to `{ glob, input, output }` objects, as
ng-packagr resolves them.
There was a problem hiding this comment.
Code Review
This pull request updates the use-library-builder migration schematic to correctly identify and migrate ng-packagr glob string assets into glob objects, since the library builder only accepts files and directories. It also adds corresponding unit tests to verify this behavior. The review feedback suggests adding a guard to check if the resolved asset path points outside the workspace root (e.g., starting with ..) to prevent potential schematic crashes when calling tree.exists or tree.getDir.
…s in use-library-builder
…s in use-library-builder
75e49d3 to
76929e6
Compare
…s in use-library-builder Co-authored-by: Alan Agius <alan.agius4@gmail.com>
…s in use-library-builder Co-authored-by: Alan Agius <alan.agius4@gmail.com>
5ff79ee to
c39ccd0
Compare
|
This PR was merged into the repository. The changes were merged into the following branches:
|
|
This pull request has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
ng-packagr treats an
assetsstring that is neither a file nor a directory as a glob relative tothe package root. The migration copied every string as a path, and the library builder treats such
a path as a directory, so glob assets like
docs/**/*.mdcopied nothing after the migration.Migrate strings that are neither a file nor a directory to
{ glob, input, output }objects, asng-packagr resolves them.