* fix: always try to register clearOn events
`registerEvents` already checks for existing registered events so there is no
need to have a pre-check in `doStorageSave`. It causes issues because the
`newState` and `oldState` parameters come from the custom deserializer which
might never return `null` (e.g. transforming `null` to some default value).
Better to just use the list of registered events as a source of truth.
A performance check shows that most calls would only save a couple of
milliseconds (ranges from 0.8 ms to 18 ms) and the total amount of time
saved from application startup, to unlock, to showing the vault is about 100 ms.
I haven't been able to perceive the change.
* Revert "feat: add folder.clear warning (#16376)"
This reverts commit a2e36c4489.
* fix(nx): add rootDir to existing project.json files
The @nx/js:tsc executor was creating builds with a structural mismatch where TypeScript
output files lived in a nested src/ directory, but package.json pointed to non-existent
dist/ paths. This caused "Cannot find module" errors throughout the dependency chain.
This fix adds the rootDir configuration to flatten the build output structure and updates
all package.json main/types fields to match the actual file locations.
Changes applied systematically across all affected libraries:
• Added "rootDir": "libs/{name}/src" to project.json build options
• Updated package.json "main" from "dist/index.js" to "index.js"
• Updated package.json "types" from "dist/index.d.ts" to "index.d.ts"
* fix(nx-plugin): set rootDir for any newly generated libs
The basic-lib generator was creating new libraries with the same package.json path bugs
that we just fixed in existing libraries. Without this template fix, any newly generated
library would inherit the broken configuration pattern.
Updated the generator templates to include:
• Added rootDir configuration to project.json template
• Fixed package.json template paths to use flattened structure
• Corrected template syntax bug (missing space in <%= name %>)
This ensures all future libraries created with "nx generate @bitwarden/nx-plugin:basic-lib"
will have proper build configuration from the start, preventing regression of the
systematic rootDir issue.