Skip to content

Commit

Permalink
feat: add ability to set the location of the tsconfig (#13)
Browse files Browse the repository at this point in the history
* feat: add ability to set the location of the tsconfig

* Automated build of f594ce9

* feat: support tsconfig for tsc-silent

* Automated build of 16a08ff

---------

Co-authored-by: GitHub Action <[email protected]>
  • Loading branch information
kylemellander and actions-user authored Mar 5, 2024
1 parent 80c30eb commit 8a88de3
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 8 deletions.
4 changes: 4 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ inputs:
description: 'Which check run conclusion type to use when annotations are created ("neutral" or "failure" are most common)'
required: false
default: "neutral"
tsconfig:
description: "Path to the tsconfig.json file. Do not preface with a slash. Example: 'tsconfig.json' or 'src/tsconfig.json'"
required: false
default: "tsconfig.json"
outputs:
issuesCount:
description: "Number of TypeScript violations found"
10 changes: 6 additions & 4 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13785,13 +13785,15 @@ __nccwpck_require__.r(__webpack_exports__);
/* harmony import */ var _ClientBase__WEBPACK_IMPORTED_MODULE_0__ = __nccwpck_require__(3570);


const { GITHUB_WORKSPACE } = process.env
const { GITHUB_WORKSPACE, INPUT_TSCONFIG } = process.env

const ERROR_REGEX = /(.*\.tsx?)[\(:](.*)[:,].*(error.*)/

class TSCClient extends _ClientBase__WEBPACK_IMPORTED_MODULE_0__/* .ClientBase */ .K {
get command() {
return `${GITHUB_WORKSPACE}/node_modules/.bin/tsc --pretty false`
return `${GITHUB_WORKSPACE}/node_modules/.bin/tsc --pretty false${
INPUT_TSCONFIG ? ` -p ${GITHUB_WORKSPACE}/${INPUT_TSCONFIG}` : ""
}`
}

get annotations() {
Expand Down Expand Up @@ -13841,11 +13843,11 @@ __nccwpck_require__.r(__webpack_exports__);
/* harmony import */ var _ClientBase__WEBPACK_IMPORTED_MODULE_0__ = __nccwpck_require__(3570);


const { GITHUB_WORKSPACE } = process.env
const { GITHUB_WORKSPACE, INPUT_TSCONFIG } = process.env

class TSCSilentClient extends _ClientBase__WEBPACK_IMPORTED_MODULE_0__/* .ClientBase */ .K {
get command() {
return `${GITHUB_WORKSPACE}/node_modules/.bin/tsc-silent -p ${GITHUB_WORKSPACE}/tsconfig.json --suppressConfig ${GITHUB_WORKSPACE}/tsc-silent.config.js --compiler ${GITHUB_WORKSPACE}/node_modules/typescript/lib/typescript.js`
return `${GITHUB_WORKSPACE}/node_modules/.bin/tsc-silent -p ${GITHUB_WORKSPACE}/${INPUT_TSCONFIG} --suppressConfig ${GITHUB_WORKSPACE}/tsc-silent.config.js --compiler ${GITHUB_WORKSPACE}/node_modules/typescript/lib/typescript.js`
}

get annotations() {
Expand Down
6 changes: 4 additions & 2 deletions src/clients/TSCClient.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
import { ClientBase } from "./ClientBase"

const { GITHUB_WORKSPACE } = process.env
const { GITHUB_WORKSPACE, INPUT_TSCONFIG } = process.env

const ERROR_REGEX = /(.*\.tsx?)[\(:](.*)[:,].*(error.*)/

export class TSCClient extends ClientBase {
get command() {
return `${GITHUB_WORKSPACE}/node_modules/.bin/tsc --pretty false`
return `${GITHUB_WORKSPACE}/node_modules/.bin/tsc --pretty false${
INPUT_TSCONFIG ? ` -p ${GITHUB_WORKSPACE}/${INPUT_TSCONFIG}` : ""
}`
}

get annotations() {
Expand Down
4 changes: 2 additions & 2 deletions src/clients/TSCSilentClient.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { ClientBase } from "./ClientBase"

const { GITHUB_WORKSPACE } = process.env
const { GITHUB_WORKSPACE, INPUT_TSCONFIG } = process.env

export class TSCSilentClient extends ClientBase {
get command() {
return `${GITHUB_WORKSPACE}/node_modules/.bin/tsc-silent -p ${GITHUB_WORKSPACE}/tsconfig.json --suppressConfig ${GITHUB_WORKSPACE}/tsc-silent.config.js --compiler ${GITHUB_WORKSPACE}/node_modules/typescript/lib/typescript.js`
return `${GITHUB_WORKSPACE}/node_modules/.bin/tsc-silent -p ${GITHUB_WORKSPACE}/${INPUT_TSCONFIG} --suppressConfig ${GITHUB_WORKSPACE}/tsc-silent.config.js --compiler ${GITHUB_WORKSPACE}/node_modules/typescript/lib/typescript.js`
}

get annotations() {
Expand Down

0 comments on commit 8a88de3

Please sign in to comment.