2018-01-15 13:56:08 +03:00
{
2023-04-21 01:25:51 +03:00
"name" : "monitor" ,
2022-05-11 02:17:52 +03:00
"version" : "1.0.0" ,
2023-04-25 02:28:16 +03:00
"description" : "Firefox Monitor" ,
2018-02-09 11:15:01 +03:00
"engines" : {
2024-09-10 19:40:08 +03:00
"node" : "20.9.x" ,
"npm" : "10.1.x"
2018-01-15 14:04:48 +03:00
} ,
Merge Next.js into `main` (#3116)
* Initialise Next.js app using create-next-app
Command run: npx create-next-app@latest
* Also tell VSCode to format TS and TSX files
* WIP: Sign in with next-auth
* Add Fluent
Unfortunately, since the ReactLocalization object contains
functions, it can't be shared between client and server (because
functions can't be serialized), so in effect every page that uses
localisation has to be a client component.
But at least we can set the correct `lang` attribute on <html> on
the server, so there's that :)
* Copy-paste public breach scan into Next.js
* Halfway migrate public breach list
Did not do: breach icons and getLocale() (for list and date
formatting).
* Enable SSR for localised strings
This allows our pages to be Server Components now.
* Download breach logos in Next.js server
* Tell search engines not to index non-prod envs
* Port existing security headers from Helmet to Next
* Add a 404 page
* Relax CSP in local development
* Set up Next-Auth for server components
It still doesn't work at the moment because the correct redirect
URL hasn't yet been set up on FxA.
* Apply Prettier to Next.js files on commit
* Enable Sass
* feat: Port existing landing page
* fix: Set hibp footer as html
* Wire up Next.js to FxA using iron-session
* feat: Port main layout for authenticated pages
* chore: Get session in layout
* Set up Prettier for VSCode users
* fix: Provide fxa user menu with data
* chore: Format Create Next App template
* Make Next-Auth work with FxA
To test, add the following two variables to your .env:
NEXTAUTH_URL=http://localhost:6060
NEXTAUTH_SECRET=<generate using `openssl rand -base64 32`>
You can then add <SignInButton/> to e.g. the landing page to kick
off authentication.
* Port breach-detail page to Next.js
* Add pending translations
* Access session data in React components
* Use Prettier as the formatter in VSCode
* Port Nebula & Protocol tokens into tokens file
* merge: Resolve conflicts
* fix: Move hr into li element
* feat: Handle authenticated users
* chore: Add todo note
* chore: Don’t use default exports for SignInButton and UserMenu
* chore: Move site navigation to client-side component
* Make mozlog work with Next.js
Unfortunately, this required patching the `intel` package. That
said, since that package hasn't been updated in six years, this
should be relatively safe.
The problem is that `intel` was trying to dynamically determine
which modules to load based on which files were present in its
directory. However, since Next.js moves (and presumably bundles)
Node modules into the `.next` folder, it was unable to find the
modules that `mozlog` was expecting to use.
The patch fixes this by simply explicitly importing those four
modules.
* Add back a couple of authentication logs
* add woff files and metropolis css file
* add right font path
* format scss file to include camelcase
* chore: Move components into (nextjs_migration) and remove redundant layout file
* chore: Remove redirect landing page -> dashboard
* chore: Redirect to dashboard upon signin
* add title and body copy variables
* use token variables in landing scss file instead of old variables from variables.css
* feat: Add basic dashboard page elements
* chore: Add circle chart web component
* chore: Add custom select web component
* breaches get and put calls
* cleanup
* get rid of debug logs
* Add sentry to nextJS branch (#3075)
MNTOR-1641 - enable Sentry for NextJS, for front- and back-end code
* chore: Render user breaches
* feat: Port breach resolution api
* fix: Check breach resolution filter by default
* chore: Add redirect /user/dashboard -> /user/breaches
* feat: Add breach page types
* chore: Remove breach resolution API call headers
* fix: Rename changed API response data key
* add template button component
* remove assets
* add button styling
* chore: Trigger auto signIn for pages that require authentication
* chore: Update breach types
* chore: Repurpose HIBP BreachDataTypes
* chore: Don’t capitalize first letter of chart label
* chore: Remove duplicate font size
* chore: Rename BreachResolutionApiBody -> BreachResolutionRequest
* Add a redirect from /security-tips for Next.js
This was already present in the Express-based website.
* Add the app shell for the React-based website
* chore: Re-enable gtag
* use old font code and add status pill component
* remove unnecessary package additions and style status pills
* lint
* test exposurecard data func
* MNTOR-1765 - set title, favicon, and meta tag correctly for nextjs app (#3082)
* Port unsubscribe-monthly page to Next.js
* add toggle to exposurecard accordion
* add icons to exposure type
* Ease transition from `getMessage`
This adds a `getStringLookup` API to ease the transition from old
Fluent functions (which depend on the user's locale being stored in
AsyncLocalStorage). It will behave the same as the old getMessage()
when called as-is, but when passed an instance of ReactLocalization
(which we have access to in Next.js routes), it will retrieve the
localised string from that.
* Add preliminary Subscriber table type definition
* Process new user sign-in
This does a couple of things:
- It updates the code that sends the breach check email on
first sign-in to pass an instance of ReactLocalization.
- It splits session data and JWT properties to separate data
provided to use by FxA from data we store in our own database.
- It checks if the user that signs in is already known in our
database, and if not, it adds them. It does so using mostly the
same code as in /src/controllers/auth.js's `confirmed` function.
* dockerflow endpoints
* remove introduction.mdx for now, refine button states
* apply some changes
* Move new components out of migration dir
* Delete .bash_profile
* Delete storybook.log
* Delete main.js
* Delete preview.js
* remove use of inter for now
* feat: add email api
* feat: remove email api
* verify email
* update comms options
* light refactoring
* take shared function out to util
* send verification email
* add another property to EmailRow
* add some types
* rename route
* fix review comment
* Fix MNTOR-1634: Stub /settings page (auth)
* Remove commented code, add CSS, match HTML markup from previous iterations
* Remove/comment out logic dependent on session info
* Wire up settings page and new APIs
* Work around radio button unchecking on page load
* Adding a catch all 404
Not ideal but the best solution at the moment
Co-authored-by: Vincent <Vinnl@users.noreply.github.com>
* version route
* remove log
* Port admin pages to Next.js
The Notification email doesn't work yet, because it's not clear yet
how to trigger the Cloud Function.
* Add Storybook build output folder to gitignore
* Set up Netlify
* Group Storybook ignores together
* add node env
Co-authored-by: Vincent <Vinnl@users.noreply.github.com>
* fix test
* fix npm test
* fix css lint
* fix lint js
* exclude sentry.*
* Set up the actual linting we'll use
* Prettier-ignore appropriate files, format the rest
* Fix/ignore ESLint and TypeScript errors
* Make tests work with getStringLookup
* Remove now-unused dependencies and build scripts
* Update CI scripts for Next.js
* Add missing Next.js dependencies to the lockfile
These were added when running `next build`.
* Tag Next.js migration TODOs
* Make "add email" dialog work on dashboard
* Load client-side scripts as modules
This is the same the old website did, and avoids e.g. different
`init` functions overriding each other.
* Fix loading of FxA avatar
* Use <BreachLogo> component
* Allow Next.js's inline scripts/styles in prod
For `style-src`, the current website already enables
'unsafe-inline'. For script-src, it looks like we currently cannot
avoid that: https://github.com/vercel/next.js/discussions/51039
* Debug Playwright (#3118)
---------
Co-authored-by: Florian Zia <zia.florian@gmail.com>
Co-authored-by: Kaitlyn <kandres@mozilla.com>
Co-authored-by: Joey Zhou <jozhou@mozilla.com>
Co-authored-by: Robert Helmer <rhelmer@mozilla.com>
Co-authored-by: maxxcrawford <maxx.crawford@gmail.com>
2023-06-12 23:35:35 +03:00
"type" : "module" ,
2018-02-08 02:29:41 +03:00
"scripts" : {
2024-04-30 17:06:40 +03:00
"dev" : "npm run build-nimbus && next dev --port=6060" ,
2024-07-09 13:11:28 +03:00
"dev:cron:first-data-broker-removal-fixed" : "tsx --tsconfig tsconfig.cronjobs.json src/scripts/cronjobs/firstDataBrokerRemovalFixed.tsx" ,
"dev:cron:monthly-activity" : "tsx --tsconfig tsconfig.cronjobs.json src/scripts/cronjobs/monthlyActivity.tsx" ,
2024-07-31 15:36:27 +03:00
"dev:cron:breach-alerts" : "tsx --tsconfig tsconfig.cronjobs.json src/scripts/cronjobs/emailBreachAlerts.tsx" ,
2024-07-09 13:11:28 +03:00
"dev:cron:db-delete-unverified-subscribers" : "tsx --tsconfig tsconfig.cronjobs.json src/scripts/cronjobs/deleteUnverifiedSubscribers.ts" ,
2024-07-15 15:19:41 +03:00
"dev:cron:db-pull-breaches" : "tsx --tsconfig tsconfig.cronjobs.json src/scripts/cronjobs/syncBreaches.ts" ,
2024-07-16 14:57:08 +03:00
"dev:cron:remote-settings-pull-breaches" : "tsx --tsconfig tsconfig.cronjobs.json src/scripts/cronjobs/updateBreachesInRemoteSettings.ts" ,
2024-07-10 16:04:14 +03:00
"dev:cron:onerep-limits-alert" : "tsx --tsconfig tsconfig.cronjobs.json src/scripts/cronjobs/onerepStatsAlert.ts" ,
2024-04-25 17:10:36 +03:00
"dev:nimbus" : "node --watch-path config/nimbus.yaml src/scripts/build/nimbusTypes.js" ,
Add a cron job for the monthly activity email
This this is running in plain Node (i.e. not with the Next.js
infrastructure), I had to make a couple of adjustments to some
existing files. Specifically, files with JSX code need to explicitly
import React, and code that shouldn't be run on the client-side
can't use `import "server-only"`, because that only checks that
it's being imported in a React server component.
Additionally, I've added esbuild to bundle it up into a single
file. Theoretically, this isn't really needed for Node.js scripts,
since there are no HTTP requests we're trying to optimise. However,
plain Node.js can't resolve module imports without file extensions
(e.g. `"../db/tables/subscribers"`), so all import specifiers in
*any* module that gets loaded by the cron jobs would need to use
file extensions that match those of the generated files (i.e. .js
rather than .ts), which is bound to cause its own issues in
Next.js. Thus, esbuild is a compromise that can resolve these
import specifiers for us.
2024-04-02 16:52:52 +03:00
"build" : "npm run get-location-data && npm run build-glean && npm run build-nimbus && next build && npm run build-cronjobs" ,
2024-05-02 20:48:17 +03:00
"cloudrun" : "npm run db:migrate && npm start" ,
2023-06-21 23:38:46 +03:00
"start" : "next start" ,
2024-07-24 17:07:43 +03:00
"lint" : "stylelint '**/*.scss' && prettier --check './src' && next lint --max-warnings=0 && tsc -p tsconfig.json --noEmit && npm run validate-nimbus" ,
2023-06-27 19:56:11 +03:00
"fix" : "prettier --write './src' && next lint --fix && stylelint --fix '**/*.scss'" ,
2024-07-10 12:19:10 +03:00
"test" : "npm run build-nimbus && jest" ,
Merge Next.js into `main` (#3116)
* Initialise Next.js app using create-next-app
Command run: npx create-next-app@latest
* Also tell VSCode to format TS and TSX files
* WIP: Sign in with next-auth
* Add Fluent
Unfortunately, since the ReactLocalization object contains
functions, it can't be shared between client and server (because
functions can't be serialized), so in effect every page that uses
localisation has to be a client component.
But at least we can set the correct `lang` attribute on <html> on
the server, so there's that :)
* Copy-paste public breach scan into Next.js
* Halfway migrate public breach list
Did not do: breach icons and getLocale() (for list and date
formatting).
* Enable SSR for localised strings
This allows our pages to be Server Components now.
* Download breach logos in Next.js server
* Tell search engines not to index non-prod envs
* Port existing security headers from Helmet to Next
* Add a 404 page
* Relax CSP in local development
* Set up Next-Auth for server components
It still doesn't work at the moment because the correct redirect
URL hasn't yet been set up on FxA.
* Apply Prettier to Next.js files on commit
* Enable Sass
* feat: Port existing landing page
* fix: Set hibp footer as html
* Wire up Next.js to FxA using iron-session
* feat: Port main layout for authenticated pages
* chore: Get session in layout
* Set up Prettier for VSCode users
* fix: Provide fxa user menu with data
* chore: Format Create Next App template
* Make Next-Auth work with FxA
To test, add the following two variables to your .env:
NEXTAUTH_URL=http://localhost:6060
NEXTAUTH_SECRET=<generate using `openssl rand -base64 32`>
You can then add <SignInButton/> to e.g. the landing page to kick
off authentication.
* Port breach-detail page to Next.js
* Add pending translations
* Access session data in React components
* Use Prettier as the formatter in VSCode
* Port Nebula & Protocol tokens into tokens file
* merge: Resolve conflicts
* fix: Move hr into li element
* feat: Handle authenticated users
* chore: Add todo note
* chore: Don’t use default exports for SignInButton and UserMenu
* chore: Move site navigation to client-side component
* Make mozlog work with Next.js
Unfortunately, this required patching the `intel` package. That
said, since that package hasn't been updated in six years, this
should be relatively safe.
The problem is that `intel` was trying to dynamically determine
which modules to load based on which files were present in its
directory. However, since Next.js moves (and presumably bundles)
Node modules into the `.next` folder, it was unable to find the
modules that `mozlog` was expecting to use.
The patch fixes this by simply explicitly importing those four
modules.
* Add back a couple of authentication logs
* add woff files and metropolis css file
* add right font path
* format scss file to include camelcase
* chore: Move components into (nextjs_migration) and remove redundant layout file
* chore: Remove redirect landing page -> dashboard
* chore: Redirect to dashboard upon signin
* add title and body copy variables
* use token variables in landing scss file instead of old variables from variables.css
* feat: Add basic dashboard page elements
* chore: Add circle chart web component
* chore: Add custom select web component
* breaches get and put calls
* cleanup
* get rid of debug logs
* Add sentry to nextJS branch (#3075)
MNTOR-1641 - enable Sentry for NextJS, for front- and back-end code
* chore: Render user breaches
* feat: Port breach resolution api
* fix: Check breach resolution filter by default
* chore: Add redirect /user/dashboard -> /user/breaches
* feat: Add breach page types
* chore: Remove breach resolution API call headers
* fix: Rename changed API response data key
* add template button component
* remove assets
* add button styling
* chore: Trigger auto signIn for pages that require authentication
* chore: Update breach types
* chore: Repurpose HIBP BreachDataTypes
* chore: Don’t capitalize first letter of chart label
* chore: Remove duplicate font size
* chore: Rename BreachResolutionApiBody -> BreachResolutionRequest
* Add a redirect from /security-tips for Next.js
This was already present in the Express-based website.
* Add the app shell for the React-based website
* chore: Re-enable gtag
* use old font code and add status pill component
* remove unnecessary package additions and style status pills
* lint
* test exposurecard data func
* MNTOR-1765 - set title, favicon, and meta tag correctly for nextjs app (#3082)
* Port unsubscribe-monthly page to Next.js
* add toggle to exposurecard accordion
* add icons to exposure type
* Ease transition from `getMessage`
This adds a `getStringLookup` API to ease the transition from old
Fluent functions (which depend on the user's locale being stored in
AsyncLocalStorage). It will behave the same as the old getMessage()
when called as-is, but when passed an instance of ReactLocalization
(which we have access to in Next.js routes), it will retrieve the
localised string from that.
* Add preliminary Subscriber table type definition
* Process new user sign-in
This does a couple of things:
- It updates the code that sends the breach check email on
first sign-in to pass an instance of ReactLocalization.
- It splits session data and JWT properties to separate data
provided to use by FxA from data we store in our own database.
- It checks if the user that signs in is already known in our
database, and if not, it adds them. It does so using mostly the
same code as in /src/controllers/auth.js's `confirmed` function.
* dockerflow endpoints
* remove introduction.mdx for now, refine button states
* apply some changes
* Move new components out of migration dir
* Delete .bash_profile
* Delete storybook.log
* Delete main.js
* Delete preview.js
* remove use of inter for now
* feat: add email api
* feat: remove email api
* verify email
* update comms options
* light refactoring
* take shared function out to util
* send verification email
* add another property to EmailRow
* add some types
* rename route
* fix review comment
* Fix MNTOR-1634: Stub /settings page (auth)
* Remove commented code, add CSS, match HTML markup from previous iterations
* Remove/comment out logic dependent on session info
* Wire up settings page and new APIs
* Work around radio button unchecking on page load
* Adding a catch all 404
Not ideal but the best solution at the moment
Co-authored-by: Vincent <Vinnl@users.noreply.github.com>
* version route
* remove log
* Port admin pages to Next.js
The Notification email doesn't work yet, because it's not clear yet
how to trigger the Cloud Function.
* Add Storybook build output folder to gitignore
* Set up Netlify
* Group Storybook ignores together
* add node env
Co-authored-by: Vincent <Vinnl@users.noreply.github.com>
* fix test
* fix npm test
* fix css lint
* fix lint js
* exclude sentry.*
* Set up the actual linting we'll use
* Prettier-ignore appropriate files, format the rest
* Fix/ignore ESLint and TypeScript errors
* Make tests work with getStringLookup
* Remove now-unused dependencies and build scripts
* Update CI scripts for Next.js
* Add missing Next.js dependencies to the lockfile
These were added when running `next build`.
* Tag Next.js migration TODOs
* Make "add email" dialog work on dashboard
* Load client-side scripts as modules
This is the same the old website did, and avoids e.g. different
`init` functions overriding each other.
* Fix loading of FxA avatar
* Use <BreachLogo> component
* Allow Next.js's inline scripts/styles in prod
For `style-src`, the current website already enables
'unsafe-inline'. For script-src, it looks like we currently cannot
avoid that: https://github.com/vercel/next.js/discussions/51039
* Debug Playwright (#3118)
---------
Co-authored-by: Florian Zia <zia.florian@gmail.com>
Co-authored-by: Kaitlyn <kandres@mozilla.com>
Co-authored-by: Joey Zhou <jozhou@mozilla.com>
Co-authored-by: Robert Helmer <rhelmer@mozilla.com>
Co-authored-by: maxxcrawford <maxx.crawford@gmail.com>
2023-06-12 23:35:35 +03:00
"e2e" : "playwright test src/e2e/" ,
2023-08-25 16:24:27 +03:00
"e2e:debug" : "playwright test src/e2e/ --ui" ,
2023-08-30 17:10:58 +03:00
"e2e:smoke" : "playwright test src/e2e/ --grep @smoke" ,
2024-06-01 21:33:06 +03:00
"cron:first-data-broker-removal-fixed" : "node dist/scripts/cronjobs/firstDataBrokerRemovalFixed.js" ,
2024-05-02 19:21:49 +03:00
"cron:monthly-activity" : "node dist/scripts/cronjobs/monthlyActivity.js" ,
2024-07-18 11:01:47 +03:00
"cron:breach-alerts" : "node dist/scripts/cronjobs/emailBreachAlerts.js" ,
2024-07-09 13:11:28 +03:00
"cron:db-delete-unverified-subscribers" : "node dist/scripts/cronjobs/deleteUnverifiedSubscribers.js" ,
2024-07-15 15:19:41 +03:00
"cron:db-pull-breaches" : "node dist/scripts/cronjobs/syncBreaches.js" ,
2024-07-16 14:57:08 +03:00
"cron:remote-settings-pull-breaches" : "node dist/scripts/cronjobs/updateBreachesInRemoteSettings.js" ,
2024-07-10 16:04:14 +03:00
"cron:onerep-limits-alert" : "node dist/scripts/cronjobs/onerepStatsAlert.js" ,
Adopt .env.local file
This makes it clearer what variables actually need to be set
locally, and which have been forgotten. It also makes the build
simpler, by removing the need to copy the .env-dist file.
This should be safe to apply, since .env-dist already got loaded by
default, just like .env now is. And it is still the case that
actual environment variables overwrite the ones in the .env file.
For non-Next.js setups (e.g. cron jobs or database migrations), I
switched to dotenv-flow. The regular dotenv explicitly avoids
inheritance [1], because it wants environment variables to be
specific to an environment. That was already not the case with most
of our environment variables, so the switch makes sense for us.
Next steps could be to remove unused variables from .env, and
possibly moving variables with local/stage-specific values to
.env.local.example, though that riskier, since environments might
depend on those being present.
[1]
https://www.npmjs.com/package/dotenv#should-i-have-multiple-env-files
2024-07-02 17:01:52 +03:00
"db:migrate" : "node -r dotenv-flow/config node_modules/knex/bin/cli.js migrate:latest --knexfile src/db/knexfile.js" ,
"db:rollback" : "node -r dotenv-flow/config node_modules/knex/bin/cli.js migrate:rollback --knexfile src/db/knexfile.js" ,
2024-06-18 22:38:02 +03:00
"prepare" : "husky" ,
Merge Next.js into `main` (#3116)
* Initialise Next.js app using create-next-app
Command run: npx create-next-app@latest
* Also tell VSCode to format TS and TSX files
* WIP: Sign in with next-auth
* Add Fluent
Unfortunately, since the ReactLocalization object contains
functions, it can't be shared between client and server (because
functions can't be serialized), so in effect every page that uses
localisation has to be a client component.
But at least we can set the correct `lang` attribute on <html> on
the server, so there's that :)
* Copy-paste public breach scan into Next.js
* Halfway migrate public breach list
Did not do: breach icons and getLocale() (for list and date
formatting).
* Enable SSR for localised strings
This allows our pages to be Server Components now.
* Download breach logos in Next.js server
* Tell search engines not to index non-prod envs
* Port existing security headers from Helmet to Next
* Add a 404 page
* Relax CSP in local development
* Set up Next-Auth for server components
It still doesn't work at the moment because the correct redirect
URL hasn't yet been set up on FxA.
* Apply Prettier to Next.js files on commit
* Enable Sass
* feat: Port existing landing page
* fix: Set hibp footer as html
* Wire up Next.js to FxA using iron-session
* feat: Port main layout for authenticated pages
* chore: Get session in layout
* Set up Prettier for VSCode users
* fix: Provide fxa user menu with data
* chore: Format Create Next App template
* Make Next-Auth work with FxA
To test, add the following two variables to your .env:
NEXTAUTH_URL=http://localhost:6060
NEXTAUTH_SECRET=<generate using `openssl rand -base64 32`>
You can then add <SignInButton/> to e.g. the landing page to kick
off authentication.
* Port breach-detail page to Next.js
* Add pending translations
* Access session data in React components
* Use Prettier as the formatter in VSCode
* Port Nebula & Protocol tokens into tokens file
* merge: Resolve conflicts
* fix: Move hr into li element
* feat: Handle authenticated users
* chore: Add todo note
* chore: Don’t use default exports for SignInButton and UserMenu
* chore: Move site navigation to client-side component
* Make mozlog work with Next.js
Unfortunately, this required patching the `intel` package. That
said, since that package hasn't been updated in six years, this
should be relatively safe.
The problem is that `intel` was trying to dynamically determine
which modules to load based on which files were present in its
directory. However, since Next.js moves (and presumably bundles)
Node modules into the `.next` folder, it was unable to find the
modules that `mozlog` was expecting to use.
The patch fixes this by simply explicitly importing those four
modules.
* Add back a couple of authentication logs
* add woff files and metropolis css file
* add right font path
* format scss file to include camelcase
* chore: Move components into (nextjs_migration) and remove redundant layout file
* chore: Remove redirect landing page -> dashboard
* chore: Redirect to dashboard upon signin
* add title and body copy variables
* use token variables in landing scss file instead of old variables from variables.css
* feat: Add basic dashboard page elements
* chore: Add circle chart web component
* chore: Add custom select web component
* breaches get and put calls
* cleanup
* get rid of debug logs
* Add sentry to nextJS branch (#3075)
MNTOR-1641 - enable Sentry for NextJS, for front- and back-end code
* chore: Render user breaches
* feat: Port breach resolution api
* fix: Check breach resolution filter by default
* chore: Add redirect /user/dashboard -> /user/breaches
* feat: Add breach page types
* chore: Remove breach resolution API call headers
* fix: Rename changed API response data key
* add template button component
* remove assets
* add button styling
* chore: Trigger auto signIn for pages that require authentication
* chore: Update breach types
* chore: Repurpose HIBP BreachDataTypes
* chore: Don’t capitalize first letter of chart label
* chore: Remove duplicate font size
* chore: Rename BreachResolutionApiBody -> BreachResolutionRequest
* Add a redirect from /security-tips for Next.js
This was already present in the Express-based website.
* Add the app shell for the React-based website
* chore: Re-enable gtag
* use old font code and add status pill component
* remove unnecessary package additions and style status pills
* lint
* test exposurecard data func
* MNTOR-1765 - set title, favicon, and meta tag correctly for nextjs app (#3082)
* Port unsubscribe-monthly page to Next.js
* add toggle to exposurecard accordion
* add icons to exposure type
* Ease transition from `getMessage`
This adds a `getStringLookup` API to ease the transition from old
Fluent functions (which depend on the user's locale being stored in
AsyncLocalStorage). It will behave the same as the old getMessage()
when called as-is, but when passed an instance of ReactLocalization
(which we have access to in Next.js routes), it will retrieve the
localised string from that.
* Add preliminary Subscriber table type definition
* Process new user sign-in
This does a couple of things:
- It updates the code that sends the breach check email on
first sign-in to pass an instance of ReactLocalization.
- It splits session data and JWT properties to separate data
provided to use by FxA from data we store in our own database.
- It checks if the user that signs in is already known in our
database, and if not, it adds them. It does so using mostly the
same code as in /src/controllers/auth.js's `confirmed` function.
* dockerflow endpoints
* remove introduction.mdx for now, refine button states
* apply some changes
* Move new components out of migration dir
* Delete .bash_profile
* Delete storybook.log
* Delete main.js
* Delete preview.js
* remove use of inter for now
* feat: add email api
* feat: remove email api
* verify email
* update comms options
* light refactoring
* take shared function out to util
* send verification email
* add another property to EmailRow
* add some types
* rename route
* fix review comment
* Fix MNTOR-1634: Stub /settings page (auth)
* Remove commented code, add CSS, match HTML markup from previous iterations
* Remove/comment out logic dependent on session info
* Wire up settings page and new APIs
* Work around radio button unchecking on page load
* Adding a catch all 404
Not ideal but the best solution at the moment
Co-authored-by: Vincent <Vinnl@users.noreply.github.com>
* version route
* remove log
* Port admin pages to Next.js
The Notification email doesn't work yet, because it's not clear yet
how to trigger the Cloud Function.
* Add Storybook build output folder to gitignore
* Set up Netlify
* Group Storybook ignores together
* add node env
Co-authored-by: Vincent <Vinnl@users.noreply.github.com>
* fix test
* fix npm test
* fix css lint
* fix lint js
* exclude sentry.*
* Set up the actual linting we'll use
* Prettier-ignore appropriate files, format the rest
* Fix/ignore ESLint and TypeScript errors
* Make tests work with getStringLookup
* Remove now-unused dependencies and build scripts
* Update CI scripts for Next.js
* Add missing Next.js dependencies to the lockfile
These were added when running `next build`.
* Tag Next.js migration TODOs
* Make "add email" dialog work on dashboard
* Load client-side scripts as modules
This is the same the old website did, and avoids e.g. different
`init` functions overriding each other.
* Fix loading of FxA avatar
* Use <BreachLogo> component
* Allow Next.js's inline scripts/styles in prod
For `style-src`, the current website already enables
'unsafe-inline'. For script-src, it looks like we currently cannot
avoid that: https://github.com/vercel/next.js/discussions/51039
* Debug Playwright (#3118)
---------
Co-authored-by: Florian Zia <zia.florian@gmail.com>
Co-authored-by: Kaitlyn <kandres@mozilla.com>
Co-authored-by: Joey Zhou <jozhou@mozilla.com>
Co-authored-by: Robert Helmer <rhelmer@mozilla.com>
Co-authored-by: maxxcrawford <maxx.crawford@gmail.com>
2023-06-12 23:35:35 +03:00
"storybook" : "storybook dev -p 6006" ,
2024-04-30 13:07:00 +03:00
"build-storybook" : "npm run build-glean && npm run build-nimbus && storybook build" ,
2024-04-24 17:47:09 +03:00
"create-location-data" : "node src/scripts/build/uploadAutoCompleteLocations.js" ,
"get-location-data" : "node src/scripts/build/getAutoCompleteLocations.js" ,
Add a cron job for the monthly activity email
This this is running in plain Node (i.e. not with the Next.js
infrastructure), I had to make a couple of adjustments to some
existing files. Specifically, files with JSX code need to explicitly
import React, and code that shouldn't be run on the client-side
can't use `import "server-only"`, because that only checks that
it's being imported in a React server component.
Additionally, I've added esbuild to bundle it up into a single
file. Theoretically, this isn't really needed for Node.js scripts,
since there are no HTTP requests we're trying to optimise. However,
plain Node.js can't resolve module imports without file extensions
(e.g. `"../db/tables/subscribers"`), so all import specifiers in
*any* module that gets loaded by the cron jobs would need to use
file extensions that match those of the generated files (i.e. .js
rather than .ts), which is bound to cause its own issues in
Next.js. Thus, esbuild is a compromise that can resolve these
import specifiers for us.
2024-04-02 16:52:52 +03:00
"build-cronjobs" : "node esbuild.cronjobs.js" ,
2024-04-25 14:41:39 +03:00
"build-nimbus" : "node src/scripts/build/nimbusTypes.js" ,
2024-06-27 20:54:22 +03:00
"build-frontend-glean" : "glean translate src/telemetry/metrics.yaml --format typescript --output src/telemetry/generated && npm run build-glean-types" ,
"build-backend-glean" : "glean translate src/telemetry/backend-metrics.yaml --format typescript --output src/telemetry/generated/backend && npm run build-glean-types" ,
"build-glean" : "npm run build-frontend-glean && npm run build-backend-glean && npm run build-glean-types" ,
2024-04-24 17:47:09 +03:00
"build-glean-types" : "node src/scripts/build/gleanTypes.js" ,
2024-06-27 20:37:07 +03:00
"build-glean-docs" : "npm run build-glean-frontend-docs && npm run build-glean-backend-docs" ,
"build-glean-frontend-docs" : "glean translate src/telemetry/metrics.yaml --format markdown --output docs/telemetry/frontent" ,
2024-07-24 17:07:43 +03:00
"build-glean-backend-docs" : "glean translate src/telemetry/backend-metrics.yaml --format markdown --output docs/telemetry/backend" ,
2024-09-16 15:49:44 +03:00
"loadtest:hbibp-webhook" : "echo 'Ensure k6 is installed; see:\n\thttps://grafana.com/docs/k6/latest/set-up/install-k6/\n' && k6 run src/scripts/loadtest/hibp.js" ,
2024-08-08 12:31:00 +03:00
"validate-nimbus" : "sh src/scripts/build/validate-nimbus-file.sh"
2022-10-10 22:45:47 +03:00
} ,
2023-04-21 01:25:51 +03:00
"repository" : {
"type" : "git" ,
"url" : "git+https://github.com/mozilla/blurts-server.git"
2022-10-10 22:45:47 +03:00
} ,
2023-04-21 01:25:51 +03:00
"homepage" : "https://github.com/mozilla/blurts-server" ,
"license" : "MPL-2.0" ,
2023-02-09 21:32:58 +03:00
"volta" : {
2024-09-10 19:40:08 +03:00
"node" : "20.9.0" ,
"npm" : "10.1.0"
2023-04-21 01:25:51 +03:00
} ,
"dependencies" : {
2024-09-16 19:45:12 +03:00
"@aws-sdk/client-s3" : "^3.651.1" ,
"@aws-sdk/lib-storage" : "^3.651.1" ,
2023-10-11 18:40:04 +03:00
"@fluent/bundle" : "^0.18.0" ,
2023-10-12 09:48:03 +03:00
"@fluent/langneg" : "^0.7.0" ,
2023-10-16 11:23:58 +03:00
"@fluent/react" : "^0.15.2" ,
2023-10-17 21:22:16 +03:00
"@google-cloud/logging-winston" : "^6.0.0" ,
2024-09-16 21:25:04 +03:00
"@google-cloud/pubsub" : "^4.7.2" ,
2024-09-16 19:39:29 +03:00
"@grpc/grpc-js" : "1.11.2" ,
2024-01-01 15:34:30 +03:00
"@leeoniya/ufuzzy" : "^1.0.14" ,
2024-05-23 19:32:01 +03:00
"@mozilla/glean" : "^5.0.2" ,
2024-09-10 01:40:01 +03:00
"@next/third-parties" : "^14.2.9" ,
2024-09-10 20:06:00 +03:00
"@sentry/nextjs" : "^8.30.0" ,
2024-05-13 19:18:49 +03:00
"@sentry/node" : "^8.0.0" ,
2024-05-14 06:09:31 +03:00
"@sentry/utils" : "^8.0.0" ,
2024-07-31 01:14:07 +03:00
"@stripe/stripe-js" : "^4.1.0" ,
2024-07-01 17:03:21 +03:00
"@types/jsdom" : "^21.1.7" ,
2024-09-16 19:50:34 +03:00
"@types/node" : "^22.5.5" ,
2024-09-02 19:16:53 +03:00
"@types/react" : "^18.3.5" ,
2024-08-01 11:47:17 +03:00
"@types/react-dom" : "^18.3.0" ,
2024-05-07 15:40:35 +03:00
"canvas-confetti" : "^1.9.3" ,
Adopt .env.local file
This makes it clearer what variables actually need to be set
locally, and which have been forgotten. It also makes the build
simpler, by removing the need to copy the .env-dist file.
This should be safe to apply, since .env-dist already got loaded by
default, just like .env now is. And it is still the case that
actual environment variables overwrite the ones in the .env file.
For non-Next.js setups (e.g. cron jobs or database migrations), I
switched to dotenv-flow. The regular dotenv explicitly avoids
inheritance [1], because it wants environment variables to be
specific to an environment. That was already not the case with most
of our environment variables, so the switch makes sense for us.
Next steps could be to remove unused variables from .env, and
possibly moving variables with local/stage-specific values to
.env.local.example, though that riskier, since environments might
depend on those being present.
[1]
https://www.npmjs.com/package/dotenv#should-i-have-multiple-env-files
2024-07-02 17:01:52 +03:00
"dotenv-flow" : "^4.1.0" ,
2024-09-10 01:40:01 +03:00
"eslint-config-next" : "^14.2.9" ,
2024-08-09 17:40:35 +03:00
"ioredis" : "^5.4.1" ,
2024-07-29 23:48:43 +03:00
"jsdom" : "^24.1.1" ,
2023-10-19 10:54:31 +03:00
"jsonwebtoken" : "^9.0.2" ,
2023-04-28 09:09:35 +03:00
"jwk-to-pem" : "^2.0.5" ,
2023-12-12 19:51:24 +03:00
"knex" : "^3.1.0" ,
2024-03-22 18:32:08 +03:00
"mjml" : "^4.15.3" ,
2024-09-10 01:40:01 +03:00
"next" : "^14.2.9" ,
2024-05-07 16:09:51 +03:00
"next-auth" : "^4.24.7" ,
2024-06-28 19:45:30 +03:00
"nodemailer" : "^6.9.14" ,
2024-07-29 14:58:56 +03:00
"pg" : "^8.12.0" ,
2024-08-01 11:47:17 +03:00
"react" : "^18.3.1" ,
2024-08-27 18:03:21 +03:00
"react-aria" : "^3.34.3" ,
2024-08-05 18:06:54 +03:00
"react-cookie" : "^7.2.0" ,
2024-08-01 11:47:17 +03:00
"react-dom" : "^18.3.1" ,
2024-08-05 17:34:37 +03:00
"react-intersection-observer" : "^9.13.0" ,
2024-08-27 18:03:21 +03:00
"react-stately" : "^3.32.2" ,
2024-09-13 18:19:20 +03:00
"react-toastify" : "^10.0.5" ,
2023-12-13 18:50:28 +03:00
"server-only" : "^0.0.1" ,
2024-08-05 19:14:28 +03:00
"uuid" : "^10.0.0" ,
2024-08-26 14:38:09 +03:00
"winston" : "^3.14.2"
2023-04-21 01:25:51 +03:00
} ,
"devDependencies" : {
2024-09-16 21:36:21 +03:00
"@faker-js/faker" : "^9.0.1" ,
2024-09-16 21:04:49 +03:00
"@playwright/test" : "^1.47.1" ,
2024-08-19 10:10:44 +03:00
"@storybook/addon-a11y" : "^8.2.9" ,
"@storybook/addon-actions" : "^8.2.9" ,
"@storybook/addon-essentials" : "^8.2.9" ,
"@storybook/addon-interactions" : "^8.2.9" ,
"@storybook/addon-links" : "^8.2.9" ,
"@storybook/nextjs" : "^8.2.9" ,
2024-03-18 15:29:12 +03:00
"@storybook/react" : "^8.0.0" ,
2024-09-02 20:03:42 +03:00
"@testing-library/jest-dom" : "^6.5.0" ,
2024-09-02 19:56:57 +03:00
"@testing-library/react" : "^16.0.1" ,
2024-01-01 14:59:23 +03:00
"@testing-library/user-event" : "^14.5.2" ,
2023-11-27 15:22:16 +03:00
"@types/adm-zip" : "^0.5.5" ,
2023-12-04 15:39:05 +03:00
"@types/canvas-confetti" : "^1.6.4" ,
2023-11-27 15:18:07 +03:00
"@types/jest-axe" : "^3.5.9" ,
2024-05-07 15:51:43 +03:00
"@types/jsonwebtoken" : "^9.0.6" ,
2023-11-20 14:00:34 +03:00
"@types/jwk-to-pem" : "^2.0.3" ,
2024-09-09 14:52:00 +03:00
"@types/k6" : "^0.53.1" ,
2024-03-22 18:32:08 +03:00
"@types/mjml" : "^4.7.4" ,
"@types/mjml-browser" : "^4.15.0" ,
2024-05-07 17:13:32 +03:00
"@types/nodemailer" : "^6.4.15" ,
2024-08-05 19:14:28 +03:00
"@types/uuid" : "^10.0.0" ,
2024-04-02 11:12:59 +03:00
"@typescript-eslint/eslint-plugin" : "^7.5.0" ,
"@typescript-eslint/parser" : "^7.5.0" ,
2024-09-02 14:11:40 +03:00
"adm-zip" : "^0.5.16" ,
2024-08-19 15:11:34 +03:00
"esbuild" : "0.23.1" ,
2024-02-26 12:26:50 +03:00
"eslint" : "^8.57.0" ,
2023-09-25 10:33:04 +03:00
"eslint-import-resolver-typescript" : "^3.6.1" ,
2024-02-26 12:26:50 +03:00
"eslint-plugin-check-file" : "^2.7.1" ,
2023-04-21 01:25:51 +03:00
"eslint-plugin-header" : "^3.1.1" ,
2023-12-18 15:22:32 +03:00
"eslint-plugin-import" : "^2.29.1" ,
2024-02-19 14:07:04 +03:00
"eslint-plugin-jest" : "^27.9.0" ,
2024-04-02 11:12:59 +03:00
"eslint-plugin-jsdoc" : "^48.2.2" ,
2024-09-10 01:39:27 +03:00
"fast-check" : "^3.22.0" ,
2024-09-16 21:19:12 +03:00
"husky" : "^9.1.6" ,
2024-08-09 19:46:21 +03:00
"ioredis-mock" : "^8.9.0" ,
2023-09-25 15:23:40 +03:00
"jest" : "^29.7.0" ,
2024-06-11 19:05:59 +03:00
"jest-axe" : "^9.0.0" ,
2023-11-17 16:38:40 +03:00
"jest-canvas-mock" : "^2.5.2" ,
2023-09-25 15:23:40 +03:00
"jest-environment-jsdom" : "^29.7.0" ,
2024-05-20 22:00:36 +03:00
"jest-fail-on-console" : "^3.3.0" ,
2024-09-02 19:23:06 +03:00
"lint-staged" : "^15.2.10" ,
2024-03-22 18:32:08 +03:00
"mjml-browser" : "^4.15.3" ,
2024-07-22 15:09:36 +03:00
"prettier" : "3.3.3" ,
2024-07-30 01:33:15 +03:00
"sass" : "^1.77.8" ,
2024-07-01 14:58:10 +03:00
"storybook" : "^8.1.11" ,
2024-09-02 19:35:39 +03:00
"stylelint" : "^16.9.0" ,
2024-07-15 15:14:29 +03:00
"stylelint-config-recommended-scss" : "^14.1.0" ,
2024-08-27 17:49:56 +03:00
"stylelint-scss" : "^6.5.1" ,
2024-09-16 21:30:33 +03:00
"tsx" : "^4.19.1" ,
2024-09-16 19:56:31 +03:00
"typescript" : "^5.6.2" ,
2024-09-12 13:51:18 +03:00
"universal-cookie" : "^7.2.0" ,
2024-08-12 14:13:47 +03:00
"yaml" : "^2.5.0"
2023-02-09 21:32:58 +03:00
}
2022-10-10 22:45:47 +03:00
}