Files
cypress/system-tests/scripts/projects-yarn-install.js
Bill Glesias 1521399bc8 fix: allow yarn 4 berry to work with cypress webpack preprocessor (#29901)
* fix: make sure string_decoder is shipped with wbip

* fix: remove pnp-webpack-plugin as it isnt needed with webpack 5

* chore: update enhanced-resolve to 5.17.0 in the yarn-lock and remove the need for you 5.15 patch as the issue we were patching was fixed in 5.16

* build binary [run ci]

* resolve to process lib installed by cypress and not the users home directory

* add changelog entry [run ci]

* build binaries [run ci]

* add binary system test

skip system test install for yarn 4 as it is an exception case [run ci]

adapt dep installer to handle yarn 4.1.1 [run ci]

rebase this out [run ci]

try this [run ci]

temp [run ci]

* update circle cache [run ci]

* fix conditional for yarn install [run ci]

* Update system-tests/projects/yarn-v4.1.1-pnp-dep-resolution/README.md

Co-authored-by: Ryan Manuel <ryanm@cypress.io>

* update from yarn 4.1.1 to 4.3.1

* update docker image name

---------

Co-authored-by: Ryan Manuel <ryanm@cypress.io>
2024-07-25 14:29:12 -04:00

46 lines
1.5 KiB
JavaScript

require('@packages/ts/register')
const path = require('path')
const { promisify } = require('util')
const glob = promisify(require('glob'))
const Fixtures = require('../lib/fixtures')
const { scaffoldProjectNodeModules } = require('../lib/dep-installer')
const logTag = '[update-cache.js]'
const log = (...args) => console.log(logTag, ...args)
;(async () => {
/**
* For all system test projects that have a package.json, check and update
* the node_modules cache using `yarn`.
*/
Fixtures.remove()
const projectsDir = path.join(__dirname, '../projects')
const packageJsons = await glob('**/package.json', {
cwd: projectsDir,
})
log('Found', packageJsons.length, '`package.json` files in `projects`:', packageJsons)
for (const packageJsonPath of packageJsons) {
const project = path.dirname(packageJsonPath)
if (project.includes('yarn-v4.3.1-pnp-dep-resolution')) {
log('found project yarn-v4.3.1-pnp-dep-resolution, skipping dependency install as this requires corepack for yarn 4')
log('this project is an exception and tested inside a docker container with corepack and yarn 4 installed against the built cypress binary')
continue
}
const timeTag = `${logTag} ${project} node_modules install`
console.time(timeTag)
log('Scaffolding node_modules for', project)
await Fixtures.scaffoldProject(project)
await scaffoldProjectNodeModules({ project })
console.timeEnd(timeTag)
}
log('Updated node_modules for', packageJsons.length, 'projects.')
})()