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
Vue: Cleanup Vue Code #2131
Vue: Cleanup Vue Code #2131
Changes from all commits
ee47e9b
5b9d0ba
671da8b
f63c05c
348caa3
b2a4e22
4b35b10
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@aws-amplify/ui-vue': patch | ||
--- | ||
|
||
Switched to vitest for testing. Add in JSX for the future. Fixed an error that showed for .vue files in the editor if there was an interface present. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
dist | ||
coverage/ |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
"strict": true, | ||
"jsx": "preserve", | ||
"importHelpers": true, | ||
"declaration": true, | ||
"declaration": false, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This fixes the issue with |
||
"moduleResolution": "node", | ||
"skipLibCheck": true, | ||
"esModuleInterop": true, | ||
|
@@ -14,7 +14,13 @@ | |
"sourceMap": true, | ||
"baseUrl": ".", | ||
"resolveJsonModule": true, | ||
"types": ["webpack-env", "vite/client", "@types/jest"], | ||
"types": [ | ||
"webpack-env", | ||
"vite/client", | ||
"@types/jest", | ||
"vitest/globals", | ||
"node" | ||
], | ||
"paths": { | ||
"@/*": ["src/*"] | ||
}, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,34 @@ | ||
// vite.config.js | ||
|
||
/// <reference types="vitest" /> | ||
import { defineConfig } from 'vite'; | ||
import dynamicImportVars from '@rollup/plugin-dynamic-import-vars'; | ||
import path from 'path'; | ||
import vue from '@vitejs/plugin-vue'; | ||
import typescript2 from 'rollup-plugin-typescript2'; | ||
import Components from 'unplugin-vue-components/vite'; | ||
import vueJsx from '@vitejs/plugin-vue-jsx'; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We can use JSX in our tests now, or in our components if needed. |
||
|
||
const resolvePath = (str: string) => path.resolve(__dirname, str); | ||
|
||
export default defineConfig({ | ||
test: { | ||
globals: true, | ||
environment: 'jsdom', | ||
deps: { | ||
inline: [ | ||
'canvas', | ||
'tslib', | ||
'xstate', | ||
'amazon-cognito-identity-js', | ||
'@aws-amplify/storage', | ||
'@aws-amplify/ui/**', | ||
/\/packages\/.*\/esm\/(.*\.js)$/, | ||
], | ||
}, | ||
threads: false, | ||
}, | ||
plugins: [ | ||
vue(), | ||
vueJsx(), | ||
Components({ | ||
dirs: ['src/components/primitives'], | ||
exclude: [/node_modules/], | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is what vitest uses for code coverage.