Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MR-886] Upgrade react-scripts to v5 #914

Merged
merged 59 commits into from
Apr 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
285d7f6
Bump react-scripts from 4.0.3 to 5.0.0
dependabot[bot] Mar 25, 2022
bb1985a
Upgrade uswds even though its out of sync with react-uswds to get the…
haworku Apr 1, 2022
3316e54
Remove tilde from sass imports, since its deprecated, and use full fi…
haworku Apr 4, 2022
5106595
Upgrade storybook react dependencies, remove pinned deps from react-s…
haworku Apr 4, 2022
85cdbe3
Remove unused dependenct react-aria-modal
haworku Apr 4, 2022
864852e
Fix up more issues related to scss compiling
haworku Apr 4, 2022
39ce622
Revert "Upgrade storybook react dependencies, remove pinned deps from…
haworku Apr 4, 2022
2cb577e
Fixing uswds asset path reduces errors from 227 to 162
haworku Apr 4, 2022
c052434
Revert "Revert "Upgrade storybook react dependencies, remove pinned d…
haworku Apr 4, 2022
90be8a4
Address all compile errors, on to warnings
haworku Apr 4, 2022
9f941b3
Upgrade sass
haworku Apr 4, 2022
7635509
Manually resolve react router deps
haworku Apr 11, 2022
79e9da8
Remove node modules and regenerate yarn.lock
haworku Apr 11, 2022
cca0caa
Upgrade to storybook 6 and add cra5 builder
haworku Apr 11, 2022
0aab907
setup router compatibility package
haworku Apr 11, 2022
ab2dbcb
Upgrade to next storybook prerelase, which pre-bundles @storybook/rou…
haworku Apr 11, 2022
31cd211
Temp commit - comment out all reference to history to see if we can …
haworku Apr 11, 2022
b8b2f85
Address Typescript warnings in ChangeHistory.test.tsx due to incorrec…
haworku Apr 11, 2022
542aa95
Apparently we need to import Buffer now to use it in app-web - fix co…
haworku Apr 11, 2022
ea800da
Revert "setup router compatibility package"
haworku Apr 11, 2022
77b80b4
Add serverless-webpack to uploads to address CORS error from webpack …
haworku Apr 11, 2022
eac7aae
Remove unnecessary history dep
haworku Apr 11, 2022
a0946d6
Merge remote-tracking branch 'origin/main' into hw-upgrade-react-scripts
haworku Apr 11, 2022
ebf9560
app-web tests passing
haworku Apr 12, 2022
c2b10e9
Add the other webpack dep from app-api to uploads, see if this gets i…
haworku Apr 12, 2022
64b021d
Upgrade ts-jest and jest to address app-api errors
haworku Apr 12, 2022
e2369b7
Sync up versions of webpack deps in app-api and uploads
haworku Apr 12, 2022
62c9ca2
Bump packages
mojotalantikite Apr 12, 2022
3f095a5
use /scss paths for uswds deps
haworku Apr 12, 2022
4897bc5
Bump mem limit on CI tests
mojotalantikite Apr 12, 2022
db83bc9
Merge branch 'hw-upgrade-react-scripts' of github.com:CMSgov/managed-…
haworku Apr 12, 2022
4989462
Adjust module.scss paths to styles deps
haworku Apr 12, 2022
242d3b5
Merge remote-tracking branch 'origin/main' into hw-upgrade-react-scripts
haworku Apr 13, 2022
adf1882
Add layer to only graphql
mojotalantikite Apr 13, 2022
f4cd48a
Debug what's setting up the prisma conn
mojotalantikite Apr 13, 2022
574b0b9
Include more prisma things
mojotalantikite Apr 13, 2022
0ae61fd
Add more prisma generate
mojotalantikite Apr 14, 2022
61fd4dc
prisma is not global in CI
mojotalantikite Apr 14, 2022
c3153cf
Have prisma generate from lerna for CI
mojotalantikite Apr 14, 2022
5a738dc
Add webpack5 syntax. Add prisma via webpack.
mojotalantikite Apr 14, 2022
6a694d1
Try to force only lambda layer
mojotalantikite Apr 14, 2022
c6aa4f5
Ignore all prisma in webpack. All of it.
mojotalantikite Apr 14, 2022
f4e3a11
Try the monorepo fix for externals
mojotalantikite Apr 14, 2022
7395f41
Add the schema file back
mojotalantikite Apr 14, 2022
d818bad
Didn't take. add again
mojotalantikite Apr 14, 2022
b41dd25
Bump ts-loader
mojotalantikite Apr 14, 2022
db2b772
Merge branch 'main' into hw-upgrade-react-scripts
mojotalantikite Apr 18, 2022
bac107c
Prisma should be layer only now
mojotalantikite Apr 18, 2022
428cf21
Have serverless force exclude prisma. In a layer.
mojotalantikite Apr 18, 2022
5428080
Fix cleaning
mojotalantikite Apr 18, 2022
953a964
Remove debug
mojotalantikite Apr 18, 2022
e6004db
Merge branch 'main' into hw-upgrade-react-scripts
mojotalantikite Apr 18, 2022
b5fdf07
Merge branch 'main' into hw-upgrade-react-scripts
mojotalantikite Apr 18, 2022
a855986
Sync resolutions. Make sure types are in devdep
mojotalantikite Apr 18, 2022
caa137d
Merge remote-tracking branch 'origin/main' into hw-upgrade-react-scripts
haworku Apr 21, 2022
6b79287
app-web lint passing
haworku Apr 21, 2022
206616d
app-api linting passing
haworku Apr 21, 2022
dd097a5
Fix app-web ReviewSubmit tests again
haworku Apr 21, 2022
7766052
Comment out problematic cy.pa11y calls to unblock this PR merge.
haworku Apr 22, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .envrc
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export CT_AWS_ROLE='ct-ado-managedcare-developer-admin'
export CT_IDMS='2'

