36 Commits

Author SHA1 Message Date
Max
95f5897428 [SM-2108] Land the Secrets Manager CLI stack in main (#24684)
* [SM-2108] Move Secrets Manager services and models to bit-sm (#23925)

* [SM-2109] Return results from Secrets Manager service create, update and restore calls (#23926)

* [SM-2110] Add the feature-flagged bw sm command foundation (#23927)

* [SM-2112] Add bw sm secret and bw sm template commands (#23929)

* [SM-2113] Add bw sm trash commands (#23930)

* [SM-2114] Add bw sm machine-account and access token commands (#23931)

* [SM-2115] Add bw sm access and bw sm grantees commands (#23932)

* [SM-2116] Add Secrets Manager counts, events, import/export and bw serve endpoints (#23933)

---------

Co-authored-by: cd-bitwarden <106776772+cd-bitwarden@users.noreply.github.com>
2026-11-13 16:47:07 +00:00
Oscar Hinton
e20a6533ea [PAM-264] Move shared PAM code to bit-pam and bit-pam-components (#24417)
* [PAM-121] Move shared PAM code to bit-pam and bit-pam-components

Creates two licensed libs owned by team-pam-dev and moves the shared PAM
code into them from bit-web so other clients can consume it:

- bitwarden_license/bit-pam (@bitwarden/bit-pam): framework-free
  abstractions, helpers, date formatting and SDK services, usable from the
  browser background. ESLint keeps Angular and the UI libraries out of it.
- bitwarden_license/bit-pam-components (@bitwarden/bit-pam-components): the
  shared components, pipes, confirm dialogs and Angular-injected services.

Each lib exposes a single barrel. Split out of #22430 to reduce its size;
no behavioural changes.

* [PAM-121] Run Chromatic on bit-pam-components changes

* [PAM-121] Run prettier
2026-11-04 16:06:27 +01:00
Derek Nance
9f07c4b890 [PM-25909] Commercial desktop builds (#18094) 2026-09-24 17:34:15 -05:00
Daniel James Smith
b9233db5dd Create libs/tools/share using the nx lib generator plugin (#22926)
Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>
2026-09-04 14:05:26 +00:00
Daniel James Smith
907324546d Create scaffold for libs/managed-settings lib (#22695)
Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>
2026-08-26 12:40:43 +00:00
Bernd Schoolmann
f47203222a feat(automation-driver): add automation-driver package (#21919)
* chore(automation-driver): add automation-driver package

* fix: add missing package lock, codeowners

* update codeowners and readme
2026-08-25 16:25:43 +09:00
Bernd Schoolmann
93a89af6b0 refactor(crypto): add legacy crypto module (#22254) 2026-08-10 16:52:15 +09:00
Will Martin
96c272a374 [CL-1285] create Storybook feature-flags addon in new @bitwarden/storybook lib (#21913)
* Add @bitwarden/storybook lib with feature-flags addon

Introduce a dedicated @bitwarden/storybook library housing Storybook
addons and utilities.

feature-flags addon:
- Manager-side "Feature Flags" panel listing every boolean flag from the
  FeatureFlag enum; toggles write to a Storybook global.
- Preview-side mock ConfigService whose getFeatureFlag$ values are driven
  by that global (reactive, so toggles update stories live).
- Flag catalog seeded into globals so the manager bundle never imports
  @bitwarden/* (esbuild can't resolve those aliases).
- featureFlagModes() helper for opt-in Chromatic on/off snapshot modes.
- Documentation/Feature Flags MDX page describing panel + modes usage.

Also:
- Move .storybook/format-args-for-code-snippet into the lib and repoint
  the 19 component stories to import from @bitwarden/storybook.
- Enable jsx ("react") in tsconfig.base.json for the manager panel (.tsx);
  the Storybook manager builder emits the classic runtime.
- .storybook wiring: preview registers the decorator + seeds globals,
  manager loads the panel by relative path.

package-lock.json also picks up npm's normalization of a few pre-existing
entries on main (readdirp dedupe, encoding removal) alongside the new
workspace registration.

* Add enabledFlags helper for per-story flag state

- enabledFlags(...flags) builds a story-level `globals` override so one
  story can render with a flag on and another with it off.
- featureFlagModes now reuses enabledFlags for a single source of truth.
- Document the per-story pattern in the Feature Flags MDX.

* Fix CI failures for the feature-flags addon

- Decorator: skip providing the mock ConfigService when a story already
  provides one at the application root (applicationConfig). Fixes the
  danger-zone story crash "Cannot mix multi providers and regular
  providers" — it registers ConfigService as `multi: true`.
- Lib jest: set isolatedModules in tsconfig.spec.json so ts-jest
  transpiles without type-checking; its node10 resolution can't read
  @storybook/angular's exports-based types (typecheck is covered by tsc).
- Reformat 5 component stories that were left prettier-dirty after the
  import repoint (pre-commit runs prettier before eslint's import sort).

* Remove comments from tsconfig.spec.json and manager.js
2026-07-20 15:36:00 +02:00
Oscar Hinton
c5449e6432 [PM-39048] Feat: scaffold @bitwarden/pam library (#21259)
Add a new libs/pam feature library for Privileged Access Management,
generated via the basic-lib Nx generator.

- Register the "pam" team in the basic-lib generator (schema enum,
  interactive prompt, and the @bitwarden/team-pam-dev CODEOWNERS handle)
- Generate libs/pam with standard structure and a placeholder spec
- Wire up tsconfig.base.json path, CODEOWNERS, and root jest.config.js
2026-06-16 09:55:07 +02:00
bmbitwarden
ec7a19c7fe PM-6796 implemented file reorg (#20648)
* PM-6796 implemented file reorg

* PM-6796 remaining jest files

* PM-6796 resolved failing tests

* PM-6796 resolved readme pr comment

* PM-6796 testEnvironment revert

* PM-6796 resolved project.json nesting

* PM-6796 restored unrelated cipher view files

* PM-6796 pushed test file

* PM-6796 resolved pr comment Type signature mismatch will fail TypeScript compilation.

* PM-6796 reverted unneeded send sdk changes

* PM-6796 resolved test issue

* PM-6796 removed revised service file
2026-06-10 17:29:01 -04:00
Will Martin
69c937e592 [CL-954] Upgrade to Angular 21 (#19725)
* prune desktop packages

* Fix @napi-rs/cli version mismatch in desktop napi workspace

Aligns package.json declaration with the locked version (3.2.0) to
resolve npm workspace inconsistency that was blocking ng update.

* update Storybook to v10

* update Angular to v21

* override jest in ng builder

* Add jest-environment-jsdom as explicit dependency

Previously installed as a side effect of a jest@29 override; removing
that override caused it to disappear from node_modules.

* Add .claude/worktrees/ to .gitignore

* Restore @napi-rs/cli to 3.5.1 to match main

* Pin jest-environment-jsdom to 29.7.0 and add to renovate config

* Override jest-environment-jsdom to 29.7.0 in build-angular context

* Add isolatedModules to libs/subscription tsconfig.spec.json to fix Angular 21 module resolution

* Change moduleResolution to bundler for Angular 21 subpath export compatibility

* Add isolatedModules to Angular libs with old spec tsconfig pattern

* Disable emitDecoratorMetadata in spec tsconfigs with isolatedModules

* Fix HostListener event parameter types for Angular 21 compiler strictness

* Revert accidental change to access-selector spec

* Remove accidentally generated desktop package-lock.json

* Fix type-only imports/exports caught by Rolldown in Storybook v10/Vite v8

* fix vault-wrapper type error from Angular 21 stricter generic inference

ngComponentOutlet accepts Type<unknown>; annotate computed() explicitly
since VaultComponent is generic and VaultOrigComponent is not, preventing
TypeScript from inferring a compatible union constructor type.

* Fix kitchen-sink interaction tests for Storybook v10

Replace fire-and-forget navigateTo + synchronous getByRole with
navigateAndWaitFor<T>, which sets the hash and retries the ready
callback via waitFor. Storybook v10 starts play functions before
Angular's initial router navigation completes, so synchronous DOM
queries after navigation were failing intermittently.

* Provide ZoneJS change detection scheduler for Storybook stories

Angular 21 no longer sets up the ZoneJS change detection scheduler by
default in bootstrapApplication. Storybook's Angular renderer uses
bootstrapApplication internally and does not add provideZoneChangeDetection
automatically, so Default CD components relying on zone.js to trigger
re-renders after async operations were not updating before Chromatic
snapshots.

* Wait for dialog/side nav to render before Chromatic snapshot

After userEvent.click the dialog and side nav open asynchronously.
Without an explicit waitFor, Chromatic captures the snapshot before the
resulting UI state is present.

* Fix kitchen-sink waitFor: re-query side nav button, use querySelector for dialog

- openSideNav: re-query the toggle button inside waitFor to avoid reading
  a stale DOM reference after Angular re-renders the element post-click
- SimpleDialogOpen / VirtualScrollBlockingDialog: replace getByRole("dialog")
  with querySelector("cdk-dialog-container") to avoid testing-library's
  visibility check failing on a momentarily inaccessible overlay element

* Revert kitchen-sink stories to main

* Bump Angular, Storybook, and ng-select to latest patch versions

* Trigger pre-commit hooks on merge

* Regenerate package-lock.json with --force to fix npm ci sync
2026-05-18 10:55:47 -05:00
Brandon Treston
6d42bbfbe5 [PM-34775] Generate Invite Link Lib and API Service (#20301)
* Scaffold generate invite link lib, api service WIP

* add missing properties

* refresh lock file

* revert lockfile

* lock file

* clean up lock file (used wrong node version)

* fix lock file

* clean up

* more lockfile issues
2026-04-28 11:54:20 -04:00
Daniel García
dc888f9acc [PM-33315] Create @bitwarden/logging (#20197)
* [PM-33315] Create @bitwarden/logging

* Reorder tsconfig, fix tests
2026-04-21 11:48:03 +02:00
Addison Beck
02fe70eaeb refactor(scheduling): extract @bitwarden/scheduling Nx leaf library (#19771) 2026-03-27 11:23:22 +00:00
Daniel James Smith
7507c33744 Remove duplicate entry from tsconfig.base.json (#19309)
Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>
2026-03-11 12:00:51 -04:00
Bernd Schoolmann
666ff42d22 [PM-31763] Add unlock service & module (#18870)
* Add unlock service

* Move methods

* Prettier

* Fix type errors

* Prettier

* Fix test

* Fix module order

* Attempt to fix tests

* Cleanup CODEOWNERS

* Backport biometric unlock and legacy master-key logic

* Add tests for biometrics

* Prettier

* Add biometric unlock to abstract unlock service

* Fix build
2026-02-25 18:50:25 +01:00
Bernd Schoolmann
bb110122a5 [PM-30144] Implement client-side user-key-rotation-service (#18285)
* Implement client-side user-key-rotation-service

* Feature flag

* Add tests

* Fix flag name

* Fix build

* Prettier

* Small clean-up

* Codeowners order cleanup

* Fix eslint issue

* Update sdk to 550

* Cleanup & fix incompatibilities

* Prettier
2026-02-20 15:28:24 +01:00
Bernd Schoolmann
1f911c09d0 Fix non-relative imports (#19022) 2026-02-18 09:32:08 +01:00
Brandon Treston
2912bf05e1 [PM-26901] Add notification handler for auto confirm (#18886)
* add notification handler for auto confirm

* add missing state check

* fix test

* isolate angular specific code from shared lib code

* clean up

* use autoconfirm method

* fix test
2026-02-13 14:36:11 -05:00
Brandon Treston
bb318ee22e Ac/pm 26364 extension UI for auto confirm (#17258)
* create nav link for auto confirm in settings page

* wip

* WIP

* create auto confirm library

* migrate auto confirm files to lib

* update imports

* fix tests

* fix nudge

* cleanup, add documentation

* clean up

* cleanup

* fix import

* fix more imports

* add tests

* design changes

* fix tests

* fix tw issue

* fix typo, add tests

* CR feedback

* more clean up, fix race condition

* CR feedback, cache policies, refactor tests

* run prettier with updated version

* clean up duplicate logic

* clean up

* fix test

* add missing prop for test mock

* clean up
2026-01-07 15:27:41 -05:00
Bernd Schoolmann
c022878d81 Fix tsconfig.base.json ts-go compat (#18176)
* Fix tsconfig.base.json

* Undo baseurl change
2026-01-06 07:44:24 +01:00
Alex Morask
a987494300 [PM-29607] Create @bitwarden/subscription (#17997)
* Create @bitwarden/subscription

* Fix changed import in tsconfig.base.json
2025-12-16 10:13:18 -06:00
Todd Martin
27d82aaf28 feat(accounts): Add creationDate of account to AccountInfo
* Add creationDate of account to AccountInfo

* Added initialization of creationDate.

* Removed extra changes.

* Fixed tests to initialize creation date

* Added helper method to abstract account initialization in tests.

* More test updates.

* Linting

* Additional test fixes.

* Fixed spec reference

* Fixed imports

* Linting.

* Fixed browser test.

* Modified tsconfig to reference spec file.

* Fixed import.

* Removed dependency on os.  This is necessary so that the @bitwarden/common/spec lib package can be referenced in tests without node.

* Revert "Removed dependency on os.  This is necessary so that the @bitwarden/common/spec lib package can be referenced in tests without node."

This reverts commit 669f6557b6.

* Updated stories to hard-code new field.

* Removed changes to tsconfig

* Revert "Removed changes to tsconfig"

This reverts commit b7d916e8dc.
2025-12-12 10:03:31 -05:00
Addison Beck
7ac75a6c52 refactor(libs): consolidate messaging-internal into messaging library (#16386)
This change eliminates the circular dependency between messaging and messaging-internal libraries by merging them into a single messaging library.

Previously, messaging-internal imported from @bitwarden/messaging while messaging tried to import from @bitwarden/messaging-internal, creating an unresolvable circular dependency. This also violated Nx best practices by using cross-library file includes in tsconfig.lib.json.

Changes made:
- Moved all messaging-internal code (SubjectMessageSender, helpers, tests) into libs/messaging/src/
- Updated all imports to use relative paths instead of @bitwarden/messaging imports
- Removed the entire messaging-internal library and its configuration files
- Updated external references in apps/browser to import from @bitwarden/messaging
- Fixed libs/messaging/tsconfig.lib.json to use standard src/**/*.ts pattern
- Updated libs/common internal.ts to re-export from messaging instead of messaging-internal

The messaging library now exports both public APIs and internal implementations, which is a cleaner architecture than maintaining two separate libraries with circular dependencies.

Fixes rootDir configuration issues identified in the Nx library systematic fix project.
2025-09-12 13:04:13 +02:00
cyprain-okeke
8c7faf49d5 Billing/pm 23385 premium modal in web after registration (#16182)
* create the pricing library

* Create pricing-card.component

* Refactor the code

* feat: Add pricing card component library

* Fix the test failing error

* Address billing pr comments

* feat: Add Storybook documentation and stories for pricing-card component

* Fix some ui feedback

* Changes from the display and sizes

* feat(billing): refactor pricing card with flexible title slots and active badge

* Enhance pricing card with flexible design and button icons

* refactor: organize pricing card files into dedicated folder

* Complete pricing card enhancements with Chromatic feedback fixes

* refactor base on pr coments

* Fix the button alignment

* Update all the card to have the same height

* Fix the slot issue on the title

* Fix the Lint format issue

* Add the header in the stories book
2025-09-04 14:44:04 +00:00
Andreas Coroiu
b957a0c28f [PM-24646] Add licensed browser builds (#16252)
* feat: create separate bit licensed browser

* feat: refactor webpack config

* fix: mv2 build not working

* feat: add bit versions of all commands

* feat: add bit CI builds

* fix: scss missing from build
2025-09-04 08:21:50 +02:00
Justin Baur
5f7f1d1924 Resolve state <-> state-test-utils circular dependency (#16093)
* Resolve state <-> state-test-utils circular dependency

* Fix type errors
2025-08-25 12:38:28 -04:00
Vicki League
805b6fe7aa [CL-573] Move all svg icons to new libs/assets (#16020)
* create libs/assets

* treeshake lib and filter out non-icons from icon story

* update docs

* fix icon colors in browser and desktop

* better name for vault icon

* move illustrations
2025-08-21 11:35:59 -05:00
Addison Beck
361f7e3447 refactor: introduce @bitwarden/state and other common libs (#15772)
* refactor: introduce @bitwarden/serialization

* refactor: introduce @bitwarden/guid

* refactor: introduce @bitwaren/client-type

* refactor: introduce @bitwarden/core-test-utils

* refactor: introduce @bitwarden/state and @bitwarden/state-test-utils

Creates initial project structure for centralized application state management. Part of modularization effort to extract state code from common.

* Added state provider documentation to README.

* Changed callouts to Github format.

* Fixed linting on file name.

* Forced git to accept rename

---------

Co-authored-by: Todd Martin <tmartin@bitwarden.com>
2025-08-04 11:01:28 -04:00
Justin Baur
a563e6d910 Add messaging & messaging-internal libraries (#15711) 2025-07-22 11:47:25 -04:00
Justin Baur
172623e050 [PM-20247] Initialize user-core library (#15029)
* Initialize user-core library

* Run `npm install`

* Fix patched generator bug
2025-07-01 15:59:11 -04:00
Justin Baur
4cb80b4a03 Platform logging lib (#15338)
* Add Platform Logging Lib

* Move console log spec and test util back into libs/common

* Fix ConsoleLogServer re-export

* Fix types error
2025-07-01 13:47:02 -04:00
Addison Beck
782dc930ad refactor(storage-test-utils): cut a new library for storage test tools (#15259)
* refactor(platform): generate a storage-test-utils library

* refactor(storage-test-utils): move FakeStorageService out of common
2025-06-30 13:56:26 -04:00
Addison Beck
95841eb078 refactor(storage-core): move storage files out of @bitwarden/common (#15076)
* refactor(platform): generate @bitwarden/storage-core boilerplate

* refactor(storage-core): move storage files out of @bitwarden/common

* chore(naming): rename AbstractStorageService to StorageService
2025-06-23 16:00:54 -04:00
Addison Beck
e8224fdbe3 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
2025-06-05 14:20:23 -04:00
Addison Beck
26caeb3083 Implement and extend tsconfig.base across projects (#14554)
* Implement and extend tsconfig.base across projects

* fixup! Merge remote-tracking branch 'origin/main' into rename-tsconfig

* fix: import tsconfig.base from components

* fix: skip typechecking node modules

* fixing tests

* fix the tests for real

* undo accidentally change
2025-06-02 20:38:17 +00:00