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

Replace webpack with vite to enable Vue3 upgrade #270

Merged
merged 5 commits into from
Nov 27, 2023
Merged
Show file tree
Hide file tree
Changes from 3 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
8 changes: 4 additions & 4 deletions .env
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
NODE_ENV=development
VUE_APP_SEQUENCESCAPE_BASE_URL=http://localhost:3000/api/v2
VUE_APP_SEQUENCESCAPE_API_KEY=development
VUE_APP_PRINT_MY_BARCODE_BASE_URL=http://localhost:3000
VUE_APP_LABEL_TEMPLATE_ID=33
VITE_SEQUENCESCAPE_BASE_URL=http://localhost:3000/api/v2
VITE_SEQUENCESCAPE_API_KEY=development
VITE_PRINT_MY_BARCODE_BASE_URL=http://localhost:3000
VITE_LABEL_TEMPLATE_ID=33
8 changes: 4 additions & 4 deletions .env.production
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
VUE_APP_SEQUENCESCAPE_BASE_URL=REPLACE_VUE_APP_SEQUENCESCAPE_BASE_URL
VUE_APP_SEQUENCESCAPE_API_KEY=REPLACE_VUE_APP_SEQUENCESCAPE_API_KEY
VUE_APP_PRINT_MY_BARCODE_BASE_URL=REPLACE_VUE_APP_PRINT_MY_BARCODE_BASE_URL
VUE_APP_LABEL_TEMPLATE_ID=REPLACE_VUE_APP_LABEL_TEMPLATE_ID
VITE_SEQUENCESCAPE_BASE_URL=REPLACE_VITE_SEQUENCESCAPE_BASE_URL
VITE_SEQUENCESCAPE_API_KEY=REPLACE_VITE_SEQUENCESCAPE_API_KEY
VITE_PRINT_MY_BARCODE_BASE_URL=REPLACE_VITE_PRINT_MY_BARCODE_BASE_URL
VITE_LABEL_TEMPLATE_ID=REPLACE_VITE_LABEL_TEMPLATE_ID
8 changes: 4 additions & 4 deletions .env.uat
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
VUE_APP_SEQUENCESCAPE_BASE_URL=REPLACE_VUE_APP_SEQUENCESCAPE_BASE_URL
VUE_APP_SEQUENCESCAPE_API_KEY=REPLACE_VUE_APP_SEQUENCESCAPE_API_KEY
VUE_APP_PRINT_MY_BARCODE_BASE_URL=REPLACE_VUE_APP_PRINT_MY_BARCODE_BASE_URL
VUE_APP_LABEL_TEMPLATE_ID=REPLACE_VUE_APP_LABEL_TEMPLATE_ID
VITE_SEQUENCESCAPE_BASE_URL=REPLACE_VITE_SEQUENCESCAPE_BASE_URL
VITE_SEQUENCESCAPE_API_KEY=REPLACE_VITE_SEQUENCESCAPE_API_KEY
VITE_PRINT_MY_BARCODE_BASE_URL=REPLACE_VITE_PRINT_MY_BARCODE_BASE_URL
VITE_LABEL_TEMPLATE_ID=REPLACE_VITE_LABEL_TEMPLATE_ID
10 changes: 6 additions & 4 deletions .eslintrc.js → .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,16 @@ module.exports = {
env: {
node: true,
},
extends: ['plugin:vue/essential', 'eslint:recommended', 'prettier'],
extends: [
'plugin:vue/essential',
'plugin:vue/recommended',
'eslint:recommended',
'prettier', // make sure this plugin is last since it turns conflicting rules off
],
rules: {
'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
'prefer-const': 'error',
'vue/multi-word-component-names': 'off',
},
parserOptions: {
parser: 'babel-eslint',
},
}
6 changes: 3 additions & 3 deletions .github/workflows/js_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ jobs:
- name: Cypress run
uses: cypress-io/github-action@v5
with:
start: npm run serve --legacy-peer-deps
wait-on: http://localhost:8080/
start: npm run serve
wait-on: http://localhost:3000/
spec: 'tests/e2e/**/*'
config-file: cypress.config.js
config-file: cypress.config.cjs
config: video=false
install: false
timeout-minutes: 5
Expand Down
11 changes: 11 additions & 0 deletions babel.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module.exports = {
presets: ['@babel/preset-env'],
plugins: [
[
'babel-plugin-transform-vite-meta-env',
{
include: ['VITE_LABEL_TEMPLATE_ID'],
},
],
],
}
3 changes: 0 additions & 3 deletions babel.config.js

This file was deleted.

2 changes: 1 addition & 1 deletion cypress.config.js → cypress.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module.exports = defineConfig({
setupNodeEvents(on, config) {},
specPattern: 'tests/e2e/specs/**/*.{js,jsx,ts,tsx}',
supportFile: 'tests/e2e/support/index.js',
baseUrl: 'http://localhost:8080/',
baseUrl: 'http://localhost:3000/',
experimentalRunAllSpecs: true,
},
})
File renamed without changes.
4 changes: 2 additions & 2 deletions public/index.html → index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width,initial-scale=1.0" />
<link rel="icon" href="<%= BASE_URL %>favicon.ico" />
<link rel="icon" href="/favicon.ico" />
<title>quanthub</title>
</head>
<body>
Expand All @@ -15,6 +15,6 @@
>
</noscript>
<div id="app"></div>
<!-- built files will be auto injected -->
<script type="module" src="/src/main.js"></script>
</body>
</html>
18 changes: 18 additions & 0 deletions jest.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
module.exports = {
roots: ['src/', 'tests/'],
moduleFileExtensions: ['js', 'json', 'vue'],
moduleNameMapper: {
'^@/(.*)$': '<rootDir>/src/$1',
'^@tests/(.*)$': '<rootDir>/tests/$1',
},
modulePaths: ['<rootDir>/tests/support/'],
transform: {
'\\.[jt]sx?$': 'babel-jest',
'^.+\\.(vue)$': '@vue/vue2-jest',
},
transformIgnorePatterns: ['/!node_modules\\/lodash-es/'],
testEnvironmentOptions: {
url: 'http://localhost/',
},
testEnvironment: 'jsdom',
}
17 changes: 0 additions & 17 deletions jest.config.js

This file was deleted.

Loading
Loading