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

Angular: Add compodoc to ng builder #15165

Merged
merged 2 commits into from
Jun 7, 2021
Merged

Angular: Add compodoc to ng builder #15165

merged 2 commits into from
Jun 7, 2021

Conversation

ThibaudAV
Copy link
Contributor

@ThibaudAV ThibaudAV commented Jun 7, 2021

Issue: 👾 next of #15061

Add the same features available natively in the storybook init for angular

What I did

Executer compodoc dans les builders angular avant le démarrage de storybook

It also allows to remove the specific script for compodoc in the package.json
the minimal package.json-> script configuration becomes :

"scripts": {
    "build-storybook": "ng run angular-cli:build-storybook",
    "storybook": "ng run angular-cli:storybook",
    ...
}

And in angular.json :

  "projects": {
    ...
    "angular-cli": {
      "architect": {
        ...
        "build": {
          "builder": "@angular-devkit/build-angular:browser",
          "options": {...},
        ...
        "storybook": {
          "builder": "@storybook/angular:start-storybook",
          "options": {
            "browserTarget": "angular-cli:build",
            "port": 4400,
            "staticDir": ["src/assets"]
            // "compodoc": false // if you do not use compodoc
          }
        },
        "build-storybook": {
          "builder": "@storybook/angular:build-storybook",
          "options": {
            "browserTarget": "angular-cli:build",
            "staticDir": ["src/assets"]
            // "compodoc": false // if you do not use compodoc
          }
        }
      }
...

✏️ A negative point the compodoc logs are not in color 😞

How to test

  • Is this testable with Jest or Chromatic screenshots? YES
  • Does this need a new example in the kitchen sink apps?
  • Does this need an update to the documentation?

@ThibaudAV ThibaudAV changed the title Angular/builder compodoc Angular: run compodoc with ng builder Jun 7, 2021
@nx-cloud
Copy link

nx-cloud bot commented Jun 7, 2021

Nx Cloud Report

CI ran the following commands for commit ded597c. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this branch

Status Command
#000000 nx run-many --target=prepare --all --parallel --max-parallel=15

Sent with 💌 from NxCloud.

context: BuilderContext
): Observable<void> => {
return new Observable<void>((observer) => {
const finalCompodocArgs = [
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as here

"compodoc": {
"type": "boolean",
"description": "Execute compodoc before.",
"default": true
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

because is added by default with sb init 🤷‍♂️
but if the user does not have compodoc it is necessary to manually change to false
I don't know if this is a good situation 🤔

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ThibaudAV#1582 does compodoc get installed by default? if so, then we should enable by default. if not, then we should disable by default. open to your opinions, but maybe we will move away from compodoc in the future as requested by some users. but for now i think we do what's consistent with the CLI

Copy link
Member

@shilman shilman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good!

@shilman shilman changed the title Angular: run compodoc with ng builder Angular: Add compodoc to ng builder Jun 7, 2021
@shilman shilman merged commit 4014faa into next Jun 7, 2021
@shilman shilman deleted the angular/builder-compodoc branch June 7, 2021 18:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants