Skip to content

Commit

Permalink
Merge pull request #446 from pagopa/feat/OI-204-craco-to-vite
Browse files Browse the repository at this point in the history
feat: [OI-204] vite migration
  • Loading branch information
sebbalex authored Nov 15, 2024
2 parents 4f429d6 + 2fa527c commit 66aed18
Show file tree
Hide file tree
Showing 19 changed files with 470 additions and 392 deletions.
20 changes: 10 additions & 10 deletions .github/workflows/deploy-fe-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
outputs:
matrix: ${{ steps.setmatrix.outputs.matrix }}

steps:
steps:
- name: Set Dynamic Env Matrix
id: setmatrix
run: |
Expand Down Expand Up @@ -58,16 +58,16 @@ jobs:
yarn lint
yarn test:coverage
if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
export $(grep -v ^# .env.${{ github.event.inputs.environment }} | xargs) && yarn build
yarn build --mode ${{ github.event.inputs.environment }}
else
export $(grep -v ^# .env.dev | xargs) && yarn build
yarn build --mode dev
fi
- name: Archive build artifacts
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808
with:
name: assets
path: src/oneid/oneid-ecs-core/src/main/webui/build
path: src/oneid/oneid-ecs-core/src/main/webui/dist

deploy:
runs-on: ubuntu-22.04
if: ${{ needs.setup.outputs.matrix != '' }}
Expand All @@ -77,25 +77,25 @@ jobs:
contents: read
strategy:
matrix: ${{ fromJson(needs.setup.outputs.matrix) }}

continue-on-error: false
environment: ${{ matrix.environment == 'prod' && format('{0}/{1}', matrix.environment, matrix.region) || matrix.environment }}

steps:
- name: Download build artifacts
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e
with:
name: assets
path: src/oneid/oneid-ecs-core/src/main/webui/build
path: src/oneid/oneid-ecs-core/src/main/webui/dist


- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502
with:
role-to-assume: ${{ vars.IAM_ROLE_DEPLOY_FE }}
aws-region: ${{ matrix.region }}

- name: Copy to S3
run: |
aws s3 sync build s3://${{ vars.ASSETS_BUCKET_NAME }}
aws s3 sync dist s3://${{ vars.ASSETS_BUCKET_NAME }}
working-directory: src/oneid/oneid-ecs-core/src/main/webui
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ gradle-app.setting

# Frontend stuff
src/oneid/oneid-ecs-core/src/main/webui/node_modules
src/oneid/oneid-ecs-core/src/main/webui/build
src/oneid/oneid-ecs-core/src/main/webui/dist
src/oneid/oneid-ecs-core/src/main/webui/coverage
src/oneid/oneid-ecs-core/.quinoa

Expand Down
40 changes: 20 additions & 20 deletions src/oneid/oneid-ecs-core/src/main/webui/.env.dev
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
REACT_APP_ENV=LOCAL_DEV
VITE_CURRENT_ENV=DEV

REACT_APP_ENABLE_ASSISTANCE=false
REACT_APP_URL_CDN=https://dev.oneid.pagopa.it/assets
VITE_ENABLE_ASSISTANCE=false
VITE_URL_CDN=https://dev.oneid.pagopa.it/assets

REACT_APP_LOGIN_SPID_ENABLED_TEMPORARY_SELECT=false
REACT_APP_SPID_TEST_ENV_ENABLED=true
REACT_APP_SPID_CIE_ENTITY_ID=https://preproduzione.idserver.servizicie.interno.gov.it/idp/profile/SAML2/POST/SSO
REACT_APP_LOGIN_ALERT_BANNER=https://dev.oneid.pagopa.it/assets/login-alert-message.json
REACT_APP_LOGIN_IDP_LIST=https://dev.oneid.pagopa.it/idps
REACT_APP_LOGIN_CLIENT_BASE_URL=https://dev.oneid.pagopa.it/client
VITE_LOGIN_SPID_ENABLED_TEMPORARY_SELECT=false
VITE_SPID_TEST_ENV_ENABLED=true
VITE_SPID_CIE_ENTITY_ID=https://collaudo.idserver.servizicie.interno.gov.it/idp/profile/SAML2/POST/SSO
VITE_LOGIN_ALERT_BANNER=https://dev.oneid.pagopa.it/assets/login-alert-message.json
VITE_LOGIN_IDP_LIST=https://dev.oneid.pagopa.it/idps
VITE_LOGIN_CLIENT_BASE_URL=https://dev.oneid.pagopa.it/client

REACT_APP_URL_API_LOGIN=https://dev.oneid.pagopa.it/login
REACT_APP_URL_API_AUTHORIZE=/oidc/authorize
VITE_URL_API_LOGIN=https://dev.oneid.pagopa.it/login
VITE_URL_API_AUTHORIZE=/oidc/authorize

REACT_APP_PAGOPA_HELP_EMAIL=[email protected]
VITE_PAGOPA_HELP_EMAIL=[email protected]

REACT_APP_URL_PRIVACY_DISCLAIMER=https://www.pagopa.it/it/informativa-privacy-area-riservata
REACT_APP_URL_TERMS_AND_CONDITIONS=https://www.pagopa.it/it/termini-condizioni-area-riservata
VITE_URL_PRIVACY_DISCLAIMER=https://www.pagopa.it/it/informativa-privacy-area-riservata
VITE_URL_TERMS_AND_CONDITIONS=https://www.pagopa.it/it/termini-condizioni-area-riservata

REACT_APP_ANALYTICS_ENABLE=true
REACT_APP_ANALYTICS_MOCK=true
REACT_APP_ANALYTICS_DEBUG=false
REACT_APP_SERVICE_EXAMPLE_TOKEN=DUMMY
VITE_ANALYTICS_ENABLE=true
VITE_ANALYTICS_MOCK=true
VITE_ANALYTICS_DEBUG=false
VITE_SERVICE_EXAMPLE_TOKEN=DUMMY

REACT_APP_HEADER_LINK_ROOTLINK="http://localhost"
REACT_APP_HEADER_LINK_PRODUCTURL="http://localhost"
VITE_HEADER_LINK_ROOTLINK="http://localhost"
VITE_HEADER_LINK_PRODUCTURL="http://localhost"
30 changes: 30 additions & 0 deletions src/oneid/oneid-ecs-core/src/main/webui/.env.development
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# This env file is loaded by default when running `vite start`
# can be changed using the --mode flag, like --mode=uat

VITE_CURRENT_ENV=LOCAL_DEV

VITE_ENABLE_ASSISTANCE=false
VITE_URL_CDN=http://localhost:8080/assets

VITE_LOGIN_SPID_ENABLED_TEMPORARY_SELECT=false
VITE_SPID_TEST_ENV_ENABLED=true
VITE_SPID_CIE_ENTITY_ID=https://preproduzione.idserver.servizicie.interno.gov.it/idp/profile/SAML2/POST/SSO
VITE_LOGIN_ALERT_BANNER=http://localhost:8080/assets/login-alert-message.json
VITE_LOGIN_IDP_LIST=http://localhost:8080/idps
VITE_LOGIN_CLIENT_BASE_URL=http://localhost:8080/client

VITE_URL_API_LOGIN=http://localhost/login
VITE_URL_API_AUTHORIZE=/oidc/authorize

VITE_PAGOPA_HELP_EMAIL=[email protected]

VITE_URL_PRIVACY_DISCLAIMER=https://www.pagopa.it/it/informativa-privacy-area-riservata
VITE_URL_TERMS_AND_CONDITIONS=https://www.pagopa.it/it/termini-condizioni-area-riservata

VITE_ANALYTICS_ENABLE=true
VITE_ANALYTICS_MOCK=true
VITE_ANALYTICS_DEBUG=false
VITE_SERVICE_EXAMPLE_TOKEN=DUMMY

VITE_HEADER_LINK_ROOTLINK="http://localhost"
VITE_HEADER_LINK_PRODUCTURL="http://localhost"
27 changes: 0 additions & 27 deletions src/oneid/oneid-ecs-core/src/main/webui/.env.local

This file was deleted.

41 changes: 21 additions & 20 deletions src/oneid/oneid-ecs-core/src/main/webui/.env.prod
Original file line number Diff line number Diff line change
@@ -1,29 +1,30 @@
VITE_CURRENT_ENV=PROD

INLINE_RUNTIME_CHUNK=false

REACT_APP_ENABLE_ASSISTANCE=true
REACT_APP_ENV=PROD
VITE_ENABLE_ASSISTANCE=true

REACT_APP_URL_CDN=https://oneid.pagopa.it/assets
VITE_URL_CDN=https://oneid.pagopa.it/assets

REACT_APP_LOGIN_SPID_ENABLED_TEMPORARY_SELECT=false
REACT_APP_SPID_TEST_ENV_ENABLED=false
REACT_APP_SPID_CIE_ENTITY_ID=https://idserver.servizicie.interno.gov.it/idp/profile/SAML2/POST/SSO
REACT_APP_LOGIN_ALERT_BANNER=https://oneid.pagopa.it/assets/login-alert-message.json
REACT_APP_LOGIN_IDP_LIST=https://oneid.pagopa.it/idps
REACT_APP_LOGIN_CLIENT_BASE_URL=https://oneid.pagopa.it/client
VITE_LOGIN_SPID_ENABLED_TEMPORARY_SELECT=false
VITE_SPID_TEST_ENV_ENABLED=false
VITE_SPID_CIE_ENTITY_ID=https://idserver.servizicie.interno.gov.it/idp/profile/SAML2/POST/SSO
VITE_LOGIN_ALERT_BANNER=https://oneid.pagopa.it/assets/login-alert-message.json
VITE_LOGIN_IDP_LIST=https://oneid.pagopa.it/idps
VITE_LOGIN_CLIENT_BASE_URL=https://oneid.pagopa.it/client

REACT_APP_URL_API_LOGIN=https://oneid.pagopa.it/login
REACT_APP_URL_API_AUTHORIZE=/oidc/authorize
VITE_URL_API_LOGIN=https://oneid.pagopa.it/login
VITE_URL_API_AUTHORIZE=/oidc/authorize

REACT_APP_PAGOPA_HELP_EMAIL=[email protected]
VITE_PAGOPA_HELP_EMAIL=[email protected]

REACT_APP_URL_PRIVACY_DISCLAIMER=https://www.pagopa.it/it/informativa-privacy-area-riservata
REACT_APP_URL_TERMS_AND_CONDITIONS=https://www.pagopa.it/it/termini-condizioni-area-riservata
VITE_URL_PRIVACY_DISCLAIMER=https://www.pagopa.it/it/informativa-privacy-area-riservata
VITE_URL_TERMS_AND_CONDITIONS=https://www.pagopa.it/it/termini-condizioni-area-riservata

REACT_APP_ANALYTICS_ENABLE=true
REACT_APP_ANALYTICS_MOCK=true
REACT_APP_ANALYTICS_DEBUG=false
REACT_APP_SERVICE_EXAMPLE_TOKEN=DUMMY
VITE_ANALYTICS_ENABLE=true
VITE_ANALYTICS_MOCK=true
VITE_ANALYTICS_DEBUG=false
VITE_SERVICE_EXAMPLE_TOKEN=DUMMY

REACT_APP_HEADER_LINK_ROOTLINK="http://localhost"
REACT_APP_HEADER_LINK_PRODUCTURL="http://localhost"
VITE_HEADER_LINK_ROOTLINK="http://localhost"
VITE_HEADER_LINK_PRODUCTURL="http://localhost"
29 changes: 29 additions & 0 deletions src/oneid/oneid-ecs-core/src/main/webui/.env.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
VITE_ENV=TEST

VITE_URL_CDN=https://dev.oneid.pagopa.it/assets

VITE_ENABLE_ASSISTANCE=false
VITE_LOGIN_SPID_ENABLED_TEMPORARY_SELECT=true
VITE_SPID_TEST_ENV_ENABLED=true
VITE_SPID_CIE_ENTITY_ID=xx_servizicie_test
VITE_LOGIN_ALERT_BANNER=http://localhost:8080/login-alert-message.json
VITE_LOGIN_IDP_LIST=http://localhost:8080/idps
VITE_LOGIN_CLIENT_BASE_URL=http://localhost:8080/client

VITE_URL_API_LOGIN=https://dev.oneid.pagopa.it/login
VITE_URL_API_AUTHORIZE=/oidc/authorize

VITE_PAGOPA_HELP_EMAIL=[email protected]

VITE_URL_PRIVACY_DISCLAIMER=https://www.pagopa.it/it/informativa-privacy-area-riservata
VITE_URL_TERMS_AND_CONDITIONS=https://www.pagopa.it/it/termini-condizioni-area-riservata

VITE_ANALYTICS_ENABLE=true
VITE_ANALYTICS_MOCK=true
VITE_ANALYTICS_DEBUG=false
VITE_SERVICE_EXAMPLE_TOKEN=DUMMY

VITE_HEADER_LINK_ROOTLINK="http://localhost"
VITE_HEADER_LINK_PRODUCTURL="http://localhost"

VITE_TZ=UTC
28 changes: 0 additions & 28 deletions src/oneid/oneid-ecs-core/src/main/webui/.env.test.local

This file was deleted.

40 changes: 20 additions & 20 deletions src/oneid/oneid-ecs-core/src/main/webui/.env.uat
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
REACT_APP_ENV=UAT
VITE_CURRENT_ENV=UAT

REACT_APP_ENABLE_ASSISTANCE=true
REACT_APP_URL_CDN=https://uat.oneid.pagopa.it/assets
VITE_ENABLE_ASSISTANCE=true
VITE_URL_CDN=https://uat.oneid.pagopa.it/assets

REACT_APP_LOGIN_SPID_ENABLED_TEMPORARY_SELECT=false
REACT_APP_SPID_TEST_ENV_ENABLED=true
REACT_APP_SPID_CIE_ENTITY_ID=https://collaudo.idserver.servizicie.interno.gov.it/idp/profile/SAML2/POST/SSO
REACT_APP_LOGIN_ALERT_BANNER=https://uat.oneid.pagopa.it/assets/login-alert-message.json
REACT_APP_LOGIN_IDP_LIST=https://uat.oneid.pagopa.it/idps
REACT_APP_LOGIN_CLIENT_BASE_URL=https://uat.oneid.pagopa.it/client
VITE_LOGIN_SPID_ENABLED_TEMPORARY_SELECT=false
VITE_SPID_TEST_ENV_ENABLED=true
VITE_SPID_CIE_ENTITY_ID=https://collaudo.idserver.servizicie.interno.gov.it/idp/profile/SAML2/POST/SSO
VITE_LOGIN_ALERT_BANNER=https://uat.oneid.pagopa.it/assets/login-alert-message.json
VITE_LOGIN_IDP_LIST=https://uat.oneid.pagopa.it/idps
VITE_LOGIN_CLIENT_BASE_URL=https://uat.oneid.pagopa.it/client

REACT_APP_URL_API_LOGIN=https://uat.oneid.pagopa.it/login
REACT_APP_URL_API_AUTHORIZE=/oidc/authorize
VITE_URL_API_LOGIN=https://uat.oneid.pagopa.it/login
VITE_URL_API_AUTHORIZE=/oidc/authorize

REACT_APP_PAGOPA_HELP_EMAIL[email protected]
VITE_PAGOPA_HELP_EMAIL[email protected]

REACT_APP_URL_PRIVACY_DISCLAIMER=https://www.pagopa.it/it/informativa-privacy-area-riservata
REACT_APP_URL_TERMS_AND_CONDITIONS=https://www.pagopa.it/it/termini-condizioni-area-riservata
VITE_URL_PRIVACY_DISCLAIMER=https://www.pagopa.it/it/informativa-privacy-area-riservata
VITE_URL_TERMS_AND_CONDITIONS=https://www.pagopa.it/it/termini-condizioni-area-riservata

REACT_APP_ANALYTICS_ENABLE=true
REACT_APP_ANALYTICS_MOCK=true
REACT_APP_ANALYTICS_DEBUG=false
REACT_APP_SERVICE_EXAMPLE_TOKEN=DUMMY
VITE_ANALYTICS_ENABLE=true
VITE_ANALYTICS_MOCK=true
VITE_ANALYTICS_DEBUG=false
VITE_SERVICE_EXAMPLE_TOKEN=DUMMY

REACT_APP_HEADER_LINK_ROOTLINK="http://localhost"
REACT_APP_HEADER_LINK_PRODUCTURL="http://localhost"
VITE_HEADER_LINK_ROOTLINK="http://localhost"
VITE_HEADER_LINK_PRODUCTURL="http://localhost"
21 changes: 0 additions & 21 deletions src/oneid/oneid-ecs-core/src/main/webui/craco.config.js

This file was deleted.

1 change: 0 additions & 1 deletion src/oneid/oneid-ecs-core/src/main/webui/eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ export default [
'locales/locales.ts',
'**/__tests__/**/*',
'eslint.config.mjs',
'craco.config.js',
'definitions/*',
'src/react-app-env.d.ts',
'**/Dangerfile.ts',
Expand Down
Loading

0 comments on commit 66aed18

Please sign in to comment.