Skip to content

(schematics documentation) Add more sources #12149

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

Closed
alexeagle opened this issue Sep 4, 2018 · 13 comments
Closed

(schematics documentation) Add more sources #12149

alexeagle opened this issue Sep 4, 2018 · 13 comments
Labels
Milestone

Comments

@alexeagle
Copy link
Contributor

From @MonsieurMan on January 21, 2018 19:47

Hello, I looked over the project because it seemed to me like I could use it for a project I have in mind and couldn't really find a simple dive in introduction.
Until I found the meetup presentation introducing it.
I think it should be added to the head of the readme to help people understand the package as of now, it really helped me understand quickly and I know we're going to use it for at least two projects.

If you know of any information sources you produced like this one I think you should point them out in the head of the readme or something.

Anyway, keep up the good job, I feel like front end development is getting healthier thanks to the trust you and the react community are creating !

Copied from original issue: angular/devkit#402

@alexeagle
Copy link
Contributor Author

From @filipesilva on January 25, 2018 14:9

@hansl I think you were working on some more Schematics docs, are they available yet?

@alexeagle
Copy link
Contributor Author

From @Toxicable on February 12, 2018 20:10

There's this here
https://blog.angular.io/schematics-an-introduction-dc1dfbc2a2b2
and the source code here is well commented on how to use schematics programtically
https://github.com/angular/devkit/blob/master/packages/angular_devkit/schematics_cli/bin/schematics.ts

@MonsieurMan
Copy link

@alexeagle

and the source code here is well commented on how to use schematics programtically

The link is broken on master, it's available on 6.0 though:
https://github.com/angular/devkit/blob/6.1.x/packages/angular_devkit/schematics_cli/bin/schematics.ts

As for the documentation maybe they could be written in the open ?
A lot of projects are already using schematics now anyway, so even an unfinished or unpolished documentation would be great !

@Splaktar
Copy link
Contributor

Splaktar commented Sep 9, 2018

I also came here looking for the latest current version of the schematics docs after finding that previous links to the old minimal version of docs/markdown are now broken.

What's the current recommended resource for schematics documentation relevant to devkit 0.8.x or Angular CLI 6.2.x?

Can anyone suggest some unofficial schematics blog posts/videos that are updated in the last 2 months or so?

@Splaktar
Copy link
Contributor

Splaktar commented Sep 10, 2018

Hrm. So much has changed lately... Note that I am trying to use only the Schematics CLI (not Angular CLI).

schematics @schematics/angular:application tmp gives me:

Error: Could not find (undefined)
    at Object.getWorkspace (/Users/splaktar/.nvm/versions/node/v8.11.3/lib/node_modules/@schematics/angular/utility/config.js:22:15)

But https://blog.angular.io/schematics-an-introduction-dc1dfbc2a2b2 doesn't cover or mention workspaces at all. The Angular CLI has a wiki entry for workspaces, but it doesn't indicate the schematics command to create one.

Even running schematics blank my-project doesn't create a "workspace" since it creates a project for writing schematics which doesn't create an angular.json file.

schematics @schematics/angular:workspace --name=tmp gives

Error: Schematic input does not validate against the Schema: {"name":"tmp","skipInstall":false,"linkCli":false,"skipGit":false,"commit":null}
Errors:

  Data path "" should have required property 'version'.
    at MapSubscriber.registry.compile.pipe.operators_1.map.result [as project] (/Users/splaktar/.nvm/versions/node/v8.11.3/lib/node_modules/@angular-devkit/schematics-cli/node_modules/@angular-devkit/schematics/tools/schema-option-transform.js:30:27)

It's not at all clear what the version should be... but https://github.com/angular/angular-cli/blob/master/packages/schematics/angular/workspace/schema.json#L69-L77 seems to indicate that this would be the version of the Angular CLI to use.

schematics @schematics/angular:workspace --name=tmp --version=6.2.1 finally gives me

CREATE /README.md (1020 bytes)
CREATE /angular.json (127 bytes)
CREATE /package.json (1262 bytes)
CREATE /tsconfig.json (408 bytes)
CREATE /tslint.json (2837 bytes)
CREATE /.editorconfig (245 bytes)
CREATE /.gitignore (503 bytes)

Of course this created the "workspace" in my CWD and not in tmp/ as I would have expected. So I then need to mkdir tmp && cd tmp/ and then run it again...

And finally I can run schematics @schematics/angular:application --name=tmp to create the app.

@Splaktar
Copy link
Contributor

The best docs that I have found are Manfred Steyer's eBook: https://leanpub.com/angular-schematics/

It covers using the Schematics CLI (and the included schematics in @schematics/schematics) but it does not cover the details of using the schematics in an external collection like @schematics/angular (i.e. workspace, application, component, etc).

@Splaktar
Copy link
Contributor

This older schematics documentation issue also has some links to resources (most are likely out of date): #7627

@Splaktar
Copy link
Contributor

Work is in progress on the official schematics documentation. I will try to post here when it is up on next.angular.io.

@Splaktar
Copy link
Contributor

The first draft of the official schematics docs is about to land in Angular master: PR angular/angular#28343 🎉

@Splaktar
Copy link
Contributor

And it's available for preview here: https://next.angular.io/guide/schematics

@clydin
Copy link
Member

clydin commented May 27, 2020

Closing as the initial set of schematic docs is now present on AIO (https://angular.io/guide/schematics). Further updates and improvements may be best tracked separately. The original issue is now over 2 years old.

@Splaktar
Copy link
Contributor

Additional Schematics docs improvements are being tracked in angular/angular#29241

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Jun 28, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

5 participants