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

17165 Migrated from Vue CLI to Vite #524

Merged
merged 8 commits into from
Aug 21, 2023
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
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
4 changes: 4 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
coverage/
dist/
node_modules/
public/
3 changes: 2 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
module.exports = {
root: true,
env: {
node: true
node: true,
es2021: true
},
extends: [
'eslint:recommended',
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ jobs:
- name: Install dependencies
run: |
make setup
- name: Test with Jest
- name: Test with Vitest
id: test
run: |
make test
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ setup: ## Clean and Install npm dependencies
ci: lint test

lint: ## Run linting of code.
npm run lint:nofix
npm run lint
severinbeauvais marked this conversation as resolved.
Show resolved Hide resolved

test: ## Unit testing
npm run test:unit
Expand Down
6 changes: 0 additions & 6 deletions babel.config.js

This file was deleted.

3 changes: 2 additions & 1 deletion devops/cloudbuild-pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@ steps:
- name: node:16.14.2
entrypoint: npm
env:
- 'VUE_APP_BUSINESS_EDIT_LD_CLIENT_ID=$_VUE_APP_BUSINESS_EDIT_LD_CLIENT_ID'
- 'VUE_APP_ADDRESS_COMPLETE_KEY=$_VUE_APP_ADDRESS_COMPLETE_KEY'
- 'VUE_APP_BUSINESS_EDIT_LD_CLIENT_ID=$_VUE_APP_BUSINESS_EDIT_LD_CLIENT_ID'
- 'VUE_APP_REGISTRIES_SEARCH_API_KEY=$_VUE_APP_REGISTRIES_SEARCH_API_KEY'
severinbeauvais marked this conversation as resolved.
Show resolved Hide resolved
args: ['run', 'build']

#
Expand Down
2 changes: 1 addition & 1 deletion firebase.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
{ "key" : "X-XSS-Protection", "value" : "1; mode=block" },
{
"key": "Content-Security-Policy",
"value": "default-src 'self'; frame-src 'self' *.gov.bc.ca *.hotjar.com *.googleapis.com https://*.nr-data.net https://*.newrelic.com https://*.cac1.pure.cloud; script-src 'self' 'unsafe-eval' 'unsafe-inline' *.gov.bc.ca *.hotjar.com *.googleapis.com https://*.nr-data.net https://*.newrelic.com https://*.cac1.pure.cloud; style-src 'self' 'unsafe-inline' *.cloudflare.com *.googleapis.com; font-src 'self' *.gov.bc.ca *.hotjar.com *.cloudflare.com *.googleapis.com *.gstatic.com *.jsdelivr.net; img-src 'self' data: *.hotjar.com https://*.cac1.pure.cloud; connect-src 'self' *.gov.bc.ca *.launchdarkly.com *.hotjar.com *.postescanada-canadapost.ca *.sentry.io *.apigee.net wss://*.hotjar.com *.hotjar.io https://*.nr-data.net https://shyrka-prod-cac1.s3.ca-central-1.amazonaws.com https://*.newrelic.com https://*.cac1.pure.cloud wss://*.cac1.pure.cloud; manifest-src 'self'; media-src 'self' https://*.cac1.pure.cloud; object-src 'self' https://*.cac1.pure.cloud; child-src 'self' https://*.cac1.pure.cloud;"
"value": "default-src 'self'; frame-src 'self' *.gov.bc.ca *.hotjar.com *.googleapis.com https://*.nr-data.net https://*.newrelic.com https://*.cac1.pure.cloud; script-src 'self' 'unsafe-eval' 'unsafe-inline' *.gov.bc.ca *.hotjar.com *.googleapis.com https://*.nr-data.net https://*.newrelic.com https://*.cac1.pure.cloud; style-src 'self' 'unsafe-inline' *.cloudflare.com *.googleapis.com; font-src 'self' *.gov.bc.ca *.hotjar.com *.cloudflare.com *.googleapis.com *.gstatic.com *.jsdelivr.net; img-src 'self' *.postescanada-canadapost.ca https://*.cac1.pure.cloud data: *.hotjar.com https://*.cac1.pure.cloud; connect-src 'self' *.gov.bc.ca *.launchdarkly.com *.hotjar.com *.postescanada-canadapost.ca *.sentry.io *.apigee.net wss://*.hotjar.com *.hotjar.io https://*.nr-data.net https://shyrka-prod-cac1.s3.ca-central-1.amazonaws.com https://*.newrelic.com https://*.cac1.pure.cloud wss://*.cac1.pure.cloud; manifest-src 'self'; media-src 'self' https://*.cac1.pure.cloud; object-src 'self' https://*.cac1.pure.cloud; child-src 'self' https://*.cac1.pure.cloud;"
Copy link
Collaborator Author

@JazzarKarim JazzarKarim Aug 17, 2023

Choose a reason for hiding this comment

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

Fixing the Canada post icon:
canada post img error

The same change has been done in the nginx.conf file.

It works now:
Screenshot (87)

Copy link
Collaborator

Choose a reason for hiding this comment

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

Does this have to be fixed in Create UI also? I only see 1 ref to CanadaPost in Create UI but 2 here.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

No Sev. It already works fine in Create UI. In nginx.conf, there should be 2 references for it. I went ahead and made the line similar in firebase.json because they should be similar.

In Create UI, it's the same as here in nginx.conf now but it's little bit different in firebase.json like you mentioned as there's only one ref there. In my opinion, we should change in Create UI so that the CSP is similar in both files. However, this change won't affect any functionalities. It's just to stay consistent.

Copy link
Collaborator

Choose a reason for hiding this comment

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

OK, thanks. I have no further comment on this.

},
{ "key": "Cache-Control", "value": "no-cache, no-store, must-revalidate"},
{ "key": "Pragma", "value": "no-cache"},
Expand Down
11 changes: 5 additions & 6 deletions public/index.html → index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<title>BC Business Registry</title>
<link rel="icon" href="<%= BASE_URL %>favicon.png">
<link rel="stylesheet" href="<%= BASE_URL %>css/addresscomplete-2.30.min.css">
<script type="text/javascript" src="<%= BASE_URL %>js/addresscomplete-2.30.min.js" defer></script>
<link rel="icon" href="/favicon.png">
<link rel="stylesheet" href="/css/addresscomplete-2.30.min.css">
<script type="text/javascript" src="/js/addresscomplete-2.30.min.js" defer></script>
</head>
<body>
<noscript>
Expand All @@ -16,8 +16,7 @@
without JavaScript enabled. Please enable it to continue.
</strong>
</noscript>
<div id="app">
<!-- app files will be auto injected here -->
</div>
<div id="app"></div>
<script type="module" src="/src/main.ts"></script>
</body>
</html>
12 changes: 0 additions & 12 deletions jest.config.js

This file was deleted.

2 changes: 1 addition & 1 deletion nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ http {
add_header Pragma "no-cache";

# Content Security Policy
add_header Content-Security-Policy "default-src 'self'; frame-src 'self' *.gov.bc.ca *.hotjar.com; script-src 'self' 'unsafe-eval' *.gov.bc.ca *.hotjar.com; style-src 'self' 'unsafe-inline' *.cloudflare.com; font-src 'self' *.gov.bc.ca *.hotjar.com *.cloudflare.com; img-src 'self' *.postescanada-canadapost.ca data:; connect-src 'self' *.gov.bc.ca *.launchdarkly.com *.hotjar.com *.postescanada-canadapost.ca *.sentry.io *.apigee.net; manifest-src 'self';";
add_header Content-Security-Policy "default-src 'self'; frame-src 'self' *.gov.bc.ca *.hotjar.com; script-src 'self' 'unsafe-eval' *.gov.bc.ca *.hotjar.com; style-src 'self' 'unsafe-inline' *.cloudflare.com; font-src 'self' *.gov.bc.ca *.hotjar.com *.cloudflare.com; img-src 'self' *.postescanada-canadapost.ca https://*.cac1.pure.cloud data:; connect-src 'self' *.gov.bc.ca *.launchdarkly.com *.hotjar.com *.postescanada-canadapost.ca *.sentry.io *.apigee.net; manifest-src 'self';";

listen 8080;
server_name _;
Expand Down
Loading