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

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

Closed
1 of 3 tasks
duydnguyen07 opened this issue Aug 25, 2019 · 3 comments
Closed
1 of 3 tasks

Comments

@duydnguyen07
Copy link

I'm submitting a...

  • Bug report
  • Feature request
  • Documentation issue or request

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
Copy link

felepp commented Sep 2, 2019

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
Copy link
Member

sinedied commented Sep 2, 2019

Thanks for the report, will look into it!

@sinedied
Copy link
Member

sinedied commented Sep 3, 2019

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.

sinedied added a commit that referenced this issue Sep 3, 2019

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants