Skip to content

Commit

Permalink
fix: don't show deps warning for projects that don't require bundler (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
ZachJW34 authored Aug 30, 2022
1 parent 95b6849 commit b615e8a
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 22 deletions.
6 changes: 0 additions & 6 deletions packages/data-context/src/data/ProjectConfigManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -191,12 +191,6 @@ export class ProjectConfigManager {
return
}

const result = await isDependencyInstalled(bundler, this.options.projectRoot)

if (!result.satisfied) {
unsupportedDeps.set(result.dependency.type, result)
}

const isFrameworkSatisfied = async (bundler: typeof WIZARD_BUNDLERS[number], framework: typeof WIZARD_FRAMEWORKS[number]) => {
for (const dep of await (framework.dependencies(bundler.type, this.options.projectRoot))) {
const res = await isDependencyInstalled(dep.dependency, this.options.projectRoot)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ describe('packagesToInstall', () => {

const actual = await ctx.wizard.installDependenciesCommand()

expect(actual).to.eq(`npm install -D react-scripts webpack react-dom react`)
expect(actual).to.eq(`npm install -D react-scripts react-dom react`)
})

it('vueclivue2-unconfigured', async () => {
Expand All @@ -43,7 +43,7 @@ describe('packagesToInstall', () => {

const actual = await ctx.wizard.installDependenciesCommand()

expect(actual).to.eq(`npm install -D @vue/cli-service webpack vue@2`)
expect(actual).to.eq(`npm install -D @vue/cli-service vue@2`)
})

it('vueclivue3-unconfigured', async () => {
Expand All @@ -59,7 +59,7 @@ describe('packagesToInstall', () => {

const actual = await ctx.wizard.installDependenciesCommand()

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

it('vuecli5vue3-unconfigured', async () => {
Expand All @@ -75,7 +75,7 @@ describe('packagesToInstall', () => {

const actual = await ctx.wizard.installDependenciesCommand()

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

it('regular react project with vite', async () => {
Expand Down
10 changes: 10 additions & 0 deletions packages/launchpad/cypress/e2e/config-warning.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -187,4 +187,14 @@ describe('component testing dependency warnings', () => {
cy.contains('Choose a Browser', { timeout: 12000 })
cy.get('[data-cy="warning-alert"]').should('not.exist')
})

it('does not show warning for project that does not require bundler to be installed', () => {
cy.scaffoldProject('next-12')
cy.openProject('next-12')
cy.visitLaunchpad()
cy.get('[data-cy="warning-alert"]').should('not.exist')
cy.get('[data-cy-testingtype="component"]').click()
cy.contains('Choose a Browser', { timeout: 12000 })
cy.get('[data-cy="warning-alert"]').should('not.exist')
})
})
2 changes: 1 addition & 1 deletion packages/launchpad/cypress/e2e/project-setup.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -379,9 +379,9 @@ describe('Launchpad: Setup Project', () => {
cy.findByRole('button', { name: 'Next Step' }).click()
cy.findByRole('button', { name: 'Waiting for you to install the dependencies...' })

cy.contains('li', 'webpack')
cy.contains('li', 'react-scripts')
cy.contains('li', 'react')
cy.contains('li', 'react-dom')

cy.findByRole('button', { name: 'Skip' }).click()

Expand Down
3 changes: 0 additions & 3 deletions packages/scaffold-config/src/frameworks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ export const WIZARD_FRAMEWORKS = [
dependencies: (bundler: WizardBundler['type'], projectPath: string): Promise<DependencyToInstall[]> => {
return Promise.all([
isDependencyInstalled(dependencies.WIZARD_DEPENDENCY_REACT_SCRIPTS, projectPath),
isDependencyInstalled(dependencies.WIZARD_DEPENDENCY_WEBPACK, projectPath),
isDependencyInstalled(dependencies.WIZARD_DEPENDENCY_REACT_DOM, projectPath),
isDependencyInstalled(dependencies.WIZARD_DEPENDENCY_REACT, projectPath),
])
Expand All @@ -107,7 +106,6 @@ export const WIZARD_FRAMEWORKS = [
dependencies: (bundler: WizardBundler['type'], projectPath: string): Promise<DependencyToInstall[]> => {
return Promise.all([
isDependencyInstalled(dependencies.WIZARD_DEPENDENCY_VUE_CLI_SERVICE, projectPath),
isDependencyInstalled(dependencies.WIZARD_DEPENDENCY_WEBPACK, projectPath),
isDependencyInstalled(dependencies.WIZARD_DEPENDENCY_VUE_2, projectPath),
])
},
Expand All @@ -127,7 +125,6 @@ export const WIZARD_FRAMEWORKS = [
dependencies: (bundler: WizardBundler['type'], projectPath: string): Promise<DependencyToInstall[]> => {
return Promise.all([
isDependencyInstalled(dependencies.WIZARD_DEPENDENCY_VUE_CLI_SERVICE, projectPath),
isDependencyInstalled(dependencies.WIZARD_DEPENDENCY_WEBPACK, projectPath),
isDependencyInstalled(dependencies.WIZARD_DEPENDENCY_VUE_3, projectPath),
])
},
Expand Down
7 changes: 0 additions & 7 deletions system-tests/__snapshots__/component_testing_spec.ts.js
Original file line number Diff line number Diff line change
Expand Up @@ -533,13 +533,6 @@ exports['React major versions with Vite executes all of the tests for React v18
`

exports['experimentalSingleTabRunMode / executes all specs in a single tab'] = `
We detected that you have versions of dependencies that are not officially supported:
- \`webpack\`. Expected >=4.0.0 || >=5.0.0 but dependency was not found.
If you're experiencing problems, downgrade dependencies and restart Cypress.
30 modules
====================================================================================================
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
module.exports = {}
module.exports = {
stats: 'errors-warnings',
}

5 comments on commit b615e8a

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on b615e8a Aug 30, 2022

Choose a reason for hiding this comment

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

Circle has built the linux x64 version of the Test Runner.

Learn more about this pre-release platform-specific build at https://on.cypress.io/installing-cypress#Install-pre-release-version.

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/10.7.1/linux-x64/develop-b615e8ac30b681b4dc8485afe9814ff453da1fbf/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on b615e8a Aug 30, 2022

Choose a reason for hiding this comment

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

Circle has built the linux arm64 version of the Test Runner.

Learn more about this pre-release platform-specific build at https://on.cypress.io/installing-cypress#Install-pre-release-version.

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/10.7.1/linux-arm64/develop-b615e8ac30b681b4dc8485afe9814ff453da1fbf/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on b615e8a Aug 30, 2022

Choose a reason for hiding this comment

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

Circle has built the darwin arm64 version of the Test Runner.

Learn more about this pre-release platform-specific build at https://on.cypress.io/installing-cypress#Install-pre-release-version.

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/10.7.1/darwin-arm64/develop-b615e8ac30b681b4dc8485afe9814ff453da1fbf/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on b615e8a Aug 30, 2022

Choose a reason for hiding this comment

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

Circle has built the darwin x64 version of the Test Runner.

Learn more about this pre-release platform-specific build at https://on.cypress.io/installing-cypress#Install-pre-release-version.

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/10.7.1/darwin-x64/develop-b615e8ac30b681b4dc8485afe9814ff453da1fbf/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on b615e8a Aug 30, 2022

Choose a reason for hiding this comment

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

Circle has built the win32 x64 version of the Test Runner.

Learn more about this pre-release platform-specific build at https://on.cypress.io/installing-cypress#Install-pre-release-version.

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/10.7.1/win32-x64/develop-b615e8ac30b681b4dc8485afe9814ff453da1fbf/cypress.tgz

Please sign in to comment.