Skip to content

Commit 2bc2c09

Browse files
committed
feat: add shareable tsconfig support
Fix danger#1283
1 parent fd3c959 commit 2bc2c09

File tree

4 files changed

+18
-3
lines changed

4 files changed

+18
-3
lines changed

package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@
142142
"typescript-json-schema": "^0.53.0"
143143
},
144144
"dependencies": {
145+
"@gitbeaker/node": "^21.3.0",
145146
"@octokit/rest": "^18.12.0",
146147
"async-retry": "1.2.3",
147148
"chalk": "^2.3.0",
@@ -150,7 +151,7 @@
150151
"debug": "^4.1.1",
151152
"fast-json-patch": "^3.0.0-1",
152153
"get-stdin": "^6.0.0",
153-
"@gitbeaker/node": "^21.3.0",
154+
"get-tsconfig": "^4.6.2",
154155
"http-proxy-agent": "^5.0.0",
155156
"https-proxy-agent": "^5.0.1",
156157
"hyperlinker": "^1.0.0",

source/ambient.d.ts

+2
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ declare module "cli-interact"
2020
declare module "hyperlinker"
2121
declare module "supports-hyperlinks"
2222

23+
declare module "get-tsconfig"
24+
2325
// declare module "require-from-string" {
2426
// export interface RequireOptions {
2527
// /** List of paths, that will be appended to module paths. Useful, when you want

source/runner/runners/utils/transpiler.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import * as fs from "fs"
22
import * as path from "path"
3-
import JSON5 from "json5"
3+
import { parseTsconfig } from "get-tsconfig"
44
import { debug } from "../../../debug"
55

66
const enum BabelPackagePrefix {
@@ -126,7 +126,7 @@ export const typescriptify = (content: string, dir: string): string => {
126126
let compilerOptions: any
127127
const tsConfigPath = lookupTSConfig(dir)
128128
if (tsConfigPath) {
129-
compilerOptions = JSON5.parse(fs.readFileSync(tsConfigPath, "utf8"))
129+
compilerOptions = parseTsconfig(tsConfigPath)
130130
} else {
131131
compilerOptions = ts.getDefaultCompilerOptions()
132132
}

yarn.lock

+12
Original file line numberDiff line numberDiff line change
@@ -4566,6 +4566,13 @@ get-stream@^6.0.0:
45664566
resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-6.0.1.tgz#a262d8eef67aced57c2852ad6167526a43cbf7b7"
45674567
integrity sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==
45684568

4569+
get-tsconfig@^4.6.2:
4570+
version "4.6.2"
4571+
resolved "https://registry.yarnpkg.com/get-tsconfig/-/get-tsconfig-4.6.2.tgz#831879a5e6c2aa24fe79b60340e2233a1e0f472e"
4572+
integrity sha512-E5XrT4CbbXcXWy+1jChlZmrmCwd5KGx502kDCXJJ7y898TtWW9FwoG5HfOLVRKmlmDGkWN2HM9Ho+/Y8F0sJDg==
4573+
dependencies:
4574+
resolve-pkg-maps "^1.0.0"
4575+
45694576
get-value@^2.0.3, get-value@^2.0.6:
45704577
version "2.0.6"
45714578
resolved "https://registry.yarnpkg.com/get-value/-/get-value-2.0.6.tgz#dc15ca1c672387ca76bd37ac0a395ba2042a2c28"
@@ -8340,6 +8347,11 @@ resolve-from@^5.0.0:
83408347
resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-5.0.0.tgz#c35225843df8f776df21c57557bc087e9dfdfc69"
83418348
integrity sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==
83428349

8350+
resolve-pkg-maps@^1.0.0:
8351+
version "1.0.0"
8352+
resolved "https://registry.yarnpkg.com/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz#616b3dc2c57056b5588c31cdf4b3d64db133720f"
8353+
integrity sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==
8354+
83438355
resolve-url@^0.2.1:
83448356
version "0.2.1"
83458357
resolved "https://registry.yarnpkg.com/resolve-url/-/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a"

0 commit comments

Comments
 (0)