Repository navigation
Description
Overview of the issue
I have recently updated from 1.1.19 to 1.1.20 and have one of my coverage commands failing in a GitHub Action pipeline.
I haven't changed the command but the command appears to be unable to path correctly to a file I specify in 1.1.20.
# command
npm run compodoc ${fileName} -- -p tsconfig.coverage.doc.json --silent --coverageTest --coverageTestShowOnlyFailed false// tsconfig.coverage.doc.json
{
}Operating System, Node.js, npm, compodoc version(s)
- Windows 10
- node 18.16.1
- @compodoc/compodoc 1.1.20
Angular configuration, a package.json file in the root folder
{
"name": "package-name",
"version": "0.0.1",
"scripts": {
"compodoc": "compodoc",
},
"private": false,
"dependencies": {
"@angular/animations": "~15.1.4",
"@angular/cdk": "~15.1.4",
"@angular/common": "~15.1.4",
"@angular/compiler": "~15.1.4",
"@angular/core": "~15.1.4",
"@angular/elements": "^15.1.4",
"@angular/forms": "~15.1.4",
"@angular/platform-browser": "~15.1.4",
"@angular/platform-browser-dynamic": "~15.1.4",
"@angular/router": "~15.1.4",
"lodash": "^4.17.21",
"ngx-virtual-scroller": "^4.0.3",
"rxjs": "^7.8.0",
"tslib": "^2.3.0",
"zone.js": "~0.11.4"
},
"devDependencies": {
"@angular-builders/jest": "^15.0.0",
"@angular-devkit/build-angular": "~15.1.5",
"@angular-eslint/builder": "15.2.1",
"@angular-eslint/eslint-plugin": "15.2.1",
"@angular-eslint/eslint-plugin-template": "15.2.1",
"@angular-eslint/schematics": "15.2.1",
"@angular-eslint/template-parser": "15.2.1",
"@angular/cli": "~15.1.5",
"@angular/compiler-cli": "~15.1.4",
"@babel/core": "^7.20.5",
"@compodoc/compodoc": "^1.1.20",
"@etchteam/storybook-addon-css-variables-theme": "^1.4.1",
"@storybook/addon-actions": "^6.5.16",
"@storybook/addon-essentials": "^6.5.16",
"@storybook/addon-interactions": "^6.5.16",
"@storybook/addon-links": "^6.5.16",
"@storybook/angular": "^6.5.16",
"@storybook/builder-webpack5": "^6.5.16",
"@storybook/manager-webpack5": "^6.5.16",
"@storybook/testing-library": "^0.0.13",
"@types/clone": "^2.1.1",
"@types/fs-extra": "^9.0.13",
"@types/jest": "^29.2.3",
"@types/jira-client": "^7.1.6",
"@types/lodash": "^4.14.195",
"@types/node": "^12.11.1",
"@typescript-eslint/eslint-plugin": "^5.52.0",
"@typescript-eslint/parser": "5.52.0",
"babel-loader": "^8.3.0",
"chalk": "4.1.2",
"cpx": "^1.5.0",
"deepmerge": "^4.2.2",
"eslint": "^8.28.0",
"eslint-config-google": "^0.14.0",
"eslint-config-standard-with-typescript": "^23.0.0",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-jsdoc": "^39.6.4",
"eslint-plugin-n": "^15.5.1",
"eslint-plugin-promise": "^6.1.1",
"eslint-plugin-storybook": "^0.6.10",
"fetch": "^1.1.0",
"fs": "^0.0.1-security",
"fs-extra": "^10.1.0",
"glob": "^8.0.3",
"gts": "^4.0.0",
"jest": "^29.3.1",
"jest-preset-angular": "^12.2.2",
"jira-client": "^8.2.2",
"ng-mocks": "^14.6.0",
"ng-packagr": "^15.1.2",
"node-fetch": "^2.6.7",
"node-html-parser": "^6.1.5",
"openai": "^3.1.0",
"sassdoc": "^2.7.4",
"showdown": "^2.1.0",
"stylelint": "^15.10.1",
"stylelint-config-standard-scss": "^10.0.0",
"ts-jest": "^29.0.3",
"ts-node": "^10.9.1",
"typescript": "4.9.5"
}
}Compodoc installed globally or locally ?
locally
If possible sourcecode of the file where it breaks
If possible your terminal logs before the error
This is the common error I get with all files that are ran with the above script. It seems to be incorrectly resolving the paths within the compodoc cli (or something has changed that I am not aware of and thus, need to update my command). The below are two error logs.
- The first comes from a github action that runs the command on each
.component.tswith changes in a PR. I noticed that the pathing seems to off, it seems to search for the file in a path that includes the[REPO_NAME]twice. - The second one comes from running the same command locally on my terminal. The local command seems to print out a path to a file that I can confirm exists in my repo.
# GitHub action log
node:events:[49](https://github.com/[ORG_NAME]/[REPO_NAME]/actions/runs/6203407742/job/16843958277?pr=970#step:5:50)1
throw er; // Unhandled 'error' event
^
Error: ENOTDIR: not a directory, scandir '/home/runner/work/[REPO_NAME]/[REPO_NAME]/awc-angular/projects/accordions/src/lib/components/accordion-group/accordion-group.component.ts'
Emitted 'error' event on PassThrough instance at:
at emitErrorNT (node:internal/streams/destroy:1[51](https://github.com/[ORG_NAME]/[REPO_NAME]/actions/runs/6203407742/job/16843958277?pr=970#step:5:52):8)
at emitErrorCloseNT (node:internal/streams/destroy:116:3)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
errno: -20,
code: 'ENOTDIR',
syscall: 'scandir',
path: '/home/runner/work/[REPO_NAME]/[REPO_NAME]/awc-angular/projects/accordions/src/lib/components/accordion-group/accordion-group.component.ts'
}
Node.js v18.16.1
Error: Command failed: npm run compodoc projects/accordions/src/lib/components/accordion-group/accordion-group.component.ts -- -p tsconfig.coverage.doc.json --silent --coverageTest --coverageTestShowOnlyFailed false
node:events:491
throw er; // Unhandled 'error' event
^# local log
Compodoc v1.1.20
node:events:491
throw er; // Unhandled 'error' event
^
Error: ENOTDIR: not a directory, scandir 'C:\Users\user\Documents\GitHub\[REPO_NAME]\awc-angular\projects\accordions\src\lib\components\accordion-group\accordion-group.component.ts'
Emitted 'error' event on PassThrough instance at:
at emitErrorNT (node:internal/streams/destroy:151:8)
at emitErrorCloseNT (node:internal/streams/destroy:116:3)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
errno: -4052,
code: 'ENOTDIR',
syscall: 'scandir',
path: 'C:\\Users\\user\\Documents\\GitHub\\[REPO_NAME]\\awc-angular\\projects\\accordions\\src\\lib\\components\\accordion-group\\accordion-group.component.ts'
}
Node.js v18.16.1Motivation for or Use Case
This command work in 1.1.19 and has regressed in 1.1.20. I checked the change log and couldn't see any obvious changes that I might need to action to keep this working.
Reproduce the error
I ran the following command in 1.1.20 to get this bug:
# command
npm run compodoc ${fileName} -- -p tsconfig.coverage.doc.json --silent --coverageTest --coverageTestShowOnlyFailed falseIf I downgrade back to 1.1.19 it begins to work again.
Activity
[-][BUG][/-][+][BUG] CLI command to run coverage on a file component has regressed[/+][-][BUG] CLI command to run coverage on a file component has regressed[/-][+][BUG] CLI command to run coverage on a single file component has regressed[/+]hinogi commentedon Sep 10, 2024
In a monorepo setup I get this for a lot of projects it tries to go up the folder tree with scandir until it hits a folder that it is not allowed to read and then crashes.
fix(cli): support single file source argument