Skip to content
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

Add to Schematics API documentation #29241

Open
cafesanu opened this issue Mar 12, 2019 · 13 comments
Open

Add to Schematics API documentation #29241

cafesanu opened this issue Mar 12, 2019 · 13 comments
Assignees
Labels
area: docs Related to the documentation effort3: weeks freq3: high P4 A relatively minor issue that is not relevant to core functions state: blocked state: needs eng input
Milestone

Comments

@cafesanu
Copy link

cafesanu commented Mar 12, 2019

📚 Docs or angular.io bug report

Description

Hello. I just spend some time creating my first schematics. Have to say it's awesome! Unfortunately, I had to spend much of my time reading throughout the angular @schematics code to see examples of how it works and articles on Medium by other people about how to create a basic schematic.

It would be awesome if the Angular team spends some time making an awesome documentation of such an awesome feature! This has so much potential to be wildly used, and I'm afraid that without proper documentation, it won't reach the masses!

Just try to google a simple example of How to copy a file in angular schematics, and there is no simple link to it. I ended up reading a file via the tree.read into a buffer, transforming the file into a string, and then creating a new one via tree.create, but don't even know if this is standard or not 🤷‍♀️

In any case, I love schematics, but there is no official documentation at all other than two blog post (one with unit test) with simple examples you guys created in the Angular Medium Blog.

Thanks! Nice job!

@Airblader
Copy link
Contributor

Having recently dealt with this to implement a default "ng add" schematic to automatically import a module etc, I fully agree with this request. Schematics are awesome, but the experience of working with them was really poor and ultimately left me with a feeling of not having done things in the intended way because it felt just too awkward.

@ericmartinezr
Copy link
Contributor

See #28343. Now you can see the PR and provide some feedback :D

@cafesanu
Copy link
Author

cafesanu commented Mar 12, 2019

Wow nice! I will definitely take a look this week. Any Eta for release? Thanks!

@jenniferfell
Copy link
Contributor

jenniferfell commented Mar 14, 2019

@cafesanu : I'm sorry, I can't provide a specific ETA. "Soon." The doc has been through several rounds of technical updates and review with subject matter experts, and we are now waiting on codeowner approval. Sometimes the codeowner review is quick, but sometimes the codeowner wants updates for accuracy, completeness, or clarity.

As you noted on that PR, there is more than can be said about schematics, so we are hoping to get approval based on accuracy and clarity, merge, and then follow on with subsequent updates for completeness. (doc is never done)

Are you asking for timeline because you'd like to start working on a derivative update? I'll let codeowner know that there is work that will be easier when that PR lands.

@Splaktar
Copy link
Member

This was also being tracked in angular/angular-cli#12149.

@Splaktar
Copy link
Member

I just wanted to link to @cafesanu's long post about additional details that need to be added in the future. It's hidden by GitHub (with 115 other comments) by default. Find it here: #28343 (comment)

I also have a Google Doc with a full outline of the structure of what needs to be documented for Schematics. I'll try to go and review it to make a list of what's missing after PR #28343 lands.

@Splaktar Splaktar mentioned this issue Mar 26, 2019
14 tasks
@cafesanu
Copy link
Author

Adding my original comment here so it's easier to see @jbogarthyde

...from #28343 (comment):

Sorry to be so repetitive and not trying to be a pain. I truly appreciate the great work that is being put into this. So let me put just a general sentiment that generalizes all my previous comments.

I feel like schematics has so many libraries/utilities that are reusable and so many utilities that deserve themselves some documentation with examples on how to use them without having to dig into the code, like this one for example https://github.com/angular/angular-cli/blob/master/packages/angular_devkit/schematics/src/rules/base.ts

Also, I ended up using for my own schematic that modifies json files the util in here https://github.com/angular/angular-cli/blob/master/packages/schematics/angular/utility/json-utils.ts

I ended up using appendPropertyInAstObject, findPropertyInAstObject, and insertPropertyInAstObjectInOrder.

So what I'm trying to say is that schematics tutorial should somehow include documentation for all that awesome util libraries and whatever the team wrote to be reusable and agnostic.

Some examples that come to mind about writing either example of documentation on the libraries that I have had to dig into the code to understand (And I'm sure there are many more that I do not know about) are :

Basically in the few days that I have been learning schematics, I have had to dig into the code and see example on how your added stuff to a json, how you copy a file, how you delete a file, how to chain schematics, etc.

The way I see schematics is as a framework within a framework that deserves documentation and example on how to use is beyond the hello world basic example.

Thanks again for your awesome work! love schematics!

@jbogarthyde
Copy link
Contributor

jbogarthyde commented Jun 11, 2019

Renaming this issue - the new basic Schematics Guide landed, but this issue has good suggestions for topics that should be added to provide Schematics API documentation.

Both Architect and Schematics need API doc

  1. Teams need to determine what is public
  2. We need to figure out where to put it, and how to generate it.
  3. Then we can document the public API

Related Issue: #30575

@jbogarthyde jbogarthyde changed the title Add Official Schematics documentation Add Schematics API documentation Jun 11, 2019
@Splaktar
Copy link
Member

Splaktar commented Sep 9, 2019

@SchnWalter
Copy link
Contributor

Before publishing the API, there needs to be a round of cleanup, see: angular/angular-cli#17597

@kapunahelewong
Copy link
Contributor

Status: docs team will need to assess the available material (above) and incorporate what's missing into the doc. The second step will be to uncover the questions that remain after adding the additional info and work with an engineer to make sure all the topics are covered.

@kapunahelewong kapunahelewong changed the title Add Schematics API documentation Add to Schematics API documentation May 29, 2020
@angular-robot
Copy link
Contributor

angular-robot bot commented Jun 4, 2021

Just a heads up that we kicked off a community voting process for your feature request. There are 20 days until the voting process ends.

Find more details about Angular's feature request process in our documentation.

@angular-robot angular-robot bot added the feature: votes required Feature request which is currently still in the voting phase label Jun 4, 2021
@angular-robot
Copy link
Contributor

angular-robot bot commented Jun 24, 2021

Thank you for submitting your feature request! Looks like during the polling process it didn't collect a sufficient number of votes to move to the next stage.

We want to keep Angular rich and ergonomic and at the same time be mindful about its scope and learning journey. If you think your request could live outside Angular's scope, we'd encourage you to collaborate with the community on publishing it as an open source package.

You can find more details about the feature request process in our documentation.

@angular-robot angular-robot bot added the feature: insufficient votes Label to add when the not a sufficient number of votes or comments from unique authors label Jun 24, 2021
@bob-watson bob-watson added the P4 A relatively minor issue that is not relevant to core functions label Jun 28, 2022
@jessicajaniuk jessicajaniuk removed feature Issue that requests a new feature feature: insufficient votes Label to add when the not a sufficient number of votes or comments from unique authors feature: votes required Feature request which is currently still in the voting phase labels Sep 22, 2022
@JeanMeche JeanMeche added area: adev Angular.dev documentation and removed area: aio labels Feb 21, 2024
@JeanMeche JeanMeche added area: docs Related to the documentation and removed area: adev Angular.dev documentation labels Apr 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: docs Related to the documentation effort3: weeks freq3: high P4 A relatively minor issue that is not relevant to core functions state: blocked state: needs eng input
Projects
None yet
Development

No branches or pull requests