Skip to content

Commit 7ed4884

Browse files
chore: package test-e2e-composable-vue3, update deps, migrate to vite (#1488)
Co-authored-by: Guillaume Chau <[email protected]>
1 parent b0844ac commit 7ed4884

24 files changed

+2890
-879
lines changed

.github/workflows/test-e2e-composable.yml

+4
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,10 @@ jobs:
5656
- name: Build
5757
run: pnpm run build
5858

59+
- name: Build app
60+
working-directory: ${{env.dir}}
61+
run: pnpm run build
62+
5963
- name: E2E tests
6064
working-directory: ${{env.dir}}
6165
run: pnpm run test:e2e

CONTRIBUTING.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ pnpm install
1010

1111
Go to a package in `packages`.
1212

13-
Build the library with watching:
13+
Build the library:
1414

1515
```
16-
pnpm run dev
16+
pnpm run build
1717
```
1818

1919
Run tests:

packages/test-e2e-composable-vue3/babel.config.js

-5
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,26 @@
11
import { defineConfig } from 'cypress'
2+
import vitePreprocessor from 'cypress-vite'
23
import axios from 'axios'
34

4-
module.exports = defineConfig({
5+
export default defineConfig({
56
fixturesFolder: 'tests/e2e/fixtures',
67
screenshotsFolder: 'tests/e2e/screenshots',
78
videosFolder: 'tests/e2e/videos',
89
downloadsFolder: 'tests/e2e/downloads',
910
e2e: {
11+
baseUrl: 'http://localhost:8080',
1012
// We've imported your old cypress plugins here.
1113
// You may want to clean this up later by importing these.
12-
setupNodeEvents (on, config) {
14+
setupNodeEvents (on) {
1315
on('task', {
1416
async 'db:reset' () {
1517
await axios.get('http://localhost:4042/_reset')
1618
return true
1719
},
1820
})
21+
on('file:preprocessor', vitePreprocessor())
1922
},
2023
specPattern: 'tests/e2e/specs/**/*.cy.{js,jsx,ts,tsx}',
21-
supportFile: 'tests/e2e/support/index.js',
24+
supportFile: 'tests/e2e/support/index.ts',
2225
},
2326
})

packages/test-e2e-composable-vue3/public/index.html renamed to packages/test-e2e-composable-vue3/index.html

+2-3
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,13 @@
44
<meta charset="utf-8">
55
<meta http-equiv="X-UA-Compatible" content="IE=edge">
66
<meta name="viewport" content="width=device-width,initial-scale=1.0">
7-
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
8-
<title><%= htmlWebpackPlugin.options.title %></title>
97
</head>
108
<body>
119
<noscript>
12-
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
10+
<strong> We're sorry but dashboard doesn't work properly without JavaScript enabled. Please enable it to continue. </strong>
1311
</noscript>
1412
<div id="app"></div>
13+
<script type="module" src="./src/main.ts"></script>
1514
<!-- built files will be auto injected -->
1615
</body>
1716
</html>

packages/test-e2e-composable-vue3/package.json

+24-26
Original file line numberDiff line numberDiff line change
@@ -3,40 +3,38 @@
33
"version": "4.0.0-alpha.16",
44
"private": true,
55
"scripts": {
6-
"serve": "vue-cli-service serve",
7-
"build": "vue-cli-service build",
8-
"test": "pnpm run test:e2e && kill-port 4042",
9-
"test:e2e": "start-server-and-test api 'http-get://localhost:4042/graphql?query=%7B__typename%7D' test:e2e:client",
10-
"test:e2e:client": "vue-cli-service test:e2e --mode production --headless",
11-
"test:e2e:dev": "start-server-and-test api:dev 'http-get://localhost:4042/graphql?query=%7B__typename%7D' test:e2e:dev:client",
12-
"test:e2e:dev:client": "vue-cli-service test:e2e --mode development",
6+
"dev": "vite --port 8080",
7+
"build": "vite build",
8+
"preview": "vite preview --port 8080",
9+
"test": "pnpm run test:e2e",
10+
"test:e2e": "start-server-and-test preview http://localhost:8080 test:e2e:run",
11+
"test:e2e:run": "start-server-and-test api 'http-get://localhost:4042/graphql?query=%7B__typename%7D' test:e2e:cy",
12+
"test:e2e:cy": "cypress run --headless",
13+
"test:e2e:dev": "cypress open",
1314
"api": "test-server --simulate-latency 50",
14-
"api:dev": "test-server --simulate-latency 500"
15+
"api:dev": "test-server --simulate-latency 500"
1516
},
1617
"dependencies": {
17-
"@apollo/client": "^3.7.7",
18+
"@apollo/client": "^3.7.16",
1819
"@vue/apollo-composable": "workspace:*",
1920
"@vue/apollo-util": "workspace:*",
20-
"core-js": "^3.23.2",
21-
"graphql": "^16.6.0",
21+
"graphql": "^16.7.1",
2222
"graphql-tag": "^2.12.6",
23-
"graphql-ws": "^5.13.1",
24-
"regenerator-runtime": "^0.13.9",
2523
"test-server": "workspace:*",
26-
"vue": "^3.2.37",
27-
"vue-demi": "^0.13.1",
28-
"vue-router": "^4.0.16"
24+
"vue": "^3.3.4",
25+
"@vitejs/plugin-vue": "^4.2.3",
26+
"vue-router": "^4.2.4"
2927
},
3028
"devDependencies": {
31-
"@babel/core": "^7.18.5",
32-
"@vue/cli-plugin-babel": "^5.0.6",
33-
"@vue/cli-plugin-e2e-cypress": "^5.0.6",
34-
"@vue/cli-plugin-typescript": "^5.0.6",
35-
"@vue/cli-service": "^5.0.6",
36-
"axios": "^0.24.0",
37-
"cypress": "^12.14.0",
38-
"kill-port": "^1.6.1",
39-
"start-server-and-test": "^1.14.0",
40-
"tailwindcss": "^1.9.6"
29+
"vite": "^4.4.2",
30+
"vue-tsc": "^1.8.3",
31+
"typescript": "^5.0.2",
32+
"cypress-vite": "^1.4.1",
33+
"axios": "^1.4.0",
34+
"cypress": "^12.17.0",
35+
"start-server-and-test": "^2.0.0",
36+
"tailwindcss": "^3.3.2",
37+
"postcss": "^8.4.25",
38+
"autoprefixer": "^10.4.14"
4139
}
4240
}
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
/* eslint-disable */
2-
31
module.exports = {
4-
plugins: [
5-
require('tailwindcss')(),
6-
require('autoprefixer')(),
7-
],
2+
plugins: {
3+
tailwindcss: {},
4+
autoprefixer: {},
5+
},
86
}
Binary file not shown.

packages/test-e2e-composable-vue3/src/assets/styles/tailwind.postcss renamed to packages/test-e2e-composable-vue3/src/assets/styles/tailwind.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22

33
@tailwind components;
44

5-
@tailwind utilities;
5+
@tailwind utilities;

packages/test-e2e-composable-vue3/src/main.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { DefaultApolloClient } from '@vue/apollo-composable'
33
import { apolloClient } from './apollo'
44
import App from './components/App.vue'
55
import { router } from './router'
6-
import '@/assets/styles/tailwind.postcss'
6+
import '@/assets/styles/tailwind.css'
77

88
const app = createApp({
99
setup () {
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,8 @@
1+
/** @type {import('tailwindcss').Config} */
12
module.exports = {
3+
content: ['./index.html', './src/**/*.{vue,js,ts,jsx,tsx}'],
4+
theme: {
5+
extend: {},
6+
},
7+
plugins: [],
28
}

packages/test-e2e-composable-vue3/tests/e2e/specs/keepPreviousResult.cy.js renamed to packages/test-e2e-composable-vue3/tests/e2e/specs/keepPreviousResult.cy.ts

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
/// <reference types="Cypress" />
2-
31
describe('keepPreviousResult', () => {
42
beforeEach(() => {
53
cy.task('db:reset')

packages/test-e2e-composable-vue3/tests/e2e/specs/nullableQuery.cy.js renamed to packages/test-e2e-composable-vue3/tests/e2e/specs/nullableQuery.cy.ts

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
/// <reference types="Cypress" />
2-
31
describe('nullableQuery', () => {
42
beforeEach(() => {
53
cy.task('db:reset')

packages/test-e2e-composable-vue3/tests/e2e/specs/test.cy.js renamed to packages/test-e2e-composable-vue3/tests/e2e/specs/test.cy.ts

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
/// <reference types="Cypress" />
2-
31
describe('Vue 3 + Apollo Composable', () => {
42
beforeEach(() => {
53
cy.task('db:reset')

packages/test-e2e-composable-vue3/tsconfig.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
"sourceMap": true,
1313
"baseUrl": ".",
1414
"types": [
15-
"webpack-env"
15+
"webpack-env",
16+
"cypress"
1617
],
1718
"paths": {
1819
"@/*": [
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { resolve } from 'path'
2+
import { defineConfig } from 'vite'
3+
import vue from '@vitejs/plugin-vue'
4+
5+
// https://vitejs.dev/config/
6+
export default defineConfig({
7+
plugins: [vue()],
8+
resolve: {
9+
alias: {
10+
'@': resolve(__dirname, './src'),
11+
},
12+
},
13+
})

packages/test-e2e-composable-vue3/vue.config.js

-4
This file was deleted.

packages/test-e2e/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"api": "node server.js"
1414
},
1515
"dependencies": {
16-
"@apollo/client": "^3.7.7",
16+
"@apollo/client": "^3.7.16",
1717
"@vue/apollo-components": "workspace:*",
1818
"@vue/apollo-option": "workspace:*",
1919
"apollo-server-express": "^2.25.4",

packages/vue-apollo-components/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
"vue": "^3.1.0"
4848
},
4949
"devDependencies": {
50-
"@apollo/client": "^3.7.7",
50+
"@apollo/client": "^3.7.16",
5151
"@babel/core": "^7.18.5",
5252
"@babel/plugin-proposal-class-properties": "^7.17.12",
5353
"@babel/plugin-transform-for-of": "^7.18.1",

packages/vue-apollo-composable/package.json

+5-5
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,13 @@
6161
}
6262
},
6363
"devDependencies": {
64-
"@apollo/client": "^3.7.7",
64+
"@apollo/client": "^3.7.16",
6565
"@types/throttle-debounce": "^5.0.0",
66-
"graphql": "^16.6.0",
66+
"graphql": "^16.7.1",
6767
"graphql-tag": "^2.12.6",
6868
"nodemon": "^1.19.4",
69-
"rimraf": "^3.0.2",
70-
"typescript": "^4.7.4",
71-
"vue": "^3.2.37"
69+
"rimraf": "^5.0.1",
70+
"typescript": "^4.9.5",
71+
"vue": "^3.3.4"
7272
}
7373
}

0 commit comments

Comments
 (0)