# values formerly in .env (required)
export SASS_PATH='node_modules:src'
export SASS_PATH='src:../../node_modules'
export REACT_APP_AUTH_MODE='LOCAL'
export REACT_APP_STAGE_NAME='local'
export REACT_APP_API_URL='http://localhost:3030/local'
Expand Down
12 changes: 11 additions & 1 deletion .github/workflows/deploy-app-to-env.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,21 @@ jobs:
name: lambda-layers-prisma-client-migration
path: ./services/app-api/lambda-layers-prisma-client-migration

- name: Unzip prisma layer
- name: Unzip prisma migration layer
run: |
tar -C ./services/app-api/lambda-layers-prisma-client-migration -xf ./services/app-api/lambda-layers-prisma-client-migration/nodejs.tar.gz
rm -rf ./services/app-api/lambda-layers-prisma-client-migration/nodejs.tar.gz

- uses: actions/download-artifact@v3
Copy link
Contributor

Choose a reason for hiding this comment

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

why is this change in the react-scripts PR?

Copy link
Contributor Author

@haworku haworku Apr 21, 2022

Choose a reason for hiding this comment

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

Looks like this came in with adf1882. @mojotalantikite @macrael does that commit look alright to yall just sanity check because we had a bit of funky stuff with app-web merge at least want to be sure.

Copy link
Contributor

@mojotalantikite mojotalantikite Apr 21, 2022

Choose a reason for hiding this comment

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

So yeah, with the webpack5 changes there was a change in behavior that stopped prisma from working again. Basically it was copying in parts of the prisma client, but not any of the engine things that it needs.

In order to get it working again I added a single layer that has the prisma packages and forced webpack to not pack up prisma. That way the resolutions for prisma go to the lambda layer, which have the appropriate query engine builds.

with:
name: lambda-layers-prisma-client-engine
path: ./services/app-api/lambda-layers-prisma-client-engine

- name: Unzip prisma engine layer
run: |
tar -C ./services/app-api/lambda-layers-prisma-client-engine -xf ./services/app-api/lambda-layers-prisma-client-engine/nodejs.tar.gz
rm -rf ./services/app-api/lambda-layers-prisma-client-engine/nodejs.tar.gz

