diff --git a/circle.yml b/circle.yml index 6043cbe79c..1cc2e30aaf 100644 --- a/circle.yml +++ b/circle.yml @@ -59,7 +59,8 @@ executors: # https://circleci.com/docs/2.0/testing-ios/#supported-xcode-versions mac: macos: - xcode: "10.1.0" + ## Node 12.10.0 (yarn 1.17.3) + xcode: "11.0.0" environment: PLATFORM: mac @@ -235,7 +236,7 @@ jobs: - run: ls $(yarn global bin)/../lib/node_modules # try several times, because flaky NPM installs ... - - run: yarn --ignore-engines || yarn --ignore-engines + - run: yarn || yarn - run: name: Top level packages command: yarn list --depth=0 || true diff --git a/package.json b/package.json index 54ded21e81..af54a6e7f6 100644 --- a/package.json +++ b/package.json @@ -218,9 +218,6 @@ "packages": [ "cli", "packages/*" - ], - "nohoist": [ - "@packages/driver/*" ] }, "lint-staged": { diff --git a/packages/driver/package.json b/packages/driver/package.json index 921154151f..86a7da542b 100644 --- a/packages/driver/package.json +++ b/packages/driver/package.json @@ -6,7 +6,7 @@ "clean-deps": "rm -rf node_modules", "cypress:open": "node ../../scripts/cypress open --project ./test", "cypress:run": "node ../../scripts/cypress run --project ./test", - "postinstall": "npx patch-package", + "postinstall": "patch-package", "start": "$(yarn bin coffee) test/support/server.coffee" }, "devDependencies": { @@ -66,6 +66,12 @@ "zone.js": "0.9.0" }, "files": [ - "lib" - ] + "lib", + "patches" + ], + "workspaces": { + "nohoist": [ + "*" + ] + } } diff --git a/packages/driver/patches/sinon+8.1.1.patch b/packages/driver/patches/sinon+8.1.1.dev.patch similarity index 100% rename from packages/driver/patches/sinon+8.1.1.patch rename to packages/driver/patches/sinon+8.1.1.dev.patch diff --git a/packages/socket/lib/socket.js b/packages/socket/lib/socket.js index dd20b07709..cb00e9c3f1 100644 --- a/packages/socket/lib/socket.js +++ b/packages/socket/lib/socket.js @@ -1,9 +1,9 @@ const fs = require('fs') const server = require('socket.io') -const path = require('path') -const pkg = require('socket.io-client/package.json') +const { version } = require('socket.io-client/package.json') const { client, circularParser } = require('./browser') -const resolvePkg = require('resolve-pkg') + +const clientSource = require.resolve('socket.io-client/dist/socket.io.js') module.exports = { server, @@ -13,17 +13,11 @@ module.exports = { circularParser, getPathToClientSource () { - const clientSource = resolvePkg('socket.io-client/dist/socket.io.js', { cwd: path.join(__dirname, '..', '..', '..') }) - - if (fs.existsSync(clientSource)) { - return clientSource - } - - return require.resolve('socket.io-client/dist/socket.io.js') + return clientSource }, getClientVersion () { - return pkg.version + return version }, getClientSource () { diff --git a/packages/socket/package.json b/packages/socket/package.json index de00a74a58..53551ce147 100644 --- a/packages/socket/package.json +++ b/packages/socket/package.json @@ -5,23 +5,30 @@ "main": "index.js", "scripts": { "clean-deps": "rm -rf node_modules", + "postinstall": "patch-package", "test": "yarn test-unit", "test-debug": "yarn test-unit --inspect-brk=5566", "test-unit": "cross-env NODE_ENV=test mocha --reporter mocha-multi-reporters --reporter-options configFile=../../mocha-reporter-config.json", "test-watch": "cross-env NODE_ENV=test mocha --watch" }, "dependencies": { - "resolve-pkg": "2.0.0", "socket.io": "2.3.0", - "socket.io-circular-parser": "cypress-io/socket.io-circular-parser#4d3076af68ea8192c2e53f9d185eaa166359b4c5", + "socket.io-circular-parser": "cypress-io/socket.io-circular-parser#unpatched-has-binary-2", "socket.io-client": "2.3.0" }, "devDependencies": { "chai": "3.5.0", "cross-env": "6.0.3", - "mocha": "3.5.3" + "mocha": "3.5.3", + "resolve-pkg": "2.0.0" }, "files": [ - "lib" - ] + "lib", + "patches" + ], + "workspaces": { + "nohoist": [ + "**" + ] + } } diff --git a/patches/has-binary2+1.0.3.patch b/packages/socket/patches/has-binary2+1.0.3.patch similarity index 100% rename from patches/has-binary2+1.0.3.patch rename to packages/socket/patches/has-binary2+1.0.3.patch diff --git a/packages/socket/test/socket_spec.js b/packages/socket/test/socket_spec.js index 0aa6c16c64..16d26a2cd0 100644 --- a/packages/socket/test/socket_spec.js +++ b/packages/socket/test/socket_spec.js @@ -18,7 +18,7 @@ describe('Socket', function () { context('.getPathToClientSource', function () { it('returns path to socket.io.js', function () { - const clientPath = path.join(resolvePkg('socket.io-client', { cwd: path.join(__dirname, '..', '..', '..') }), 'dist', 'socket.io.js') + const clientPath = path.join(resolvePkg('socket.io-client'), 'dist', 'socket.io.js') expect(lib.getPathToClientSource()).to.eq(clientPath) }) @@ -36,7 +36,7 @@ describe('Socket', function () { context('.getClientSource', function () { it('returns client source as a string', function (done) { - const clientPath = path.join(resolvePkg('socket.io-client', { cwd: path.join(__dirname, '..', '..', '..') }), 'dist', 'socket.io.js') + const clientPath = path.join(resolvePkg('socket.io-client'), 'dist', 'socket.io.js') fs.readFile(clientPath, 'utf8', function (err, str) { if (err) done(err) diff --git a/scripts/binary/build.coffee b/scripts/binary/build.coffee index 6159daf9ce..45596a0ae5 100644 --- a/scripts/binary/build.coffee +++ b/scripts/binary/build.coffee @@ -121,20 +121,6 @@ buildCypressApp = (platform, version, options = {}) -> packages.copyAllToDist(distDir()) - copyPatches = -> - log("#copyPatches") - - patchesPath = path.join(__dirname, '..', '..', 'patches') - destPatchesPath = path.join(distDir(), 'patches') - - fs.mkdirSync(destPatchesPath) - fs.readdirSync(patchesPath) - .map((patchFileName) -> [ - path.join(patchesPath, patchFileName), - path.join(destPatchesPath, patchFileName) - ]) - .forEach(([src, dest]) -> fs.copyFileSync(src, dest)) - transformSymlinkRequires = -> log("#transformSymlinkRequires") @@ -355,7 +341,6 @@ buildCypressApp = (platform, version, options = {}) -> .then(cleanupPlatform) .then(buildPackages) .then(copyPackages) - .then(copyPatches) .then(npmInstallPackages) .then(createRootPackage) .then(convertCoffeeToJs) diff --git a/scripts/binary/util/packages.coffee b/scripts/binary/util/packages.coffee index c5580f179f..b928137341 100644 --- a/scripts/binary/util/packages.coffee +++ b/scripts/binary/util/packages.coffee @@ -106,7 +106,7 @@ forceNpmInstall = (packagePath, packageToInstall) -> console.log("Force installing %s", packageToInstall) console.log("in %s", packagePath) la(check.unemptyString(packageToInstall), "missing package to install") - yarn(["install", "--force", "--ignore-engines", packageToInstall], packagePath) + yarn(["install", "--force", packageToInstall], packagePath) removeDevDependencies = (packageFolder) -> packagePath = pathToPackageJson(packageFolder) @@ -141,7 +141,7 @@ npmInstallAll = (pathToPackages) -> # force installing only PRODUCTION dependencies # https://docs.npmjs.com/cli/install - npmInstall = _.partial(yarn, ["install", "--production", "--silent", "--ignore-engines"]) + npmInstall = _.partial(yarn, ["install", "--production"]) npmInstall(pkg, {NODE_ENV: "production"}) .catch {code: "EMFILE"}, -> diff --git a/yarn.lock b/yarn.lock index e7ac4714f3..b85f3aeead 100644 --- a/yarn.lock +++ b/yarn.lock @@ -13490,12 +13490,6 @@ has-ansi@^2.0.0: dependencies: ansi-regex "^2.0.0" -has-binary2@cypress-io/has-binary#8580a33df21e8b36a43f57872a82c60829636a92: - version "1.0.2" - resolved "https://codeload.github.com/cypress-io/has-binary/tar.gz/8580a33df21e8b36a43f57872a82c60829636a92" - dependencies: - isarray "2.0.1" - has-binary2@~1.0.2: version "1.0.3" resolved "https://registry.yarnpkg.com/has-binary2/-/has-binary2-1.0.3.tgz#7776ac627f3ea77250cfc332dab7ddf5e4f5d11d" @@ -22603,14 +22597,14 @@ socket.io-adapter@~1.1.0: resolved "https://registry.yarnpkg.com/socket.io-adapter/-/socket.io-adapter-1.1.1.tgz#2a805e8a14d6372124dd9159ad4502f8cb07f06b" integrity sha1-KoBeihTWNyEk3ZFZrUUC+MsH8Gs= -socket.io-circular-parser@cypress-io/socket.io-circular-parser#4d3076af68ea8192c2e53f9d185eaa166359b4c5: +socket.io-circular-parser@cypress-io/socket.io-circular-parser#unpatched-has-binary-2: version "3.1.2-patch1" - resolved "https://codeload.github.com/cypress-io/socket.io-circular-parser/tar.gz/4d3076af68ea8192c2e53f9d185eaa166359b4c5" + resolved "https://codeload.github.com/cypress-io/socket.io-circular-parser/tar.gz/e274585ec04d1840fd1211dd3061d6dba2160475" dependencies: circular-json "0.5.9" component-emitter "1.2.1" debug "~4.1.0" - has-binary2 cypress-io/has-binary#8580a33df21e8b36a43f57872a82c60829636a92 + has-binary2 "~1.0.2" socket.io-client@2.3.0: version "2.3.0"