[HowTo] Generate publishable angular schematics?
See original GitHub issueI’m trying to generate a publishable angular schematic. But I can’t figure it out.
I see generators like @schematics/angular
and workspace-schematics
but they don’t seem to what I want.
There’s a tools/schematics
folder which suggests that there is some support.
Please advice, thanks.
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (1 by maintainers)
Top Results From Across the Web
Schematics for libraries - Angular
To start a collection, you need to create the schematic files. The following steps show you ... In your library's root folder, create...
Read more >Quick Guide to Angular Schematics: How I Built My First ...
You'll need to create a NPM account first if you haven't already. You can do this on the website or directly in the...
Read more >How to create your own Angular Schematics
We'll start by creating the new-project schematic. To do that, we're going to use an NPM package called schematics . You'll need to...
Read more >Use Angular Schematics to Simplify Your Life | Okta Developer
Use Schematics to add Authentication to Your Angular App · Angular CLI, Angular Schematics, and Angular DevKit · Create Your First Schematic. Add ......
Read more >Angular Schematics from 0 to publishing your own library (III)
Generating a blank schematic is super straight forward with the schematics-cli. ... As you can already appreciate, we're simply invoking the schematics function ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@snebjorn I tried to take a shot at adding a schematics library that I can publish, I based it off of the
@nrwl/node:lib
which I created with thepublishable
flag.I’ve added 2 schematics, a simple
hello-world
and one calledng-add
which can be installed usingng add @your-org/schematic
.You can find the repo here, both schematics have a separate commit.
In order to copy over the
collection.json
andlib/**/schema.json
files, make sure to add something like this.With this in place the build is an npm package with schematics enabled.
@beeman thank you.
meanwhile I’ve got a working version of “bundled schematic” here https://github.com/datorama/akita/tree/master/libs/akita-schematics
In the target package I just assume the schematic is there https://github.com/datorama/akita/blob/master/libs/akita/package.json#L37
And then I just build the schematic when i build the target library. NX support for this would be great. Hence my “trigger it after a my-lib build” comment in OP. https://github.com/datorama/akita/blob/master/package.json#L35