Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Use require.resolve when yarn v2 is detected #15623

Closed
Changes from 2 commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
ac2f274
fix: Use require.resolve when yarn v2 is detected
blake-transcend Mar 22, 2021
e0dea49
Update resolve.js
blake-transcend Mar 22, 2021
e31ce74
Merge branch 'develop' into issue-8008-typescript-plugins-pnp
blake-transcend Mar 23, 2021
f457d77
Merge branch 'develop' into issue-8008-typescript-plugins-pnp
blake-transcend Mar 23, 2021
8120618
Merge branch 'develop' into issue-8008-typescript-plugins-pnp
blake-transcend Mar 24, 2021
051aec4
Merge branch 'develop' into issue-8008-typescript-plugins-pnp
blake-transcend Mar 30, 2021
89c245b
Update resolve.js
blake-transcend Apr 1, 2021
89997d4
Update resolve.js
blake-transcend Apr 1, 2021
4e47428
Update resolve.js
blake-transcend Apr 1, 2021
67cf414
Merge branch 'develop' into issue-8008-typescript-plugins-pnp
blake-transcend Apr 1, 2021
a056378
Merge branch 'develop' into issue-8008-typescript-plugins-pnp
blake-transcend Apr 2, 2021
d889411
Merge branch 'develop' into issue-8008-typescript-plugins-pnp
blake-transcend Apr 5, 2021
89d0252
Merge branch 'develop' into issue-8008-typescript-plugins-pnp
blake-transcend Apr 5, 2021
2529c82
Merge branch 'develop' into issue-8008-typescript-plugins-pnp
blake-transcend Apr 5, 2021
7ce42cb
Merge branch 'develop' into issue-8008-typescript-plugins-pnp
blake-transcend Apr 6, 2021
c135cda
Merge branch 'develop' into issue-8008-typescript-plugins-pnp
blake-transcend Apr 6, 2021
b8c5c6d
add 4_yarn_v2_spec
flotwig Apr 8, 2021
2a58263
update spec to use `yarn node` to launch cli
flotwig Apr 8, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion packages/server/lib/util/resolve.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
const resolve = require('resolve')
const env = require('./env')
const debug = require('debug')('cypress:server:plugins')
const fs = require('fs')
const path = require('path')

module.exports = {
/**
Expand All @@ -21,7 +23,10 @@ module.exports = {

debug('resolving typescript with options %o', options)
blake-transcend marked this conversation as resolved.
Show resolved Hide resolved

const resolved = resolve.sync('typescript', options)
// use built-in resolve when yarn v2 is detected
const resolved = fs.existsSync(path.join(projectRoot, '.yarn', 'cache')) ?
blake-transcend marked this conversation as resolved.
Show resolved Hide resolved
require.resolve('typescript') :
resolve.sync('typescript', options)
blake-transcend marked this conversation as resolved.
Show resolved Hide resolved

debug('resolved typescript %s', resolved)

Expand Down