The bitwarden-clients workspace uses source-direct webpack bundling: apps
bundle libs via @bitwarden/* path aliases in tsconfig.base.json that resolve
to sibling lib source, not dist artifacts.
The workspace default targetDefaults.build.dependsOn: ["^build"] is an
artifact-based declaration that did not match the codebase. Combined with
@nx/js plugin auto-inference of build targets on every lib with a
tsconfig.lib.json, it forces nx build <app> to walk into leaf libs that
cannot compile standalone with tsc. This causes failed builds.
This commit changes the workspace default to [], making the declaration match
the actual bundling pattern. Apps no longer pull broken leaf libs through
their build chain, instead using their dependencies with their aliases.
* 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