Граф коммитов

19 Коммитов

Автор SHA1 Сообщение Дата
Reino Muhl f47d120d71
feat(libs): convert libs/* to esbuild and swc/jest
Because:

- ts-jest is consuming too much memory during unit test execution

This commit:

- Replace ts-jest with @swc/jest, which has better memory utilization
- Replace Nx TSC build executor with Nx esbuild build executor, for better performance.
- Reduce size of unit-test job instance size from large back to medium+

Closes #FXA-9879
2024-06-27 15:28:55 -04:00
Reino Muhl ab8ae37229
feat(next): update payments-next build and restart
Because:

- Starting and restarting payments-next takes a long time due to always
  building the app first, which isn't necessary during development.
- When changes are made to NestApp or its dependencies, these are not
  hot reloaded by Next.js, requiring a full Next.js restart.

This commit:

- Adopt Nx plugin for Next.js which more closely aligns with Next.js
  standard dev commands.
- Retained Nx Next.js executors for build, since it more closely fits
  into the current FxA build and deploy CI logic.
- Added a watcher to NestApp which calls a NestApp restart api, only
  available in development, to restart the NestApp on any changes.
- Adds a function to get the NestApp, instead of a const, thus ensuring,
  in dev mode, the latest NestApp is always returned.

Closes #FXA-9706
2024-06-18 10:45:04 -04:00
dschom 8b9051f881
task(graphql): Send notifications when users opt in/out of metrics collection
Because:
- We want to let RPs know when users opt out of metrics collection
- We want to let RPs know when users opt in to metrics collection

This Commit:
- Ports the notifier code over to nx libs from auth server
- Ports other supporting libraries from fxa-shared to nx libs
  - MozLoggerService
  - Sentry
  - Metrics (ie statsd)
- Updates graphql to emit a 'metricsChange' event when users toggle their 'Help improve Mozilla accounts' option in settings.
- Adds support for the metricsChanged event to the fxa-event-broker
2024-04-24 08:10:14 -07:00
Reino Muhl 6f931ebe47
Remove linter plugin from nxjson 2024-04-15 12:49:46 -04:00
Reino Muhl c595afe4f3
feat(next): create setupCart server action
Because:

* Call CartService.setupCart from payments-next via server action.

This commit:

* Extracts fxa-geodb into libs/* library
* Updates CartService to include GeodbManager
* Call setupCart from payments-next

Closes #FXA-8892
2024-04-15 12:48:35 -04:00
Reino Muhl 2df7ca494a
chore(nx): upgrade to nx 18
Because:

* Want to migrate Nx to latest

This commit:

* Migrate nx to 18 using nx cli migrate latest
* Readd a few dev dependancies back into packages/**/package.json
  * Behavior of `npx nx...` commands seems to have changed, resulting in
    multiple "command not found: <library>" errors, where <library>
    refers to libaries used in packages/**/package.json scripts, such as
    tailwindcss, tsc-alias, nx, etc.
* Updates nx cache location for Circle CI

Closes #FXA-8880
2024-02-12 09:01:00 -05:00
dschom 5f1c915445
task(nx): Remove accessToken
Because:
- We are removing tokens from our source
- Even those that are just for dev purposes

This Commit:
- Removes the accessToken from the default nx tasksRunnerOptions.

Note: Some instructions will be added for developers who want to an access token to speed up builds locally.
2023-10-26 15:31:55 -07:00
Ivo Plamenac 5c5b055f86
feat(sp3): add Stripe Factories
Because:

* we want to employ the factory pattern for mocking testing data

This commit:

* adds factory functions for several stripe objects

Closes #FXA-8311
2023-10-25 10:52:05 -07:00
Julian Poyourow b10922d49e
chore(build): update nx cloud token 2023-09-25 07:42:19 -07:00
Reino Muhl 3894a65527
feat(next): payments-next initial work
Because:

* Create the initial work for the Checkout page as a starting point and
  example for the rest of the SP3 components and pages.

This commit:

* Adds the payments/next/ui Next.js library.
* Move Header JSX into layout.tsx and remove ExampleHeader component.
* Add RSC PurchaseDetails, using JSX from SP2.5 PlanDetails component.
* Add RSC TermsAndPrivacy component
* Add various stubs functions for illustration purposes. These will be
  replaced with actual implementations in future tickets.
  * Cart fetch
  * Contentful fetch
  * Translation using @fluent/bundle

Closes FXA-8133
2023-09-12 14:24:39 -04:00
Meghan Sardesai a999afd748
chore(next): add Storybook to NextJS setup
Because:

* We want to include Storybook in 3.0.

This commit:

* Ensures Storybook component loads as expected.
* Ensures shared Tailwind styles can be used in payments-next and works with hot-reloading.
* Ensures the build script executes without any errors.

Closes FXA-7503
2023-09-11 17:26:30 -04:00
dschom 0b02be4033
bug(nx): Fix crashing nx daemon 2023-08-31 12:24:21 -07:00
dschom d96797ae6a
task(CI): Improve nx caching for CI pipelines
Because:
- Not all CI operations where taking advantage of NX caches

This Commit:
- Adjusts nx.json config to ensure correct caching behavior
- Adjusts nx.json config to ensure proper target chains. ie build is dependent on pre-build
- Uses nx to directly run integration tests
- Uses nx to directly run unit tests
- Phases out dependency on generated .list files
- Ensures 'start up' for services for functional tests is done with nx and uses nx caches.
- Creates nx tags to facilitate test commands
- Fixes linter errors encountered
- Updates docker images to nx for builds
- Updates nx ignore files
2023-08-29 11:19:54 -07:00
dschom 535498214a
task(many): Switch nx test target to be test-unit
Because:
- The CI already targets test-unit
- We want to draw a distinction between unit and integration tests.

This Commit:
- Renames "test" to "test-unit" in lib packages.
- Sets up CI to run integration tests on 'libs' folder packages
- Adds tags to nx projects in libs folder
2023-08-03 15:38:16 -07:00
Lisa Chan d4bf24117c
chore(next): Add Next.js to fxa and initial setup 2023-07-19 14:57:15 -04:00
dschom df7897920d
task(gql-api): Allowlist graphql queries
Because:
- We want to lock down our gql queries as part of good security practices.

This Commit:
- Creates task that extracts existing gql queries from our code
- Applies middleware that checks a allowlist of extracted queries.
- Creates a 403 if the query is not in the allowlist
- Makes all gql parsable by extraction utility. The extraction utility doesn't support string placeholders. e.g. gql` Account { ${ACCOUNT_FIELDS} }`
- Moves all the gql in the admin server into .ts files. Again for consistency and extraction utility support.
- Cleans up some config references at startup
- Adds nx config for extraction & copy tasks
2023-07-18 05:54:28 -07:00
Ben Bangert 4f008b5163
chore: use nx-cloud
Because:

* We'd like faster builds to avoid repeat work.

This commit:

* Uses nx-cloud as a cache for build/test/lint operations.
2023-07-11 14:41:45 -07:00
Julian Poyourow d07236bcd8
chore(build): upgrade nx to v16
Because:

* Nx released v16!

This commit:

* Upgrades Nx to v16 using `nx migrate`

Closes FXA-7622
2023-06-01 13:21:44 -07:00
Julian Poyourow 565ebb89c9
chore(build): initial nx implementation
Because:

* We want to introduce nx to the repository

This commit:

* Adds nx with working builds

Closes: FXA-7341

Co-authored-by: dschom <dschomburg@mozilla.com>
2023-05-23 08:37:47 -07:00