blurts-server/tsconfig.json

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

101 строка
12 KiB
JSON
Исходник Обычный вид История

{
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts", "jest.setup.ts"],
"compilerOptions": {
/* Visit https://aka.ms/tsconfig to read more about this file */
/* Projects */
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
"incremental": true /* Save .tsbuildinfo files to allow for incremental compilation of projects. */, // "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */
// "tsBuildInfoFile": "./.tsbuildinfo", /* Specify the path to .tsbuildinfo incremental compilation file. */
// "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects. */
// "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */
// "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */
/* Language and Environment */
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
"target": "es2022" /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */, // "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */
"jsx": "preserve" /* Specify what JSX code is generated. */, // "experimentalDecorators": true, /* Enable experimental support for legacy experimental decorators. */
// "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */
// "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'. */
// "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */
// "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'. */
// "reactNamespace": "", /* Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit. */
// "noLib": true, /* Disable including any library files, including the default lib.d.ts. */
// "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */
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
"moduleDetection": "force" /* Control what method is used to detect module-format JS files. */ /* Modules */,
"module": "esnext" /* Specify what module code is generated. */,
// "rootDir": "./src/" /* Specify the root folder within your source files. */,
"moduleResolution": "node" /* Specify how TypeScript looks up a file from a given module specifier. */, // "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */
"plugins": [
{
"name": "next"
}
],
// "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */
// "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */
// "typeRoots": [], /* Specify multiple folders that act like './node_modules/@types'. */
// "types": [], /* Specify type package names to be included without being referenced in a source file. */
// "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
// "moduleSuffixes": [], /* List of file name suffixes to search when resolving a module. */
"allowImportingTsExtensions": true, /* Allow imports to include TypeScript file extensions. Requires '--moduleResolution bundler' and either '--noEmit' or '--emitDeclarationOnly' to be set. */
// "resolvePackageJsonExports": true, /* Use the package.json 'exports' field when resolving package imports. */
// "resolvePackageJsonImports": true, /* Use the package.json 'imports' field when resolving imports. */
// "customConditions": [], /* Conditions to set in addition to the resolver-specific defaults when resolving imports. */
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
"resolveJsonModule": true /* Enable importing .json files. */, // "allowArbitraryExtensions": true, /* Enable importing files with any extension, provided a declaration file is present. */
// "noResolve": true, /* Disallow 'import's, 'require's or '<reference>'s from expanding the number of files TypeScript should add to a project. */
/* JavaScript Support */
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
"allowJs": true /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */,
"checkJs": true /* Enable error reporting in type-checked JavaScript files. */, // "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */
/* Emit */
// "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */
// "declarationMap": true, /* Create sourcemaps for d.ts files. */
// "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */
// "sourceMap": true, /* Create source map files for emitted JavaScript files. */
// "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */
// "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */
// "outDir": "./", /* Specify an output folder for all emitted files. */
// "removeComments": true, /* Disable emitting comments. */
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
"noEmit": true /* Disable emitting files from a compilation. */, // "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */
// "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types. */
// "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */
// "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */
// "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */
// "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */
// "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */
// "newLine": "crlf", /* Set the newline character for emitting files. */
// "stripInternal": true, /* Disable emitting declarations that have '@internal' in their JSDoc comments. */
// "noEmitHelpers": true, /* Disable generating custom helper functions like '__extends' in compiled output. */
// "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */
// "preserveConstEnums": true, /* Disable erasing 'const enum' declarations in generated code. */
// "declarationDir": "./", /* Specify the output directory for generated declaration files. */
// "preserveValueImports": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */
/* Interop Constraints */
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
"isolatedModules": true /* Ensure that each file can be safely transpiled without relying on other imports. */, // "verbatimModuleSyntax": true, /* Do not transform or elide any imports or exports not marked as type-only, ensuring they are written in the output file's format based on the 'module' setting. */
// "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */
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
"esModuleInterop": true /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */, // "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */
"forceConsistentCasingInFileNames": true /* Ensure that casing is correct in imports. */ /* Type Checking */,
"strict": true /* Enable all strict type-checking options. */, // "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied 'any' type. */
// "strictNullChecks": true, /* When type checking, take into account 'null' and 'undefined'. */
// "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */
// "strictBindCallApply": true, /* Check that the arguments for 'bind', 'call', and 'apply' methods match the original function. */
// "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */
// "noImplicitThis": true, /* Enable error reporting when 'this' is given the type 'any'. */
// "useUnknownInCatchVariables": true, /* Default catch clause variables as 'unknown' instead of 'any'. */
// "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */
// "noUnusedLocals": true, /* Enable error reporting when local variables aren't read. */
// "noUnusedParameters": true, /* Raise an error when a function parameter isn't read. */
// "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */
// "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */
// "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */
// "noUncheckedIndexedAccess": true, /* Add 'undefined' to a type when accessed using an index. */
// "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */
// "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type. */
// "allowUnusedLabels": true, /* Disable error reporting for unused labels. */
// "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */
/* Completeness */
// "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */
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
"skipLibCheck": true /* Skip type checking all .d.ts files. */,
"lib": ["dom", "dom.iterable", "esnext"]
},
"exclude": [
"node_modules/",
"sentry.*.config.ts",
]
}