twittwer / nx-tools

Workspace for Nx Plugins.
40 stars 7 forks source link

Code documentation coverage not available #68

Closed Captainnik53 closed 2 years ago

Captainnik53 commented 2 years ago

Hi,

I created a new Nx workspace and installed Compodoc using the following commands

  1. npm install --save-dev @twittwer/compodoc
  2. nx g @twittwer/compodoc:config <project> and then run using - nx run <project>:compodoc --serve

The documentation is served locally, but there is no code documentation coverage tab in the left side nav, which is otherwise visible in angular projects without Nx workspace.

project.json file for the project

{
  "projectType": "application",
  "sourceRoot": "apps/app1/src",
  "prefix": "compodoc-test",
  "targets": {
    "build": {
      "executor": "@angular-devkit/build-angular:browser",
      "outputs": ["{options.outputPath}"],
      "options": {
        "outputPath": "dist/apps/app1",
        "index": "apps/app1/src/index.html",
        "main": "apps/app1/src/main.ts",
        "polyfills": "apps/app1/src/polyfills.ts",
        "tsConfig": "apps/app1/tsconfig.app.json",
        "assets": ["apps/app1/src/favicon.ico", "apps/app1/src/assets"],
        "styles": ["apps/app1/src/styles.css"],
        "scripts": []
      },
      "configurations": {
        "production": {
          "budgets": [
            {
              "type": "initial",
              "maximumWarning": "500kb",
              "maximumError": "1mb"
            },
            {
              "type": "anyComponentStyle",
              "maximumWarning": "2kb",
              "maximumError": "4kb"
            }
          ],
          "fileReplacements": [
            {
              "replace": "apps/app1/src/environments/environment.ts",
              "with": "apps/app1/src/environments/environment.prod.ts"
            }
          ],
          "outputHashing": "all"
        },
        "development": {
          "buildOptimizer": false,
          "optimization": false,
          "vendorChunk": true,
          "extractLicenses": false,
          "sourceMap": true,
          "namedChunks": true
        }
      },
      "defaultConfiguration": "production"
    },
    "serve": {
      "executor": "@angular-devkit/build-angular:dev-server",
      "configurations": {
        "production": {
          "browserTarget": "app1:build:production"
        },
        "development": {
          "browserTarget": "app1:build:development"
        }
      },
      "defaultConfiguration": "development"
    },
    "extract-i18n": {
      "executor": "@angular-devkit/build-angular:extract-i18n",
      "options": {
        "browserTarget": "app1:build"
      }
    },
    "lint": {
      "executor": "@nrwl/linter:eslint",
      "options": {
        "lintFilePatterns": ["apps/app1/**/*.ts", "apps/app1/**/*.html"]
      }
    },
    "test": {
      "executor": "@nrwl/jest:jest",
      "outputs": ["coverage/apps/app1"],
      "options": {
        "jestConfig": "apps/app1/jest.config.ts",
        "passWithNoTests": true
      }
    },
    "compodoc": {
      "executor": "@twittwer/compodoc:compodoc",
      "options": {
        "tsConfig": "apps/app1/tsconfig.editor.json",
        "outputPath": "dist/compodoc/app1"
      },
      "configurations": {
        "json": {
          "exportFormat": "json"
        }
      }
    }
  },
  "tags": []
}

Please refer the screenshot here - https://ibb.co/DMvfSsT

Request you to look into the issue @twittwer . Thank you in advance

twittwer commented 2 years ago

Have you tried to enable coverage as it is disabled by default as shown in the README? image Via argument: --disableCoverage=false Via configuration: "disableCoverage": false

twittwer commented 2 years ago

I assume this solved your problem, therefore I will close the issue.