mirror of
https://github.com/cypress-io/cypress.git
synced 2026-01-07 23:19:48 -06:00
Co-authored-by: Lachlan Miller <lachlan.miller.1990@outlook.com> Co-authored-by: Zach Bloomquist <git@chary.us> Co-authored-by: Tyler Biethman <tbiethman@users.noreply.github.com> Co-authored-by: Matt Henkes <mjhenkes@gmail.com> Co-authored-by: Chris Breiding <chrisbreiding@users.noreply.github.com> Co-authored-by: Matt Schile <mschile@cypress.io> Co-authored-by: Mark Noonan <mark@cypress.io> Co-authored-by: Zachary Williams <ZachJW34@gmail.com> Co-authored-by: Ben M <benm@cypress.io> Co-authored-by: Zachary Williams <zachjw34@gmail.com> Co-authored-by: astone123 <adams@cypress.io> Co-authored-by: Bill Glesias <bglesias@gmail.com> Co-authored-by: Emily Rohrbough <emilyrohrbough@yahoo.com> Co-authored-by: Emily Rohrbough <emilyrohrbough@users.noreply.github.com> Co-authored-by: semantic-release-bot <semantic-release-bot@martynus.net> Co-authored-by: Adam Stone <adams@cypress.io> Co-authored-by: Blue F <blue@cypress.io> Co-authored-by: GitStart <1501599+gitstart@users.noreply.github.com> Co-authored-by: Mike Plummer <mike-plummer@users.noreply.github.com> Co-authored-by: Jordan <jordan@jpdesigning.com> Co-authored-by: Sam Goodger <turbo@tailz.dev> Co-authored-by: Colum Ferry <cferry09@gmail.com> Co-authored-by: Stokes Player <stokes@cypress.io> Co-authored-by: Vilhelm Melkstam <vilhelm.melkstam@gmail.com> Co-authored-by: amehta265 <65267668+amehta265@users.noreply.github.com>
39 lines
1.2 KiB
JavaScript
39 lines
1.2 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)
|
|
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.')
|
|
})()
|