From 31aa5f4d5bea642cd3a341b62e521c06ef088ab4 Mon Sep 17 00:00:00 2001 From: Addison Beck Date: Tue, 14 Oct 2025 11:07:23 -0400 Subject: [PATCH] refactor(nx): remove unneeded tsconfig.build.json & adjust nx docs (#16864) * cleanup: remove unneeded tsconfig.build.json * cleanup: nx docs --- apps/browser/project.json | 46 +++++++++++++++--------------- apps/browser/tsconfig.build.json | 5 ---- apps/browser/tsconfig.json | 3 +- apps/browser/webpack.config.js | 2 +- docs/using-nx-to-build-projects.md | 7 +++-- 5 files changed, 29 insertions(+), 34 deletions(-) delete mode 100644 apps/browser/tsconfig.build.json diff --git a/apps/browser/project.json b/apps/browser/project.json index 90b04ad272..9a8df56c17 100644 --- a/apps/browser/project.json +++ b/apps/browser/project.json @@ -12,7 +12,7 @@ "options": { "outputPath": "dist/apps/browser", "webpackConfig": "apps/browser/webpack.config.js", - "tsConfig": "apps/browser/tsconfig.build.json", + "tsConfig": "apps/browser/tsconfig.json", "main": "apps/browser/src/popup/main.ts", "target": "web", "compiler": "tsc" @@ -149,7 +149,7 @@ "outputPath": "dist/apps/browser/commercial-chrome", "webpackConfig": "bitwarden_license/bit-browser/webpack.config.js", "main": "bitwarden_license/bit-browser/src/popup/main.ts", - "tsConfig": "bitwarden_license/bit-browser/tsconfig.build.json", + "tsConfig": "bitwarden_license/bit-browser/tsconfig.json", "env": { "BROWSER": "chrome", "MANIFEST_VERSION": "3", @@ -161,7 +161,7 @@ "outputPath": "dist/apps/browser/commercial-chrome-dev", "webpackConfig": "bitwarden_license/bit-browser/webpack.config.js", "main": "bitwarden_license/bit-browser/src/popup/main.ts", - "tsConfig": "bitwarden_license/bit-browser/tsconfig.build.json", + "tsConfig": "bitwarden_license/bit-browser/tsconfig.json", "env": { "BROWSER": "chrome", "MANIFEST_VERSION": "3", @@ -173,7 +173,7 @@ "outputPath": "dist/apps/browser/commercial-edge", "webpackConfig": "bitwarden_license/bit-browser/webpack.config.js", "main": "bitwarden_license/bit-browser/src/popup/main.ts", - "tsConfig": "bitwarden_license/bit-browser/tsconfig.build.json", + "tsConfig": "bitwarden_license/bit-browser/tsconfig.json", "env": { "BROWSER": "edge", "MANIFEST_VERSION": "3", @@ -185,7 +185,7 @@ "outputPath": "dist/apps/browser/commercial-edge-dev", "webpackConfig": "bitwarden_license/bit-browser/webpack.config.js", "main": "bitwarden_license/bit-browser/src/popup/main.ts", - "tsConfig": "bitwarden_license/bit-browser/tsconfig.build.json", + "tsConfig": "bitwarden_license/bit-browser/tsconfig.json", "env": { "BROWSER": "edge", "MANIFEST_VERSION": "3", @@ -197,7 +197,7 @@ "outputPath": "dist/apps/browser/commercial-firefox", "webpackConfig": "bitwarden_license/bit-browser/webpack.config.js", "main": "bitwarden_license/bit-browser/src/popup/main.ts", - "tsConfig": "bitwarden_license/bit-browser/tsconfig.build.json", + "tsConfig": "bitwarden_license/bit-browser/tsconfig.json", "env": { "BROWSER": "firefox", "MANIFEST_VERSION": "3", @@ -209,7 +209,7 @@ "outputPath": "dist/apps/browser/commercial-firefox-dev", "webpackConfig": "bitwarden_license/bit-browser/webpack.config.js", "main": "bitwarden_license/bit-browser/src/popup/main.ts", - "tsConfig": "bitwarden_license/bit-browser/tsconfig.build.json", + "tsConfig": "bitwarden_license/bit-browser/tsconfig.json", "env": { "BROWSER": "firefox", "MANIFEST_VERSION": "3", @@ -221,7 +221,7 @@ "outputPath": "dist/apps/browser/commercial-firefox-mv2", "webpackConfig": "bitwarden_license/bit-browser/webpack.config.js", "main": "bitwarden_license/bit-browser/src/popup/main.ts", - "tsConfig": "bitwarden_license/bit-browser/tsconfig.build.json", + "tsConfig": "bitwarden_license/bit-browser/tsconfig.json", "env": { "BROWSER": "firefox", "MANIFEST_VERSION": "2", @@ -233,7 +233,7 @@ "outputPath": "dist/apps/browser/commercial-firefox-mv2-dev", "webpackConfig": "bitwarden_license/bit-browser/webpack.config.js", "main": "bitwarden_license/bit-browser/src/popup/main.ts", - "tsConfig": "bitwarden_license/bit-browser/tsconfig.build.json", + "tsConfig": "bitwarden_license/bit-browser/tsconfig.json", "env": { "BROWSER": "firefox", "MANIFEST_VERSION": "2", @@ -245,7 +245,7 @@ "outputPath": "dist/apps/browser/commercial-opera", "webpackConfig": "bitwarden_license/bit-browser/webpack.config.js", "main": "bitwarden_license/bit-browser/src/popup/main.ts", - "tsConfig": "bitwarden_license/bit-browser/tsconfig.build.json", + "tsConfig": "bitwarden_license/bit-browser/tsconfig.json", "env": { "BROWSER": "opera", "MANIFEST_VERSION": "3", @@ -257,7 +257,7 @@ "outputPath": "dist/apps/browser/commercial-opera-dev", "webpackConfig": "bitwarden_license/bit-browser/webpack.config.js", "main": "bitwarden_license/bit-browser/src/popup/main.ts", - "tsConfig": "bitwarden_license/bit-browser/tsconfig.build.json", + "tsConfig": "bitwarden_license/bit-browser/tsconfig.json", "env": { "BROWSER": "opera", "MANIFEST_VERSION": "3", @@ -269,7 +269,7 @@ "outputPath": "dist/apps/browser/commercial-safari", "webpackConfig": "bitwarden_license/bit-browser/webpack.config.js", "main": "bitwarden_license/bit-browser/src/popup/main.ts", - "tsConfig": "bitwarden_license/bit-browser/tsconfig.build.json", + "tsConfig": "bitwarden_license/bit-browser/tsconfig.json", "env": { "BROWSER": "safari", "MANIFEST_VERSION": "3", @@ -281,7 +281,7 @@ "outputPath": "dist/apps/browser/commercial-safari-dev", "webpackConfig": "bitwarden_license/bit-browser/webpack.config.js", "main": "bitwarden_license/bit-browser/src/popup/main.ts", - "tsConfig": "bitwarden_license/bit-browser/tsconfig.build.json", + "tsConfig": "bitwarden_license/bit-browser/tsconfig.json", "env": { "BROWSER": "safari", "MANIFEST_VERSION": "3", @@ -293,7 +293,7 @@ "outputPath": "dist/apps/browser/commercial-safari-mv2", "webpackConfig": "bitwarden_license/bit-browser/webpack.config.js", "main": "bitwarden_license/bit-browser/src/popup/main.ts", - "tsConfig": "bitwarden_license/bit-browser/tsconfig.build.json", + "tsConfig": "bitwarden_license/bit-browser/tsconfig.json", "env": { "BROWSER": "safari", "MANIFEST_VERSION": "2", @@ -305,7 +305,7 @@ "outputPath": "dist/apps/browser/commercial-safari-mv2-dev", "webpackConfig": "bitwarden_license/bit-browser/webpack.config.js", "main": "bitwarden_license/bit-browser/src/popup/main.ts", - "tsConfig": "bitwarden_license/bit-browser/tsconfig.build.json", + "tsConfig": "bitwarden_license/bit-browser/tsconfig.json", "env": { "BROWSER": "safari", "MANIFEST_VERSION": "2", @@ -320,7 +320,7 @@ "options": { "outputPath": "dist/apps/browser", "webpackConfig": "apps/browser/webpack.config.js", - "tsConfig": "apps/browser/tsconfig.build.json", + "tsConfig": "apps/browser/tsconfig.json", "main": "apps/browser/src/popup/main.ts", "target": "web", "compiler": "tsc", @@ -395,7 +395,7 @@ "outputPath": "dist/apps/browser/commercial-chrome-dev", "webpackConfig": "bitwarden_license/bit-browser/webpack.config.js", "main": "bitwarden_license/bit-browser/src/popup/main.ts", - "tsConfig": "bitwarden_license/bit-browser/tsconfig.build.json", + "tsConfig": "bitwarden_license/bit-browser/tsconfig.json", "env": { "BROWSER": "chrome", "MANIFEST_VERSION": "3", @@ -407,7 +407,7 @@ "outputPath": "dist/apps/browser/commercial-firefox-dev", "webpackConfig": "bitwarden_license/bit-browser/webpack.config.js", "main": "bitwarden_license/bit-browser/src/popup/main.ts", - "tsConfig": "bitwarden_license/bit-browser/tsconfig.build.json", + "tsConfig": "bitwarden_license/bit-browser/tsconfig.json", "env": { "BROWSER": "firefox", "MANIFEST_VERSION": "3", @@ -419,7 +419,7 @@ "outputPath": "dist/apps/browser/commercial-firefox-mv2-dev", "webpackConfig": "bitwarden_license/bit-browser/webpack.config.js", "main": "bitwarden_license/bit-browser/src/popup/main.ts", - "tsConfig": "bitwarden_license/bit-browser/tsconfig.build.json", + "tsConfig": "bitwarden_license/bit-browser/tsconfig.json", "env": { "BROWSER": "firefox", "MANIFEST_VERSION": "2", @@ -431,7 +431,7 @@ "outputPath": "dist/apps/browser/commercial-safari-dev", "webpackConfig": "bitwarden_license/bit-browser/webpack.config.js", "main": "bitwarden_license/bit-browser/src/popup/main.ts", - "tsConfig": "bitwarden_license/bit-browser/tsconfig.build.json", + "tsConfig": "bitwarden_license/bit-browser/tsconfig.json", "env": { "BROWSER": "safari", "MANIFEST_VERSION": "3", @@ -443,7 +443,7 @@ "outputPath": "dist/apps/browser/commercial-safari-mv2-dev", "webpackConfig": "bitwarden_license/bit-browser/webpack.config.js", "main": "bitwarden_license/bit-browser/src/popup/main.ts", - "tsConfig": "bitwarden_license/bit-browser/tsconfig.build.json", + "tsConfig": "bitwarden_license/bit-browser/tsconfig.json", "env": { "BROWSER": "safari", "MANIFEST_VERSION": "2", @@ -455,7 +455,7 @@ "outputPath": "dist/apps/browser/commercial-edge-dev", "webpackConfig": "bitwarden_license/bit-browser/webpack.config.js", "main": "bitwarden_license/bit-browser/src/popup/main.ts", - "tsConfig": "bitwarden_license/bit-browser/tsconfig.build.json", + "tsConfig": "bitwarden_license/bit-browser/tsconfig.json", "env": { "BROWSER": "edge", "MANIFEST_VERSION": "3", @@ -467,7 +467,7 @@ "outputPath": "dist/apps/browser/commercial-opera-dev", "webpackConfig": "bitwarden_license/bit-browser/webpack.config.js", "main": "bitwarden_license/bit-browser/src/popup/main.ts", - "tsConfig": "bitwarden_license/bit-browser/tsconfig.build.json", + "tsConfig": "bitwarden_license/bit-browser/tsconfig.json", "env": { "BROWSER": "opera", "MANIFEST_VERSION": "3", diff --git a/apps/browser/tsconfig.build.json b/apps/browser/tsconfig.build.json deleted file mode 100644 index 53e44090f2..0000000000 --- a/apps/browser/tsconfig.build.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "extends": "./tsconfig.json", - "include": ["src", "../../libs/common/src/autofill/constants"], - "exclude": ["**/*.stories.*", "**/*.spec.ts"] -} diff --git a/apps/browser/tsconfig.json b/apps/browser/tsconfig.json index 04f3594f8c..0fd6cac423 100644 --- a/apps/browser/tsconfig.json +++ b/apps/browser/tsconfig.json @@ -4,6 +4,5 @@ "src", "../../libs/common/src/autofill/constants", "../../libs/common/custom-matchers.d.ts" - ], - "exclude": ["**/*.stories.*"] + ] } diff --git a/apps/browser/webpack.config.js b/apps/browser/webpack.config.js index 14a36db264..cb0761c859 100644 --- a/apps/browser/webpack.config.js +++ b/apps/browser/webpack.config.js @@ -29,7 +29,7 @@ module.exports = (webpackConfig, context) => { background: { entry: path.resolve(__dirname, "src/platform/background.ts"), }, - tsConfig: path.resolve(__dirname, "tsconfig.build.json"), + tsConfig: path.resolve(__dirname, "tsconfig.json"), outputPath: context.context && context.context.root ? path.resolve(context.context.root, context.options.outputPath) diff --git a/docs/using-nx-to-build-projects.md b/docs/using-nx-to-build-projects.md index f1fd54e1c2..408a6e92fb 100644 --- a/docs/using-nx-to-build-projects.md +++ b/docs/using-nx-to-build-projects.md @@ -2,7 +2,7 @@ Bitwarden uses [Nx](https://nx.dev/) to make building projects from the monorepo easier. To build, lint, or test a project you'll want to reference the project's `project.json` file for availible commands and their names. Then you'll run `npx nx [your_command] [your_project] [your_options]`. Run `npx nx --help` to see availible options, there are many. -Please note: the Nx implementation is a work in progress. Not all apps support Nx yet, CI still uses the old npm builds, and we have many "legacy" libraries that use hacks to get them into the Nx project graph. +Please note: the Nx implementation is a work in progress. CI still uses the old npm builds, and we have many "legacy" libraries that use hacks to get them into the Nx project graph. ## Quick Start @@ -11,6 +11,7 @@ Please note: the Nx implementation is a work in progress. Not all apps support N ```bash # Build a project npx nx build cli +npx nx build-native desktop # Some apps have special build commands npx nx build state # Modern libs and apps have simple, all lowercase target names npx nx build @bitwarden/common # Legacy libs have a special naming convention and include the @bitwarden prefix @@ -203,6 +204,6 @@ npx nx reset ## Additional Resources -- [Nx Documentation](https://nx.dev/getting-started/intro) -- [Nx CLI Reference](https://nx.dev/packages/nx/documents/cli) +- [Nx Intro Documentation](https://nx.dev/getting-started/intro) +- [Nx CLI Commands Reference](https://nx.dev/docs/reference/nx-commands) - [Nx Workspace Configuration](https://nx.dev/reference/project-configuration)