Skip to content

Commit

Permalink
Move deploy scripts (#205)
Browse files Browse the repository at this point in the history
* root: move deploy scripts from server to top level scripts

* remove postinstall download stop variable

* deploy: list all dev dependencies

* working on deploy run

* WIP comment out obsolete run-sequence

* add cypress-io/cypress-example-recipes

* root: enable run all to skip package or packages by name

* deploy: move coffee lint to root

* deploy: make bump async

* deploy: WIP update deploy + build processes for monorepo

* Add cypress-io/cypress-example-module-api project build to bump

* remove commas

* Add project cypress-io/cypress-test-ci-environments to list of projects to test

* deploy: WIP refactor classes -> functional

* deploy: don't copy node_modules or prune -> just npm install

* cli: consolidate important fields into monorepo root, pull out and build

* all: cleanup package.json, remove versions, license, repo information

-move some deps to devDeps

* all: convert es5 -> es6 + fix linting

* deploy: specify files to include when copying packages for dist

* deploy: convert coffee script in place + remove coffee files
  • Loading branch information
bahmutov committed Jun 23, 2017
1 parent b4bfafa commit 91ec7a0
Show file tree
Hide file tree
Showing 41 changed files with 821 additions and 487 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -40,3 +40,4 @@ docs/support

# CLI tool
cli/build
scripts/deploy/support/
15 changes: 2 additions & 13 deletions cli/package.json
@@ -1,12 +1,11 @@
{
"name": "cypress",
"version": "0.0.0",
"description": "dev build project for Cypress NPM package",
"main": "index.js",
"private": true,
"bin": {
"cypress": "bin/cypress"
},
"private": true,
"scripts": {
"pretest": "npm run lint",
"test": "npm run test-unit",
Expand Down Expand Up @@ -60,15 +59,5 @@
"bin",
"lib",
"index.js"
],
"repository": {
"type": "git",
"url": "https://github.com/cypress-io/cypress.git"
},
"author": "Brian Mann",
"license": "MIT",
"bugs": {
"url": "https://github.com/cypress-io/cypress/issues"
},
"homepage": "https://github.com/cypress-io/cypress"
]
}
15 changes: 14 additions & 1 deletion cli/scripts/build.js
Expand Up @@ -5,7 +5,15 @@ const Promise = require('bluebird')
const fs = Promise.promisifyAll(require('fs-extra'))

// grab the current version from the root monorepo package.json
const { version, description } = require('../../package.json')
const {
version,
description,
author,
homepage,
license,
bugs,
repository,
} = require('../../package.json')

