-
Notifications
You must be signed in to change notification settings - Fork 12k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add secondary entrypoint schematic #28723
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me! Ship It!
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
acc6219
to
6d617b8
Compare
This comment was marked as outdated.
This comment was marked as outdated.
6d617b8
to
6392681
Compare
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for this. We discussed this during yesterday's meeting and agreed to proceed with adding a schematic to generate additional library entry points.
As a side note, it would be great if the library schematic could also leverage this schematic to generate its own entry point.
I’ve completed an initial review and left a few minor comments. Let me know if you have any questions!
15c1b3d
to
50434a9
Compare
packages/schematics/angular/library-entrypoint/files/README.md.template
Outdated
Show resolved
Hide resolved
* Public API Surface of <%= dasherize(name) %> | ||
*/ | ||
|
||
export const greeting = 'Hello Angular World!'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This might confuse users as this file should not be used to put code.
We we instead generate a service, component and module. IE: move the code from the library schematic
angular-cli/packages/schematics/angular/library/index.ts
Lines 168 to 193 in 518ff9f
options.standalone | |
? noop() | |
: schematic('module', { | |
name: options.name, | |
commonModule: false, | |
flat: true, | |
path: sourceDir, | |
project: packageName, | |
}), | |
schematic('component', { | |
name: options.name, | |
selector: `${prefix}-${options.name}`, | |
inlineStyle: true, | |
inlineTemplate: true, | |
flat: true, | |
path: sourceDir, | |
export: true, | |
standalone: options.standalone, | |
project: packageName, | |
}), | |
schematic('service', { | |
name: options.name, | |
flat: true, | |
path: sourceDir, | |
project: packageName, | |
}), |
518ff9f
to
ccd52af
Compare
PR Checklist
Please check to confirm your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
There is no easy way to generate a secondary entrypoint
Issue Number: #19070
What is the new behavior?
This PR adds the ability to generate a secondary entrypoint in a library project. It cannot be used without a library project.
Does this PR introduce a breaking change?
Other information
I've copied some helper utils from other schematics. I'm happy to make a other PR to add these to the utility parts with proper tests on it. Not updated the docs as this is I think in a other repo?
Pinging @SanderElias he mentioned there was nothing in the cli and encourage me to make this change 👍
Closes #19070