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

Feature/350 switch to vite #195

Merged
merged 10 commits into from
Oct 11, 2024
Merged
8 changes: 6 additions & 2 deletions .github/workflows/dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ jobs:
CF_S3_PRIV_SECRET_KEY: ${{ secrets.CF_DEV_S3_PRIV_SECRET_KEY }}
DB_POOL_MAX: 20
DB_POOL_MIN: 5
DB_SSL: true
DB_NAME: ${{ secrets.DB_NAME_DEV }}
DB_PASSWORD: ${{ secrets.EQ_PASSWORD_DEV }}
DB_USERNAME: ${{ secrets.EQ_USER_DEV }}
Expand Down Expand Up @@ -109,8 +110,8 @@ jobs:
- name: Build front-end files and move to server
run: |
PUBLIC_URL="$SERVER_URL" \
REACT_APP_SERVER_BASE_PATH="$SERVER_BASE_PATH" \
REACT_APP_CLOUD_SPACE="$CLOUD_SPACE" \
VITE_SERVER_BASE_PATH="$SERVER_BASE_PATH" \
VITE_CLOUD_SPACE="$CLOUD_SPACE" \
npm run build
cd build
cp -r * ../../server/app/public
Expand Down Expand Up @@ -139,6 +140,7 @@ jobs:
cf set-env $APP_NAME "CF_S3_PRIV_SECRET_KEY" "$CF_S3_PRIV_SECRET_KEY" > /dev/null
cf set-env $APP_NAME "DB_POOL_MAX" "$DB_POOL_MAX" > /dev/null
cf set-env $APP_NAME "DB_POOL_MIN" "$DB_POOL_MIN" > /dev/null
cf set-env $APP_NAME "DB_SSL" "$DB_SSL" > /dev/null
cf set-env $APP_NAME "DB_NAME" "$DB_NAME" > /dev/null
cf set-env $APP_NAME "DB_PASSWORD" "$DB_PASSWORD" > /dev/null
cf set-env $APP_NAME "DB_USERNAME" "$DB_USERNAME" > /dev/null
Expand Down Expand Up @@ -205,6 +207,7 @@ jobs:
CF_S3_PRIV_REGION: ${{ secrets.CF_DEV_S3_PRIV_REGION }}
CF_S3_PRIV_SECRET_KEY: ${{ secrets.CF_DEV_S3_PRIV_SECRET_KEY }}
DB_NAME: ${{ secrets.DB_NAME_DEV }}
DB_SSL: true
EQ_PASSWORD: ${{ secrets.EQ_PASSWORD_DEV }}
EQ_USERNAME: ${{ secrets.EQ_USER_DEV }}
GLOSSARY_AUTH: ${{ secrets.GLOSSARY_AUTH }}
Expand Down Expand Up @@ -239,6 +242,7 @@ jobs:
cf set-env $APP_NAME "CF_S3_PRIV_REGION" "$CF_S3_PRIV_REGION" > /dev/null
cf set-env $APP_NAME "CF_S3_PRIV_SECRET_KEY" "$CF_S3_PRIV_SECRET_KEY" > /dev/null
cf set-env $APP_NAME "DB_NAME" "$DB_NAME" > /dev/null
cf set-env $APP_NAME "DB_SSL" "$DB_SSL" > /dev/null
cf set-env $APP_NAME "EQ_USERNAME" "$EQ_USERNAME" > /dev/null
cf set-env $APP_NAME "EQ_PASSWORD" "$EQ_PASSWORD" > /dev/null
cf set-env $APP_NAME "GLOSSARY_AUTH" "$GLOSSARY_AUTH" > /dev/null
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ jobs:
- name: Build front-end files and move to server
run: |
PUBLIC_URL="$SERVER_URL" \
REACT_APP_SERVER_BASE_PATH="$SERVER_BASE_PATH" \
REACT_APP_CLOUD_SPACE="$CLOUD_SPACE" \
VITE_SERVER_BASE_PATH="$SERVER_BASE_PATH" \
VITE_CLOUD_SPACE="$CLOUD_SPACE" \
npm run build
cd build
cp -r * ../../server/app/public
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ jobs:
CF_S3_PRIV_SECRET_KEY: ${{ secrets.CF_STAGING_S3_PRIV_SECRET_KEY }}
DB_POOL_MAX: 20
DB_POOL_MIN: 5
DB_SSL: true
DB_NAME: ${{ secrets.DB_NAME_STAGING }}
DB_PASSWORD: ${{ secrets.EQ_PASSWORD_STAGING }}
DB_USERNAME: ${{ secrets.EQ_USER_STAGING }}
Expand Down Expand Up @@ -110,8 +111,8 @@ jobs:
- name: Build front-end files and move to server
run: |
PUBLIC_URL="$SERVER_URL" \
REACT_APP_SERVER_BASE_PATH="$SERVER_BASE_PATH" \
REACT_APP_CLOUD_SPACE="$CLOUD_SPACE" \
VITE_SERVER_BASE_PATH="$SERVER_BASE_PATH" \
VITE_CLOUD_SPACE="$CLOUD_SPACE" \
npm run build
cd build
cp -r * ../../server/app/public
Expand Down Expand Up @@ -140,6 +141,7 @@ jobs:
cf set-env $APP_NAME "CF_S3_PRIV_SECRET_KEY" "$CF_S3_PRIV_SECRET_KEY" > /dev/null
cf set-env $APP_NAME "DB_POOL_MAX" "$DB_POOL_MAX" > /dev/null
cf set-env $APP_NAME "DB_POOL_MIN" "$DB_POOL_MIN" > /dev/null
cf set-env $APP_NAME "DB_SSL" "$DB_SSL" > /dev/null
cf set-env $APP_NAME "DB_NAME" "$DB_NAME" > /dev/null
cf set-env $APP_NAME "DB_PASSWORD" "$DB_PASSWORD" > /dev/null
cf set-env $APP_NAME "DB_USERNAME" "$DB_USERNAME" > /dev/null
Expand Down Expand Up @@ -206,6 +208,7 @@ jobs:
CF_S3_PRIV_REGION: ${{ secrets.CF_STAGING_S3_PRIV_REGION }}
CF_S3_PRIV_SECRET_KEY: ${{ secrets.CF_STAGING_S3_PRIV_SECRET_KEY }}
DB_NAME: ${{ secrets.DB_NAME_STAGING }}
DB_SSL: true
EQ_PASSWORD: ${{ secrets.EQ_PASSWORD_STAGING }}
EQ_USERNAME: ${{ secrets.EQ_USER_STAGING }}
GLOSSARY_AUTH: ${{ secrets.GLOSSARY_AUTH }}
Expand Down Expand Up @@ -240,6 +243,7 @@ jobs:
cf set-env $APP_NAME "CF_S3_PRIV_REGION" "$CF_S3_PRIV_REGION" > /dev/null
cf set-env $APP_NAME "CF_S3_PRIV_SECRET_KEY" "$CF_S3_PRIV_SECRET_KEY" > /dev/null
cf set-env $APP_NAME "DB_NAME" "$DB_NAME" > /dev/null
cf set-env $APP_NAME "DB_SSL" "$DB_SSL" > /dev/null
cf set-env $APP_NAME "EQ_USERNAME" "$EQ_USERNAME" > /dev/null
cf set-env $APP_NAME "EQ_PASSWORD" "$EQ_PASSWORD" > /dev/null
cf set-env $APP_NAME "GLOSSARY_AUTH" "$GLOSSARY_AUTH" > /dev/null
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ coverage/
app/cypress/downloads/
app/cypress/screenshots/
app/cypress/videos/
app/combined_coverage_reports


# misc
Expand Down
22 changes: 22 additions & 0 deletions app/client/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
module.exports = {
root: true,
env: {
browser: true,
es2020: true,
},
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:react-hooks/recommended',
],
ignorePatterns: ['dist', '.eslintrc.cjs'],
parser: '@typescript-eslint/parser',
plugins: ['react-refresh'],
rules: {
'no-extra-boolean-cast': 'off',
'@typescript-eslint/no-unused-vars': [
'warn',
{ argsIgnorePattern: '^_' }, // ignore unused args starting with _
],
},
};
1 change: 0 additions & 1 deletion app/client/.prettierrc.json

This file was deleted.

7 changes: 4 additions & 3 deletions app/client/gulpfile.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const uswds = require('@uswds/compile');
import * as uswds from '@uswds/compile';

uswds.settings.version = 3;

Expand All @@ -8,8 +8,9 @@ uswds.paths.dist.fonts = './public/uswds/fonts';
uswds.paths.dist.js = './public/uswds/js';
uswds.paths.dist.theme = './public/scss';

exports.init = async () => {
export const init = async () => {
await uswds.copyAssets();
uswds.compile();
};
exports.compile = uswds.compile;

export const compile = uswds.compile;
Loading