const packageJsonSrc = path.join('package.json')
const packageJsonDest = path.join('build', 'package.json')
Expand All @@ -19,6 +27,11 @@ function preparePackageForNpmRelease (json) {
_.extend(json, {
version,
description,
author,
homepage,
license,
bugs,
repository,
scripts: {
postinstall: 'node index.js --exec install',
size: 't=\"$(npm pack .)\"; wc -c \"${t}\"; tar tvf \"${t}\"; rm \"${t}\";',
Expand Down
File renamed without changes.
1 change: 0 additions & 1 deletion docs/package.json
@@ -1,7 +1,6 @@
{
"name": "cypress-documentation",
"version": "0.0.0",
"description": "Cypress.io documentation",
"private": true,
"hexo": {
"version": "3.3.7"
Expand Down
41 changes: 36 additions & 5 deletions package.json
@@ -1,5 +1,6 @@
{
"name": "cypress-monorepo",
"name": "cypress",
"productName": "Cypresss",
"version": "0.19.4",
"description": "Cypress.io end to end testing tool",
"private": true,
Expand All @@ -15,13 +16,16 @@
"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",
"postinstall": "CYPRESS_DOWNLOAD=0 npm run link && npm run all install && npm run build",
"postinstall": "npm run link && npm run all install && npm run build",
"clean-deps": "npm run all clean-deps",
"docker": "./scripts/run-docker-local.sh",
"lint": "eslint --fix scripts/*.js",
"pretest": "npm run lint && npm run all lint",
"precommit": "lint-staged",
"precommit-lint": "eslint --fix --rule 'no-only-tests/no-only-tests: 2'"
"precommit-lint": "eslint --fix --rule 'no-only-tests/no-only-tests: 2'",
"bump": "gulp bump",
"deploy": "node ./scripts/deploy.js",
"release": "gulp release"
},
"lint-staged": {
"*.js": [
Expand All @@ -30,19 +34,46 @@
]
},
"devDependencies": {
"@cypress/bumpercar": "^1.0.6",
"@cypress/npm-run-all": "^4.0.4",
"ascii-table": "0.0.9",
"babel-eslint": "^6.0.4",
"bluebird": "^3.4.5",
"chai": "^4.0.2",
"del": "^3.0.0",
"electron-osx-sign": "^0.4.6",
"deps-ok": "^1.2.0",
"eslint": "^3.18.0",
"eslint-plugin-mocha": "^4.9.0",
"eslint-plugin-no-only-tests": "levibuzolic/eslint-plugin-no-only-tests#dbb7270c4f48e33081729c0ef076441b39f35487",
"eslint-plugin-react": "^5.1.1",
"fs-extra": "^2.1.2",
"gulp": "^3.9.1",
"gulp-awspublish": "^3.3.0",
"gulp-coffee": "^2.3.4",
"gulp-debug": "^3.1.0",
"gulp-rename": "^1.2.2",
"human-interval": "^0.1.6",
"husky": "^0.13.4",
"inquirer": "^3.1.1",
"konfig": "^0.2.1",
"lint-staged": "^3.6.0",
"lodash": "^4.17.4"
"lodash": "^4.17.4",
"obfuscator": "^0.5.4",
"plist": "^2.1.0",
"run-sequence": "^1.2.2",
"vagrant": "0.0.1",
"vinyl-paths": "^2.1.0",
"xvfb": "^0.2.3"
},
"license": "MIT"
"author": "Brian Mann",
"license": "MIT",
"homepage": "https://github.com/cypress-io/cypress",
"repository": {
"type": "git",
"url": "https://github.com/cypress-io/cypress.git"
},
"bugs": {
"url": "https://github.com/cypress-io/cypress/issues"
}
}
13 changes: 1 addition & 12 deletions packages/desktop-gui/package.json
@@ -1,7 +1,6 @@
{
"name": "@packages/desktop-gui",
"version": "0.4.9",
"description": "Desktop GUI for managing Cypress projects.",
"version": "0.0.0",
"main": "lib/gui.js",
"private": true,
"scripts": {
Expand All @@ -17,16 +16,6 @@
"test": "echo 'No unit tests to run, but there are e2e tests'",
"pretest": "npm run lint"
},
"repository": {
"type": "git",
"url": "https://github.com/cypress-io/cypress-core-desktop-gui.git"
},
"author": "Brian Mann",
"license": "MIT",
"bugs": {
"url": "https://github.com/cypress-io/cypress-core-desktop-gui/issues"
},
"homepage": "https://github.com/cypress-io/cypress-core-desktop-gui",
"files": [
"dist",
"lib"
Expand Down
13 changes: 6 additions & 7 deletions packages/driver/lib/driver.js
@@ -1,13 +1,12 @@
var path = require('path')
const path = require('path')

function dist () {
var args = [].slice.call(arguments)
var paths = [__dirname, '..', 'dist'].concat(args)
return path.join.apply(path, paths)
function dist (...args) {
const paths = [__dirname, '..', 'dist'].concat(args)
return path.join(...paths)
}

module.exports = {
getPathToDist: function(){
return dist.apply(null, arguments)
getPathToDist (...args) {
return dist(...args)
},
}
7 changes: 5 additions & 2 deletions packages/driver/package.json
@@ -1,7 +1,6 @@
{
"name": "@packages/driver",
"version": "1.0.0",
"description": "",
"version": "0.0.0",
"private": true,
"scripts": {
"postinstall": "echo '@packages/driver needs: npm run build'",
Expand All @@ -10,6 +9,10 @@
"clean-deps": "rm -rf node_modules",
"test": "gulp test"
},
"files": [
"dist",
"lib"
],
"devDependencies": {
"@cypress/bower-kendo-ui": "0.0.2",
"angular": "^1.3.1",
Expand Down
19 changes: 6 additions & 13 deletions packages/electron/package.json
@@ -1,9 +1,8 @@
{
"name": "@packages/electron",
"version": "0.3.4",
"private": true,
"version": "0.0.0",
"electronVersion": "1.4.6",
"description": "Cypress electron wrapper shell",
"private": true,
"main": "index.js",
"scripts": {
"postinstall": "echo '@packages/electron needs: npm run build'",
Expand All @@ -15,16 +14,10 @@
"bin": {
"cypress-electron": "./bin/cypress-electron"
},
"repository": {
"type": "git",
"url": "git+https://github.com/cypress-io/cypress-core-electron.git"
},
"author": "Brian Mann",
"license": "MIT",
"bugs": {
"url": "https://github.com/cypress-io/cypress-core-electron/issues"
},
"homepage": "https://github.com/cypress-io/cypress-core-electron#readme",
"files": [
"dist",
"lib"
],
"devDependencies": {
"@cypress/releaser": "0.1.12",
"chai": "^3.5.0",
Expand Down
10 changes: 6 additions & 4 deletions packages/example/bin/convert.js
@@ -1,14 +1,16 @@
#!/usr/bin/env node

let fs = require('fs')
let path = require('path')
let glob = require('glob')
/* eslint-disable quotes */

const fs = require('fs')
const path = require('path')
const glob = require('glob')

function replaceStringsIn (file) {
fs.readFile(file, 'utf8', function (err, str) {
if (err) throw err

let replace = function (source, dest) {
const replace = function (source, dest) {
str = str.split(source).join(dest)
}

Expand Down
2 changes: 1 addition & 1 deletion packages/example/lib/example.js
@@ -1,4 +1,4 @@
let path = require('path')
const path = require('path')

module.exports = {
getPathToExample () {
Expand Down
25 changes: 8 additions & 17 deletions packages/example/package.json
@@ -1,8 +1,7 @@
{
"name": "@packages/example",
"version": "0.8.0",
"version": "0.0.0",
"private": true,
"description": "Interal Cypress repo for managing https://example.cypress.io",
"main": "index.js",
"scripts": {
"postinstall": "echo '@packages/example needs: npm run build'",
Expand All @@ -17,29 +16,21 @@
"lint": "$(bin-up eslint) --fix *.js bin/*.js lib/*.js test/*.js",
"pretest": "npm run lint"
},
"author": "Brian Mann",
"license": "MIT",
"dependencies": {
"cypress-example-kitchensink": "0.7.0",
"glob": "^7.0.3"
},
"files": [
"cypress",
"lib"
],
"devDependencies": {
"@cypress/releaser": "0.1.12",
"bin-up": "^1.0.1",
"chai": "^3.5.0",
"cypress-example-kitchensink": "0.7.0",
"glob": "^7.0.3",
"gulp": "^3.9.1",
"gulp-clean": "^0.3.1",
"gulp-gh-pages": "^0.5.4",
"gulp-rev-all": "^0.8.22",
"mocha": "^2.4.5",
"run-sequence": "^1.1.5"
},
"repository": {
"type": "git",
"url": "git+https://github.com/cypress-io/cypress-core-example.git"
},
"bugs": {
"url": "https://github.com/cypress-io/cypress-core-example/issues"
},
"homepage": "https://github.com/cypress-io/cypress-core-example#readme"
}
}
15 changes: 2 additions & 13 deletions packages/extension/package.json
@@ -1,8 +1,7 @@
{
"name": "@packages/extension",
"version": "0.4.2",
"version": "0.0.0",
"private": true,
"description": "Cypress Chrome Extension",
"main": "index.js",
"scripts": {
"postinstall": "echo '@packages/extension needs: npm run build'",
Expand All @@ -20,18 +19,9 @@
"lib",
"theme"
],
"repository": {
"type": "git",
"url": "git+https://github.com/cypress-io/cypress-core-extension.git"
},
"author": "Brian Mann",
"license": "MIT",
"bugs": {
"url": "https://github.com/cypress-io/cypress-core-extension/issues"
},
"homepage": "https://github.com/cypress-io/cypress-core-extension#readme",
"devDependencies": {
"@cypress/core-socket": "0.1.0",
"@cypress/icons": "0.5.4",
"@cypress/releaser": "0.1.12",
"browserify": "^13.0.0",
"chai": "^3.5.0",
Expand All @@ -47,7 +37,6 @@
"vinyl-source-stream": "^1.1.0"
},
"dependencies": {
"@cypress/icons": "0.5.4",
"bluebird": "^3.3.5",
"lodash": "^4.11.2"
}
Expand Down
16 changes: 4 additions & 12 deletions packages/https-proxy/package.json
@@ -1,7 +1,6 @@
{
"name": "@packages/https-proxy",
"version": "0.1.5",
"description": "",
"version": "0.0.0",
"private": true,
"main": "index.js",
"scripts": {
Expand All @@ -12,16 +11,9 @@
"https": "node https.js",
"release": "releaser"
},
"repository": {
"type": "git",
"url": "git+https://github.com/cypress-io/cypress-core-https-proxy.git"
},
"author": "Brian Mann",
"license": "MIT",
"bugs": {
"url": "https://github.com/cypress-io/cypress-core-https-proxy/issues"
},
"homepage": "https://github.com/cypress-io/cypress-core-https-proxy#readme",
"files": [
"lib"
],
"devDependencies": {
"@cypress/releaser": "0.1.12",
"chai": "^3.5.0",
Expand Down

0 comments on commit 91ec7a0

Please sign in to comment.