Skip to content

Commit 88bd5b0

Browse files
committed
breaking: remove support for @vue/cli-serivce from Cypress Component Testing
1 parent 37b944f commit 88bd5b0

File tree

125 files changed

+9154
-40780
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

125 files changed

+9154
-40780
lines changed

.circleci/cache-version.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# Bump this version to force CI to re-create the cache from scratch.
22

3-
11-07-24-cra-removal
3+
11-07-24-vue-cli-removal

cli/CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ _Released 12/3/2024 (PENDING)_
2323
- Cypress Component Testing no longer supports `Angular` versions 13, 14, 15, and 16. The minimum supported version is now `17.2.0` in order to fully support Angular [signals](https://angular.dev/guide/signals). Addresses [#29582](https://github.com/cypress-io/cypress/issues/29582). Addressed in [#30539](https://github.com/cypress-io/cypress/pull/30539).
2424
- The `cypress/angular-signals` test harness is no longer included in the Cypress binary. Instead, signals support is now shipped with `cypress/angular`! This requires `rxjs` to be installed as a `peerDependency`. Addresses [#29606](https://github.com/cypress-io/cypress/issues/29606).
2525
- Cypress Component Testing no longer supports `create-react-app`. Addresses [#30028](https://github.com/cypress-io/cypress/issues/30028).
26+
- Cypress Component Testing no longer supports `@vue/cli-service`. Addresses [#30481](https://github.com/cypress-io/cypress/issues/30481).
2627

2728
**Deprecations:**
2829

cli/types/cypress.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -3515,7 +3515,7 @@ declare namespace Cypress {
35153515

35163516
type DevServerConfigOptions = {
35173517
bundler: 'webpack'
3518-
framework: 'react' | 'vue' | 'vue-cli' | 'next' | 'svelte'
3518+
framework: 'react' | 'vue' | 'next' | 'svelte'
35193519
webpackConfig?: ConfigHandler<PickConfigOpt<'webpackConfig'>>
35203520
} | {
35213521
bundler: 'vite'

cli/types/tests/cypress-npm-api-test.ts

-10
Original file line numberDiff line numberDiff line change
@@ -104,16 +104,6 @@ const componentConfigVueWebpack: Cypress.ConfigOptions = {
104104
}
105105
}
106106

107-
const componentConfigVueCliWebpack: Cypress.ConfigOptions = {
108-
component: {
109-
devServer: {
110-
bundler: 'webpack',
111-
framework: 'vue-cli',
112-
webpackConfig: {}
113-
}
114-
}
115-
}
116-
117107
const componentConfigViteReact: Cypress.ConfigOptions = {
118108
component: {
119109
devServer: {

npm/webpack-dev-server/cypress/e2e/vue-cli.cy.ts

-85
This file was deleted.

npm/webpack-dev-server/src/devServer.ts

-4
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import type { Compiler, Configuration } from 'webpack'
77

88
import { createWebpackDevServer } from './createWebpackDevServer'
99
import debugLib from 'debug'
10-
import { vueCliHandler } from './helpers/vueCliHandler'
1110
import { nextHandler } from './helpers/nextHandler'
1211
import { sourceDefaultWebpackDependencies, SourceRelativeWebpackResult } from './helpers/sourceRelativeWebpackModules'
1312
import { angularHandler } from './helpers/angularHandler'
@@ -107,9 +106,6 @@ async function getPreset (devServerConfig: WebpackDevServerConfig): Promise<Opti
107106
}
108107

109108
switch (devServerConfig.framework) {
110-
case 'vue-cli':
111-
return await vueCliHandler(devServerConfig)
112-
113109
case 'next':
114110
return await nextHandler(devServerConfig)
115111

npm/webpack-dev-server/src/helpers/sourceRelativeWebpackModules.ts

-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ export const cypressWebpackPath = (config: WebpackDevServerConfig) => {
6666
type FrameworkWebpackMapper = { [Property in Frameworks]: string | undefined }
6767

6868
const frameworkWebpackMapper: FrameworkWebpackMapper = {
69-
'vue-cli': '@vue/cli-service',
7069
react: undefined,
7170
vue: undefined,
7271
next: 'next',

npm/webpack-dev-server/src/helpers/vueCliHandler.ts

-27
This file was deleted.

npm/webpack-dev-server/test/handlers/vueCliHandler.spec.ts

-27
This file was deleted.

packages/app/cypress/e2e/runner/ct-framework-errors.cy.ts

+8-8
Original file line numberDiff line numberDiff line change
@@ -208,21 +208,21 @@ describe('Vue', {
208208
numTestsKeptInMemory: 1,
209209
}, () => {
210210
beforeEach(() => {
211-
cy.scaffoldProject('vuecli5-vue3')
211+
cy.scaffoldProject('vue3-webpack-ts-configured')
212212
})
213213

214214
it('error conditions', () => {
215215
const verify = loadErrorSpec({
216-
projectName: 'vuecli5-vue3',
216+
projectName: 'vue3-webpack-ts-configured',
217217
configFile: 'cypress.config.ts',
218-
filePath: 'src/components/Errors.cy.js',
218+
filePath: 'src/components/Errors.cy.ts',
219219
failCount: 4,
220220
})
221221

222222
verify('error on mount', {
223223
fileName: 'Errors.vue',
224224
line: 19,
225-
column: 16,
225+
column: 15,
226226
message: [
227227
'mount error',
228228
],
@@ -232,7 +232,7 @@ describe('Vue', {
232232
verify('sync error', {
233233
fileName: 'Errors.vue',
234234
line: 24,
235-
column: 16,
235+
column: 15,
236236
uncaught: true,
237237
uncaughtMessage: 'sync error',
238238
message: [
@@ -247,7 +247,7 @@ describe('Vue', {
247247
verify('async error', {
248248
fileName: 'Errors.vue',
249249
line: 28,
250-
column: 18,
250+
column: 17,
251251
uncaught: true,
252252
uncaughtMessage: 'async error',
253253
message: [
@@ -265,8 +265,8 @@ describe('Vue', {
265265
'Timed out retrying',
266266
'element-that-does-not-exist',
267267
],
268-
codeFrameRegex: /Errors\.cy\.js:25/,
269-
stackRegex: /Errors\.cy\.js:25/,
268+
codeFrameRegex: /Errors\.cy\.ts:32/,
269+
stackRegex: /Errors\.cy\.ts:32/,
270270
})
271271
})
272272
})

packages/app/cypress/e2e/runner/reporter-ct-mount-hover.cy.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@ const PROJECTS: {projectName: ProjectDirs[number], test: string}[] = [
66
{ projectName: 'angular-18', test: 'app.component' },
77
{ projectName: 'react-vite-ts-configured', test: 'App.cy' },
88
{ projectName: 'react18', test: 'App.cy' },
9-
{ projectName: 'vueclivue3-configured', test: 'HelloWorld.cy' },
9+
{ projectName: 'next-14', test: 'index.cy' },
10+
{ projectName: 'vue3-vite-ts-configured', test: 'HelloWorld.cy' },
11+
{ projectName: 'vue3-webpack-ts-configured', test: 'HelloWorld.cy' },
12+
{ projectName: 'svelte-vite', test: 'App.cy' },
1013
]
1114

1215
// These are especially flaky on windows, skipping them there.

packages/data-context/test/unit/sources/WizardDataSource.spec.ts

+8-8
Original file line numberDiff line numberDiff line change
@@ -15,36 +15,36 @@ describe('packagesToInstall', () => {
1515
removeCommonNodeModules()
1616
})
1717

18-
it('vueclivue3-unconfigured', async () => {
18+
it('regular react project with webpack', async () => {
1919
const ctx = createTestDataContext()
2020

21-
const projectPath = await scaffoldMigrationProject('vueclivue3-unconfigured')
21+
const projectPath = await scaffoldMigrationProject('react-app-webpack-5-unconfigured')
2222

2323
ctx.update((coreData) => {
2424
coreData.currentProject = projectPath
25-
coreData.wizard.chosenFramework = findFramework('vueclivue3')
25+
coreData.wizard.chosenFramework = findFramework('react')
2626
coreData.wizard.chosenBundler = findBundler('webpack')
2727
})
2828

2929
const actual = await ctx.wizard.installDependenciesCommand()
3030

31-
expect(actual).to.eq(`npm install -D @vue/cli-service vue`)
31+
expect(actual).to.eq(`npm install -D webpack react react-dom`)
3232
})
3333

34-
it('vuecli5vue3-unconfigured', async () => {
34+
it('regular vue project with webpack', async () => {
3535
const ctx = createTestDataContext()
3636

37-
const projectPath = await scaffoldMigrationProject('vuecli5vue3-unconfigured')
37+
const projectPath = await scaffoldMigrationProject('vue3-webpack-ts-unconfigured')
3838

3939
ctx.update((coreData) => {
4040
coreData.currentProject = projectPath
41-
coreData.wizard.chosenFramework = findFramework('vueclivue3')
41+
coreData.wizard.chosenFramework = findFramework('vue3')
4242
coreData.wizard.chosenBundler = findBundler('webpack')
4343
})
4444

4545
const actual = await ctx.wizard.installDependenciesCommand()
4646

47-
expect(actual).to.eq(`npm install -D @vue/cli-service vue`)
47+
expect(actual).to.eq(`npm install -D webpack vue`)
4848
})
4949

5050
it('regular react project with vite', async () => {

packages/launchpad/cypress/e2e/config-warning.cy.ts

+8-9
Original file line numberDiff line numberDiff line change
@@ -209,30 +209,29 @@ describe('component testing dependency warnings', () => {
209209
cy.get('.warning-markdown').find('li').should('have.length', 3)
210210
})
211211

212-
// TODO: make this version of @vue/cli-service 5 in https://github.com/cypress-io/cypress/issues/30295 or related issue
213-
it.skip('warns against outdated @vue/cli dependency', () => {
214-
cy.scaffoldProject('outdated-deps-vuecli3')
215-
cy.addProject('outdated-deps-vuecli3')
212+
it('warns against outdated vue/vite dependency', () => {
213+
cy.scaffoldProject('outdated-deps-vue-vite')
214+
cy.addProject('outdated-deps-vue-vite')
216215
cy.openGlobalMode()
217216
cy.visitLaunchpad()
218-
cy.contains('outdated-deps-vuecli3').click()
217+
cy.contains('outdated-deps-vue-vite').click()
219218
cy.get('[data-cy="warning-alert"]').should('not.exist')
220219
cy.contains('a', 'Projects').click()
221220
cy.get('[data-cy-testingtype="component"]', { timeout: 12000 }).click()
222221
cy.get('[data-cy="warning-alert"]', { timeout: 12000 }).should('exist')
223222
.should('contain.text', 'Warning: Component Testing Mismatched Dependencies')
224-
.should('contain.text', '@vue/cli-service. Expected ^4.0.0 || ^5.0.0, found 3.12.1.')
223+
.should('contain.text', 'vite. Expected ^4.0.0 || ^5.0.0, found 3.2.11.')
225224
.should('contain.text', 'vue. Expected ^3.0.0, found 2.7.8.')
226225

227226
cy.get('.warning-markdown').find('li').should('have.length', 2)
228227
})
229228

230229
it('does not show warning for project with supported dependencies', () => {
231-
cy.scaffoldProject('vueclivue3-configured')
232-
cy.addProject('vueclivue3-configured')
230+
cy.scaffoldProject('vue3-webpack-ts-configured')
231+
cy.addProject('vue3-webpack-ts-configured')
233232
cy.openGlobalMode()
234233
cy.visitLaunchpad()
235-
cy.contains('vueclivue3-configured').click()
234+
cy.contains('vue3-webpack-ts-configured').click()
236235
cy.get('[data-cy="warning-alert"]').should('not.exist')
237236
cy.get('a').contains('Projects').click()
238237
cy.get('[data-cy-testingtype="component"]', { timeout: 10000 }).click()

packages/launchpad/cypress/e2e/scaffold-component-testing.cy.ts

+6-5
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,17 @@ const ONE_MINUTE = 1000 * 60
2424
describe('scaffolding component testing', {
2525
taskTimeout: ONE_MINUTE,
2626
}, () => {
27-
context('vuecli5vue3', () => {
28-
it('scaffolds component testing for Vue CLI 5 w/ Vue 3 project', () => {
29-
startSetupFor('vuecli5vue3-unconfigured')
27+
context('webpack5vue3', () => {
28+
it('scaffolds component testing for Webpack 5 w/ Vue 3 project', () => {
29+
startSetupFor('vue3-webpack-ts-unconfigured')
3030

3131
// should detect correctly
32-
cy.get('button').should('be.visible').contains('Vue CLI (Vue 3)(detected)')
32+
cy.get('button').should('be.visible').contains('Vue.js 3(detected)')
33+
cy.get('button').should('be.visible').contains('Webpack(detected)')
3334
cy.get('button').contains('Next step').click()
3435
cy.findByRole('button', { name: 'Continue' }).click()
3536
cy.get('[data-cy="launchpad-Configuration files"]').should('be.visible')
36-
verifyConfigFile(`cypress.config.js`)
37+
verifyConfigFile(`cypress.config.ts`)
3738
})
3839
})
3940

packages/launchpad/src/setup/SelectFrameworkOrBundler.cy.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ describe('<SelectFrameworkOrBundler />', () => {
4747
{
4848
name: 'VueJs',
4949
id: 'vue',
50-
type: 'vueclivue3',
50+
type: 'vite',
5151
supportStatus: 'full',
5252
},
5353
]}

0 commit comments

Comments
 (0)