mirror of
https://github.com/cypress-io/cypress.git
synced 2026-03-13 12:59:07 -05:00
wip - get packages talking to each other
This commit is contained in:
8
index.js
8
index.js
@@ -1,8 +1,4 @@
|
||||
var path = require("path")
|
||||
var pkgsDir = path.join(__dirname, "packages")
|
||||
|
||||
require("app-module-path").addPath(pkgsDir)
|
||||
|
||||
require("app-module-path/register")
|
||||
require("coffee-script/register")
|
||||
|
||||
module.exports = require("./lib").start(process.argv.slice(2))
|
||||
module.exports = require("./lib").start(process.argv.slice(2))
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
{
|
||||
"lerna": "2.0.0-beta.26",
|
||||
"version": "0.0.0"
|
||||
}
|
||||
@@ -5,7 +5,9 @@ chalk = require("chalk")
|
||||
Promise = require("bluebird")
|
||||
minimist = require("minimist")
|
||||
runAll = require("@cypress/npm-run-all")
|
||||
through = require("through")
|
||||
through = require("through")
|
||||
|
||||
coreApp = require("packages/core-app")
|
||||
|
||||
globAsync = Promise.promisify(glob)
|
||||
|
||||
@@ -23,7 +25,7 @@ setTerminalTitle = (title) ->
|
||||
String.fromCharCode(27) + "]0;" + title + String.fromCharCode(7)
|
||||
)
|
||||
|
||||
colors = "black red green yellow blue magenta cyan white gray".split(" ")
|
||||
colors = "green yellow blue magenta cyan white gray bgGreen bgYellow bgBlue bgMagenta bgCyan bgWhite".split(" ")
|
||||
|
||||
module.exports = {
|
||||
getDirs: (dir) ->
|
||||
@@ -34,12 +36,17 @@ module.exports = {
|
||||
exec: (cmd) ->
|
||||
setTerminalTitle("run:all:#{cmd}")
|
||||
|
||||
runCommand = if cmd isnt "install" or cmd isnt "test"
|
||||
"run #{cmd}"
|
||||
else
|
||||
cmd
|
||||
|
||||
@getDirs()
|
||||
.then (dirs) ->
|
||||
tasks = getPackages(cmd, dirs).map (dir, index) ->
|
||||
packageName = dir.replace(path.resolve("packages") + "/", "")
|
||||
return {
|
||||
command: cmd
|
||||
command: runCommand
|
||||
options: {
|
||||
cwd: dir
|
||||
label: {
|
||||
@@ -66,7 +73,7 @@ module.exports = {
|
||||
@exec(e)
|
||||
|
||||
else
|
||||
require("core-app").start(options)
|
||||
coreApp.start()
|
||||
}
|
||||
|
||||
|
||||
@@ -78,11 +85,8 @@ work out script running UX
|
||||
* nodemon's colors are coming through, so see what it does
|
||||
- bring back panes
|
||||
* need to be able to scroll
|
||||
work out build dependencies
|
||||
- e.g. runner waits on reporter
|
||||
- any other examples? if not, just deal with runner/reporter
|
||||
wire up interdependencies correctly
|
||||
- @cypress/core-runner -> core-runner
|
||||
- @cypress/core-runner -> packages/core-runner
|
||||
handle deployment
|
||||
core-app -> core-server
|
||||
more some core-app stuff into root
|
||||
|
||||
@@ -3,10 +3,10 @@
|
||||
"version": "0.0.0",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"postinstall": "node index.js --exec 'npm install, npm run build'",
|
||||
"postinstall": "npm run all install",
|
||||
"start": "node index.js",
|
||||
"dev": "node index.js --exec 'npm run dev'",
|
||||
"test": "node index.js --exec 'npm test'",
|
||||
"watch-dev": "node run all watch-dev",
|
||||
"test": "node run all test",
|
||||
"all": "node index.js"
|
||||
},
|
||||
"author": "",
|
||||
|
||||
@@ -13,7 +13,7 @@ Promise = require("bluebird")
|
||||
obfuscator = require("obfuscator")
|
||||
runSequence = require("run-sequence")
|
||||
cypressIcons = require("@cypress/core-icons")
|
||||
cypressElectron = require("@cypress/core-electron")
|
||||
cypressElectron = require("packages/core-electron")
|
||||
log = require("./log")
|
||||
meta = require("./meta")
|
||||
pkg = require("../package.json")
|
||||
@@ -387,4 +387,4 @@ class Base
|
||||
.then(@verifyAppCanOpen)
|
||||
.return(@)
|
||||
|
||||
module.exports = Base
|
||||
module.exports = Base
|
||||
|
||||
@@ -10,7 +10,7 @@ child_process = require("child_process")
|
||||
runSequence = require("run-sequence")
|
||||
importOnce = require("node-sass-import-once")
|
||||
cyIcons = require("@cypress/core-icons")
|
||||
deploy = require("./deploy")
|
||||
# deploy = require("./deploy")
|
||||
|
||||
fs = Promise.promisifyAll(fs)
|
||||
|
||||
@@ -170,14 +170,14 @@ gulp.task "server", -> require("./server.coffee")
|
||||
|
||||
gulp.task "test", -> require("./spec/server.coffee")
|
||||
|
||||
gulp.task "release", deploy.release
|
||||
# gulp.task "release", deploy.release
|
||||
|
||||
gulp.task "deploy:fixture", ->
|
||||
require("./lib/deploy")().fixture()
|
||||
# gulp.task "deploy:fixture", ->
|
||||
# require("./lib/deploy")().fixture()
|
||||
|
||||
gulp.task "build", deploy.build
|
||||
# gulp.task "build", deploy.build
|
||||
|
||||
gulp.task "deploy", deploy.deploy
|
||||
# gulp.task "deploy", deploy.deploy
|
||||
|
||||
gulp.task "app", ["app:build", "app:watch"]
|
||||
|
||||
|
||||
@@ -1,4 +1,11 @@
|
||||
require("coffee-script/register")
|
||||
require && require.extensions && delete require.extensions[".litcoffee"]
|
||||
require && require.extensions && delete require.extensions[".coffee.md"]
|
||||
require("./lib/cypress").start(process.argv)
|
||||
|
||||
cypress = require("./lib/cypress")
|
||||
|
||||
module.exports = {
|
||||
start () {
|
||||
cypress.start(process.argv)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
socketIo = require("@cypress/core-socket")
|
||||
socketIo = require("packages/core-socket")
|
||||
|
||||
## hold onto the client source + version in memory
|
||||
clientSource = socketIo.getClientSource()
|
||||
|
||||
11
packages/core-app/lib/controllers/reporter.coffee
Normal file
11
packages/core-app/lib/controllers/reporter.coffee
Normal file
@@ -0,0 +1,11 @@
|
||||
_ = require("lodash")
|
||||
send = require("send")
|
||||
reporter = require("packages/core-reporter")
|
||||
|
||||
module.exports = {
|
||||
handle: (req, res) ->
|
||||
pathToFile = reporter.getPathToDist(req.params[0])
|
||||
|
||||
send(req, pathToFile)
|
||||
.pipe(res)
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
_ = require("lodash")
|
||||
send = require("send")
|
||||
runner = require("@cypress/core-runner")
|
||||
runner = require("packages/core-runner")
|
||||
|
||||
module.exports = {
|
||||
serve: (req, res, config, getRemoteState) ->
|
||||
|
||||
@@ -57,7 +57,7 @@ module.exports = {
|
||||
|
||||
## open the cypress electron wrapper shell app
|
||||
new Promise (resolve) ->
|
||||
cypressElectron = require("@cypress/core-electron")
|
||||
cypressElectron = require("packages/core-electron")
|
||||
fn = (code) ->
|
||||
## juggle up the failures since our outer
|
||||
## promise is expecting this object structure
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
_ = require("lodash")
|
||||
Promise = require("bluebird")
|
||||
extension = require("@cypress/core-extension")
|
||||
extension = require("packages/core-extension")
|
||||
|
||||
module.exports = {
|
||||
get: (cookies, filter = {}) ->
|
||||
@@ -35,4 +35,4 @@ module.exports = {
|
||||
@get(cookies, {domain: "github.com"})
|
||||
.map(removeCookie)
|
||||
.return(null)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
_ = require("lodash")
|
||||
Promise = require("bluebird")
|
||||
extension = require("@cypress/core-extension")
|
||||
extension = require("packages/core-extension")
|
||||
files = require("../../controllers/files")
|
||||
config = require("../../config")
|
||||
errors = require("../../errors")
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
_ = require("lodash")
|
||||
path = require("path")
|
||||
uri = require("url")
|
||||
cyDesktop = require("@cypress/core-desktop-gui")
|
||||
cyDesktop = require("packages/core-desktop-gui")
|
||||
BrowserWindow = require("electron").BrowserWindow
|
||||
cwd = require("../../cwd")
|
||||
user = require("../../user")
|
||||
@@ -147,4 +147,4 @@ module.exports = {
|
||||
else
|
||||
Promise.resolve(win)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ fs = require("fs-extra")
|
||||
path = require("path")
|
||||
Promise = require("bluebird")
|
||||
launcher = require("@cypress/core-launcher")
|
||||
extension = require("@cypress/core-extension")
|
||||
extension = require("packages/core-extension")
|
||||
appData = require("./util/app_data")
|
||||
|
||||
fs = Promise.promisifyAll(fs)
|
||||
|
||||
@@ -5,7 +5,7 @@ url = require("url")
|
||||
tough = require("tough-cookie")
|
||||
moment = require("moment")
|
||||
Promise = require("bluebird")
|
||||
extension = require("@cypress/core-extension")
|
||||
extension = require("packages/core-extension")
|
||||
|
||||
Cookie = tough.Cookie
|
||||
CookieJar = tough.CookieJar
|
||||
|
||||
@@ -3,6 +3,7 @@ CacheBuster = require("./util/cache_buster")
|
||||
cwd = require("./cwd")
|
||||
logger = require("./logger")
|
||||
spec = require("./controllers/spec_processor")
|
||||
reporter = require("./controllers/reporter")
|
||||
runner = require("./controllers/runner")
|
||||
xhrs = require("./controllers/xhrs")
|
||||
client = require("./controllers/client")
|
||||
@@ -22,6 +23,9 @@ module.exports = (app, config, getRemoteState) ->
|
||||
app.get "/__cypress/socket.io.js", (req, res) ->
|
||||
client.handle(req, res)
|
||||
|
||||
app.get "/__cypress/reporter/*", (req, res) ->
|
||||
reporter.handle(req, res)
|
||||
|
||||
app.get "/__cypress/runner/*", (req, res) ->
|
||||
runner.handle(req, res)
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ Promise = require("bluebird")
|
||||
evilDns = require("evil-dns")
|
||||
statuses = require("http-status-codes")
|
||||
httpProxy = require("http-proxy")
|
||||
httpsProxy = require("@cypress/core-https-proxy")
|
||||
httpsProxy = require("packages/core-https-proxy")
|
||||
allowDestroy = require("server-destroy-vvo")
|
||||
cors = require("./util/cors")
|
||||
headersUtil = require("./util/headers")
|
||||
|
||||
@@ -4,7 +4,7 @@ str = require("underscore.string")
|
||||
path = require("path")
|
||||
uuid = require("node-uuid")
|
||||
Promise = require("bluebird")
|
||||
socketIo = require("@cypress/core-socket")
|
||||
socketIo = require("packages/core-socket")
|
||||
open = require("./util/open")
|
||||
pathHelpers = require("./util/path_helpers")
|
||||
cwd = require("./cwd")
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
"scripts": {
|
||||
"start": "node index.js",
|
||||
"server": "node index.js --mode server",
|
||||
"build": "gulp app:build",
|
||||
"watch": "gulp app",
|
||||
"build-prod": "gulp app:build",
|
||||
"watch-dev": "gulp app",
|
||||
"deploy": "gulp deploy",
|
||||
"release": "gulp release",
|
||||
"postinstall": "bower install",
|
||||
@@ -39,7 +39,6 @@
|
||||
},
|
||||
"homepage": "https://github.com/cypress-io/cypress",
|
||||
"devDependencies": {
|
||||
"@cypress/core-electron": "0.2.1",
|
||||
"body-parser": "1.12.4",
|
||||
"chai": "2.1.0",
|
||||
"chai-as-promised": "^4.2.0",
|
||||
@@ -104,14 +103,9 @@
|
||||
"xvfb-maybe": "^0.1.3"
|
||||
},
|
||||
"dependencies": {
|
||||
"@cypress/core-desktop-gui": "0.3.7",
|
||||
"@cypress/core-example": "0.6.1",
|
||||
"@cypress/core-extension": "0.3.4",
|
||||
"@cypress/core-https-proxy": "0.1.3",
|
||||
"@cypress/core-icons": "0.4.1",
|
||||
"@cypress/core-launcher": "0.1.0",
|
||||
"@cypress/core-runner": "0.3.2",
|
||||
"@cypress/core-socket": "0.2.0",
|
||||
"ansi_up": "^1.3.0",
|
||||
"bluebird": "3.3.3",
|
||||
"browserify": "6.1.0",
|
||||
|
||||
@@ -8,7 +8,7 @@ http = require("http")
|
||||
Promise = require("bluebird")
|
||||
electron = require("electron")
|
||||
inquirer = require("inquirer")
|
||||
extension = require("@cypress/core-extension")
|
||||
extension = require("packages/core-extension")
|
||||
Fixtures = require("../helpers/fixtures")
|
||||
pkg = require("#{root}package.json")
|
||||
settings = require("#{root}lib/util/settings")
|
||||
|
||||
@@ -6,7 +6,7 @@ ws = require("ws")
|
||||
httpsAgent = require("https-proxy-agent")
|
||||
evilDns = require("evil-dns")
|
||||
Promise = require("bluebird")
|
||||
socketIo = require("@cypress/core-socket")
|
||||
socketIo = require("packages/core-socket")
|
||||
httpsServer = require("@cypress/core-https-proxy/test/helpers/https_server")
|
||||
config = require("#{root}lib/config")
|
||||
Server = require("#{root}lib/server")
|
||||
|
||||
@@ -2,7 +2,7 @@ require("../../spec_helper")
|
||||
|
||||
_ = require("lodash")
|
||||
icons = require("@cypress/core-icons")
|
||||
extension = require("@cypress/core-extension")
|
||||
extension = require("packages/core-extension")
|
||||
electron = require("electron")
|
||||
cache = require("#{root}../lib/cache")
|
||||
logger = require("#{root}../lib/logger")
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
require("../../spec_helper")
|
||||
|
||||
extension = require("@cypress/core-extension")
|
||||
extension = require("packages/core-extension")
|
||||
Fixtures = require("../../helpers/fixtures")
|
||||
project = require("#{root}../lib/electron/handlers/project")
|
||||
Project = require("#{root}../lib/project")
|
||||
|
||||
@@ -5,8 +5,8 @@ os = require("os")
|
||||
path = require("path")
|
||||
uuid = require("node-uuid")
|
||||
Promise = require("bluebird")
|
||||
socketIo = require("@cypress/core-socket")
|
||||
extension = require("@cypress/core-extension")
|
||||
socketIo = require("packages/core-socket")
|
||||
extension = require("packages/core-extension")
|
||||
httpsAgent = require("https-proxy-agent")
|
||||
open = require("#{root}lib/util/open")
|
||||
config = require("#{root}lib/config")
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
"build-prod": "node ./scripts/build-prod.js",
|
||||
"prod": "npm run build-prod && npm run server",
|
||||
"server": "zunder serve-prod --port 8000",
|
||||
"start": "zunder watch",
|
||||
"watch-dev": "zunder watch",
|
||||
"prepublish": "npm run build-prod",
|
||||
"release": "releaser",
|
||||
"test": "npm run build-prod && npm run server & cypress run"
|
||||
|
||||
@@ -47,4 +47,4 @@ module.exports = {
|
||||
.catch (err) ->
|
||||
console.log(err.stack)
|
||||
process.exit(1)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ clean = require("gulp-clean")
|
||||
rename = require("gulp-rename")
|
||||
runSeq = require("run-sequence")
|
||||
source = require("vinyl-source-stream")
|
||||
socket = require("@cypress/core-socket")
|
||||
socket = require("packages/core-socket")
|
||||
icons = require("@cypress/core-icons")
|
||||
Promise = require("bluebird")
|
||||
coffeeify = require("coffeeify")
|
||||
|
||||
@@ -2,7 +2,7 @@ require("../spec_helper")
|
||||
|
||||
_ = require("lodash")
|
||||
http = require("http")
|
||||
socket = require("@cypress/core-socket")
|
||||
socket = require("packages/core-socket")
|
||||
Promise = require("bluebird")
|
||||
background = require("../../app/background")
|
||||
|
||||
|
||||
42
packages/core-reporter/.gitignore
vendored
42
packages/core-reporter/.gitignore
vendored
@@ -1,41 +1,9 @@
|
||||
.DS_Store
|
||||
|
||||
# Logs
|
||||
logs
|
||||
*.log
|
||||
npm-debug.log*
|
||||
|
||||
# Runtime data
|
||||
pids
|
||||
*.pid
|
||||
*.seed
|
||||
|
||||
# Directory for instrumented libs generated by jscoverage/JSCover
|
||||
lib-cov
|
||||
|
||||
# Coverage directory used by tools like istanbul
|
||||
coverage
|
||||
|
||||
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
|
||||
.grunt
|
||||
|
||||
# node-waf configuration
|
||||
.lock-wscript
|
||||
|
||||
# Compiled binary addons (http://nodejs.org/api/addons.html)
|
||||
build/Release
|
||||
|
||||
# Dependency directory
|
||||
# https://docs.npmjs.com/misc/faq#should-i-check-my-node-modules-folder-into-git
|
||||
node_modules
|
||||
|
||||
# Optional npm cache directory
|
||||
.npm
|
||||
|
||||
# Optional REPL history
|
||||
.node_repl_history
|
||||
|
||||
bower_components
|
||||
dist
|
||||
|
||||
*.log
|
||||
dist*
|
||||
build
|
||||
cypress.env.json
|
||||
tmp
|
||||
*.orig
|
||||
|
||||
@@ -1,140 +0,0 @@
|
||||
'use strict'
|
||||
|
||||
const autoprefixer = require('gulp-autoprefixer')
|
||||
const babel = require('gulp-babel')
|
||||
const del = require('del')
|
||||
const fs = require('fs')
|
||||
const gulp = require('gulp')
|
||||
const gulpif = require('gulp-if')
|
||||
const gutil = require('gulp-util')
|
||||
const mocha = require('gulp-spawn-mocha')
|
||||
const pathUtil = require('path')
|
||||
const plumber = require('gulp-plumber')
|
||||
const rename = require('gulp-rename')
|
||||
const sass = require('gulp-sass')
|
||||
const sassGlobbing = require('node-sass-globbing')
|
||||
const through = require('through')
|
||||
const watch = require('gulp-watch')
|
||||
|
||||
function handleError (error) {
|
||||
if (/Mocha exited/.test(error.message)) {
|
||||
return // ignore mocha exit errors
|
||||
}
|
||||
console.error(error.stack || `${error.plugin}: ${error.message}`)
|
||||
}
|
||||
|
||||
function isArray (value) {
|
||||
return Object.prototype.toString.call(value) === '[object Array]'
|
||||
}
|
||||
|
||||
const stylesheetsGlob = 'src/**/*.scss'
|
||||
const scriptsGlob = 'src/**/*.+(js|jsx)'
|
||||
const noSpecsGlob = '!src/**/*.spec.+(js|jsx)'
|
||||
|
||||
|
||||
const buildStylesheets = (isProd) => () => {
|
||||
gutil.log('build stylesheets')
|
||||
let firstTime = true
|
||||
const sassOpts = isProd ? {
|
||||
importer: sassGlobbing,
|
||||
outputStyle: 'compressed',
|
||||
} : {
|
||||
importer: sassGlobbing,
|
||||
sourceComments: true,
|
||||
outputStyle: 'expanded',
|
||||
}
|
||||
|
||||
return gulp.src('src/main.scss')
|
||||
.pipe(plumber(handleError))
|
||||
.pipe(sass(sassOpts))
|
||||
.pipe(autoprefixer({ browsers: ['last 2 versions'], cascade: false }))
|
||||
.pipe(rename('reporter.css'))
|
||||
.pipe(gulp.dest('dist'))
|
||||
.on('end', () => {
|
||||
if (firstTime) {
|
||||
firstTime = false
|
||||
return
|
||||
}
|
||||
gutil.log('Stylesheets re-compiled')
|
||||
})
|
||||
}
|
||||
|
||||
gulp.task('build-stylesheets-dev', ['clean'], buildStylesheets(false))
|
||||
gulp.task('build-stylesheets-prod', ['clean'], buildStylesheets(true))
|
||||
|
||||
gulp.task('watch-stylesheets', ['build-stylesheets-dev'], () => {
|
||||
return watch(stylesheetsGlob, buildStylesheets(false))
|
||||
})
|
||||
|
||||
function getSpecFile (file) {
|
||||
let fileName = file.basename.replace('.jsx', '.js')
|
||||
if (!/\.spec\./.test(fileName)) {
|
||||
fileName = fileName.replace('.js', '.spec.js')
|
||||
}
|
||||
var path = file.dirname.replace('src', 'dist')
|
||||
var filePath = `${path}/${fileName}`
|
||||
|
||||
try {
|
||||
fs.statSync(filePath)
|
||||
return new gutil.File({ path: filePath })
|
||||
} catch (e) {
|
||||
// no spec file
|
||||
return null
|
||||
}
|
||||
}
|
||||
|
||||
function passSpecFile (specFile) {
|
||||
return through(function () {
|
||||
if (specFile) this.queue(specFile)
|
||||
})
|
||||
}
|
||||
|
||||
function buildScripts (globOrFile) {
|
||||
let file = globOrFile
|
||||
let log = globOrFile
|
||||
let dest = 'dist'
|
||||
|
||||
if (!isArray(globOrFile)) {
|
||||
file = globOrFile.path
|
||||
log = pathUtil.basename(file)
|
||||
dest = pathUtil.dirname(file).replace('src', 'dist').replace(`${__dirname}/`, '')
|
||||
}
|
||||
|
||||
gutil.log('babel', log)
|
||||
return gulp.src(file)
|
||||
.pipe(plumber(handleError))
|
||||
.pipe(babel({
|
||||
plugins: [
|
||||
'babel-plugin-transform-decorators-legacy',
|
||||
'babel-plugin-add-module-exports',
|
||||
],
|
||||
presets: ['es2015', 'react', 'stage-1'],
|
||||
}))
|
||||
.pipe(gulp.dest(dest))
|
||||
}
|
||||
|
||||
gulp.task('build-scripts-dev', ['clean'], () => {
|
||||
return buildScripts([scriptsGlob])
|
||||
})
|
||||
|
||||
gulp.task('build-scripts-prod', ['clean'], () => {
|
||||
return buildScripts([scriptsGlob, noSpecsGlob])
|
||||
})
|
||||
|
||||
gulp.task('watch-scripts', ['build-scripts-dev'], () => {
|
||||
return watch(scriptsGlob, (file) => {
|
||||
const specFile = getSpecFile(file)
|
||||
return buildScripts(file)
|
||||
.pipe(passSpecFile(specFile))
|
||||
.pipe(gulpif(!!specFile, mocha({
|
||||
r: 'lib/test-setup.js',
|
||||
})))
|
||||
})
|
||||
})
|
||||
|
||||
gulp.task('clean', () => del('dist'))
|
||||
|
||||
gulp.task('watch', ['watch-scripts', 'watch-stylesheets'])
|
||||
gulp.task('build-test', ['build-scripts-dev'])
|
||||
gulp.task('build-dev', ['build-scripts-dev', 'build-stylesheets-dev'])
|
||||
gulp.task('build-prod', ['build-scripts-prod', 'build-stylesheets-prod'])
|
||||
13
packages/core-reporter/lib/reporter.js
Normal file
13
packages/core-reporter/lib/reporter.js
Normal file
@@ -0,0 +1,13 @@
|
||||
var path = require('path')
|
||||
|
||||
function dist () {
|
||||
var args = [].slice.call(arguments)
|
||||
var paths = [__dirname, '..', 'dist'].concat(args)
|
||||
return path.join.apply(path, paths)
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
getPathToDist: function(){
|
||||
return dist.apply(null, arguments)
|
||||
},
|
||||
}
|
||||
@@ -3,12 +3,12 @@
|
||||
"version": "0.3.0",
|
||||
"main": "dist/reporter",
|
||||
"scripts": {
|
||||
"build-dev": "gulp build-dev",
|
||||
"build-prod": "gulp build-prod",
|
||||
"build-dev": "node ./scripts/build-dev.js",
|
||||
"build-prod": "node ./scripts/build-prod.js",
|
||||
"prepublish": "npm run build-prod",
|
||||
"release": "releaser",
|
||||
"start": "gulp watch",
|
||||
"test": "gulp build-test && mocha -r lib/test-setup.js dist/**/*.spec.js"
|
||||
"test": "node ./scripts/test.js",
|
||||
"watch-dev": "node ./scripts/watch.js"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@@ -28,54 +28,24 @@
|
||||
"@cypress/react-tooltip": "^0.1.1",
|
||||
"classnames": "^2.2.5",
|
||||
"babel-eslint": "^6.0.4",
|
||||
"babel-plugin-add-module-exports": "^0.2.1",
|
||||
"babel-plugin-transform-decorators-legacy": "^1.3.4",
|
||||
"babel-preset-es2015": "^6.9.0",
|
||||
"babel-preset-react": "^6.5.0",
|
||||
"babel-preset-stage-1": "^6.5.0",
|
||||
"chai": "^3.5.0",
|
||||
"chai-enzyme": "^0.5.0",
|
||||
"del": "^2.2.2",
|
||||
"classnames": "^2.2.5",
|
||||
"css-element-queries": "^0.3.2",
|
||||
"enzyme": "^2.3.0",
|
||||
"eslint": "^2.12.0",
|
||||
"eslint-plugin-mocha": "^4.0.0",
|
||||
"eslint-plugin-react": "^5.1.1",
|
||||
"font-awesome": "^4.6.3",
|
||||
"gulp": "^3.9.1",
|
||||
"gulp-autoprefixer": "^3.1.0",
|
||||
"gulp-babel": "^6.1.2",
|
||||
"gulp-if": "^2.0.1",
|
||||
"gulp-plumber": "^1.1.0",
|
||||
"gulp-rename": "^1.2.2",
|
||||
"gulp-sass": "^2.3.2",
|
||||
"gulp-spawn-mocha": "^2.2.2",
|
||||
"gulp-util": "^3.0.7",
|
||||
"gulp-watch": "^4.3.8",
|
||||
"jsdom": "^9.4.1",
|
||||
"lodash": "^4.0.0",
|
||||
"markdown-it": "^6.1.1",
|
||||
"mobx": "^2.3.6",
|
||||
"mobx-react": "^3.5.3",
|
||||
"mocha": "^2.5.3",
|
||||
"node-sass-globbing": "0.0.23",
|
||||
"react": "^15.3.0",
|
||||
"react-addons-test-utils": "^15.3.0",
|
||||
"react-dom": "^15.3.0",
|
||||
"sinon": "^1.17.4",
|
||||
"sinon-chai": "^2.8.0",
|
||||
"through": "^2.3.8"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@cypress/react-tooltip": "^0.1.1",
|
||||
"classnames": "^2.2.5",
|
||||
"font-awesome": "^4.6.3",
|
||||
"lodash": "^4.0.0",
|
||||
"mobx": "^2.3.6",
|
||||
"mobx-react": "^3.5.3",
|
||||
"react": "^15.3.0",
|
||||
"react-dom": "^15.3.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"css-element-queries": "^0.3.2",
|
||||
"markdown-it": "^6.1.1"
|
||||
"zunder": "^3.5.0"
|
||||
}
|
||||
}
|
||||
|
||||
14
packages/core-reporter/scripts/build-dev.js
Normal file
14
packages/core-reporter/scripts/build-dev.js
Normal file
@@ -0,0 +1,14 @@
|
||||
var z = require('zunder')
|
||||
var u = z.undertaker
|
||||
var setZunderConfig = require('./set-zunder-config')
|
||||
|
||||
setZunderConfig(z)
|
||||
|
||||
u.series(
|
||||
z.applyDevEnv,
|
||||
z.cleanDev,
|
||||
u.parallel(
|
||||
z.buildDevScripts,
|
||||
z.buildDevStylesheets
|
||||
)
|
||||
)()
|
||||
14
packages/core-reporter/scripts/build-prod.js
Normal file
14
packages/core-reporter/scripts/build-prod.js
Normal file
@@ -0,0 +1,14 @@
|
||||
var z = require('zunder')
|
||||
var u = z.undertaker
|
||||
var setZunderConfig = require('./set-zunder-config')
|
||||
|
||||
setZunderConfig(z)
|
||||
|
||||
u.series(
|
||||
z.applyProdEnv,
|
||||
z.cleanProd,
|
||||
u.parallel(
|
||||
z.buildDevScripts,
|
||||
z.buildProdStylesheets
|
||||
)
|
||||
)()
|
||||
17
packages/core-reporter/scripts/set-zunder-config.js
Normal file
17
packages/core-reporter/scripts/set-zunder-config.js
Normal file
@@ -0,0 +1,17 @@
|
||||
module.exports = function setZunderConfig (zunder) {
|
||||
var commonScripts = ['@cypress/react-tooltip', 'react', 'react-dom', 'mobx', 'mobx-react', 'lodash']
|
||||
|
||||
zunder.setConfig({
|
||||
cacheBust: false,
|
||||
externalBundles: [
|
||||
{
|
||||
scriptName: 'common.js',
|
||||
libs: commonScripts.map((file) => ({ file })),
|
||||
}
|
||||
],
|
||||
prodDir: 'dist',
|
||||
resolutions: commonScripts,
|
||||
scriptName: 'reporter.js',
|
||||
stylesheetName: 'reporter.css',
|
||||
})
|
||||
}
|
||||
12
packages/core-reporter/scripts/test.js
Normal file
12
packages/core-reporter/scripts/test.js
Normal file
@@ -0,0 +1,12 @@
|
||||
var z = require('zunder')
|
||||
var u = z.undertaker
|
||||
var setZunderConfig = require('./set-zunder-config')
|
||||
|
||||
setZunderConfig(z)
|
||||
|
||||
u.series(
|
||||
z.applyTestEnv,
|
||||
z.cleanTests,
|
||||
z.buildTestScripts,
|
||||
z.runTests
|
||||
)()
|
||||
16
packages/core-reporter/scripts/watch.js
Normal file
16
packages/core-reporter/scripts/watch.js
Normal file
@@ -0,0 +1,16 @@
|
||||
var z = require('zunder')
|
||||
var u = z.undertaker
|
||||
var setZunderConfig = require('./set-zunder-config')
|
||||
|
||||
setZunderConfig(z)
|
||||
|
||||
u.series(
|
||||
z.applyDevEnv,
|
||||
z.cleanDev,
|
||||
z.cleanTests,
|
||||
u.parallel(
|
||||
z.watchScripts,
|
||||
z.watchTests,
|
||||
z.watchStylesheets
|
||||
)
|
||||
)()
|
||||
@@ -69,4 +69,5 @@ Reporter.defaultProps = {
|
||||
statsStore,
|
||||
}
|
||||
|
||||
window.Reporter = Reporter
|
||||
export default Reporter
|
||||
@@ -3,7 +3,7 @@ import { shallow } from 'enzyme'
|
||||
import React from 'react'
|
||||
import sinon from 'sinon'
|
||||
|
||||
import Reporter from './reporter'
|
||||
import Reporter from './main'
|
||||
import Header from './header/header'
|
||||
import Runnables from './runnables/runnables'
|
||||
|
||||
@@ -15,9 +15,9 @@
|
||||
"build-dev": "node ./scripts/build-dev.js",
|
||||
"build-prod": "node ./scripts/build-prod.js",
|
||||
"prepublish": "npm run build-prod",
|
||||
"release": "node ./scripts/check-reporter.js && releaser",
|
||||
"start": "node ./scripts/watch.js",
|
||||
"test": "node ./scripts/test.js"
|
||||
"release": "releaser",
|
||||
"test": "node ./scripts/test.js",
|
||||
"watch-dev": "node ./scripts/watch.js"
|
||||
},
|
||||
"files": [
|
||||
"dist",
|
||||
@@ -25,7 +25,6 @@
|
||||
],
|
||||
"devDependencies": {
|
||||
"@cypress/core-releaser": "0.1.8",
|
||||
"@cypress/core-reporter": "0.3.0",
|
||||
"@cypress/react-tooltip": "0.1.1",
|
||||
"babel-eslint": "^6.0.4",
|
||||
"bluebird": "^3.4.0",
|
||||
@@ -45,6 +44,6 @@
|
||||
"react-dom": "^15.3.0",
|
||||
"sinon": "^1.17.5",
|
||||
"sinon-chai": "^2.8.0",
|
||||
"zunder": "^3.4.12"
|
||||
"zunder": "^3.5.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
// check if reporter is linked before releasing
|
||||
// if it is, we don't want to release
|
||||
// the reporter needs to be the prod version from npm
|
||||
|
||||
var fs = require('fs')
|
||||
|
||||
function bail (err) {
|
||||
console.error("!!!!!!!!!!!!!!")
|
||||
console.error("!!!!!!!!!!!!!!")
|
||||
console.error()
|
||||
console.error(err)
|
||||
console.error()
|
||||
console.error("!!!!!!!!!!!!!!")
|
||||
console.error("!!!!!!!!!!!!!!")
|
||||
process.exit(1)
|
||||
}
|
||||
|
||||
try {
|
||||
var stats = fs.lstatSync('node_modules/@cypress/core-reporter')
|
||||
if (stats.isSymbolicLink()) {
|
||||
bail('The reporter is linked. It needs to be properly installed through npm before releasing.')
|
||||
} else {
|
||||
process.exit(0)
|
||||
}
|
||||
} catch (e) {
|
||||
// reporter isn't installed at all, that's no good
|
||||
bail('The reporter is not installed. Run "npm install" before releasing.')
|
||||
}
|
||||
@@ -1,14 +1,21 @@
|
||||
module.exports = function setZunderConfig (zunder) {
|
||||
var commonScripts = ['@cypress/react-tooltip', 'react', 'react-dom', 'mobx', 'mobx-react', 'lodash']
|
||||
|
||||
zunder.setConfig({
|
||||
cacheBust: false,
|
||||
externalBundles: [
|
||||
{
|
||||
scriptName: 'common.js',
|
||||
libs: commonScripts.map((file) => ({ file })),
|
||||
}
|
||||
],
|
||||
prodDir: 'dist',
|
||||
resolutions: ['react', 'react-dom', 'mobx', 'mobx-react', 'lodash'],
|
||||
resolutions: commonScripts,
|
||||
scriptName: 'runner.js',
|
||||
stylesheetName: 'runner.css',
|
||||
staticGlobs: {
|
||||
'static/**': '',
|
||||
'node_modules/font-awesome/fonts/**': '/fonts',
|
||||
'node_modules/@cypress/core-reporter/dist/reporter.css': '',
|
||||
'node_modules/font-awesome/fonts/**': '/fonts'
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
/* global $ */
|
||||
/* global $, Reporter */
|
||||
|
||||
import cs from 'classnames'
|
||||
import { action, observable } from 'mobx'
|
||||
import { observer } from 'mobx-react'
|
||||
import React, { Component, PropTypes } from 'react'
|
||||
import { findDOMNode } from 'react-dom'
|
||||
import Reporter from '@cypress/core-reporter'
|
||||
|
||||
import windowUtil from '../lib/window-util'
|
||||
import State from '../lib/state'
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
<link href="/__cypress/static/img/favicon.ico" rel="icon">
|
||||
|
||||
<link rel="stylesheet" href="/__cypress/runner/reporter.css">
|
||||
<link rel="stylesheet" href="/__cypress/reporter/reporter.css">
|
||||
<link rel="stylesheet" href="/__cypress/runner/runner.css">
|
||||
</head>
|
||||
<body>
|
||||
@@ -16,6 +16,8 @@
|
||||
<script type="text/javascript" src="/__cypress/socket.io.js"></script>
|
||||
<script type="text/javascript" src="/__cypress/static/js/vendor.js"></script>
|
||||
<script type="text/javascript" src="/__cypress/static/js/cypress.js"></script>
|
||||
<script type="text/javascript" src="/__cypress/runner/common.js"></script>
|
||||
<script type="text/javascript" src="/__cypress/reporter/reporter.js"></script>
|
||||
<script type="text/javascript" src="/__cypress/runner/runner.js"></script>
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
|
||||
Reference in New Issue
Block a user