@player-tools/cli 0.5.2--canary.72.2148 → 0.5.2-next.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -24,13 +24,16 @@ class Validate extends base_command_1.BaseCommand {
|
|
|
24
24
|
}
|
|
25
25
|
async getTSConfig(filePath, compilerOptions = {}) {
|
|
26
26
|
let TSEnvConfig, configFile;
|
|
27
|
-
const
|
|
28
|
-
|
|
27
|
+
const EnvTSConfigPath = filePath
|
|
28
|
+
? filePath
|
|
29
|
+
: globby_1.default.sync("./tsconfig.json")[0];
|
|
30
|
+
this.log(`Loading TypeScript config from path ${EnvTSConfigPath}`);
|
|
29
31
|
try {
|
|
30
|
-
configFile = await fs_1.promises.readFile(
|
|
32
|
+
configFile = await fs_1.promises.readFile(EnvTSConfigPath);
|
|
31
33
|
}
|
|
32
34
|
catch (e) {
|
|
33
|
-
this.
|
|
35
|
+
this.warn("Error reading TypeScript configuration file, falling back to internal defaults");
|
|
36
|
+
return;
|
|
34
37
|
}
|
|
35
38
|
const compilerConfigObject = configFile && JSON.parse(configFile.toString());
|
|
36
39
|
const configCompilerOpts = compilerConfigObject?.compilerOptions || {};
|
|
@@ -48,17 +51,17 @@ class Validate extends base_command_1.BaseCommand {
|
|
|
48
51
|
}
|
|
49
52
|
if (TSEnvConfig && Object.keys(TSEnvConfig).length > 0) {
|
|
50
53
|
if (!compilerConfigObject.extends)
|
|
51
|
-
this.
|
|
54
|
+
this.debug(`Final effective config: ${JSON.stringify(TSEnvConfig, null, 4)}`);
|
|
52
55
|
return TSEnvConfig;
|
|
53
56
|
}
|
|
54
|
-
this.
|
|
57
|
+
this.log(`No local TypeScript compiler configuration could be found, falling back to internal defaults`);
|
|
55
58
|
}
|
|
56
59
|
async run() {
|
|
57
60
|
const { inputFiles } = await this.getOptions();
|
|
58
61
|
const files = await (0, globby_1.default)((0, fs_2.convertToFileGlob)(inputFiles, "**/*.(tsx|jsx|js|ts)"), {
|
|
59
62
|
expandDirectories: true,
|
|
60
63
|
});
|
|
61
|
-
const TSConfig = (await this.getTSConfig())
|
|
64
|
+
const TSConfig = (await this.getTSConfig()) ?? compiler_options_1.DEFAULT_COMPILER_OPTIONS;
|
|
62
65
|
const program = ts.createProgram(files, TSConfig);
|
|
63
66
|
const allDiagnostics = ts.getPreEmitDiagnostics(program);
|
|
64
67
|
let diagnosticsCount = 0;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@player-tools/cli",
|
|
3
|
-
"version": "0.5.2
|
|
3
|
+
"version": "0.5.2-next.0",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"types": "./dist/index.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -21,12 +21,12 @@
|
|
|
21
21
|
"@oclif/plugin-plugins"
|
|
22
22
|
],
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@player-tools/dsl": "0.5.2
|
|
25
|
-
"@player-tools/json-language-service": "0.5.2
|
|
26
|
-
"@player-tools/xlr": "0.5.2
|
|
27
|
-
"@player-tools/xlr-converters": "0.5.2
|
|
28
|
-
"@player-tools/xlr-sdk": "0.5.2
|
|
29
|
-
"@player-tools/xlr-utils": "0.5.2
|
|
24
|
+
"@player-tools/dsl": "0.5.2-next.0",
|
|
25
|
+
"@player-tools/json-language-service": "0.5.2-next.0",
|
|
26
|
+
"@player-tools/xlr": "0.5.2-next.0",
|
|
27
|
+
"@player-tools/xlr-converters": "0.5.2-next.0",
|
|
28
|
+
"@player-tools/xlr-sdk": "0.5.2-next.0",
|
|
29
|
+
"@player-tools/xlr-utils": "0.5.2-next.0",
|
|
30
30
|
"react": "^18.2.0",
|
|
31
31
|
"tapable-ts": "^0.2.4",
|
|
32
32
|
"@babel/register": "^7.23.3",
|