diff --git a/.eslintignore b/.eslintignore index 1e654ae4c95e..ca14a9daecf3 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,6 +1,27 @@ -__snapshots__ +# unignore hidden files +!.* + +**/__snapshots__ +**/build +**/cypress/fixtures +**/dist +**/dist-test +**/node_modules +**/support/fixtures +**/test/fixtures +**/vendor + +# cli/types is linted by tslint/dtslint +cli/types +# packages/example is not linted (think about changing this) +packages/example + +packages/extension/test/helpers/background.js packages/server/lib/scaffold/plugins/index.js packages/server/lib/scaffold/support/index.js packages/server/lib/scaffold/support/commands.js -packages/server/test/fixtures -packages/example/cypress + +packages/launcher/lib/**/*.js + +**/package-lock.json +**/tsconfig.json diff --git a/.eslintrc b/.eslintrc index 6f2cbf68ab49..22f00333db5e 100644 --- a/.eslintrc +++ b/.eslintrc @@ -1,72 +1,9 @@ { + "plugins": [ + "@cypress/dev" + ], "extends": [ - "plugin:cypress-dev/general" + "plugin:@cypress/dev/general" ], - "rules": { - "no-multiple-empty-lines": ["error", { "max": 1 } ], - "no-else-return": [ "error", { "allowElseIf": false } ], - "brace-style": ["error", "1tbs", { "allowSingleLine": false }], - "no-unneeded-ternary": ["error"], - "array-bracket-newline": ["error", "consistent"], - "arrow-body-style": ["error", "always"], - "padding-line-between-statements": [ - "error", - { - "blankLine": "always", - "prev": "*", - "next": "return" - }, - { - "blankLine": "always", - "prev": [ - "const", - "let", - "var", - "if", - "while", - "export", - "cjs-export", - "import", - "cjs-import" - ], - "next": "*" - }, - { - "blankLine": "any", - "prev": [ - "const", - "let", - "var", - "import", - "cjs-import" - ], - "next": [ - "const", - "let", - "var", - "import", - "cjs-import" - ] - } - ] - }, - "env": { - "es6": true, - "node": true - }, - "parserOptions": { - "ecmaFeatures": { - "legacyDecorators": true - } - }, - "overrides": [ - { - "files": [ - "**/*.jsx" - ], - "rules": { - "arrow-body-style": "off" - } - } - ] + "rules": {} } diff --git a/.gitignore b/.gitignore index 10dd2b4a9bf2..83a7f76c92fa 100644 --- a/.gitignore +++ b/.gitignore @@ -13,7 +13,6 @@ _test-output cypress.zip tmp/ .nyc_output -.vscode/settings.json # from extension Cached Theme.pak diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 000000000000..871e456f40c1 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,28 @@ +{ + "eslint.autoFixOnSave": true, + "eslint.validate": [ + "javascript", + "javascriptreact", + { + "language": "typescript", + "autoFix": true + }, + { + "language": "typescriptreact", + "autoFix": true + }, + { + "language": "json", + "autoFix": true + }, + { + "language": "coffeescript", + "autoFix": false + } + ], + "eslint.options": { + "rules": { + "no-debugger": "off" + } + } +} diff --git a/.yarnrc b/.yarnrc new file mode 100644 index 000000000000..4f14322dc8b3 --- /dev/null +++ b/.yarnrc @@ -0,0 +1 @@ +--ignore-engines true diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 6c203cd1f419..fe2152b0fdba 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -264,15 +264,16 @@ DEBUG=cypress:launcher ### Coding Style We use [eslint](https://eslint.org/) to lint all JavaScript code and follow rules specified in -[eslint-plugin-cypress-dev](https://github.com/cypress-io/eslint-plugin-cypress-dev) plugin. +[@cypress/eslint-plugin-dev](https://github.com/cypress-io/cypress-eslint-plugin-dev) plugin. -When you edit files, you can quickly fix all changed files before committing using +When you edit files, you can quickly fix all changed files before you commit using ```bash -npm run lint-changed +npm run lint-changed-fix ``` -When committing files, we run Git pre-commit hook to fix the staged JS files. See the `precommit-lint` script in [package.json](package.json). This might change JS files and you would need to commit the changes again. +When committing files, we run a Git pre-commit hook to lint the staged JS files. See the `lint-staged` script in [package.json](package.json). +If this command fails, you may need to run `npm run lint-changed-fix` and commit those changes. ### Tests diff --git a/circle.yml b/circle.yml index 37536e678412..ae6d090241c6 100644 --- a/circle.yml +++ b/circle.yml @@ -206,7 +206,6 @@ jobs: - attach_workspace: at: ~/ - run: npm run lint - - run: npm run all lint unit-tests: <<: *defaults @@ -237,7 +236,7 @@ jobs: - store_test_results: path: /tmp/cypress - lint-typescript: + lint-types: <<: *defaults parallelism: 1 steps: @@ -717,7 +716,7 @@ linux-workflow: &linux-workflow name: Linux lint requires: - build - - lint-typescript: + - lint-types: requires: - build # unit, integration and e2e tests diff --git a/cli/package.json b/cli/package.json index 7a9751e86276..c6d2174ce7bb 100644 --- a/cli/package.json +++ b/cli/package.json @@ -1,36 +1,34 @@ { "name": "cypress", "version": "0.0.0", - "main": "index.js", "private": true, - "bin": { - "cypress": "bin/cypress" - }, - "engines": { - "node": ">=4.0.0" - }, + "files": [ + "bin", + "lib", + "index.js", + "types/**/*.d.ts" + ], + "main": "index.js", "scripts": { + "prebuild": "npm run test-dependencies && node ./scripts/start-build.js", + "build": "node ./scripts/build.js", + "check-deps": "node ../scripts/check-deps.js --verbose", + "check-deps-pre": "npm run check-deps -- --prescript", + "dtslint": "dtslint types", "postinstall": "node ./scripts/post-install.js", + "prerelease": "npm run build", + "release": "cd build && releaser --no-node --no-changelog", + "size": "t=\"$(npm pack .)\"; wc -c \"${t}\"; tar tvf \"${t}\"; rm \"${t}\";", "pretest": "npm run check-deps-pre", "test": "npm run test-unit", + "test-debug": "node --inspect --debug-brk $(bin-up _mocha)", + "test-dependencies": "npm run check-deps && dependency-check . --no-dev", "pretest-unit": "npm run check-deps-pre", "test-unit": "npm run unit", "pretest-watch": "npm run check-deps-pre", "test-watch": "npm run unit -- --watch", - "check-deps": "node ../scripts/check-deps.js --verbose", - "check-deps-pre": "npm run check-deps -- --prescript", - "test-dependencies": "npm run check-deps && dependency-check . --no-dev", - "test-debug": "node --inspect --debug-brk $(bin-up _mocha)", - "unit": "BLUEBIRD_DEBUG=1 NODE_ENV=test bin-up mocha --reporter mocha-multi-reporters --reporter-options configFile=../mocha-reporter-config.json", - "lint": "bin-up eslint --fix *.js scripts/*.js bin/* lib/*.js lib/**/*.js test/*.js test/**/*.js", - "dtslint": "dtslint types", - "prebuild": "npm run test-dependencies && node ./scripts/start-build.js", - "build": "node ./scripts/build.js", - "prerelease": "npm run build", - "release": "cd build && releaser --no-node --no-changelog", - "size": "t=\"$(npm pack .)\"; wc -c \"${t}\"; tar tvf \"${t}\"; rm \"${t}\";" + "unit": "BLUEBIRD_DEBUG=1 NODE_ENV=test bin-up mocha --reporter mocha-multi-reporters --reporter-options configFile=../mocha-reporter-config.json" }, - "types": "types", "dependencies": { "@cypress/listr-verbose-renderer": "0.4.1", "@cypress/xvfb": "1.2.4", @@ -58,7 +56,7 @@ "moment": "2.24.0", "ramda": "0.24.1", "request": "2.88.0", - "request-progress": "3.0.0", + "request-progress": "0.4.0", "supports-color": "5.5.0", "tmp": "0.1.0", "url": "0.11.0", @@ -94,10 +92,11 @@ "snap-shot-it": "7.7.1", "spawn-mock": "1.0.0" }, - "files": [ - "bin", - "lib", - "index.js", - "types/**/*.d.ts" - ] + "bin": { + "cypress": "bin/cypress" + }, + "types": "types", + "engines": { + "node": ">=4.0.0" + } } diff --git a/cli/schema/cypress.schema.json b/cli/schema/cypress.schema.json index 41b0403571b5..740eb24eb86e 100644 --- a/cli/schema/cypress.schema.json +++ b/cli/schema/cypress.schema.json @@ -1,19 +1,22 @@ { - "title": "JSON schema for the https://cypress.io Test Runner's configuration file. Details at https://on.cypress.io/configuration", + "title": "JSON schema for https://cypress.io test runner cypress.json file. Details at https://on.cypress.io/configuration", "$schema": "http://json-schema.org/draft-04/schema#", "type": "object", "properties": { - "baseUrl" : { + "baseUrl": { "type": "string", "description": "Url used as prefix for cy.visit() or cy.request() command’s url. Example http://localhost:3030 or https://test.my-domain.com" }, "env": { "type": "object", - "description": "Any values to be set as environment variables. See https://on.cypress.io/environment-variables", + "description": "Any values to be set as environment variables", "body": {} }, "ignoreTestFiles": { - "type": ["string", "array"], + "type": [ + "string", + "array" + ], "items": { "type": "string" }, @@ -39,11 +42,6 @@ "default": null, "description": "The reporter options used. Supported options depend on the reporter. See https://on.cypress.io/reporters#Reporter-Options" }, - "testFiles": { - "type": "string", - "default": "**/*.*", - "description": "A String glob pattern of the test files to load" - }, "watchForFileChanges": { "type": "boolean", "default": true, @@ -59,15 +57,10 @@ "default": 60000, "description": "Time, in milliseconds, to wait for a system command to finish executing during a cy.exec() command" }, - "taskTimeout": { - "type": "number", - "default": 60000, - "description": "Time, in milliseconds, to wait for a task to finish executing during a cy.task() command" - }, "pageLoadTimeout": { "type": "number", "default": 60000, - "description": "Time, in milliseconds, to wait for page transition events or cy.visit(), cy.go(), cy.reload() commands to fire their page load events. Network requests are limited by the underlying operating system, and may still time out if this value is increased." + "description": "Time, in milliseconds, to wait for page transition events or cy.visit(), cy.go(), cy.reload() commands to fire their page load events" }, "requestTimeout": { "type": "number", @@ -79,13 +72,16 @@ "default": 30000, "description": "Time, in milliseconds, to wait until a response in a cy.request(), cy.wait(), cy.fixture(), cy.getCookie(), cy.getCookies(), cy.setCookie(), cy.clearCookie(), cy.clearCookies(), and cy.screenshot() commands" }, - "fileServerFolder": { + "fileServerFolder": { "type": "string", "default": "root project folder", "description": "Path to folder where application files will attempt to be served from" }, "fixturesFolder": { - "type": ["string", "boolean"], + "type": [ + "string", + "boolean" + ], "default": "cypress/fixtures", "description": "Path to folder containing fixture files (Pass false to disable)" }, @@ -95,44 +91,53 @@ "description": "Path to folder containing integration test files" }, "pluginsFile": { - "type": ["string", "boolean"], + "type": [ + "string", + "boolean" + ], "default": "cypress/plugins/index.js", "description": "Path to plugins file. (Pass false to disable)" }, "screenshotsFolder": { "type": "string", "default": "cypress/screenshots", - "description": "Path to folder where screenshots will be saved from cy.screenshot() command or after a test fails during cypress run" + "description": "Path to folder where screenshots will be saved from cy.screenshot() command or after a headless or CI run’s test failure" }, "supportFile": { - "type": ["string", "boolean"], + "type": [ + "string", + "boolean" + ], "default": "cypress/support/index.js", "description": "Path to file to load before test files load. This file is compiled and bundled. (Pass false to disable)" }, - "videosFolder": { + "videosFolder": { "type": "string", "default": "cypress/videos", - "description": "Path to folder where videos will be saved during cypress run" + "description": "Path to folder where videos will be saved after a headless or CI run" }, "trashAssetsBeforeRuns": { "type": "boolean", "default": true, - "description": "Whether Cypress will trash assets within the screenshotsFolder and videosFolder before tests run with cypress run" + "description": "Whether Cypress will trash assets within the screenshotsFolder and videosFolder before headless test runs." }, - "videoCompression": { - "type": ["number", "boolean"], + "videoCompression": { + "type": [ + "number", + "boolean" + ], "default": 32, "description": "The quality setting for the video compression, in Constant Rate Factor (CRF). The value can be false to disable compression or a value between 0 and 51, where a lower value results in better quality (at the expense of a higher file size)." }, "video": { "type": "boolean", "default": true, - "description": "Whether Cypress will capture a video of the tests run with cypress run" + "description": "Whether Cypress will record a video of the test run when running headlessly." }, "videoUploadOnPasses": { "type": "boolean", "default": true, - "description": "Whether Cypress will process, compress, and upload videos to the Dashboard even when all tests in a spec file are passing. This only applies when recording your runs to the Dashboard. Turn this off if you’d like to only upload the spec file’s video when there are failing tests." + "description": "Whether Cypress will upload the video to the Dashboard even if all tests are passing. This applies only when recording your runs to the Dashboard. Turn this off if you’d like the video uploaded only when there are failing tests." }, "chromeWebSecurity": { "type": "boolean", @@ -145,7 +150,10 @@ "description": "Enables you to override the default user agent the browser sends in all request headers. User agent values are typically used by servers to help identify the operating system, browser, and browser version. See User-Agent MDN Documentation for example user agent values here: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/User-Agent" }, "blacklistHosts": { - "type": ["string", "array"], + "type": [ + "string", + "array" + ], "items": { "type": "string" }, @@ -155,9 +163,9 @@ "modifyObstructiveCode": { "type": "boolean", "default": true, - "description": "Whether Cypress will search for and replace obstructive JS code found in .js or .html files that prevent Cypress from working. Please read the notes for more information on this setting. https://on.cypress.io/configuration#modifyObstructiveCode" + "description": "Whether Cypress will search for and replace obstructive JS code found in .js or .html files that prevents Cypress from working. Please read the notes for more information on this setting. https://on.cypress.io/configuration#modifyObstructiveCode" }, - "viewportHeight": { + "viewportHeight": { "type": "number", "default": 660, "description": "Default height in pixels for the application under tests’ viewport (Override with cy.viewport() command)" @@ -167,7 +175,7 @@ "default": 1000, "description": "Default width in pixels for the application under tests’ viewport. (Override with cy.viewport() command)" }, - "animationDistanceThreshold": { + "animationDistanceThreshold": { "type": "number", "default": 5, "description": "The distance in pixels an element must exceed over time to be considered animating" @@ -180,7 +188,7 @@ "projectId": { "type": "string", "default": null, - "description": "A 6 character string use to identify this project in the Cypress Dashboard. See https://on.cypress.io/dashboard-service#Identification" + "description": "A 6 character string to identify this project with Dashboard service. See https://on.cypress.io/dashboard-service#Identification" } } } diff --git a/cli/test/.eslintrc b/cli/test/.eslintrc index 9714ee5390f8..722558a67462 100644 --- a/cli/test/.eslintrc +++ b/cli/test/.eslintrc @@ -4,6 +4,6 @@ "sinon": true }, "extends": [ - "plugin:cypress-dev/tests" + "plugin:@cypress/dev/tests" ] } diff --git a/cli/test/lib/exec/.eslintrc b/cli/test/lib/exec/.eslintrc new file mode 100644 index 000000000000..74e0826b6dbb --- /dev/null +++ b/cli/test/lib/exec/.eslintrc @@ -0,0 +1,5 @@ +{ + "parserOptions": { + "sourceType": "script" + } +} diff --git a/electron-builder.json b/electron-builder.json index 2b57bb700de4..104f760f7a69 100644 --- a/electron-builder.json +++ b/electron-builder.json @@ -1,7 +1,7 @@ { - "mac": { - "forceCodeSigning": true, - "publish": null, - "target": "zip" - } + "mac": { + "forceCodeSigning": true, + "publish": null, + "target": "zip" + } } diff --git a/package.json b/package.json index 19240fdfa766..bc3ffeecea36 100644 --- a/package.json +++ b/package.json @@ -1,78 +1,74 @@ { "name": "cypress", - "productName": "Cypress", - "version": "3.3.2", - "description": "Cypress.io end to end testing tool", + "version": "3.3.1", "private": true, - "engines": { - "node": ">=8.9.3" - }, "scripts": { - "prestart": "npm run check-deps-pre", - "start": "node ./cli/bin/cypress open --dev --global", + "all": "node ./scripts/run.js", + "binary-build": "node ./scripts/binary.js build", + "binary-deploy": "node ./scripts/binary.js deploy", + "binary-deploy-linux": "./scripts/build-linux-binary.sh", + "binary-purge": "node ./scripts/binary.js purge-version", + "binary-release": "node ./scripts/binary.js release", + "binary-upload": "node ./scripts/binary.js upload", + "binary-zip": "node ./scripts/binary.js zip", + "prebuild": "npm run check-deps-pre && npm run all prebuild", + "build": "npm run all build", + "bump": "node ./scripts/binary.js bump", + "check-deps": "node ./scripts/check-deps.js --verbose", + "check-deps-pre": "node ./scripts/check-deps.js --verbose --prescript", + "check-node-version": "node scripts/check-node-version.js", + "check-terminal": "node scripts/check-terminal.js", + "clean-deps": "npm run all clean-deps && rm -rf node_modules", "cypress:open": "node ./cli/bin/cypress open --dev --global", - "cypress:run": "node ./cli/bin/cypress run --dev", - "cypress:verify": "node ./cli/bin/cypress verify --dev", "cypress:open:debug": "node ./scripts/debug.js cypress:open", + "cypress:run": "node ./cli/bin/cypress run --dev", "cypress:run:debug": "node ./scripts/debug.js cypress:run", + "cypress:verify": "node ./cli/bin/cypress verify --dev", + "decaffeinate": "decaffeinate --use-cs2 --loose", + "decaffeinate-bulk": "bulk-decaffeinate", "dev": "node ./scripts/start.js", "dev-debug": "node ./scripts/debug.js dev", - "watch": "npm run all watch", - "test-debug-package": "node ./scripts/test-debug-package.js", + "docker": "./scripts/run-docker-local.sh", + "effective:circle:config": "circleci config process circle.yml | sed /^#/d", + "postinstall": "echo 'root postinstall' && npm run link && npm run all install && npm run build", + "install-filtered": "npm run all install -- --package $(node ./scripts/check-deps.js --list)", "jscodeshift": "jscodeshift -t ./node_modules/js-codemod/transforms/arrow-function-arguments.js", - "decaffeinate": "decaffeinate --use-cs2 --loose", - "decaffeinate-bulk": "bulk-decaffeinate", - "check-deps": "node ./scripts/check-deps.js --verbose", - "check-deps-pre": "node ./scripts/check-deps.js --verbose --prescript", - "prebuild": "npm run check-deps-pre && npm run all prebuild", - "build": "npm run all build", - "all": "node ./scripts/run.js", - "test": "echo '⚠️ This root monorepo is only for local development and new contributions. There are no tests.'", "link": "node ./scripts/link-packages.js", - "install-filtered": "npm run all install -- --package $(node ./scripts/check-deps.js --list)", - "postinstall": "echo 'root postinstall' && npm run link && npm run all install && npm run build", - "clean-deps": "npm run all clean-deps && rm -rf node_modules", - "docker": "./scripts/run-docker-local.sh", - "lint-js": "eslint --fix scripts/*.js packages/ts/*.js cli/*.js cli/**/*.js", - "lint-changed": "git diff --name-only | grep '\\.js$' | xargs npx eslint --fix", - "lint-coffee": "coffeelint scripts/**/*.coffee", - "lint": "npm run lint-js && npm run lint-coffee", - "pretest": "npm run lint && npm run all lint && npm run test-scripts", - "precommit": "npm run warn-only && lint-staged", - "precommit-lint": "eslint --fix", - "prepush": "npm run stop-only", - "stop-only": "stop-only --folder packages --skip .cy,.publish,.projects,node_modules,dist,dist-test,fixtures,lib,bower_components,spec_helper.coffee", - "warn-only": "stop-only --warn --folder packages --skip .cy,.publish,.projects,node_modules,dist,dist-test,fixtures,lib,bower_components,spec_helper.coffee", - "bump": "node ./scripts/binary.js bump", - "set-next-ci-version": "node ./scripts/binary.js setNextVersion", - "binary-build": "node ./scripts/binary.js build", - "binary-zip": "node ./scripts/binary.js zip", - "binary-upload": "node ./scripts/binary.js upload", - "binary-deploy": "node ./scripts/binary.js deploy", - "binary-purge": "node ./scripts/binary.js purge-version", - "binary-deploy-linux": "./scripts/build-linux-binary.sh", + "lint": "npm run lint-coffee && echo 'running eslint...' && eslint --ext .js,.jsx,.ts,.tsx,.json,.eslintrc .", + "lint-changed": "node ./scripts/lint/lint-changed", + "lint-changed-fix": "node ./scripts/lint/lint-changed --fix", + "lint-coffee": "coffeelint scripts/**/*.coffee && eslint --ext .coffee . && npm run all lint-coffee", + "lint-fix": "npm run lint -- --fix", + "lint-pre-push": "node ./scripts/lint/lint-pre-push", + "lint-staged": "node ./scripts/lint/lint-staged", "move-binaries": "node ./scripts/binary.js move-binaries", - "binary-release": "node ./scripts/binary.js release", - "test-scripts": "mocha -r packages/coffee/register -r packages/ts/register --reporter spec 'scripts/unit/**/*spec.js'", - "test-s3-api": "node -r ./packages/coffee/register -r ./packages/ts/register scripts/binary/s3-api-demo.ts", + "set-next-ci-version": "node ./scripts/binary.js setNextVersion", + "prestart": "npm run check-deps-pre", + "start": "node ./cli/bin/cypress open --dev --global", + "test": "echo '⚠️ This root monorepo is only for local development and new contributions. There are no tests.'", + "test-debug-package": "node ./scripts/test-debug-package.js", "test-mocha": "mocha --reporter spec scripts/spec.js", "test-mocha-snapshot": "mocha scripts/mocha-snapshot-spec.js", - "check-node-version": "node scripts/check-node-version.js", - "check-terminal": "node scripts/check-terminal.js", - "effective:circle:config": "circleci config process circle.yml | sed /^#/d" + "test-s3-api": "node -r ./packages/coffee/register -r ./packages/ts/register scripts/binary/s3-api-demo.ts", + "test-scripts": "mocha -r packages/coffee/register -r packages/ts/register --reporter spec 'scripts/unit/**/*spec.js'", + "watch": "npm run all watch" }, - "lint-staged": { - "*.js": [ - "npm run precommit-lint" - ] + "husky": { + "hooks": { + "pre-commit": "npm run lint-staged --silent", + "pre-push": "npm run lint-pre-push --silent" + } }, "devDependencies": { - "@cypress/bumpercar": "2.0.9", + "@cypress/bumpercar": "2.0.7", "@cypress/commit-message-install": "2.6.2", "@cypress/env-or-json-file": "2.0.0", + "@cypress/eslint-plugin-dev": "1.0.0", + "@cypress/eslint-plugin-json": "^3.0.3", + "@cypress/github-commit-status-check": "1.4.1", "@cypress/npm-run-all": "4.0.5", "@cypress/questions-remain": "1.0.1", - "@cypress/github-commit-status-check": "1.4.1", + "@fellow/eslint-plugin-coffee": "^0.4.13", "@types/bluebird": "3.5.21", "@types/chai": "3.5.2", "@types/debug": "4.1.4", @@ -84,6 +80,8 @@ "@types/ramda": "0.25.47", "@types/request-promise": "4.1.42", "@types/sinon-chai": "3.2.2", + "@typescript-eslint/eslint-plugin": "1.11.0", + "@typescript-eslint/parser": "1.11.0", "ansi-styles": "3.2.1", "arg": "4.1.0", "ascii-table": "0.0.9", @@ -106,14 +104,14 @@ "electron-builder": "20.39.0", "eslint": "5.16.0", "eslint-plugin-cypress": "2.2.1", - "eslint-plugin-cypress-dev": "2.1.0", + "eslint-plugin-cypress-dev": "^3.0.0", "eslint-plugin-mocha": "5.3.0", "eslint-plugin-react": "7.12.4", "execa": "1.0.0", "execa-wrap": "1.4.0", "filesize": "4.1.2", "find-package-json": "1.2.0", - "fs-extra": "8.0.1", + "fs-extra": "7.0.1", "gift": "0.10.2", "gulp": "3.9.1", "gulp-awspublish": "3.4.0", @@ -123,7 +121,7 @@ "gulp-typescript": "3.2.4", "hasha": "5.0.0", "human-interval": "0.1.6", - "husky": "2.3.0", + "husky": "2.4.1", "inquirer": "3.3.0", "inquirer-confirm": "2.0.3", "js-codemod": "cpojer/js-codemod#29dafed", @@ -148,16 +146,21 @@ "ramda": "0.24.1", "shelljs": "0.8.3", "sinon": "7.3.2", + "sinon-chai": "^3.3.0", "snap-shot-it": "7.7.1", - "stop-only": "3.0.1", "strip-ansi": "4.0.0", "terminal-banner": "1.1.0", "typescript": "3.4.5", "vinyl-paths": "2.1.0" }, - "author": "Brian Mann", - "license": "MIT", + "description": "Cypress.io end to end testing tool", "homepage": "https://github.com/cypress-io/cypress", + "license": "MIT", + "author": "Brian Mann", + "productName": "Cypress", + "engines": { + "node": ">=8.9.3" + }, "repository": { "type": "git", "url": "https://github.com/cypress-io/cypress.git" @@ -166,18 +169,18 @@ "url": "https://github.com/cypress-io/cypress/issues" }, "keywords": [ + "automation", "browser", "cypress", "cypress.io", - "automation", - "end-to-end", "e2e", + "end-to-end", "integration", "mocks", - "test", - "testing", "runner", "spies", - "stubs" + "stubs", + "test", + "testing" ] } diff --git a/packages/coffee/package.json b/packages/coffee/package.json index c3346c974848..13900e4d7f9b 100644 --- a/packages/coffee/package.json +++ b/packages/coffee/package.json @@ -1,15 +1,15 @@ { "name": "@packages/coffee", - "main": "index.js", "private": true, - "dependencies": { - "coffeescript": "1.12.7" - }, "files": [ "register.js" ], + "main": "index.js", "scripts": { "check-deps": "node ../../scripts/check-deps.js --verbose", "clean-deps": "rm -rf node_modules" + }, + "dependencies": { + "coffeescript": "1.12.7" } } diff --git a/packages/desktop-gui/.eslintrc b/packages/desktop-gui/.eslintrc new file mode 100644 index 000000000000..3d8ebbe284af --- /dev/null +++ b/packages/desktop-gui/.eslintrc @@ -0,0 +1,11 @@ +{ + "extends": [ + "plugin:@cypress/dev/tests", + "plugin:@cypress/dev/react" + ], + "settings": { + "react": { + "version": "16.8" + } + } +} diff --git a/packages/desktop-gui/package.json b/packages/desktop-gui/package.json index a99b87cef574..469b93d7158b 100644 --- a/packages/desktop-gui/package.json +++ b/packages/desktop-gui/package.json @@ -1,33 +1,32 @@ { "name": "@packages/desktop-gui", "version": "0.0.0", - "main": "lib/gui.js", "private": true, + "files": [ + "dist", + "lib" + ], + "main": "lib/gui.js", "scripts": { - "postinstall": "echo '@packages/desktop-gui needs: npm run build'", "prebuild": "npm run check-deps-pre && rebuild-node-sass", "build": "node ./scripts/build-dev.js", "prebuild-prod": "npm run check-deps-pre", "build-prod": "node ./scripts/build-prod.js", - "prewatch": "npm run check-deps-pre", - "watch": "node ./scripts/watch.js", "check-deps": "node ../../scripts/check-deps.js --verbose", "check-deps-pre": "npm run check-deps -- --prescript", "clean": "zunder clean", "clean-deps": "rm -rf node_modules", - "lint": "$(bin-up eslint) --fix lib/*.js src/*.js* src/**/*.js*", "cypress:open": "TZ=America/New_York node ../../scripts/cypress open --project .", - "cypress:run": "TZ=America/New_York node ../../scripts/cypress run --project ." + "cypress:run": "TZ=America/New_York node ../../scripts/cypress run --project .", + "postinstall": "echo '@packages/desktop-gui needs: npm run build'", + "prewatch": "npm run check-deps-pre", + "watch": "node ./scripts/watch.js" }, - "files": [ - "dist", - "lib" - ], "devDependencies": { "@babel/plugin-proposal-object-rest-spread": "7.4.4", "@cypress/icons": "0.7.0", - "@cypress/json-schemas": "5.32.1", - "@cypress/react-tooltip": "0.5.0", + "@cypress/json-schemas": "5.31.3", + "@cypress/react-tooltip": "0.4.0", "bin-up": "1.2.0", "bluebird": "3.5.3", "bootstrap-sass": "3.4.1", diff --git a/packages/driver/.eslintrc b/packages/driver/.eslintrc index 555c3dbbf257..e5a34aec6abe 100644 --- a/packages/driver/.eslintrc +++ b/packages/driver/.eslintrc @@ -1,5 +1,5 @@ { "env": { "browser": true - }, + } } diff --git a/packages/driver/package.json b/packages/driver/package.json index ee01879a557c..29662bf26303 100644 --- a/packages/driver/package.json +++ b/packages/driver/package.json @@ -2,20 +2,20 @@ "name": "@packages/driver", "version": "0.0.0", "private": true, + "files": [ + "lib" + ], "main": "index.js", "browser": "src/main", "scripts": { - "prestart": "npm run check-deps-pre", - "start": "../coffee/node_modules/.bin/coffee test/support/server.coffee", - "cypress:open": "node ../../scripts/cypress open --project ./test", - "cypress:run": "node ../../scripts/cypress run --project ./test", "check-deps": "node ../../scripts/check-deps.js --verbose", "check-deps-pre": "npm run check-deps -- --prescript", - "clean-deps": "rm -rf node_modules" + "clean-deps": "rm -rf node_modules", + "cypress:open": "node ../../scripts/cypress open --project ./test", + "cypress:run": "node ../../scripts/cypress run --project ./test", + "prestart": "npm run check-deps-pre", + "start": "../coffee/node_modules/.bin/coffee test/support/server.coffee" }, - "files": [ - "lib" - ], "devDependencies": { "@cypress/bower-kendo-ui": "0.0.2", "@cypress/sinon-chai": "1.1.0", @@ -38,7 +38,7 @@ "compression": "1.7.4", "cors": "2.8.5", "debug": "4.1.1", - "errorhandler": "1.5.1", + "errorhandler": "1.5.0", "eventemitter2": "4.1.2", "express": "4.16.4", "jquery": "2.2.4", diff --git a/packages/driver/test/.eslintrc b/packages/driver/test/.eslintrc new file mode 100644 index 000000000000..f7cfa5c3a5fe --- /dev/null +++ b/packages/driver/test/.eslintrc @@ -0,0 +1,8 @@ +{ + "extends": [ + "plugin:@cypress/dev/tests" + ], + "rules": { + "mocha/no-global-tests": "off" + } +} diff --git a/packages/electron/package.json b/packages/electron/package.json index 84fbc88b4f6a..35e0ac7be900 100644 --- a/packages/electron/package.json +++ b/packages/electron/package.json @@ -1,39 +1,39 @@ { "name": "@packages/electron", "version": "0.0.0", - "electronVersion": "2.0.18", "private": true, + "files": [ + "dist", + "lib" + ], "main": "index.js", "scripts": { - "postinstall": "echo '@packages/electron needs: npm run build'", - "prestart": "npm run check-deps-pre", - "start": "./bin/cypress-electron", - "pretest": "npm run check-deps-pre", - "test": "mocha --compilers coffee:@packages/coffee/register", "prebuild": "npm run check-deps-pre", "build": "node ./bin/cypress-electron --install", "check-deps": "node ../../scripts/check-deps.js --verbose", "check-deps-pre": "npm run check-deps -- --prescript", - "clean-deps": "rm -rf node_modules" - }, - "bin": { - "cypress-electron": "./bin/cypress-electron" - }, - "files": [ - "dist", - "lib" - ], - "devDependencies": { - "chai": "3.5.0", - "mocha": "3.5.3" + "clean-deps": "rm -rf node_modules", + "postinstall": "echo '@packages/electron needs: npm run build'", + "prestart": "npm run check-deps-pre", + "start": "./bin/cypress-electron", + "pretest": "npm run check-deps-pre", + "test": "mocha --compilers coffee:@packages/coffee/register" }, "dependencies": { "@cypress/icons": "0.7.0", "bluebird": "3.5.3", "debug": "4.1.1", "electron-packager": "13.1.1", - "fs-extra": "8.0.1", + "fs-extra": "5.0.0", "lodash": "4.17.11", "minimist": "1.2.0" - } + }, + "devDependencies": { + "chai": "3.5.0", + "mocha": "3.5.3" + }, + "bin": { + "cypress-electron": "./bin/cypress-electron" + }, + "electronVersion": "2.0.18" } diff --git a/packages/electron/test/.eslintrc b/packages/electron/test/.eslintrc new file mode 100644 index 000000000000..b5ed5206d083 --- /dev/null +++ b/packages/electron/test/.eslintrc @@ -0,0 +1,5 @@ +{ + "extends": [ + "plugin:@cypress/dev/tests" + ] +} diff --git a/packages/example/package.json b/packages/example/package.json index c1d2ee52a362..2d15ac32385f 100644 --- a/packages/example/package.json +++ b/packages/example/package.json @@ -8,14 +8,13 @@ "check-deps": "node ../../scripts/check-deps.js --verbose", "check-deps-pre": "npm run check-deps -- --prescript", "clean-deps": "rm -rf node_modules", - "pretest": "npm run check-deps-pre && npm run lint", + "pretest": "npm run check-deps-pre", "test": "cross-env NODE_ENV=test mocha", "test-e2e": "cypress run", "prebuild": "npm run check-deps-pre", "build": "node ./bin/build.js && gulp build", "predeploy": "npm run build", - "deploy": "gulp deploy", - "lint": "bin-up eslint --fix *.js bin/*.js lib/*.js test/*.js" + "deploy": "gulp deploy" }, "files": [ "cypress", diff --git a/packages/extension/app/manifest.json b/packages/extension/app/manifest.json index 98c2a503dd2e..2bb08b5279e1 100644 --- a/packages/extension/app/manifest.json +++ b/packages/extension/app/manifest.json @@ -1,6 +1,6 @@ { - "name" : "Cypress", - "description" : "Adds chrome.* API's for testing with Cypress", + "name": "Cypress", + "description": "Adds chrome.* API's for testing with Cypress", "permissions": [ "cookies", "tabs", @@ -10,8 +10,8 @@ ], "key": "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAugoxpSqfoblTYUGvyXZpmBgjYQUY9k2Hx3PaDwquyaTH6GBxitwVMSu5sZuDYgPHpGYoF4ol6A4PZHhd6JvfuUDS9ZrxTW0XzP+dSS9AwmJo3uLuP88zBs4mhpje1+WE5NGM0pTzyCXYTPoyzyPRmToALWD96cahSGuhG8bSmaBw3py+16qNKm8SOlANbUvHtEaTpmrSWBUIq7YV8SIPLtR8G47vjqPTE1yEsBQ3GAgllhi0cJolwk/629fRLr3KVckICmU6spXD/jVhIgAeyHhFuFGYNuubzbel8trBVw5Q/HE5F6j66sBvEvW64tH4lPxnM5JPv0qie5wouPiT0wIDAQAB", "icons": { - "16": "icons/icon_16x16.png", - "48": "icons/icon_48x48.png", + "16": "icons/icon_16x16.png", + "48": "icons/icon_48x48.png", "128": "icons/icon_128x128.png" }, "browser_action": { diff --git a/packages/extension/package.json b/packages/extension/package.json index 64817ec23c31..54d1b9aa7f1f 100644 --- a/packages/extension/package.json +++ b/packages/extension/package.json @@ -2,30 +2,34 @@ "name": "@packages/extension", "version": "0.0.0", "private": true, + "files": [ + "app", + "dist", + "lib", + "theme" + ], "main": "index.js", "scripts": { - "postinstall": "echo '@packages/extension needs: npm run build'", - "prewatch": "npm run check-deps-pre", - "watch": "gulp watch", "prebuild": "npm run check-deps-pre", "build": "gulp build", "prebuild-prod": "npm run check-deps-pre", "build-prod": "gulp build", + "check-deps": "node ../../scripts/check-deps.js --verbose", + "check-deps-pre": "npm run check-deps -- --prescript", + "clean": "gulp clean", + "clean-deps": "rm -rf node_modules", + "postinstall": "echo '@packages/extension needs: npm run build'", "pretest": "npm run check-deps-pre", "test": "cross-env NODE_ENV=test bin-up mocha --reporter mocha-multi-reporters --reporter-options configFile=../../mocha-reporter-config.json", "pretest-watch": "npm run check-deps-pre", "test-watch": "npm run test -- --watch", - "check-deps": "node ../../scripts/check-deps.js --verbose", - "check-deps-pre": "npm run check-deps -- --prescript", - "clean": "gulp clean", - "clean-deps": "rm -rf node_modules" + "prewatch": "npm run check-deps-pre", + "watch": "gulp watch" + }, + "dependencies": { + "bluebird": "3.5.3", + "lodash": "4.17.11" }, - "files": [ - "app", - "dist", - "lib", - "theme" - ], "devDependencies": { "@cypress/icons": "0.7.0", "bin-up": "1.2.0", @@ -34,7 +38,7 @@ "coffeeify": "2.1.0", "cross-env": "5.2.0", "eol": "0.9.1", - "fs-extra": "8.0.1", + "fs-extra": "5.0.0", "gulp": "3.9.1", "gulp-clean": "0.4.0", "gulp-rename": "1.4.0", @@ -42,9 +46,5 @@ "sinon": "1.17.7", "sinon-chai": "3.3.0", "vinyl-source-stream": "1.1.2" - }, - "dependencies": { - "bluebird": "3.5.3", - "lodash": "4.17.11" } } diff --git a/packages/extension/test/.eslintrc b/packages/extension/test/.eslintrc new file mode 100644 index 000000000000..b5ed5206d083 --- /dev/null +++ b/packages/extension/test/.eslintrc @@ -0,0 +1,5 @@ +{ + "extends": [ + "plugin:@cypress/dev/tests" + ] +} diff --git a/packages/extension/theme/manifest.json b/packages/extension/theme/manifest.json index fe246c289890..57842adcf012 100644 --- a/packages/extension/theme/manifest.json +++ b/packages/extension/theme/manifest.json @@ -4,16 +4,36 @@ "manifest_version": 2, "theme": { "colors": { - "bookmark_text": [ 0, 0, 0 ], - "frame": [ 29, 31, 33 ], - "ntp_section": [ 255, 255, 255 ] + "bookmark_text": [ + 0, + 0, + 0 + ], + "frame": [ + 29, + 31, + 33 + ], + "ntp_section": [ + 255, + 255, + 255 + ] }, "images": { - "theme_frame": "images/theme_frame.png" + "theme_frame": "images/theme_frame.png" }, "tints": { - "frame_inactive": [-1.0, -1.0, -1.0], - "background_tab": [-1.0, -1.0, -1.0] + "frame_inactive": [ + -1, + -1, + -1 + ], + "background_tab": [ + -1, + -1, + -1 + ] } } } diff --git a/packages/https-proxy/package.json b/packages/https-proxy/package.json index 2da1bc9527f2..b050a54c4f71 100644 --- a/packages/https-proxy/package.json +++ b/packages/https-proxy/package.json @@ -2,44 +2,44 @@ "name": "@packages/https-proxy", "version": "0.0.0", "private": true, + "files": [ + "lib" + ], "main": "index.js", "scripts": { - "prestart": "npm run check-deps-pre", - "start": "node index.js", "check-deps": "node ../../scripts/check-deps.js --verbose", "check-deps-pre": "npm run check-deps -- --prescript", "clean-deps": "rm -rf node_modules", + "https": "node https.js", + "prestart": "npm run check-deps-pre", + "start": "node index.js", "pretest": "npm run check-deps-pre", "test": "cross-env NODE_ENV=test bin-up mocha --reporter mocha-multi-reporters --reporter-options configFile=../../mocha-reporter-config.json", "test-debug": "cross-env NODE_ENV=test bin-up mocha --inspect-brk --reporter mocha-multi-reporters --reporter-options configFile=../../mocha-reporter-config.json", "pretest-watch": "npm run check-deps-pre", - "test-watch": "cross-env NODE_ENV=test bin-up mocha --watch", - "https": "node https.js" + "test-watch": "cross-env NODE_ENV=test bin-up mocha --watch" + }, + "dependencies": { + "bluebird": "3.5.3", + "debug": "4.1.1", + "fs-extra": "5.0.0", + "lodash": "4.17.11", + "node-forge": "0.6.49", + "proxy-from-env": "1.0.0", + "semaphore": "1.1.0", + "server-destroy-vvo": "1.0.1", + "ssl-root-cas": "1.3.1" }, - "files": [ - "lib" - ], "devDependencies": { + "@cypress/debugging-proxy": "2.0.1", "bin-up": "1.2.0", "chai": "3.5.0", "cross-env": "5.2.0", - "@cypress/debugging-proxy": "2.0.1", "request": "2.88.0", "request-promise": "4.2.4", "sinon": "1.17.7", "sinon-as-promised": "4.0.3", "sinon-chai": "3.3.0", "supertest": "4.0.2" - }, - "dependencies": { - "bluebird": "3.5.3", - "debug": "4.1.1", - "fs-extra": "8.0.1", - "lodash": "4.17.11", - "node-forge": "0.6.49", - "proxy-from-env": "1.0.0", - "semaphore": "1.1.0", - "server-destroy-vvo": "1.0.1", - "ssl-root-cas": "1.3.1" } } diff --git a/packages/https-proxy/test/.eslintrc b/packages/https-proxy/test/.eslintrc new file mode 100644 index 000000000000..b5ed5206d083 --- /dev/null +++ b/packages/https-proxy/test/.eslintrc @@ -0,0 +1,5 @@ +{ + "extends": [ + "plugin:@cypress/dev/tests" + ] +} diff --git a/packages/launcher/package.json b/packages/launcher/package.json index 25c525220c9c..0cc318c3c6a3 100644 --- a/packages/launcher/package.json +++ b/packages/launcher/package.json @@ -2,47 +2,40 @@ "name": "@packages/launcher", "version": "0.0.0", "private": true, - "main": "index.js", - "types": "../ts/index.d.ts", "files": [ "lib" ], + "main": "index.js", "scripts": { - "pretest": "npm run check-deps-pre && npm run lint", - "test": "npm run unit", - "unit": "bin-up mocha --reporter mocha-multi-reporters --reporter-options configFile=../../mocha-reporter-config.json", + "build": "bin-up tsc --project .", + "build-js": "bin-up tsc --project .", "check-deps": "node ../../scripts/check-deps.js --verbose", "check-deps-pre": "npm run check-deps -- --prescript", - "clean-deps": "rm -rf node_modules", "preclean": "npm run check-deps-pre", "clean": "node scripts/clean.js || true", + "clean-deps": "rm -rf node_modules", "clean-js": "npm run clean", - "lint": "npm run format-ts && npm run lint-ts && npm run lint-js", - "lint-js": "bin-up eslint --fix *.js", - "lint-ts": "tslint --project . --fix --format stylish lib/*.ts lib/**/*.ts", - "format-ts": "prettier --no-semi --single-quote --write lib/*.ts lib/**/*.ts", - "build": "bin-up tsc --project .", - "build-js": "bin-up tsc --project .", - "size": "t=\"$(npm pack .)\"; wc -c \"${t}\"; tar tvf \"${t}\"; rm \"${t}\";" - }, - "devDependencies": { - "bin-up": "1.2.0", - "chai": "3.5.0", - "prettier": "1.17.0", - "shelljs": "0.8.3", - "sinon": "2.4.1", - "sinon-chai": "3.3.0", - "tslint": "5.16.0", - "tslint-config-standard": "8.0.1" + "size": "t=\"$(npm pack .)\"; wc -c \"${t}\"; tar tvf \"${t}\"; rm \"${t}\";", + "pretest": "npm run check-deps-pre", + "test": "npm run unit", + "unit": "bin-up mocha --reporter mocha-multi-reporters --reporter-options configFile=../../mocha-reporter-config.json" }, "dependencies": { "bluebird": "3.5.3", "debug": "4.1.1", "execa": "1.0.0", - "fs-extra": "8.0.1", + "fs-extra": "5.0.0", "lodash": "4.17.11", "plist": "2.1.0", "pluralize": "8.0.0", "ramda": "0.24.1" - } + }, + "devDependencies": { + "bin-up": "1.2.0", + "chai": "3.5.0", + "shelljs": "0.8.3", + "sinon": "2.4.1", + "sinon-chai": "3.3.0" + }, + "types": "../ts/index.d.ts" } diff --git a/packages/launcher/test/.eslintrc b/packages/launcher/test/.eslintrc new file mode 100644 index 000000000000..b5ed5206d083 --- /dev/null +++ b/packages/launcher/test/.eslintrc @@ -0,0 +1,5 @@ +{ + "extends": [ + "plugin:@cypress/dev/tests" + ] +} diff --git a/packages/launcher/tsconfig.json b/packages/launcher/tsconfig.json index ffda540c3654..e2f0a1e19c6a 100644 --- a/packages/launcher/tsconfig.json +++ b/packages/launcher/tsconfig.json @@ -6,5 +6,8 @@ ], "files": [ "./../ts/index.d.ts" + ], + "exclude": [ + "test" ] } diff --git a/packages/network/package.json b/packages/network/package.json index 49b031dfc355..6e7c01495370 100644 --- a/packages/network/package.json +++ b/packages/network/package.json @@ -2,11 +2,10 @@ "name": "@packages/network", "version": "0.0.0", "private": true, - "main": "index.js", - "types": "./lib/index.ts", "files": [ "lib" ], + "main": "index.js", "scripts": { "build-js": "bin-up tsc --project .", "test": "bin-up mocha --reporter mocha-multi-reporters --reporter-options configFile=../../mocha-reporter-config.json" @@ -18,12 +17,13 @@ "proxy-from-env": "1.0.0" }, "devDependencies": { - "bin-up": "1.2.0", "@cypress/debugging-proxy": "2.0.1", + "bin-up": "1.2.0", "express": "4.16.4", "request": "2.88.0", "request-promise": "4.2.4", "sinon": "7.3.1", "sinon-chai": "3.3.0" - } + }, + "types": "./lib/index.ts" } diff --git a/packages/network/test/.eslintrc b/packages/network/test/.eslintrc new file mode 100644 index 000000000000..b5ed5206d083 --- /dev/null +++ b/packages/network/test/.eslintrc @@ -0,0 +1,5 @@ +{ + "extends": [ + "plugin:@cypress/dev/tests" + ] +} diff --git a/packages/reporter/cypress/.eslintrc b/packages/reporter/cypress/.eslintrc index 0d714a44ea96..5b988562725d 100644 --- a/packages/reporter/cypress/.eslintrc +++ b/packages/reporter/cypress/.eslintrc @@ -5,4 +5,4 @@ "env": { "cypress/globals": true } -} \ No newline at end of file +} diff --git a/packages/reporter/package.json b/packages/reporter/package.json index 180cd3b08855..dfb07e3447d8 100644 --- a/packages/reporter/package.json +++ b/packages/reporter/package.json @@ -2,33 +2,32 @@ "name": "@packages/reporter", "version": "0.0.0", "private": true, + "files": [ + "dist" + ], "main": "lib/reporter.js", "browser": "src/main", "scripts": { - "postinstall": "echo '@packages/reporter needs: npm run build'", "prebuild": "npm run check-deps-pre && rebuild-node-sass", "build": "node ./scripts/build-dev.js", "prebuild-prod": "npm run check-deps-pre", "build-prod": "node ./scripts/build-prod.js", - "prewatch": "npm run check-deps-pre", - "watch": "node ./scripts/watch.js", "check-deps": "node ../../scripts/check-deps.js --verbose", "check-deps-pre": "npm run check-deps -- --prescript", "preclean": "npm run check-deps-pre", "clean": "zunder clean", "clean-deps": "rm -rf node_modules", + "cypress:open": "node ../../scripts/cypress open --project .", + "cypress:run": "node ../../scripts/cypress run --project .", + "postinstall": "echo '@packages/reporter needs: npm run build'", "pretest": "npm run check-deps-pre", "test": "node ./scripts/test.js", - "lint": "bin-up eslint --fix lib/*.js scripts/*.js src/*.js* src/**/*.js*", - "cypress:open": "node ../../scripts/cypress open --project .", - "cypress:run": "node ../../scripts/cypress run --project ." + "prewatch": "npm run check-deps-pre", + "watch": "node ./scripts/watch.js" }, - "files": [ - "dist" - ], "devDependencies": { "@babel/plugin-proposal-object-rest-spread": "7.4.4", - "@cypress/react-tooltip": "0.5.0", + "@cypress/react-tooltip": "0.4.0", "bin-up": "1.2.0", "chai": "3.5.0", "chai-enzyme": "1.0.0-beta.1", diff --git a/packages/reporter/src/.eslintrc b/packages/reporter/src/.eslintrc index 212723095723..68e3a504cfe4 100644 --- a/packages/reporter/src/.eslintrc +++ b/packages/reporter/src/.eslintrc @@ -1,6 +1,11 @@ { "extends": [ - "plugin:cypress-dev/react", - "plugin:cypress-dev/tests" - ] + "plugin:@cypress/dev/react", + "plugin:@cypress/dev/tests" + ], + "settings": { + "react": { + "version": "16.8" + } + } } diff --git a/packages/root/package.json b/packages/root/package.json index 60d65f233cb1..8908dc48b833 100644 --- a/packages/root/package.json +++ b/packages/root/package.json @@ -1,6 +1,6 @@ { "name": "@packages/root", "version": "0.0.0", - "description": "dummy package pointing at the root package", - "main": "../../package.json" + "main": "../../package.json", + "description": "dummy package pointing at the root package" } diff --git a/packages/runner/package.json b/packages/runner/package.json index 4e4dc79d2b85..7ffa2380ccc1 100644 --- a/packages/runner/package.json +++ b/packages/runner/package.json @@ -1,28 +1,27 @@ { "name": "@packages/runner", "version": "0.0.0", - "main": "lib/runner.js", "private": true, + "files": [ + "dist", + "lib" + ], + "main": "lib/runner.js", "scripts": { - "postinstall": "echo '@packages/runner needs: npm run build'", "prebuild": "npm run check-deps-pre && rebuild-node-sass", "build": "node ./scripts/build-dev.js", "prebuild-prod": "npm run check-deps-pre", "build-prod": "node ./scripts/build-prod.js", - "prewatch": "npm run check-deps-pre", - "watch": "node ./scripts/watch.js", "check-deps": "node ../../scripts/check-deps.js --verbose", "check-deps-pre": "npm run check-deps -- --prescript", "clean": "zunder clean", "clean-deps": "rm -rf node_modules", + "postinstall": "echo '@packages/runner needs: npm run build'", "pretest": "npm run check-deps-pre", "test": "node ./scripts/test.js", - "lint": "bin-up eslint --fix scripts/*.js src/*.js* src/**/*.js*" + "prewatch": "npm run check-deps-pre", + "watch": "node ./scripts/watch.js" }, - "files": [ - "dist", - "lib" - ], "devDependencies": { "@babel/plugin-proposal-object-rest-spread": "7.4.4", "@cypress/react-tooltip": "0.4.0", diff --git a/packages/runner/src/.eslintrc b/packages/runner/src/.eslintrc index 212723095723..68e3a504cfe4 100644 --- a/packages/runner/src/.eslintrc +++ b/packages/runner/src/.eslintrc @@ -1,6 +1,11 @@ { "extends": [ - "plugin:cypress-dev/react", - "plugin:cypress-dev/tests" - ] + "plugin:@cypress/dev/react", + "plugin:@cypress/dev/tests" + ], + "settings": { + "react": { + "version": "16.8" + } + } } diff --git a/packages/server/package.json b/packages/server/package.json index 311c0fbe75e5..64619eab0b37 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -1,104 +1,52 @@ { "name": "@packages/server", - "productName": "Cypress", "version": "0.0.0", "private": true, + "files": [ + "config", + "timers", + "lib" + ], "main": "index.js", "scripts": { - "start": "node ../../cli/bin/cypress open --dev --global", - "dev": "node index.js", - "repl": "node repl.js", + "build-js": "tsc", "check-deps": "node ../../scripts/check-deps.js --verbose", "check-deps-pre": "npm run check-deps -- --prescript", "clean-deps": "rm -rf node_modules", - "build-js": "tsc", - "test": "node ./test/scripts/run.js", - "test-watch": "./test/support/watch test", - "test-unit": "node ./test/scripts/run.js test/unit", - "test-unit-watch": "./test/support/watch test/unit", - "test-integration": "node ./test/scripts/run.js test/integration", - "test-integration-watch": "./test/support/watch test-integration", - "test-performance": "node ./test/scripts/run.js test/performance", - "test-e2e": "node ./test/scripts/e2e.js", - "test-e2e-chrome": "node ./test/scripts/run.js test/e2e chrome", - "test-cov": "NODE_COVERAGE=true NODE_ENV=test CYPRESS_ENV=test BLUEBIRD_DEBUG=1 xvfb-maybe istanbul cover node_modules/.bin/_mocha -- --opts ./test/support/mocha.opts", - "test-cov-process": "NODE_COVERAGE=true NODE_ENV=test CYPRESS_ENV=test BLUEBIRD_DEBUG=1 istanbul cover --include-pid", + "precodecov": "npm run check-deps-pre", "codecov": "codecov", - "lint": "bin-up coffeelint test/*.coffee test/unit/*.coffee test/integration/*.coffee", - "prestart": "npm run check-deps-pre", "predev": "npm run check-deps-pre", + "dev": "node index.js", + "lint-coffee": "bin-up coffeelint test/*.coffee test/unit/*.coffee test/integration/*.coffee", "prerepl": "npm run check-deps-pre", + "repl": "node repl.js", + "prestart": "npm run check-deps-pre", + "start": "node ../../cli/bin/cypress open --dev --global", "pretest": "npm run check-deps-pre", - "pretest-watch": "npm run check-deps-pre", - "pretest-unit": "npm run check-deps-pre", - "pretest-unit-watch": "npm run check-deps-pre", - "pretest-integration": "npm run check-deps-pre", - "pretest-integration-watch": "npm run check-deps-pre", - "pretest-e2e": "npm run check-deps-pre", - "pretest-e2e-chrome": "npm run check-deps-pre", + "test": "node ./test/scripts/run.js", "pretest-cov": "npm run check-deps-pre", + "test-cov": "NODE_COVERAGE=true NODE_ENV=test CYPRESS_ENV=test BLUEBIRD_DEBUG=1 xvfb-maybe istanbul cover node_modules/.bin/_mocha -- --opts ./test/support/mocha.opts", "pretest-cov-process": "npm run check-deps-pre", - "precodecov": "npm run check-deps-pre" - }, - "files": [ - "config", - "timers", - "lib" - ], - "devDependencies": { - "@babel/core": "7.4.4", - "@babel/plugin-proposal-class-properties": "7.4.4", - "@babel/plugin-proposal-object-rest-spread": "7.4.4", - "@babel/plugin-transform-runtime": "7.4.4", - "@babel/preset-env": "7.4.4", - "@babel/preset-react": "7.0.0", - "@babel/runtime": "7.4.4", - "@cypress/debugging-proxy": "2.0.1", - "@cypress/json-schemas": "5.32.1", - "@cypress/sinon-chai": "1.1.0", - "babel-plugin-add-module-exports": "1.0.2", - "babelify": "10.0.0", - "bin-up": "1.2.0", - "body-parser": "1.19.0", - "chai-uuid": "1.0.6", - "chokidar-cli": "1.2.2", - "chrome-har-capturer": "0.13.4", - "coffee-coverage": "1.0.1", - "console-table-printer": "1.0.0-beta12", - "cors": "2.8.5", - "electron-osx-sign": "0.4.11", - "eol": "0.9.1", - "eventsource": "1.0.7", - "express-session": "1.16.1", - "express-useragent": "1.0.12", - "http-mitm-proxy": "0.7.0", - "https-proxy-agent": "1.0.0", - "inquirer": "3.3.0", - "istanbul": "0.4.5", - "mocked-env": "1.2.4", - "mockery": "1.7.0", - "multiparty": "4.2.1", - "nock": "9.6.1", - "npm-install-version": "6.0.2", - "obfuscator": "0.5.4", - "plist": "1.2.0", - "proxyquire": "2.1.0", - "react": "15.6.2", - "repl.history": "0.1.4", - "run-sequence": "1.2.2", - "snap-shot-it": "7.7.1", - "ssestream": "1.0.1", - "stream-to-promise": "1.1.1", - "supertest": "4.0.2", - "supertest-session": "0.0.7", - "through2": "0.6.5", - "ws": "5.2.2", - "xvfb": "cypress-io/node-xvfb#22e3783c31d81ebe64d8c0df491ea00cdc74726a", - "xvfb-maybe": "cypress-io/xvfb-maybe#c4a810c42d603949cd63b8cf245f6c239331d370" + "test-cov-process": "NODE_COVERAGE=true NODE_ENV=test CYPRESS_ENV=test BLUEBIRD_DEBUG=1 istanbul cover --include-pid", + "pretest-e2e": "npm run check-deps-pre", + "test-e2e": "node ./test/scripts/e2e.js", + "pretest-e2e-chrome": "npm run check-deps-pre", + "test-e2e-chrome": "node ./test/scripts/run.js test/e2e chrome", + "pretest-integration": "npm run check-deps-pre", + "test-integration": "node ./test/scripts/run.js test/integration", + "pretest-integration-watch": "npm run check-deps-pre", + "test-integration-watch": "./test/support/watch test-integration", + "test-performance": "node ./test/scripts/run.js test/performance", + "pretest-unit": "npm run check-deps-pre", + "test-unit": "node ./test/scripts/run.js test/unit", + "pretest-unit-watch": "npm run check-deps-pre", + "test-unit-watch": "./test/support/watch test/unit", + "pretest-watch": "npm run check-deps-pre", + "test-watch": "./test/support/watch test" }, "dependencies": { "@cypress/browserify-preprocessor": "1.1.2", - "@cypress/commit-info": "2.1.4", + "@cypress/commit-info": "2.1.3", "@cypress/get-windows-proxy": "1.5.4", "@cypress/icons": "0.7.0", "@cypress/mocha-teamcity-reporter": "1.0.0", @@ -124,14 +72,14 @@ "dependency-tree": "7.0.2", "duplexify": "4.0.0", "electron-context-menu": "0.11.0", - "errorhandler": "1.5.1", + "errorhandler": "1.5.0", "evil-dns": "0.2.0", "execa": "1.0.0", "express": "4.16.4", "express-handlebars": "3.0.2", "find-process": "1.4.1", "fluent-ffmpeg": "2.1.2", - "fs-extra": "8.0.1", + "fs-extra": "5.0.0", "getos": "3.1.1", "glob": "7.1.3", "graceful-fs": "4.1.15", @@ -179,6 +127,7 @@ "shell-env": "3.0.0", "signal-exit": "3.0.2", "sinon": "5.1.1", + "string-to-stream": "1.1.1", "strip-ansi": "3.0.1", "supports-color": "6.1.0", "syntax-error": "1.4.0", @@ -192,5 +141,57 @@ "uuid": "3.3.2", "widest-line": "3.1.0", "winston": "2.4.4" - } + }, + "devDependencies": { + "@babel/core": "7.4.4", + "@babel/plugin-proposal-class-properties": "7.4.4", + "@babel/plugin-proposal-object-rest-spread": "7.4.4", + "@babel/plugin-transform-runtime": "7.4.4", + "@babel/preset-env": "7.4.4", + "@babel/preset-react": "7.0.0", + "@babel/runtime": "7.4.4", + "@cypress/debugging-proxy": "2.0.1", + "@cypress/json-schemas": "5.31.3", + "@cypress/sinon-chai": "1.1.0", + "babel-plugin-add-module-exports": "1.0.2", + "babelify": "10.0.0", + "bin-up": "1.2.0", + "body-parser": "1.19.0", + "chai-uuid": "1.0.6", + "chokidar-cli": "1.2.2", + "chrome-har-capturer": "0.13.4", + "coffee-coverage": "1.0.1", + "console-table-printer": "1.0.0-beta12", + "cors": "2.8.5", + "electron-osx-sign": "0.4.11", + "eol": "0.9.1", + "eventsource": "1.0.7", + "express-session": "1.16.1", + "express-useragent": "1.0.12", + "http-mitm-proxy": "0.7.0", + "https-proxy-agent": "1.0.0", + "inquirer": "3.3.0", + "istanbul": "0.4.5", + "mocked-env": "1.2.4", + "mockery": "1.7.0", + "multiparty": "4.2.1", + "nock": "9.6.1", + "npm-install-version": "6.0.2", + "obfuscator": "0.5.4", + "plist": "1.2.0", + "proxyquire": "2.1.0", + "react": "15.6.2", + "repl.history": "0.1.4", + "run-sequence": "1.2.2", + "snap-shot-it": "7.5.1", + "ssestream": "1.0.1", + "stream-to-promise": "1.1.1", + "supertest": "4.0.2", + "supertest-session": "0.0.7", + "through2": "0.6.5", + "ws": "5.2.2", + "xvfb": "cypress-io/node-xvfb#22e3783c31d81ebe64d8c0df491ea00cdc74726a", + "xvfb-maybe": "cypress-io/xvfb-maybe#c4a810c42d603949cd63b8cf245f6c239331d370" + }, + "productName": "Cypress" } diff --git a/packages/server/test/.eslintrc b/packages/server/test/.eslintrc index 8deaa24774b2..296f15334e82 100644 --- a/packages/server/test/.eslintrc +++ b/packages/server/test/.eslintrc @@ -3,6 +3,6 @@ "sinon": true }, "extends": [ - "plugin:cypress-dev/tests" + "plugin:@cypress/dev/tests" ] } diff --git a/packages/server/test/scripts/.eslintrc b/packages/server/test/scripts/.eslintrc new file mode 100644 index 000000000000..74e0826b6dbb --- /dev/null +++ b/packages/server/test/scripts/.eslintrc @@ -0,0 +1,5 @@ +{ + "parserOptions": { + "sourceType": "script" + } +} diff --git a/packages/socket/package.json b/packages/socket/package.json index 16d28525bbff..52291bc11e38 100644 --- a/packages/socket/package.json +++ b/packages/socket/package.json @@ -2,22 +2,22 @@ "name": "@packages/socket", "version": "0.0.0", "private": true, + "files": [ + "lib", + "patches" + ], "main": "index.js", "browser": "./lib/browser.js", "scripts": { + "check-deps": "node ../../scripts/check-deps.js --verbose", + "check-deps-pre": "npm run check-deps -- --prescript", + "clean-deps": "rm -rf node_modules", "postinstall": "npx patch-package", "pretest": "npm run check-deps-pre", "test": "cross-env NODE_ENV=test bin-up mocha --reporter mocha-multi-reporters --reporter-options configFile=../../mocha-reporter-config.json", "pretest-watch": "npm run check-deps-pre", - "test-watch": "cross-env NODE_ENV=test bin-up mocha --watch", - "clean-deps": "rm -rf node_modules", - "check-deps": "node ../../scripts/check-deps.js --verbose", - "check-deps-pre": "npm run check-deps -- --prescript" + "test-watch": "cross-env NODE_ENV=test bin-up mocha --watch" }, - "files": [ - "lib", - "patches" - ], "dependencies": { "socket.io": "2.2.0", "socket.io-circular-parser": "cypress-io/socket.io-circular-parser#8c61ca1475c741285f336d9ad5bc05cc561b1066", diff --git a/packages/socket/test/.eslintrc b/packages/socket/test/.eslintrc new file mode 100644 index 000000000000..b5ed5206d083 --- /dev/null +++ b/packages/socket/test/.eslintrc @@ -0,0 +1,5 @@ +{ + "extends": [ + "plugin:@cypress/dev/tests" + ] +} diff --git a/packages/static/package.json b/packages/static/package.json index 809016aab21a..b7e429701b6d 100644 --- a/packages/static/package.json +++ b/packages/static/package.json @@ -1,22 +1,22 @@ { "name": "@packages/static", "version": "0.0.0", - "main": "index.js", "private": true, + "files": [ + "dist", + "lib" + ], + "main": "index.js", "scripts": { - "postinstall": "echo '@packages/static needs: npm run build'", - "clean-deps": "rm -rf node_modules", - "check-deps": "node ../../scripts/check-deps.js --verbose", - "check-deps-pre": "npm run check-deps -- --prescript", "prebuild": "npm run check-deps-pre", "build": "gulp build", + "check-deps": "node ../../scripts/check-deps.js --verbose", + "check-deps-pre": "npm run check-deps -- --prescript", + "clean-deps": "rm -rf node_modules", + "postinstall": "echo '@packages/static needs: npm run build'", "pretest": "npm run check-deps-pre", "test": "echo 'Nothing to test yet'" }, - "files": [ - "dist", - "lib" - ], "devDependencies": { "@cypress/icons": "0.7.0", "gulp": "3.9.1" diff --git a/packages/ts/package.json b/packages/ts/package.json index 98cbae6b2b0c..45c196df84aa 100644 --- a/packages/ts/package.json +++ b/packages/ts/package.json @@ -2,18 +2,18 @@ "name": "@packages/ts", "version": "0.0.0", "private": true, - "main": "index.js", "files": [ "register.js" ], + "main": "index.js", "scripts": { - "test": "node test", - "clean-deps": "rm -rf node_modules" - }, - "devDependencies": { - "ts-node": "4.1.0" + "clean-deps": "rm -rf node_modules", + "test": "node test" }, "dependencies": { "debug": "4.1.1" + }, + "devDependencies": { + "ts-node": "4.1.0" } } diff --git a/scripts/.eslintrc b/scripts/.eslintrc new file mode 100644 index 000000000000..6cb92dcbe6ca --- /dev/null +++ b/scripts/.eslintrc @@ -0,0 +1,3 @@ +{ + "parser": "@typescript-eslint/parser" +} diff --git a/scripts/binary/.eslintrc b/scripts/binary/.eslintrc new file mode 100644 index 000000000000..d5ba8f9d9ca8 --- /dev/null +++ b/scripts/binary/.eslintrc @@ -0,0 +1,5 @@ +{ + "rules": { + "no-console": "off" + } +} diff --git a/scripts/unit/.eslintrc b/scripts/unit/.eslintrc new file mode 100644 index 000000000000..b5ed5206d083 --- /dev/null +++ b/scripts/unit/.eslintrc @@ -0,0 +1,5 @@ +{ + "extends": [ + "plugin:@cypress/dev/tests" + ] +}