2e230d2365
Bumps the npm_and_yarn group with 3 updates: [jose](https://github.com/panva/jose), [postcss](https://github.com/postcss/postcss) and [webpack](https://github.com/webpack/webpack). Updates `jose` from 5.7.0 to 5.8.0 - [Release notes](https://github.com/panva/jose/releases) - [Changelog](https://github.com/panva/jose/blob/main/CHANGELOG.md) - [Commits](https://github.com/panva/jose/compare/v5.7.0...v5.8.0) Updates `postcss` from 8.4.41 to 8.4.42 - [Release notes](https://github.com/postcss/postcss/releases) - [Changelog](https://github.com/postcss/postcss/blob/main/CHANGELOG.md) - [Commits](https://github.com/postcss/postcss/compare/8.4.41...8.4.42) Updates `webpack` from 5.89.0 to 5.94.0 - [Release notes](https://github.com/webpack/webpack/releases) - [Commits](https://github.com/webpack/webpack/compare/v5.89.0...v5.94.0) --- updated-dependencies: - dependency-name: jose dependency-type: direct:production dependency-group: npm_and_yarn - dependency-name: postcss dependency-type: direct:production dependency-group: npm_and_yarn - dependency-name: webpack dependency-type: direct:production dependency-group: npm_and_yarn ... Signed-off-by: dependabot[bot] <support@github.com> |
||
---|---|---|
.. | ||
.storybook | ||
.vscode | ||
public | ||
scripts | ||
server | ||
src | ||
.eslintignore | ||
.eslintrc.json | ||
.license.header | ||
.nsprc | ||
.prettierignore | ||
.rescriptsrc.js | ||
Gruntfile.js | ||
README.md | ||
backstage.yaml | ||
jest.config.js | ||
package.json | ||
pm2.config.js | ||
postcss.config.js | ||
tailwind.config.js | ||
tsconfig.json |
README.md
fxa-payments-server
This is the server that handles payments.
Storybook
This project uses Storybook to show each screen without requiring a full stack.
In local development, yarn storybook
should start a Storybook server at http://localhost:6006 with hot module replacement to reflect live changes.
Latest builds
The latest builds of the various FXA Storybooks are published to Google Cloud Platform, using this GCP Storybook Publisher, and can be found in the following ways.
- Via direct URL
- Navigate to the Mozilla Storybooks FXA URL
- Click the commit you’d like to view. (This includes both main and PR commits)
- Click fxa-payments-server
- From the FXA Github repo
- Click on the green check mark next to the latest commit off of main. (Near the top of the page)
- Scroll down and click on “Details” for entry storybooks:pull request
- Click fxa-payments-server
Installation notes
On Mac OS, yarn test
may trigger an EMFILE
error. In this case, to get tests running, you may need to brew install watchman
. (If the watchman postinstall step fails, follow the instructions here to change /usr/local
ownership from root to your user account.)
Secrets
Create the following file: server/config/secrets.json
. It will not be tracked in Git.
Use the following as a template, and fill in your own values:
{
"stripe": {
"apiKey": "pk_test_123"
},
"paypal": {
"clientId": "sb"
}
}
apiKey
should be a test Stripe Publishable KeyclientId
should be a sandbox PayPal client ID. For local testing, the default value of "sb" should be sufficient.
Testing
This package uses Jest to test both the frontend and server. By default yarn test
will run all yarn test scripts:
yarn test-frontend
will test the React App frontend undersrc/
yarn test-server
will test the Express server underserver/
Test specific tests with the following commands:
# Test frontend tests for the component AlertBar
yarn test-frontend AlertBar
# Grep frontend tests for "renders as expected"
yarn test-frontend -t "renders as expected"
# Test server tests for the file server/lib/csp
yarn test-server server/lib/csp
# Grep server tests for "logs raw events"
yarn test-server -t "logs raw events"
Note that prior to testing you may need to create a build of the React App. You can do this by running yarn build
.
Refer to Jest's CLI documentation for more advanced test configuration.
Location Override
When running the FxA stack locally, our geodb service needs an override to resolve a location. This override object takes the form of:
{
"location": {
"countryCode": <2 letter country code string>,
"postalCode": <corresponding postal code string>
}
}
and can be passed in either through your secrets.json
or through your environment variables.
Example using secrets.json
:
"geodb": {
"locationOverride": {
"location": {
"countryCode": "US",
"postalCode": "98332"
}
}
},
or with a .env
file using dotenv
GEODB_LOCATION_OVERRIDE= { "location": { "countryCode": "US", "postalCode": "85001"} }
Debugging Tests
Launch configs for Visual Studio Code are provided to help debug tests. In order to use the launch config, open the fxa-payments-server
folder in Visual Studio Code, then add a debugger
statement in the body of the test you plan to debug. In the Visual Studio Code sidebar navigate to the Run and Debug tab, and select the "Debug FxA-Payments Frontend Tests" or "Debug FxA-Payments Server Tests." Click the run button and the tests will begin to run and a debugger will be attached to the process. You can now add further breakpoints to the test source code by clicking near the line number.
Current Debugging Limitations
As the launch config is currently offered, a debugger
statement is needed to cause the debugger to properly attach; on initial run, simply selecting breakpoints on the side of the editor window will not work. Furthermore, the launch config currently runs all tests in a single process so it may take a moment before the test you are trying to debug is reached.
We use rescripts and yarn workspaces to manage our node packages. If you are encountering any error with packages not being found, please make sure to run yarn install
from the FxA root directory.
L10N
Strings are automatically extracted to the fxa-content-server-l10n
repo where they reach Pontoon for translations to occur by our l10n team and contributors. This is achieved by concatenating all of our .ftl (Fluent) files into a single payments.ftl
file with the merge-ftl
grunttask, and the script that runs in fxa-content-server-l10n
on a weekly cadence. For more detailed information, check out the ecosystem platform l10n doc.
License
MPL-2.0