1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-17 00:33:44 +00:00

feat(nx): add basic-lib generator for streamlined library creation (#14992)

* feat(nx): add basic-lib generator for streamlined library creation

This adds a new nx-plugin library with a generator for creating "common" type
Bitwarden libs. It is set up to accept a lib name, description, team, and
directory. It then
- Creates a folder in the directory (default to libs)
- Sets up complete library scaffolding:
  - README with team ownership
  - Build, lint and test task configuration
  - Test infrastructure
- Configures TypeScript path mapping
- Updates CODEOWNERS with team ownership
- Runs npm i

This will make library creation more consistent and reduce manual boilerplate setup.

The plugin design itself was generated by `npx nx g plugin`. This means we
used a plugin to generate a plugin that exports generators. To create our
generator generator, we first needed a generator.

* fix(dirt/card): correct tsconfig path in jest configuration

Fix the relative path to tsconfig.base in the dirt/card library's Jest config.
The path was incorrectly using four parent directory traversals (../../../../)
when only three (../../../) were needed to reach the project root.

* chore(codeowners): clarify some nx ownership stuff
This commit is contained in:
Addison Beck
2025-06-05 14:20:23 -04:00
committed by GitHub
parent 509af7b7bd
commit e8224fdbe3
34 changed files with 1273 additions and 578 deletions

4
.github/CODEOWNERS vendored
View File

@@ -117,6 +117,9 @@ apps/web/src/translation-constants.ts @bitwarden/team-platform-dev
.github/workflows/version-auto-bump.yml @bitwarden/team-platform-dev
# ESLint custom rules
libs/eslint @bitwarden/team-platform-dev
# Typescript tooling
tsconfig.base.json @bitwarden/team-platform-dev
nx.json @bitwarden/team-platform-dev
## Autofill team files ##
apps/browser/src/autofill @bitwarden/team-autofill-dev
@@ -189,3 +192,4 @@ apps/web/src/locales/en/messages.json
# To track that effort please see https://bitwarden.atlassian.net/browse/PM-21636
**/tsconfig.json @bitwarden/team-platform-dev
**/jest.config.js @bitwarden/team-platform-dev
**/project.jsons @bitwarden/team-platform-dev

View File

@@ -144,6 +144,10 @@
"@electron/notarize",
"@electron/rebuild",
"@ngtools/webpack",
"@nx/devkit",
"@nx/eslint",
"@nx/jest",
"@nx/js",
"@types/chrome",
"@types/firefox-webext-browser",
"@types/glob",
@@ -210,6 +214,7 @@
"simplelog",
"style-loader",
"sysinfo",
"ts-node",
"ts-loader",
"tsconfig-paths-webpack-plugin",
"type-fest",

View File

@@ -34,3 +34,4 @@
./apps/browser/src/safari/safari/Info.plist
./apps/browser/src/safari/desktop.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
./SECURITY.md
./libs/nx-plugin/src/generators/files/README.md__tmpl__