Skip to content

Commit

Permalink
chore(web): remove paths from tsconfig.json
Browse files Browse the repository at this point in the history
See #12027 (as well as build failures in the current repo restructurings)
for the motivation for this change.

Basically remove all `path` lines from `references` except when they
reference files in or below the current directory. Another execption is
if there is no `package.json` file for the current directory, i.e. the
current directory is not a separate module.
  • Loading branch information
ermshiperete committed Jul 26, 2024
1 parent b5b349e commit db283df
Show file tree
Hide file tree
Showing 28 changed files with 12 additions and 158 deletions.
9 changes: 2 additions & 7 deletions common/models/templates/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,10 @@
"tsBuildInfoFile": "build/obj/tsconfig.tsbuildinfo",
"rootDir": "./src"
},
"references": [
{ "path": "../types" },
{ "path": "../../web/utils" },
{ "path": "../../models/wordbreakers" }
],
"include": [
"src/**/*.ts"
"src/**/*.ts"
],
"exclude": [
"test"
"test"
]
}
9 changes: 3 additions & 6 deletions common/models/wordbreakers/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,11 @@
"tsBuildInfoFile": "build/obj/tsconfig.tsbuildinfo",
"rootDir": "./src"
},
"references": [
{ "path": "../types" }
],
"include": [
"src/**/*"
"src/**/*"
],
"exclude": [
"node_modules",
"test/**/*.ts"
"node_modules",
"test/**/*.ts"
]
}
7 changes: 0 additions & 7 deletions common/predictive-text/src/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,6 @@
"tsBuildInfoFile": "../build/obj/tsconfig.tsbuildinfo",
"rootDir": "./"
},
"references": [
{ "path": "../../web/utils" },
{ "path": "../../models/types"},
{ "path": "../../models/wordbreakers"},
{ "path": "../../web/lm-message-types"},
{ "path": "../../models/templates"}
],
"include" : [ "./*.ts" ],
"exclude" : [
"node",
Expand Down
5 changes: 0 additions & 5 deletions common/predictive-text/tsconfig.all.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,6 @@
},
"files": [],
"references": [
{ "path": "../web/utils" },
{ "path": "../models/types"},
{ "path": "../models/wordbreakers"},
{ "path": "../web/lm-message-types"},
{ "path": "../models/templates"},
{ "path": "src/node" },
{ "path": "src/web" }
],
Expand Down
3 changes: 0 additions & 3 deletions common/web/gesture-recognizer/src/test/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,4 @@
],
// Undo the base config's exclude.
"exclude": ["../../../../../node_modules/promise-status-async/lib/index.d.ts"],
"references": [
{"path": "../../"}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,5 @@
"rootDir": "./src",
"tsBuildInfoFile": "../../../build/tools/tsconfig.tsbuildinfo"
},
"references": [
{ "path": "../../../." }
],
"include": ["./src/**/*.ts"]
}
3 changes: 0 additions & 3 deletions common/web/gesture-recognizer/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,4 @@
},
"include": ["./src/engine/**/*.ts"],
"exclude": ["./src/test/**/*.ts", "./src/tools/**/*.ts"],
"references": [
{ "path": "../utils" }
]
}
5 changes: 0 additions & 5 deletions common/web/input-processor/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,6 @@
"tsBuildInfoFile": "build/obj/tsconfig.tsbuildinfo",
"rootDir": "./src"
},
"references": [
{ "path": "../utils" },
{ "path": "../keyboard-processor" },
{ "path": "../../predictive-text/tsconfig.all.json" },
],
// The extra .d.ts is necessary to avoid issues with lack of a Worker type definition when not including
// the standard DOM in the TS "lib" configuration.
"include": ["./src/**/*.ts", "../../predictive-text/src/worker-interface.d.ts"]
Expand Down
6 changes: 0 additions & 6 deletions common/web/keyboard-processor/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,6 @@
"tsBuildInfoFile": "build/obj/tsconfig.tsbuildinfo",
"rootDir": "./src/"
},
"references": [
{ "path": "../types" },
{ "path": "../../models/types" },
{ "path": "../keyman-version/" },
{ "path": "../utils/" }
],
"include": [ "./src/**/*.ts"],
"exclude": ["./src/keyboards/loaders/**/*.ts"]
}
10 changes: 0 additions & 10 deletions common/web/lm-worker/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,6 @@
// As this one is the one that directly interfaces with the worker (from the inside)
"lib": ["webworker", "es6"],
},
"references": [
// types
{ "path": "../../models/types" },
{ "path": "../lm-message-types" },
// modules
{ "path": "../keyman-version" },
{ "path": "../utils" },
{ "path": "../../models/templates" },
{ "path": "../../models/wordbreakers" },
],
"include": [
"src/main/**/*.ts"
]
Expand Down
7 changes: 0 additions & 7 deletions common/web/recorder/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,4 @@
"include": [
"src/**/*.ts"
],