- name: deploy app-api
id: deploy-app-api
env:
Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ jobs:

- name: API Unit Tests
env:
NODE_OPTIONS: --max_old_space_size=6000
REACT_APP_AUTH_MODE: AWS_COGNITO
DATABASE_URL: postgresql://postgres:shhhsecret@localhost:5432/postgres?schema=public&connection_limit=5 #pragma: allowlist secret
run: ./dev test api --unit
Expand Down Expand Up @@ -184,6 +185,11 @@ jobs:
name: lambda-layers-prisma-client-migration
path: ./services/app-api/lambda-layers-prisma-client-migration

- uses: actions/upload-artifact@v3
with:
name: lambda-layers-prisma-client-engine
path: ./services/app-api/lambda-layers-prisma-client-engine

deploy-infra:
needs: [begin-deployment]
uses: CMSgov/managed-care-review/.github/workflows/deploy-infra-to-env.yml@main
Expand Down Expand Up @@ -213,7 +219,7 @@ jobs:
always() &&
(needs.deploy-infra.result == 'success' || needs.deploy-infra.result == 'skipped')

uses: CMSgov/managed-care-review/.github/workflows/deploy-app-to-env.yml@main
uses: CMSgov/managed-care-review/.github/workflows/deploy-app-to-env.yml@hw-upgrade-react-scripts
with:
stage_name: ${{ needs.begin-deployment.outputs.stage-name }}
app_version: ${{ needs.begin-deployment.outputs.app-version }}
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,4 @@ lambda_response.json
services/app-api/lambda-layers-prisma-client
services/app-api/lambda-layers-prisma-client-migration
services/app-api/lambda-layers-prisma-client-query
services/app-api/lambda-layers-prisma-client-engine
6 changes: 1 addition & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
},
"homepage": "https://github.com/CMSgov/managed-care-review#readme",
"devDependencies": {
"@cypress-audit/pa11y": "^1.1.0",
"@cypress-audit/pa11y": "^1.3.0",
"chromedriver": "^96.0.0",
"cypress": "^9.1.1",
"cypress-pipe": "^2.0.0",
Expand All @@ -48,9 +48,5 @@
"aws-sdk": "^2.1018.0",
"cypress-file-upload": "^5.0.8",
"path-browserify": "^1.0.1"
},
"resolutions": {
"babel-loader": "8.1.0",
"jest": "26.6.0"
}
}
5 changes: 4 additions & 1 deletion services/app-api/.eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@
"jest/no-identical-title": "error",
"@typescript-eslint/no-floating-promises": "error",
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": ["warn", { "argsIgnorePattern": "^_*" }]
"@typescript-eslint/no-unused-vars": [
"warn",
{ "argsIgnorePattern": "^_*" }
]
},
"overrides": []
}
2 changes: 1 addition & 1 deletion services/app-api/handlers/postgres_migrate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export const main: APIGatewayProxyHandler = async () => {
throw new Error('Init Error: DATABASE_URL is required to run app-api')
}

