From ecfdeb2276338ecb685415ca472082dc50ca8426 Mon Sep 17 00:00:00 2001 From: Anton Nikolaev Date: Mon, 8 Jun 2020 08:47:29 -0700 Subject: [PATCH] Make external typings re-usable across all the workspaces Summary: Our external typings were only effective for the main "app" package. In this diff I've made them effective for all other workspaces too, and also cleaned up typescript configs. Reviewed By: passy Differential Revision: D21927361 fbshipit-source-id: ceb8009255583d969d79cc11b20dfe8b686f2fb3 --- desktop/babel-transformer/tsconfig.json | 6 +----- desktop/pkg-lib/src/types/metro.d.ts | 10 ---------- desktop/pkg-lib/tsconfig.json | 6 +----- desktop/pkg/tsconfig.json | 5 +---- desktop/plugin-lib/tsconfig.json | 6 +----- desktop/tsconfig.base.json | 16 +++++++++++----- desktop/tsconfig.json | 14 +++----------- .../types/{JSONStream.d.tsx => JSONStream.d.ts} | 0 ...unceRender.d.tsx => ReactDebounceRender.d.ts} | 0 ...{ResizeObserver.d.tsx => ResizeObserver.d.ts} | 0 .../{XmlBeautifier.d.tsx => XmlBeautifier.d.ts} | 0 .../{adbkit-logcat.d.tsx => adbkit-logcat.d.ts} | 0 desktop/types/{adbkit.d.tsx => adbkit.d.ts} | 0 ...ompress-targz.d.tsx => decompress-targz.d.ts} | 0 ...ompress-unzip.d.tsx => decompress-unzip.d.ts} | 0 ...nload-tarball.d.tsx => download-tarball.d.ts} | 0 desktop/types/{globals.tsx => globals.ts} | 0 ...in-manager.d.tsx => live-plugin-manager.d.ts} | 0 ...{metro-resolver.d.tsx => metro-resolver.d.ts} | 0 desktop/types/metro.d.tsx | 10 ---------- desktop/types/{nodejs.tsx => nodejs.d.ts} | 0 ...penssl-wrapper.d.tsx => openssl-wrapper.d.ts} | 0 ...compare.d.tsx => string-natural-compare.d.ts} | 0 23 files changed, 18 insertions(+), 55 deletions(-) delete mode 100644 desktop/pkg-lib/src/types/metro.d.ts rename desktop/types/{JSONStream.d.tsx => JSONStream.d.ts} (100%) rename desktop/types/{ReactDebounceRender.d.tsx => ReactDebounceRender.d.ts} (100%) rename desktop/types/{ResizeObserver.d.tsx => ResizeObserver.d.ts} (100%) rename desktop/types/{XmlBeautifier.d.tsx => XmlBeautifier.d.ts} (100%) rename desktop/types/{adbkit-logcat.d.tsx => adbkit-logcat.d.ts} (100%) rename desktop/types/{adbkit.d.tsx => adbkit.d.ts} (100%) rename desktop/types/{decompress-targz.d.tsx => decompress-targz.d.ts} (100%) rename desktop/types/{decompress-unzip.d.tsx => decompress-unzip.d.ts} (100%) rename desktop/types/{download-tarball.d.tsx => download-tarball.d.ts} (100%) rename desktop/types/{globals.tsx => globals.ts} (100%) rename desktop/types/{live-plugin-manager.d.tsx => live-plugin-manager.d.ts} (100%) rename desktop/types/{metro-resolver.d.tsx => metro-resolver.d.ts} (100%) delete mode 100644 desktop/types/metro.d.tsx rename desktop/types/{nodejs.tsx => nodejs.d.ts} (100%) rename desktop/types/{openssl-wrapper.d.tsx => openssl-wrapper.d.ts} (100%) rename desktop/types/{string-natural-compare.d.tsx => string-natural-compare.d.ts} (100%) diff --git a/desktop/babel-transformer/tsconfig.json b/desktop/babel-transformer/tsconfig.json index 545c321c0..2fb289f45 100644 --- a/desktop/babel-transformer/tsconfig.json +++ b/desktop/babel-transformer/tsconfig.json @@ -2,11 +2,7 @@ "extends": "../tsconfig.base.json", "compilerOptions": { "outDir": "lib", - "rootDir": "src", - "allowJs": true, - "esModuleInterop": true, - "composite": true, - "incremental": true + "rootDir": "src" }, "include": ["src"], "exclude": ["node_modules", "**/__tests__/*"] diff --git a/desktop/pkg-lib/src/types/metro.d.ts b/desktop/pkg-lib/src/types/metro.d.ts deleted file mode 100644 index 19d6a54d7..000000000 --- a/desktop/pkg-lib/src/types/metro.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * @format - */ - -declare module 'metro'; diff --git a/desktop/pkg-lib/tsconfig.json b/desktop/pkg-lib/tsconfig.json index ac09ad07b..d40807250 100644 --- a/desktop/pkg-lib/tsconfig.json +++ b/desktop/pkg-lib/tsconfig.json @@ -2,11 +2,7 @@ "extends": "../tsconfig.base.json", "compilerOptions": { "outDir": "lib", - "rootDir": "src", - "allowJs": true, - "esModuleInterop": true, - "composite": true, - "incremental": true + "rootDir": "src" }, "references": [{"path": "../babel-transformer"}], "include": ["src"], diff --git a/desktop/pkg/tsconfig.json b/desktop/pkg/tsconfig.json index 6a376a67e..b68777a6a 100644 --- a/desktop/pkg/tsconfig.json +++ b/desktop/pkg/tsconfig.json @@ -2,10 +2,7 @@ "extends": "../tsconfig.base.json", "compilerOptions": { "outDir": "lib", - "rootDir": "src", - "allowJs": true, - "esModuleInterop": true, - "incremental": true + "rootDir": "src" }, "references": [{"path": "../pkg-lib"}, {"path": "../plugin-lib"}], "include": ["src"], diff --git a/desktop/plugin-lib/tsconfig.json b/desktop/plugin-lib/tsconfig.json index 545c321c0..2fb289f45 100644 --- a/desktop/plugin-lib/tsconfig.json +++ b/desktop/plugin-lib/tsconfig.json @@ -2,11 +2,7 @@ "extends": "../tsconfig.base.json", "compilerOptions": { "outDir": "lib", - "rootDir": "src", - "allowJs": true, - "esModuleInterop": true, - "composite": true, - "incremental": true + "rootDir": "src" }, "include": ["src"], "exclude": ["node_modules", "**/__tests__/*"] diff --git a/desktop/tsconfig.base.json b/desktop/tsconfig.base.json index b4425cda3..55025f742 100644 --- a/desktop/tsconfig.base.json +++ b/desktop/tsconfig.base.json @@ -1,11 +1,7 @@ { "compilerOptions": { "module": "commonjs", - "lib": [ - "es7", - "dom", - "es2017" - ], + "lib": ["es7", "dom", "es2017"], "esModuleInterop": true, "target": "ES2017", "removeComments": true, @@ -16,5 +12,15 @@ "moduleResolution": "node", "skipLibCheck": true, "strict": true, + "composite": true, + "incremental": true, + "baseUrl": ".", + "allowJs": true, + "rootDir": ".", + "paths": { + "flipper": ["./app/src"], + "flipper-*": ["./*/src"], + "*": ["./*", "./types/*"] + } } } diff --git a/desktop/tsconfig.json b/desktop/tsconfig.json index 2e57b3aa9..fe3689dc4 100644 --- a/desktop/tsconfig.json +++ b/desktop/tsconfig.json @@ -1,18 +1,10 @@ { "extends": "./tsconfig.base.json", "compilerOptions": { - "baseUrl": ".", - "skipLibCheck": true, "noEmit": true, - "paths": { - "flipper": ["./app/src"], - "flipper-doctor": ["./doctor/src"], - "flipper-pkg": ["./pkg/src"], - "flipper-pkg-lib": ["./pkg-lib/src"], - "live-plugin-manager": ["./types/live-plugin-manager.d.tsx"], - "flipper-babel-transformer": ["./babel-transformer/src"], - "flipper-plugin-lib": ["./plugin-lib/src"] - } + "incremental": false, + "composite": false, + "allowJs": false }, "exclude": ["**/node_modules/", "**/*.spec.ts"] } diff --git a/desktop/types/JSONStream.d.tsx b/desktop/types/JSONStream.d.ts similarity index 100% rename from desktop/types/JSONStream.d.tsx rename to desktop/types/JSONStream.d.ts diff --git a/desktop/types/ReactDebounceRender.d.tsx b/desktop/types/ReactDebounceRender.d.ts similarity index 100% rename from desktop/types/ReactDebounceRender.d.tsx rename to desktop/types/ReactDebounceRender.d.ts diff --git a/desktop/types/ResizeObserver.d.tsx b/desktop/types/ResizeObserver.d.ts similarity index 100% rename from desktop/types/ResizeObserver.d.tsx rename to desktop/types/ResizeObserver.d.ts diff --git a/desktop/types/XmlBeautifier.d.tsx b/desktop/types/XmlBeautifier.d.ts similarity index 100% rename from desktop/types/XmlBeautifier.d.tsx rename to desktop/types/XmlBeautifier.d.ts diff --git a/desktop/types/adbkit-logcat.d.tsx b/desktop/types/adbkit-logcat.d.ts similarity index 100% rename from desktop/types/adbkit-logcat.d.tsx rename to desktop/types/adbkit-logcat.d.ts diff --git a/desktop/types/adbkit.d.tsx b/desktop/types/adbkit.d.ts similarity index 100% rename from desktop/types/adbkit.d.tsx rename to desktop/types/adbkit.d.ts diff --git a/desktop/types/decompress-targz.d.tsx b/desktop/types/decompress-targz.d.ts similarity index 100% rename from desktop/types/decompress-targz.d.tsx rename to desktop/types/decompress-targz.d.ts diff --git a/desktop/types/decompress-unzip.d.tsx b/desktop/types/decompress-unzip.d.ts similarity index 100% rename from desktop/types/decompress-unzip.d.tsx rename to desktop/types/decompress-unzip.d.ts diff --git a/desktop/types/download-tarball.d.tsx b/desktop/types/download-tarball.d.ts similarity index 100% rename from desktop/types/download-tarball.d.tsx rename to desktop/types/download-tarball.d.ts diff --git a/desktop/types/globals.tsx b/desktop/types/globals.ts similarity index 100% rename from desktop/types/globals.tsx rename to desktop/types/globals.ts diff --git a/desktop/types/live-plugin-manager.d.tsx b/desktop/types/live-plugin-manager.d.ts similarity index 100% rename from desktop/types/live-plugin-manager.d.tsx rename to desktop/types/live-plugin-manager.d.ts diff --git a/desktop/types/metro-resolver.d.tsx b/desktop/types/metro-resolver.d.ts similarity index 100% rename from desktop/types/metro-resolver.d.tsx rename to desktop/types/metro-resolver.d.ts diff --git a/desktop/types/metro.d.tsx b/desktop/types/metro.d.tsx deleted file mode 100644 index 19d6a54d7..000000000 --- a/desktop/types/metro.d.tsx +++ /dev/null @@ -1,10 +0,0 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * @format - */ - -declare module 'metro'; diff --git a/desktop/types/nodejs.tsx b/desktop/types/nodejs.d.ts similarity index 100% rename from desktop/types/nodejs.tsx rename to desktop/types/nodejs.d.ts diff --git a/desktop/types/openssl-wrapper.d.tsx b/desktop/types/openssl-wrapper.d.ts similarity index 100% rename from desktop/types/openssl-wrapper.d.tsx rename to desktop/types/openssl-wrapper.d.ts diff --git a/desktop/types/string-natural-compare.d.tsx b/desktop/types/string-natural-compare.d.ts similarity index 100% rename from desktop/types/string-natural-compare.d.tsx rename to desktop/types/string-natural-compare.d.ts