Skip to content

Commit

Permalink
refactor(e2e-runner): Also add @nx/playwright dep when running migr…
Browse files Browse the repository at this point in the history
…ation
  • Loading branch information
TriPSs committed Aug 31, 2023
1 parent 32770e0 commit 770133f
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions packages/e2e-runner/src/migrations/update-7.0.0/update-7.0.0.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/* eslint-disable @typescript-eslint/no-unused-vars */
import { getProjects, Tree, updateProjectConfiguration } from '@nx/devkit'
import { addDependenciesToPackageJson, getProjects, removeDependenciesFromPackageJson, Tree, updateProjectConfiguration } from '@nx/devkit'
import { existsSync } from 'fs'
import { join } from 'path'

export default function update(host: Tree) {
const projects = getProjects(host)
const deps = {}
let hadProject = false

for (const [name, config] of projects.entries()) {
let updated = false
Expand All @@ -16,6 +16,7 @@ export default function update(host: Tree) {
&& config.targets[target].options?.runner === 'playwright'
) {
updated = true
hadProject = true

let playwrightConfig = undefined

Expand All @@ -40,4 +41,10 @@ export default function update(host: Tree) {
updateProjectConfiguration(host, name, config)
}
}

if (hadProject) {
return addDependenciesToPackageJson(host, {}, {
'@nx/playwright': '16.7.4'
})
}
}

0 comments on commit 770133f

Please sign in to comment.