Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export default class PasswordStrengthBalloonModel extends Model {

_getCommonPasswordList() {
return import(
/* webpackChunkName: "fxa-common-password-list" */ 'fxa-common-password-list'
/* webpackChunkName: "common-password-list" */ '@fxa/vendored/common-password-list'
);
}

Expand Down
1 change: 0 additions & 1 deletion packages/fxa-content-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@
"fast-text-encoding": "^1.0.4",
"fxa-auth-client": "workspace:*",
"fxa-auth-server": "workspace:*",
"fxa-common-password-list": "0.0.4",
"fxa-geodb": "workspace:*",
"fxa-mustache-loader": "0.0.2",
"fxa-pairing-channel": "1.0.2",
Expand Down
8 changes: 8 additions & 0 deletions packages/fxa-content-server/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,14 @@ const webpackConfig = {
uuid: require.resolve('node-uuid/uuid'),
vat: require.resolve('node-vat/vat'),
'fxa-auth-client/browser': require.resolve('fxa-auth-client/browser'),
'@fxa/vendored/common-password-list': path.resolve(
__dirname,
'../../libs/vendored/common-password-list/src/index.ts'
),
'@fxa/vendored/incremental-encoder': path.resolve(
__dirname,
'../../libs/vendored/incremental-encoder/src/index.ts'
),
},
},

Expand Down
5 changes: 3 additions & 2 deletions packages/fxa-settings/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,9 @@
"@fxa/shared/metrics/glean": "<rootDir>/../../libs/shared/metrics/glean/src/index.ts",
"^@fxa/shared/assets(.*)$": "<rootDir>/../../libs/shared/assets/src$1",
"@fxa/accounts/errors": "<rootDir>/../../libs/accounts/errors/src/index.ts",
"@fxa/accounts/oauth": "<rootDir>/../../libs/accounts/oauth/src/index.ts"
"@fxa/accounts/oauth": "<rootDir>/../../libs/accounts/oauth/src/index.ts",
"@fxa/vendored/common-password-list": "<rootDir>/../../libs/vendored/common-password-list/src/index.ts",
"@fxa/vendored/incremental-encoder": "<rootDir>/../../libs/vendored/incremental-encoder/src/index.ts"
},
"moduleFileExtensions": [
"web.js",
Expand Down Expand Up @@ -155,7 +157,6 @@
"file-saver": "^2.0.5",
"fs-extra": "^11.2.0",
"fxa-auth-client": "workspace:*",
"fxa-common-password-list": "^0.0.4",
"fxa-react": "workspace:*",
"html-webpack-plugin": "^5.6.0",
"identity-obj-proxy": "^3.0.0",
Expand Down
7 changes: 4 additions & 3 deletions packages/fxa-settings/src/components/FormPassword/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -195,11 +195,12 @@ export const FormPassword = ({
return !passwordValidator.isSameAsEmail(value.toLowerCase());
},
uncommon: async (value: string) => {
// @ts-ignore
const list = await import('fxa-common-password-list');
const { test: isCommon } = await import(
'@fxa/vendored/common-password-list'
);
Comment on lines +198 to +200
Copy link

Copilot AI Mar 31, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same issue as in FormPasswordWithInlineCriteria: this import('@fxa/vendored/common-password-list') will fail under Jest/Node module resolution unless @fxa/vendored/* is mapped (workspaces are packages/*, so the vendored lib won’t exist in node_modules). Please ensure Jest can resolve @fxa/vendored/common-password-list (and @fxa/vendored/incremental-encoder) via moduleNameMapper or equivalent tsconfig-paths resolver setup.

Copilot uses AI. Check for mistakes.
const input = value.toLowerCase();
return (
!list.test(input) && !passwordValidator.isBanned(input)
!isCommon(input) && !passwordValidator.isBanned(input)
);
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -289,11 +289,12 @@ export const FormPasswordWithInlineCriteria = ({
);
},
uncommon: async (value: string) => {
// @ts-ignore
const list = await import('fxa-common-password-list');
const { test: isCommon } = await import(
'@fxa/vendored/common-password-list'
);
Comment on lines +292 to +294
Copy link

Copilot AI Mar 31, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This dynamic import('@fxa/vendored/common-password-list') will be executed in Jest (e.g., the FormPasswordWithInlineCriteria tests include a “disallows common passwords” case). Since @fxa/vendored/* libs are not Yarn workspaces (root workspaces are packages/* only), Jest won’t be able to resolve this module unless it’s mapped (e.g., via moduleNameMapper) or Jest is configured to honor tsconfig path aliases. Please add Jest resolution for @fxa/vendored/common-password-list (and its dependency @fxa/vendored/incremental-encoder) so tests/runtime under Node can load it.

Copilot uses AI. Check for mistakes.
const input = value.toLowerCase();
return (
!list.test(input) && !passwordValidator.isBanned(input)
!isCommon(input) && !passwordValidator.isBanned(input)
);
},
},
Expand Down
18 changes: 0 additions & 18 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -36481,15 +36481,6 @@ __metadata:
languageName: unknown
linkType: soft

"fxa-common-password-list@npm:0.0.4, fxa-common-password-list@npm:^0.0.4":
version: 0.0.4
resolution: "fxa-common-password-list@npm:0.0.4"
dependencies:
incremental-encoder: "npm:0.0.1"
checksum: 10c0/ec639effd2d14e5394fbaee29ccec032eab2bf43b15cea33732a0b158ea49733288c26a6dcaa9b7d028ff2c8cf17f48baa4e35e0a77dbf8d27551f0ec7c8b348
languageName: node
linkType: hard

"fxa-content-server@workspace:*, fxa-content-server@workspace:packages/fxa-content-server":
version: 0.0.0-use.local
resolution: "fxa-content-server@workspace:packages/fxa-content-server"
Expand Down Expand Up @@ -36534,7 +36525,6 @@ __metadata:
firefox-profile: "npm:4.7.0"
fxa-auth-client: "workspace:*"
fxa-auth-server: "workspace:*"
fxa-common-password-list: "npm:0.0.4"
fxa-geodb: "workspace:*"
fxa-mustache-loader: "npm:0.0.2"
fxa-pairing-channel: "npm:1.0.2"
Expand Down Expand Up @@ -37048,7 +37038,6 @@ __metadata:
file-saver: "npm:^2.0.5"
fs-extra: "npm:^11.2.0"
fxa-auth-client: "workspace:*"
fxa-common-password-list: "npm:^0.0.4"
fxa-react: "workspace:*"
fxa-shared: "workspace:*"
grunt: "npm:^1.6.1"
Expand Down Expand Up @@ -40061,13 +40050,6 @@ __metadata:
languageName: node
linkType: hard

"incremental-encoder@npm:0.0.1":
version: 0.0.1
resolution: "incremental-encoder@npm:0.0.1"
checksum: 10c0/646032c1ff35ee8556e55d6fbf817fcb172147f4442f5ed786f6b8845cb05e7cc0633ef3c22e57cbf758ac328aac69215d4126f093118e206047ef2a98a4fc66
languageName: node
linkType: hard

"indent-string@npm:^4.0.0":
version: 4.0.0
resolution: "indent-string@npm:4.0.0"
Expand Down
Loading