mirror of
https://github.com/cypress-io/cypress.git
synced 2026-03-15 05:40:29 -05:00
cleanup decaf
This commit is contained in:
@@ -1,21 +1,8 @@
|
||||
/* eslint-disable
|
||||
brace-style,
|
||||
no-unused-vars,
|
||||
*/
|
||||
// TODO: This file was created by bulk-decaffeinate.
|
||||
// Fix any style issues and re-enable lint.
|
||||
/*
|
||||
* decaffeinate suggestions:
|
||||
* DS102: Remove unnecessary code created because of implicit returns
|
||||
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
|
||||
*/
|
||||
const _ = require('lodash')
|
||||
let fs = require('fs-extra')
|
||||
let glob = require('glob')
|
||||
const Promise = require('bluebird')
|
||||
const inquirer = require('inquirer')
|
||||
const la = require('lazy-ass')
|
||||
const check = require('check-more-types')
|
||||
const path = require('path')
|
||||
|
||||
glob = Promise.promisify(glob)
|
||||
@@ -190,8 +177,7 @@ const whichZipFile = () => {
|
||||
.get('zipFile')
|
||||
}
|
||||
|
||||
const whichVersion = (distDir) => // realpath returns the absolute full path
|
||||
{
|
||||
const whichVersion = (distDir) => {
|
||||
return glob('*/package.json', { cwd: distDir, realpath: true })
|
||||
.map((pkg) => {
|
||||
return fs.readJsonAsync(pkg)
|
||||
@@ -204,8 +190,7 @@ const whichVersion = (distDir) => // realpath returns the absolute full path
|
||||
})
|
||||
}
|
||||
|
||||
const whichRelease = (distDir) => // realpath returns the absolute full path
|
||||
{
|
||||
const whichRelease = (distDir) => {
|
||||
return glob('*/package.json', { cwd: distDir, realpath: true })
|
||||
.map((pkg) => {
|
||||
return fs.readJsonAsync(pkg)
|
||||
|
||||
@@ -1,13 +1,3 @@
|
||||
/* eslint-disable
|
||||
no-unused-vars,
|
||||
*/
|
||||
// TODO: This file was created by bulk-decaffeinate.
|
||||
// Fix any style issues and re-enable lint.
|
||||
/*
|
||||
* decaffeinate suggestions:
|
||||
* DS102: Remove unnecessary code created because of implicit returns
|
||||
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
|
||||
*/
|
||||
const _ = require('lodash')
|
||||
const fse = require('fs-extra')
|
||||
const os = require('os')
|
||||
@@ -28,7 +18,6 @@ const debug = require('debug')('cypress:binary')
|
||||
const R = require('ramda')
|
||||
const la = require('lazy-ass')
|
||||
const check = require('check-more-types')
|
||||
const humanInterval = require('human-interval')
|
||||
|
||||
const meta = require('./meta')
|
||||
const smoke = require('./smoke')
|
||||
@@ -97,18 +86,6 @@ const buildCypressApp = function (platform, version, options = {}) {
|
||||
return testStaticAssets(distDir())
|
||||
}
|
||||
|
||||
const canBuildInDocker = () => {
|
||||
return (platform === 'linux') && (os.platform() === 'darwin')
|
||||
}
|
||||
|
||||
const badPlatformMismatch = function () {
|
||||
console.error(`⛔️ cannot build ${platform} from ${os.platform()}`)
|
||||
console.error('⛔️ should use matching platform to build it')
|
||||
console.error('program arguments')
|
||||
|
||||
return console.error(process.argv)
|
||||
}
|
||||
|
||||
const checkPlatform = function () {
|
||||
log('#checkPlatform')
|
||||
if (platform === os.platform()) {
|
||||
|
||||
@@ -1,30 +1,15 @@
|
||||
/* eslint-disable
|
||||
brace-style,
|
||||
no-unused-vars,
|
||||
*/
|
||||
// TODO: This file was created by bulk-decaffeinate.
|
||||
// Fix any style issues and re-enable lint.
|
||||
/*
|
||||
* decaffeinate suggestions:
|
||||
* DS102: Remove unnecessary code created because of implicit returns
|
||||
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
|
||||
*/
|
||||
const _ = require('lodash')
|
||||
let fs = require('fs-extra')
|
||||
const Promise = require('bluebird')
|
||||
const bumpercar = require('@cypress/bumpercar')
|
||||
const path = require('path')
|
||||
const la = require('lazy-ass')
|
||||
const check = require('check-more-types')
|
||||
const R = require('ramda')
|
||||
const os = require('os')
|
||||
const { configFromEnvOrJsonFile, filenameToShellVariable } = require('@cypress/env-or-json-file')
|
||||
const makeEmptyGithubCommit = require('make-empty-github-commit')
|
||||
const parse = require('parse-github-repo-url')
|
||||
const { setCommitStatus } = require('@cypress/github-commit-status-check')
|
||||
|
||||
fs = Promise.promisifyAll(fs)
|
||||
|
||||
let car = null
|
||||
|
||||
// all the projects to trigger / run / change environment variables for
|
||||
@@ -361,9 +346,9 @@ Testing new Cypress version ${version}
|
||||
}
|
||||
|
||||
return makeEmptyGithubCommit(specificBranchOptions)
|
||||
.catch(() => // maybe there is no branch for next version
|
||||
// try default branch
|
||||
{
|
||||
.catch(() => {
|
||||
// maybe there is no branch for next version
|
||||
// try default branch
|
||||
return makeEmptyGithubCommit(defaultOptions)
|
||||
}).then(createGithubCommitStatusCheck)
|
||||
}
|
||||
|
||||
@@ -1,14 +1,3 @@
|
||||
/* eslint-disable
|
||||
default-case,
|
||||
*/
|
||||
// TODO: This file was created by bulk-decaffeinate.
|
||||
// Fix any style issues and re-enable lint.
|
||||
/*
|
||||
* decaffeinate suggestions:
|
||||
* DS102: Remove unnecessary code created because of implicit returns
|
||||
* DS207: Consider shorter variations of null checks
|
||||
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
|
||||
*/
|
||||
// store the cwd
|
||||
const cwd = process.cwd()
|
||||
|
||||
@@ -133,6 +122,8 @@ const deploy = {
|
||||
.then((v) => {
|
||||
return bump.version(v)
|
||||
})
|
||||
default:
|
||||
throw new Error('unknown task')
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
@@ -1,10 +1,3 @@
|
||||
// TODO: This file was created by bulk-decaffeinate.
|
||||
// Sanity-check the conversion and remove this comment.
|
||||
/*
|
||||
* decaffeinate suggestions:
|
||||
* DS102: Remove unnecessary code created because of implicit returns
|
||||
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
|
||||
*/
|
||||
const chalk = require('chalk')
|
||||
|
||||
module.exports = function (msg, color = 'yellow') {
|
||||
|
||||
@@ -1,13 +1,3 @@
|
||||
/* eslint-disable
|
||||
default-case,
|
||||
*/
|
||||
// TODO: This file was created by bulk-decaffeinate.
|
||||
// Fix any style issues and re-enable lint.
|
||||
/*
|
||||
* decaffeinate suggestions:
|
||||
* DS102: Remove unnecessary code created because of implicit returns
|
||||
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
|
||||
*/
|
||||
const path = require('path')
|
||||
const la = require('lazy-ass')
|
||||
const check = require('check-more-types')
|
||||
@@ -55,6 +45,8 @@ const buildDir = function (platform, ...args) {
|
||||
|
||||
// x86 32bit architecture
|
||||
return path.resolve(root, 'win-ia32-unpacked', ...args)
|
||||
default:
|
||||
throw new Error('unexpected platform')
|
||||
}
|
||||
}
|
||||
|
||||
@@ -75,6 +67,8 @@ const zipDir = function (platform) {
|
||||
return buildDir(platform)
|
||||
case 'win32':
|
||||
return buildDir(platform)
|
||||
default:
|
||||
throw new Error('unexpected platform')
|
||||
}
|
||||
}
|
||||
|
||||
@@ -89,6 +83,8 @@ const buildAppDir = function (platform, ...args) {
|
||||
return buildDir(platform, 'resources', 'app', ...args)
|
||||
case 'win32':
|
||||
return buildDir(platform, 'resources', 'app', ...args)
|
||||
default:
|
||||
throw new Error('unexpected platform')
|
||||
}
|
||||
}
|
||||
|
||||
@@ -101,6 +97,8 @@ const buildAppExecutable = function (platform) {
|
||||
return buildDir(platform, 'Cypress')
|
||||
case 'win32':
|
||||
return buildDir(platform, 'Cypress')
|
||||
default:
|
||||
throw new Error('unexpected platform')
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,10 +1,3 @@
|
||||
// TODO: This file was created by bulk-decaffeinate.
|
||||
// Sanity-check the conversion and remove this comment.
|
||||
/*
|
||||
* decaffeinate suggestions:
|
||||
* DS102: Remove unnecessary code created because of implicit returns
|
||||
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
|
||||
*/
|
||||
const _ = require('lodash')
|
||||
const fse = require('fs-extra')
|
||||
const cp = require('child_process')
|
||||
|
||||
@@ -1,13 +1,3 @@
|
||||
/* eslint-disable
|
||||
no-unused-vars,
|
||||
*/
|
||||
// TODO: This file was created by bulk-decaffeinate.
|
||||
// Fix any style issues and re-enable lint.
|
||||
/*
|
||||
* decaffeinate suggestions:
|
||||
* DS102: Remove unnecessary code created because of implicit returns
|
||||
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
|
||||
*/
|
||||
const minimist = require('minimist')
|
||||
const Promise = require('bluebird')
|
||||
const la = require('lazy-ass')
|
||||
@@ -18,8 +8,6 @@ const awspublish = require('gulp-awspublish')
|
||||
const rename = require('gulp-rename')
|
||||
const gulpDebug = require('gulp-debug')
|
||||
const gulp = require('gulp')
|
||||
const human = require('human-interval')
|
||||
const R = require('ramda')
|
||||
const uploadUtils = require('./util/upload')
|
||||
|
||||
const npmPackageExtension = '.tgz'
|
||||
|
||||
@@ -1,14 +1,3 @@
|
||||
/* eslint-disable
|
||||
no-unused-vars,
|
||||
*/
|
||||
// TODO: This file was created by bulk-decaffeinate.
|
||||
// Fix any style issues and re-enable lint.
|
||||
/*
|
||||
* decaffeinate suggestions:
|
||||
* DS102: Remove unnecessary code created because of implicit returns
|
||||
* DS207: Consider shorter variations of null checks
|
||||
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
|
||||
*/
|
||||
const minimist = require('minimist')
|
||||
const Promise = require('bluebird')
|
||||
const la = require('lazy-ass')
|
||||
@@ -19,7 +8,6 @@ const awspublish = require('gulp-awspublish')
|
||||
const rename = require('gulp-rename')
|
||||
const gulpDebug = require('gulp-debug')
|
||||
const gulp = require('gulp')
|
||||
const human = require('human-interval')
|
||||
const R = require('ramda')
|
||||
const hasha = require('hasha')
|
||||
|
||||
|
||||
@@ -1,22 +1,9 @@
|
||||
/* eslint-disable
|
||||
no-undef,
|
||||
no-unused-vars,
|
||||
*/
|
||||
// TODO: This file was created by bulk-decaffeinate.
|
||||
// Fix any style issues and re-enable lint.
|
||||
/*
|
||||
* decaffeinate suggestions:
|
||||
* DS102: Remove unnecessary code created because of implicit returns
|
||||
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
|
||||
*/
|
||||
const awspublish = require('gulp-awspublish')
|
||||
const rename = require('gulp-rename')
|
||||
const gulpDebug = require('gulp-debug')
|
||||
let fs = require('fs-extra')
|
||||
const cp = require('child_process')
|
||||
const path = require('path')
|
||||
const gulp = require('gulp')
|
||||
const human = require('human-interval')
|
||||
const Promise = require('bluebird')
|
||||
const meta = require('./meta')
|
||||
const la = require('lazy-ass')
|
||||
@@ -188,7 +175,7 @@ module.exports = {
|
||||
p.dirname = this.getUploadDirName({ version, platform })
|
||||
|
||||
return p
|
||||
})).pipe(debug())
|
||||
})).pipe(gulpDebug())
|
||||
.pipe(publisher.publish(headers))
|
||||
.pipe(awspublish.reporter())
|
||||
.on('error', reject)
|
||||
|
||||
@@ -1,19 +1,5 @@
|
||||
/* eslint-disable
|
||||
brace-style,
|
||||
no-undef,
|
||||
no-unused-vars,
|
||||
*/
|
||||
// TODO: This file was created by bulk-decaffeinate.
|
||||
// Fix any style issues and re-enable lint.
|
||||
/*
|
||||
* decaffeinate suggestions:
|
||||
* DS102: Remove unnecessary code created because of implicit returns
|
||||
* DS207: Consider shorter variations of null checks
|
||||
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
|
||||
*/
|
||||
const _ = require('lodash')
|
||||
let fs = require('fs-extra')
|
||||
const cp = require('child_process')
|
||||
const path = require('path')
|
||||
// we wrap glob to handle EMFILE error
|
||||
let glob = require('glob')
|
||||
@@ -95,32 +81,33 @@ const copyAllToDist = function (distDir) {
|
||||
}
|
||||
|
||||
const copyPackage = function (pkg) {
|
||||
let globOptions
|
||||
|
||||
console.log('** copy package: %s **', pkg)
|
||||
|
||||
// copies the package to dist
|
||||
// including the default paths
|
||||
// and any specified in package.json files
|
||||
return Promise.resolve(fs.readJsonAsync(pathToPackageJson(pkg)))
|
||||
.then((json) => // grab all the files that match "files" wildcards
|
||||
// but without all negated files ("!src/**/*.spec.js" for example)
|
||||
// and default included paths
|
||||
// and convert to relative paths
|
||||
{
|
||||
.then((json) => {
|
||||
// grab all the files that match "files" wildcards
|
||||
// but without all negated files ("!src/**/*.spec.js" for example)
|
||||
// and default included paths
|
||||
// and convert to relative paths
|
||||
return DEFAULT_PATHS
|
||||
.concat(json.files || [])
|
||||
.concat(json.main || [])
|
||||
}).then((pkgFileMasks) => {},
|
||||
debug('for pkg %s have the following file masks %o', pkg, pkgFileMasks),
|
||||
(globOptions = {
|
||||
}).then((pkgFileMasks) => {
|
||||
debug('for pkg %s have the following file masks %o', pkg, pkgFileMasks)
|
||||
const globOptions = {
|
||||
cwd: pkg, // search in the package folder
|
||||
absolute: false, // and return relative file paths
|
||||
followSymbolicLinks: false, // do not follow symlinks
|
||||
}),
|
||||
externalUtils.globby(pkgFileMasks, globOptions)).map((foundFileRelativeToPackageFolder) => {
|
||||
}
|
||||
|
||||
return externalUtils.globby(pkgFileMasks, globOptions)
|
||||
}).map((foundFileRelativeToPackageFolder) => {
|
||||
return path.join(pkg, foundFileRelativeToPackageFolder)
|
||||
}).tap(debug)
|
||||
})
|
||||
.tap(debug)
|
||||
.map(copyRelativePathToDist, { concurrency: 1 })
|
||||
}
|
||||
|
||||
@@ -172,8 +159,8 @@ const removeDevDependencies = function (packageFolder) {
|
||||
const retryGlobbing = function (pathToPackages, delay = 1000) {
|
||||
const retryGlob = () => {
|
||||
return glob(pathToPackages)
|
||||
.catch({ code: 'EMFILE' }, () => // wait, then retry
|
||||
{
|
||||
.catch({ code: 'EMFILE' }, () => {
|
||||
// wait, then retry
|
||||
return Promise
|
||||
.delay(delay)
|
||||
.then(retryGlob)
|
||||
@@ -259,9 +246,6 @@ const symlinkAll = function (pathToDistPackages, pathTo) {
|
||||
la(check.unemptyString(pathToDistPackages),
|
||||
'missing paths to dist packages', pathToDistPackages)
|
||||
|
||||
const baseDir = path.dirname(pathTo())
|
||||
const toBase = path.relative.bind(null, baseDir)
|
||||
|
||||
const symlink = function (pkg) {
|
||||
// console.log(pkg, dist)
|
||||
// strip off the initial './'
|
||||
|
||||
@@ -1,20 +1,9 @@
|
||||
/* eslint-disable
|
||||
no-unused-vars,
|
||||
*/
|
||||
// TODO: This file was created by bulk-decaffeinate.
|
||||
// Fix any style issues and re-enable lint.
|
||||
/*
|
||||
* decaffeinate suggestions:
|
||||
* DS102: Remove unnecessary code created because of implicit returns
|
||||
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
|
||||
*/
|
||||
const _ = require('lodash')
|
||||
const path = require('path')
|
||||
const awspublish = require('gulp-awspublish')
|
||||
const human = require('human-interval')
|
||||
const la = require('lazy-ass')
|
||||
const check = require('check-more-types')
|
||||
const cp = require('child_process')
|
||||
const fse = require('fs-extra')
|
||||
const os = require('os')
|
||||
const Promise = require('bluebird')
|
||||
|
||||
@@ -1,10 +1,3 @@
|
||||
// TODO: This file was created by bulk-decaffeinate.
|
||||
// Sanity-check the conversion and remove this comment.
|
||||
/*
|
||||
* decaffeinate suggestions:
|
||||
* DS102: Remove unnecessary code created because of implicit returns
|
||||
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
|
||||
*/
|
||||
const Promise = require('bluebird')
|
||||
const os = require('os')
|
||||
const execa = require('execa')
|
||||
|
||||
Reference in New Issue
Block a user