ngx-rocket / generator-ngx-rocket

:rocket: Extensible Angular 14+ enterprise-grade project generator
https://ngx-rocket.github.io/
MIT License
1.53k stars 217 forks source link

Npm run compodoc does not work because src/tsconfig.app.json is not found #497

Closed duydnguyen07 closed 5 years ago

duydnguyen07 commented 5 years ago

I'm submitting a...

Current behavior

After the app was bootstrapped, run npm run compodoc and the following error will appear "src/tsconfig.app.json" file was not found in the current directory

Expected behavior

The run script should work out of the box

Minimal reproduction of the problem with instructions

Reproducing the problem with the following configuration using the ngx new command


\ ./ / ____ ____ | ' \/ ` |> < |--< [] | |-: |=== | |||_, //°\\ ENTERPRISE APP STARTER -~*=> |___/ v7.0.2

? What is the name of your app? demo ? What kind of app do you want to create? (Press to select, to toggle all, to invert selection)Web app ? Do you want a progressive web app? (with manifest and service worker) Yes ? Which UI framework do you want? Angular Material (more website-oriented) ? Which kind of layout do you want? Simple responsive header bar (more website-oriented) ? Do you want authentication? No ? Do you want lazy loading? Yes ? Do you want analytics support (with Angulartics2)? No ? Do you want additional tools? Prettier (automatic code formatting), Hads (markdown-based doc system), Compodoc (Angular doc generator) ? Do you want additional libraries? Lodash (collection & general utilities)

Environment



ngX-Rocket: 7.0.2
Node.js: v12.4.0
Npm: 6.9.0
OS: darwin x64 18.5.0

Generated project options:
{
  "generator-ngx-rocket": {
    "version": "7.0.2",
    "props": {
      "location": "path",
      "strict": false,
      "skipInstall": false,
      "skipQuickstart": false,
      "initGit": true,
      "appName": "huex",
      "target": [
        "web"
      ],
      "pwa": true,
      "ui": "material",
      "layout": "simple",
      "auth": false,
      "lazy": true,
      "angulartics": false,
      "tools": [
        "prettier",
        "hads",
        "compodoc"
      ],
      "utility": [
        "lodash"
      ],
      "projectName": "huex",
      "packageManager": "npm",
      "mobile": [],
      "desktop": []
    }
  }
}

     _                      _                 ____ _     ___
    / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
   / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
  / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
 /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
                |___/

Angular CLI: 8.1.3
Node: 12.4.0
OS: darwin x64
Angular: 8.2.3
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router, service-worker

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.801.3
@angular-devkit/build-angular     0.801.3
@angular-devkit/build-optimizer   0.801.3
@angular-devkit/build-webpack     0.801.3
@angular-devkit/core              8.1.3
@angular-devkit/schematics        8.1.3
@angular/cdk                      8.1.3
@angular/cli                      8.1.3
@angular/flex-layout              8.0.0-beta.26
@angular/material                 8.1.3
@ngtools/webpack                  8.1.3
@schematics/angular               8.1.3
@schematics/update                0.801.3
rxjs                              6.5.2
typescript                        3.4.5
webpack                           4.35.2

Others:

When corrected the script to "compodoc -p tsconfig.app.json -d docs/generated -s -o", it worked.

felepp commented 5 years ago

I had the same problem and changing the command argument lets compodoc run without error, BUT the documentation is missing everything except project metadata (no components, modules, routes etc.)

I got it working by moving the tsconfig.app.json to the src directory and modifying the paths like this:

{
    "extends": "../tsconfig.json",
    "compilerOptions": {
        "outDir": "../out-tsc/app",
        "types": []
    },
    "include": ["./**/*.ts"],
    "exclude": ["./test.ts", "./**/*.spec.ts", "./**/*.mock.ts"]
}

With this, compodoc generates the full documentation as expected, although I can't guarantee that this change doesn't break something else. ng serve still seems to work fine.

sinedied commented 5 years ago

Thanks for the report, will look into it!

sinedied commented 5 years ago

Found the bug, you just need to edit the compodoc script in package.json to remove src/ from the path, as tsconfig.app.json was moved to the root following the latest angular cli schematics.