let dbConnResult = await getPostgresURL(dbURL, secretsManagerSecret)
const dbConnResult = await getPostgresURL(dbURL, secretsManagerSecret)
if (dbConnResult instanceof Error) {
console.error('Init Error: failed to get pg URL', dbConnResult)
throw dbConnResult
Expand Down
20 changes: 11 additions & 9 deletions services/app-api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"test": "jest --watch",
"test:once": "jest --runInBand --ci",
"lint": "tsc --noEmit && eslint . --max-warnings=0",
"clean": "rm -rf node_modules && yarn cache clean"
"clean": "rm -rf node_modules && yarn cache clean",
"generate-code": "yarn prisma generate"
},
"lint-staged": {
"*.{js,ts}": [
Expand All @@ -31,21 +32,20 @@
"@opentelemetry/sdk-trace-base": "^1.0.1",
"@opentelemetry/sdk-trace-node": "^1.0.1",
"@opentelemetry/semantic-conventions": "^1.0.1",
"@prisma/client": "^3.10.0",
"apollo-server-lambda": "^3.5.0",
"archiver": "^5.3.0",
"axios": "^0.26.1",
"graphql": "^16.2.0",
"graphql-scalars": "^1.11.1",
"launchdarkly-node-server-sdk": "5.14.6",
"neverthrow": "^4.2.2",
"prisma": "^3.11.1",
"protobufjs": "^6.11.2",
"request": "^2.88.2",
"uuid": "^8.3.2",
"zod": "^3.11.6"
},
"devDependencies": {
"@prisma/client": "^3.10.0",
"@types/archiver": "^5.1.1",
"@types/aws-lambda": "^8.10.83",
"@types/glob": "^7.2.0",
Expand All @@ -55,33 +55,35 @@
"@typescript-eslint/eslint-plugin": "^5.6.0",
"@typescript-eslint/parser": "^5.6.0",
"aws-sdk": "^2.991.0",
"copy-webpack-plugin": "6.4.1",
"copy-webpack-plugin": "^10.2.4",
"csv-parser": "^3.0.0",
"eslint": "^8.3.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-jest": "^25.3.0",
"eslint-plugin-prettier": "^4.0.0",
"graphql-tag": "^2.12.5",
"jest": "^27.4.7",
"jest": "^27.5.1",
"jest-raw-loader": "^1.0.1",
"lint-staged": "^12.1.2",
"prettier": "^2.4.1",
"prisma": "^3.11.1",
"serverless": "^2.65.0",
"serverless-associate-waf": "^1.2.1",
"serverless-dotenv-plugin": "^3.10.0",
"serverless-iam-helper": "CMSgov/serverless-iam-helper",
"serverless-idempotency-helper": "CMSgov/serverless-idempotency-helper",
"serverless-offline": "^8.0.0",
"serverless-online": "CMSgov/serverless-online",
"serverless-plugin-monorepo": "^0.11.0",
"serverless-s3-bucket-helper": "CMSgov/serverless-s3-bucket-helper",
"serverless-stack-termination-protection": "^1.0.4",
"serverless-webpack": "^5.5.4",
"serverless-webpack": "^5.7.0",
"slugify": "^1.6.5",
"ts-jest": "^26.4.4",
"ts-loader": "~8.3.0",
"ts-jest": "^27.1.4",
"ts-loader": "^9.2.8",
"tsconfig-paths-webpack-plugin": "^3.5.1",
"typescript": "4.5.3",
"webpack": "4.44.2",
"webpack": "^5.72.0",
"webpack-node-externals": "^3.0.0"
}
}
32 changes: 32 additions & 0 deletions services/app-api/scripts/prepare-prisma-layer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,20 @@ function preparePrismaLayer() {
echo pwd
echo "Cleaning up workspace ..."
rm -rf lambda-layers-prisma-client-migration
rm -rf lambda-layers-prisma-client-engine

echo "Creating migration layer ..."
mkdir -p lambda-layers-prisma-client-migration/nodejs/node_modules/.prisma
mkdir -p lambda-layers-prisma-client-migration/nodejs/node_modules/@prisma/engines
mkdir -p lambda-layers-prisma-client-migration/nodejs/node_modules/prisma
mkdir -p lambda-layers-prisma-client-migration/nodejs/prisma

echo "Creating engine layer ..."
mkdir -p lambda-layers-prisma-client-engine/nodejs/node_modules/.prisma
mkdir -p lambda-layers-prisma-client-engine/nodejs/node_modules/@prisma/engines
mkdir -p lambda-layers-prisma-client-engine/nodejs/node_modules/prisma
mkdir -p lambda-layers-prisma-client-engine/nodejs/prisma

echo "Generate RHEL client..."
PRISMA_CLI_BINARY_TARGETS=rhel-openssl-1.0.x yarn prisma generate

Expand All @@ -22,11 +29,21 @@ function preparePrismaLayer() {
cp ../../node_modules/@prisma/engines/package.json lambda-layers-prisma-client-migration/nodejs/node_modules/@prisma/engines/package.json
rsync -av ../../node_modules/@prisma/engines/dist/ lambda-layers-prisma-client-migration/nodejs/node_modules/@prisma/engines/dist

echo "Prepare Prisma Client Engine lambda layer"
rsync -av ../../node_modules/@prisma/client/ lambda-layers-prisma-client-engine/nodejs/node_modules/@prisma/client
rsync -av ../../node_modules/prisma/ lambda-layers-prisma-client-engine/nodejs/node_modules/prisma
rsync -av ../../node_modules/.prisma/ lambda-layers-prisma-client-engine/nodejs/node_modules/.prisma
cp ../../node_modules/@prisma/engines/libquery_engine-rhel-openssl-1.0.x.so.node lambda-layers-prisma-client-engine/nodejs/node_modules/@prisma/engines/
cp ../../node_modules/@prisma/engines/package.json lambda-layers-prisma-client-engine/nodejs/node_modules/@prisma/engines/package.json
rsync -av ../../node_modules/@prisma/engines/dist/ lambda-layers-prisma-client-engine/nodejs/node_modules/@prisma/engines/dist

echo "Copy migration files to layer..."
rsync -av prisma/ lambda-layers-prisma-client-migration/nodejs/prisma
rsync -av prisma/ lambda-layers-prisma-client-engine/nodejs/prisma

echo "Remove Prisma CLI ..."
rm -rf lambda-layers-prisma-client-migration/nodejs/node_modules/@prisma/cli
rm -rf lambda-layers-prisma-client-engine/nodejs/node_modules/@prisma/cli

echo "Remove non-RHEL bins to save space ..."
rm -rf lambda-layers-prisma-client-migration/nodejs/node_modules/.prisma/client/libquery_engine-debian-openssl-1.1.x.so.node
Expand All @@ -38,10 +55,25 @@ function preparePrismaLayer() {
rm -rf lambda-layers-prisma-client-migration/nodejs/node_modules/@prisma/migration-engine-debian-openssl-1.1.x
rm -rf lambda-layers-prisma-client-migration/nodejs/node_modules/@prisma/prisma-fmt-debian-openssl-1.1.x

rm -rf lambda-layers-prisma-client-engine/nodejs/node_modules/.prisma/client/libquery_engine-debian-openssl-1.1.x.so.node
rm -rf lambda-layers-prisma-client-engine/nodejs/node_modules/prisma/engines
rm -rf lambda-layers-prisma-client-engine/nodejs/node_modules/prisma/libquery_engine-debian-openssl-1.1.x.so.node
rm -rf lambda-layers-prisma-client-engine/nodejs/node_modules/@prisma/introspection-engine-debian-openssl-1.1.x
rm -rf lambda-layers-prisma-client-engine/nodejs/node_modules/@prisma/libquery_engine-debian-openssl-1.1.x.so.node
rm -rf lambda-layers-prisma-client-engine/nodejs/node_modules/@prisma/migration-engine-debian-openssl-1.1.x
rm -rf lambda-layers-prisma-client-engine/nodejs/node_modules/@prisma/prisma-fmt-debian-openssl-1.1.x


echo "Compressing and cleaning migration engine..."
pushd lambda-layers-prisma-client-migration && tar -zcf /tmp/nodejs.tar.gz . && mv /tmp/nodejs.tar.gz ./nodejs.tar.gz
rm -rf nodejs
ls -lh nodejs.tar.gz
popd || exit

echo "Compressing and cleaning prisma engine..."
pushd lambda-layers-prisma-client-engine && tar -zcf /tmp/nodejs.tar.gz . && mv /tmp/nodejs.tar.gz ./nodejs.tar.gz
rm -rf nodejs
ls -lh nodejs.tar.gz
popd || exit
}
preparePrismaLayer
8 changes: 8 additions & 0 deletions services/app-api/serverless.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ package:

plugins:
- serverless-webpack
- serverless-plugin-monorepo
- serverless-offline
- serverless-online
- serverless-stack-termination-protection
Expand Down Expand Up @@ -41,6 +42,8 @@ custom:
webpackConfig: 'webpack.config.js'
packager: 'yarn'
includeModules:
forceExclude:
- '@prisma/client'
nodeModulesRelativeDir: '../../'
excludeRegex: 'darwin|debian'
serverlessTerminationProtection:
Expand Down Expand Up @@ -125,6 +128,8 @@ provider:
layers:
prismaClientMigration:
path: lambda-layers-prisma-client-migration
prismaClientEngine:
path: lambda-layers-prisma-client-engine

functions:
email_submit:
Expand Down Expand Up @@ -216,6 +221,9 @@ functions:
securityGroupIds:
- ${self:custom.sgId}
subnetIds: ${self:custom.privateSubnets}
layers:
- !Ref PrismaClientEngineLambdaLayer
- arn:aws:lambda:us-east-1:901920570463:layer:aws-otel-nodejs-amd64-ver-1-0-1:1

hello:
handler: handlers/hello.main
Expand Down
7 changes: 3 additions & 4 deletions services/app-api/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,10 @@ const extensions = [
'.graphql',
'.gql',
];
const servicePath = '';

module.exports = {
entry: slsw.lib.entries,
target: 'node',
externalsPresets: { node: true },
context: __dirname,
mode: isLocal ? 'development' : 'production',
performance: {
Expand All @@ -31,7 +30,8 @@ module.exports = {
nodeExternals({
modulesDir: path.resolve(__dirname, '../../node_modules'),
}),
'aws-sdk',
'prisma',
'@prisma/client',
],
devtool: 'source-map',
resolve: {
Expand All @@ -55,7 +55,6 @@ module.exports = {
options: {
projectReferences: true,
configFile: tsConfigPath,
experimentalWatchApi: true,
},
},
],
Expand Down
33 changes: 15 additions & 18 deletions services/app-web/.storybook/main.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
module.exports = {
stories: ['../src/**/*.stories.@(ts|tsx)'],
addons: [
'@storybook/addon-a11y',
'@storybook/addon-links',
'@storybook/addon-essentials',
'@storybook/preset-create-react-app',
],
typescript: {
check: false,
checkOptions: {},
reactDocgen: 'react-docgen-typescript',
reactDocgenTypescriptOptions: {
shouldExtractLiteralValuesFromEnum: true,
propFilter: (prop) =>
prop.parent ? !/node_modules/.test(prop.parent.fileName) : true,
},
},
};
stories: ['../src/**/*.stories.@(ts|tsx)'],
addons: ['@storybook/addon-a11y', '@storybook/addon-links', '@storybook/addon-essentials', '@storybook/preset-create-react-app'],
typescript: {
check: false,
checkOptions: {},
reactDocgen: 'react-docgen-typescript',
reactDocgenTypescriptOptions: {
shouldExtractLiteralValuesFromEnum: true,
propFilter: prop => prop.parent ? !/node_modules/.test(prop.parent.fileName) : true
}
},
core: {
builder: 'webpack5'
}
};
2 changes: 1 addition & 1 deletion services/app-web/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ Open [http://localhost:6000](http://localhost:6000) to view in the browser.
- Use modular styles. This means creating`<component>.module.scss` or `<component>.module.css` files in your component folders.
- Learn about [Sass](https://sass-lang.com/documentation/file.SASS_REFERENCE.html) and [CSS modules](https://github.com/css-modules/css-modules) as well [uswds scss classes, tokens, and mixins](https://designsystem.digital.gov/design-tokens/).
- Syntax: Sass styles should be written in camelCase. Import styles from a component's stylesheet using something like `import styles from 'InvoicePanel.module.scss'`. Access the styles with dot notation `styles.myclassname`. If fewer than 50% of the styles are used from a stylesheet, import only the styles used (ex. `import { myclassname } from 'MyComponent.module.scss'`).
- To reference sass variables, bring in uswds scss or project/cms scss as `@import '../../styles/uswdsImports.scss';` and `@import '../../styles/custom'` accordingly.
- To reference sass variables, bring in uswds scss or project/cms scss as `@import 'styles/uswdsImports.scss';` and `@import 'styles/custom.scss'` accordingly.

### `/gen`

Expand Down
Loading