"references": [
{ "path": "../keyman-version" },
{ "path": "../utils/" },
{ "path": "../keyboard-processor/" },
{ "path": "../lm-message-types" }
],
}
5 changes: 0 additions & 5 deletions common/web/types/test/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,4 @@
"**/test-*.ts",
"./helpers/*.ts",
],
"references": [
{ "path": "../../keyman-version" },
{ "path": "../../../../core/include/ldml/"},
{ "path": "../" },
]
}
4 changes: 0 additions & 4 deletions common/web/types/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,4 @@
"src/**/*.ts",
"src/schemas/*.mjs", // Import the validators
],
"references": [
{ "path": "../keyman-version" },
{ "path": "../../../core/include/ldml/tsconfig.json"},
]
}
3 changes: 0 additions & 3 deletions common/web/utils/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@
"outDir": "./build/obj/",
"rootDir": "./src"
},
"references": [
{ "path": "../keyman-version"}
],
"include": [
"src/*.ts"
],
Expand Down
5 changes: 0 additions & 5 deletions web/src/app/browser/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,4 @@
},

"include": [ "**/*.ts" ],

"references": [
{ "path": "../../engine/attachment" },
{ "path": "../../engine/main" }
]
}
17 changes: 7 additions & 10 deletions web/src/app/ui/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
{
"extends": "../../tsconfig.dom.json",

"compilerOptions": {
"compilerOptions": {
"baseUrl": "./",
"outDir": "../../../build/app/ui/obj",
"rootDir": "",
"outDir": "../../../build/app/ui/obj",
"rootDir": "",
"tsBuildInfoFile": "../../../build/app/ui/obj/tsconfig.tsbuildinfo",
},
"files": [
"kmwuibutton.ts",
"kmwuifloat.ts",
"kmwuitoggle.ts",
"kmwuitoolbar.ts"
"kmwuibutton.ts",
"kmwuifloat.ts",
"kmwuitoggle.ts",
"kmwuitoolbar.ts"
],
"references": [
{ "path": "../browser" }
]
}
4 changes: 0 additions & 4 deletions web/src/app/webview/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,4 @@
},

"include": [ "**/*.ts" ],

"references": [
{ "path": "../../engine/main" }
]
}
5 changes: 0 additions & 5 deletions web/src/engine/attachment/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,4 @@
},

"include": [ "src/**/*.ts" ],

"references": [
{ "path": "../dom-utils" },
{ "path": "../element-wrappers" }
]
}
5 changes: 0 additions & 5 deletions web/src/engine/device-detect/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,4 @@
},

"include": [ "**/*.ts" ],

"references": [
{ "path": "../../../../common/web/keyman-version" },
{ "path": "../../../../common/web/utils" }
]
}
5 changes: 0 additions & 5 deletions web/src/engine/dom-utils/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,4 @@
},

"include": [ "src/**/*.ts" ],

"references": [
{ "path": "../../../../common/web/keyboard-processor" },
{ "path": "../../../../common/web/utils" }
]
}
4 changes: 0 additions & 4 deletions web/src/engine/element-wrappers/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,4 @@
},

"include": [ "src/**/*.ts" ],

"references": [
{ "path": "../../../../common/web/keyboard-processor" }
]
}
5 changes: 0 additions & 5 deletions web/src/engine/events/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,4 @@
},

"include": [ "src/**/*.ts" ],

"references": [
{ "path": "../../../../common/web/utils" },
{ "path": "../../../../common/web/keyboard-processor" }
]
}
8 changes: 0 additions & 8 deletions web/src/engine/main/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,4 @@
},

"include": [ "src/**/*.ts" ],

"references": [
{ "path": "../../../../common/web/input-processor" },
{ "path": "../device-detect" },
{ "path": "../osk" },
{ "path": "../package-cache" },
{ "path": "../paths" },
]
}
7 changes: 0 additions & 7 deletions web/src/engine/osk/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,4 @@
},

"include": [ "src/**/*.ts" ],

"references": [
{ "path": "../../../../common/web/input-processor" },
{ "path": "../../../../common/web/gesture-recognizer" },
{ "path": "../dom-utils" },
{ "path": "../events" }
]
}
5 changes: 0 additions & 5 deletions web/src/engine/package-cache/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,4 @@
},

"include": [ "src/**/*.ts" ],

"references": [
{ "path": "../../../../common/web/input-processor" },
{ "path": "../paths" }
]
}
6 changes: 0 additions & 6 deletions web/src/engine/paths/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,4 @@
},

"include": [ "**/*.ts" ],

"references": [
// We want OSK to be free from the need to reference this child project for its paths definitions.
// There are a number of extra components here the OSK doesn't need.
{ "path": "../osk" }
]
}
5 changes: 0 additions & 5 deletions web/src/tools/testing/bulk_rendering/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,4 @@
"files": [
"renderer_core.ts"
],

"references": [
{ "path": "../../../app/browser" },
{ "path": "../../../engine/device-detect" }
]
}
10 changes: 0 additions & 10 deletions web/src/tools/testing/recorder/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,4 @@
},

"include": [ "*.ts" ],

"references": [
{ "path": "../../../../../common/web/keyman-version" },
{ "path": "../../../../../common/web/utils" },
{ "path": "../../../../../common/web/keyboard-processor" },
{ "path": "../../../../../common/web/input-processor" },
{ "path": "../../../../../common/web/recorder" },
{ "path": "../../../../../common/web/lm-message-types" },
{ "path": "../../../../../web/src/app/browser" }
]
}

0 comments on commit db283df

Please sign in to comment.