diff --git a/style.md b/doc/contributing/style.md similarity index 100% rename from style.md rename to doc/contributing/style.md diff --git a/experimental/backwards-compatability/node14/tsconfig.json b/experimental/backwards-compatability/node14/tsconfig.json index 93d86afe21..5151549589 100644 --- a/experimental/backwards-compatability/node14/tsconfig.json +++ b/experimental/backwards-compatability/node14/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.es5.json", + "extends": "../../../tsconfig.base.es5.json", "compilerOptions": { "rootDir": ".", "outDir": "build" diff --git a/experimental/backwards-compatability/node16/tsconfig.json b/experimental/backwards-compatability/node16/tsconfig.json index 93d86afe21..5151549589 100644 --- a/experimental/backwards-compatability/node16/tsconfig.json +++ b/experimental/backwards-compatability/node16/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.es5.json", + "extends": "../../../tsconfig.base.es5.json", "compilerOptions": { "rootDir": ".", "outDir": "build" diff --git a/experimental/packages/otlp-grpc-exporter-base/tsconfig.json b/experimental/packages/otlp-grpc-exporter-base/tsconfig.json index 417e1ad468..bbfbbc57b0 100644 --- a/experimental/packages/otlp-grpc-exporter-base/tsconfig.json +++ b/experimental/packages/otlp-grpc-exporter-base/tsconfig.json @@ -6,6 +6,7 @@ }, "include": [ "src/**/*.ts", + "src/generated/*.js", "test/**/*.ts" ], "references": [ diff --git a/scripts/update-ts-configs.js b/scripts/update-ts-configs.js index bbe3bd2b35..0242a54668 100644 --- a/scripts/update-ts-configs.js +++ b/scripts/update-ts-configs.js @@ -247,12 +247,7 @@ function resolvePackageMeta(pkgDir) { } function readAndMaybeMergeTsConfig(tsconfigPath, updates) { - let tsconfig; - try { - tsconfig = readJSON(tsconfigPath); - } catch { - return updates; - } + const tsconfig = readJSON(tsconfigPath); updates = mergeTsConfig(tsconfig, updates); return updates; } @@ -284,8 +279,11 @@ function hasEsTargets(pjson) { function readJSON(filepath) { const fileContent = fs.readFileSync(filepath, 'utf8'); - const json = JSON.parse(fileContent); - return json; + try { + return JSON.parse(fileContent); + } catch (e) { + throw new Error(`Invalid JSON ${filepath}: ${e.message}`); + } } function writeJSON(filepath, content, dry) { diff --git a/tsconfig.es5.json b/tsconfig.base.es5.json similarity index 100% rename from tsconfig.es5.json rename to tsconfig.base.es5.json diff --git a/tsconfig.base.esm.json b/tsconfig.base.esm.json index e65651a426..d63786958e 100644 --- a/tsconfig.base.esm.json +++ b/tsconfig.base.esm.json @@ -1,5 +1,5 @@ { - "extends": "./tsconfig.es5.json", + "extends": "./tsconfig.base.es5.json", "compilerOptions": { "module": "ES6", "moduleResolution": "node"