UNPKG

57 kBSource Map (JSON)View Raw
1{"version":3,"sources":["webpack:///webpack/bootstrap f19cb6eb659f571a79ce","webpack:///external \"babel-runtime/helpers/asyncToGenerator\"","webpack:///external \"babel-runtime/regenerator\"","webpack:///external \"babel-runtime/core-js/promise\"","webpack:///external \"denodeify\"","webpack:///external \"debug\"","webpack:///external \"babel-runtime/helpers/classCallCheck\"","webpack:///external \"babel-runtime/helpers/createClass\"","webpack:///external \"babel-runtime/helpers/extends\"","webpack:///external \"child_process\"","webpack:////Users/tom/Chroma/chromatic/lib/util/GraphQLClient.js","webpack:///./src/assets/environment.js","webpack:///./src/lib/tunnel.js","webpack:///./src/tester/git.js","webpack:///./src/tester/package-json.js","webpack:///./src/tester/runtimes.js","webpack:///./src/tester/start-app.js","webpack:///./package.json","webpack:///external \"babel-runtime/core-js/json/stringify\"","webpack:///external \"node-ask\"","webpack:///external \"tree-kill\"","webpack:///./src/tester/index.js","webpack:///external \"apollo-fetch\"","webpack:///external \"babel-runtime/core-js/object/keys\"","webpack:///external \"babel-runtime/core-js/object/values\"","webpack:///external \"babel-runtime/helpers/slicedToArray\"","webpack:///external \"babel-runtime/helpers/toConsumableArray\"","webpack:///external \"isomorphic-fetch\"","webpack:///external \"jsdom\"","webpack:///external \"jsonfile\"","webpack:///external \"localtunnel\"","webpack:///external \"path\""],"names":["GraphQLClient","uri","jwtToken","headers","apolloFetch","setJwtToken","use","next","options","authorization","query","variables","data","errors","runQuery","process","env","CHROMATIC_SERVER_PORT","CHROMATIC_INDEX_URL","CHROMATIC_TUNNEL_URL","CHROMATIC_CREATE_TUNNEL","CHROMATIC_APP_CODE","tunnelUrl","port","Error","local_host","host","openTunnel","command","trim","message","match","console","error","execGitCommand","split","commit","committedAtSeconds","committedAt","getCommit","branch","CI_BRANCH","getBranch","commits","commitsForCLI","code","checkSomeCommitsAreInHistory","client","newestCommittedAt","skip","max","fail","TesterGetRecentBuildCommitsQuery","recentCommits","app","buildCommits","debug","FETCH_N_INITIAL_BUILD_COMMITS","length","getSince","count","MAX_N_FETCHES","getRecentCommits","LIMIT_HISTORY_TO_N_COMMITS","boundaryData","boundaryLines","baselineCommits","oldestCommittedAt","filter","l","forEach","rawRow","commitWithDash","slice","find","c","push","Math","min","getBaselinesFromCommits","currentCommit","recentBaselineCommits","TesterGetAllPossibleBuildCommitsQuery","allPossibleCommits","getBaselineCommits","map","join","checkPackageJson","addScriptToPackageJson","appDir","cwd","packageJson","resolve","scripts","script","scriptName","scriptCommand","filename","spaces","addShimsToJSDOM","dom","Object","defineProperty","window","value","matches","addListener","removeListener","LocalStorageMock","store","key","toString","WorkerMock","getRandomValues","url","verbose","logs","virtualConsole","on","logType","log","sendTo","fromURL","userAgent","runScripts","resources","pretendToBeVisual","reject","document","addEventListener","separator","__chromaticRuntimeSpecs__","specs","close","getRuntimeSpecs","checkResponse","child","timeoutAt","Date","now","TIMEOUT","resolved","setTimeout","check","CHECK_EVERY","output","stderr","e","stdout","o","waitForResponse","NODE_ENV","BROWSER","startApp","TesterBuildQuery","build","status","inProgressCount","specCount","changeCount","errorCount","lastInProgressCount","pluralize","BUILD_POLL_INTERVAL","waitForBuild","TesterCreateAppTokenMutation","TesterCreateBuildMutation","msg","n","noun","noNumber","pluralizedNoun","appCode","noStart","appPath","exitZeroOnChanges","indexUrl","createTunnel","originalArgv","createAppToken","appPathWithSlash","appUrl","isolatorUrl","tunnel","runtimeSpecs","fromCI","CI","exitCode","input","packageVersion","createBuild","number","componentCount","webUrl","onlineHint","buildNumber","pid","replace","confirmed","runTest"],"mappings":";;AAAA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA,mDAA2C,cAAc;;AAEzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAK;AACL;AACA;;AAEA;AACA;AACA;AACA,mCAA2B,0BAA0B,EAAE;AACvD,y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2B,GAA3B,CAAlB,EAAoD+G,OAApD,CACpB,mBADoB,EAEpB,EAFoB,CApKX;AAAA;AAAA,mBAyKa,sBACtB,0GADsB,CAzKb;;AAAA;AAyKLC,qBAzKK;;AA4KX,gBAAIA,SAAJ,EAAe;AACb,uDAAuB,WAAvB,EAAoCtG,aAApC;AACA;AACAhE,sBAAQwF,GAAR,CACE,6GADF;AAGD,aAND,MAMO;AACL;AACAxF,sBAAQwF,GAAR,qFAIcxB,aAJd;AAOD;;AAED;AACAhE,oBAAQwF,GAAR;;AA9LW;AAAA,8CAmMNmE,QAnMM;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,G;;WAAeY,O;;;;SAAAA,O;;;;;;;AClF9B,yC;;;;;;ACAA,8D;;;;;;ACAA,gE;;;;;;ACAA,gE;;;;;;ACAA,oE;;;;;;ACAA,6C;;;;;;ACAA,kC;;;;;;ACAA,qC;;;;;;ACAA,wC;;;;;;ACAA,iC","file":"dist/tester.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// identity function for calling harmony imports with the correct context\n \t__webpack_require__.i = function(value) { return value; };\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"dist\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 20);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap f19cb6eb659f571a79ce","module.exports = require(\"babel-runtime/helpers/asyncToGenerator\");\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"babel-runtime/helpers/asyncToGenerator\"\n// module id = 0\n// module chunks = 0","module.exports = require(\"babel-runtime/regenerator\");\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"babel-runtime/regenerator\"\n// module id = 1\n// module chunks = 0","module.exports = require(\"babel-runtime/core-js/promise\");\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"babel-runtime/core-js/promise\"\n// module id = 2\n// module chunks = 0","module.exports = require(\"denodeify\");\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"denodeify\"\n// module id = 3\n// module chunks = 0","module.exports = require(\"debug\");\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"debug\"\n// module id = 4\n// module chunks = 0","module.exports = require(\"babel-runtime/helpers/classCallCheck\");\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"babel-runtime/helpers/classCallCheck\"\n// module id = 5\n// module chunks = 0","module.exports = require(\"babel-runtime/helpers/createClass\");\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"babel-runtime/helpers/createClass\"\n// module id = 6\n// module chunks = 0","module.exports = require(\"babel-runtime/helpers/extends\");\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"babel-runtime/helpers/extends\"\n// module id = 7\n// module chunks = 0","module.exports = require(\"child_process\");\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"child_process\"\n// module id = 8\n// module chunks = 0","import { createApolloFetch } from 'apollo-fetch';\n\nexport default class GraphQLClient {\n constructor({ uri, jwtToken, headers }) {\n this.apolloFetch = createApolloFetch({ uri });\n this.headers = headers;\n\n if (jwtToken) {\n this.setJwtToken(jwtToken);\n }\n }\n\n setJwtToken(jwtToken) {\n this.apolloFetch.use(({ options }, next) => {\n if (jwtToken) {\n // eslint-disable-next-line no-param-reassign\n options.headers = {\n ...options.headers,\n ...this.headers,\n authorization: `bearer ${jwtToken}`,\n };\n }\n\n next();\n });\n }\n\n async runQuery(query, variables) {\n const { data, errors } = await this.apolloFetch({ query, variables });\n if (errors) {\n throw errors;\n }\n return data;\n }\n\n // Convenience static method\n static async runQuery(options, query, variables) {\n return new GraphQLClient(options).runQuery(query, variables);\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// /Users/tom/Chroma/chromatic/lib/util/GraphQLClient.js","// Note this file differs from our usual convention because it is packaged\nconst {\n CHROMATIC_SERVER_PORT = 3004,\n CHROMATIC_INDEX_URL = 'https://index.chromaticqa.com',\n CHROMATIC_TUNNEL_URL = 'https://tunnel.chromaticqa.com',\n CHROMATIC_CREATE_TUNNEL = 'true',\n CHROMATIC_APP_CODE,\n} = process.env;\n\nexport {\n CHROMATIC_SERVER_PORT,\n CHROMATIC_INDEX_URL,\n CHROMATIC_TUNNEL_URL,\n CHROMATIC_CREATE_TUNNEL,\n CHROMATIC_APP_CODE,\n};\n\n\n\n// WEBPACK FOOTER //\n// ./src/assets/environment.js","import localtunnel from 'localtunnel';\nimport denodeify from 'denodeify';\n\nexport default async function openTunnel({ tunnelUrl, port }) {\n if (!port) {\n throw new Error('Need to pass a port into `openTunnel`');\n }\n\n return denodeify(localtunnel)(port, {\n local_host: 'localhost',\n host: tunnelUrl,\n });\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/lib/tunnel.js","import { exec } from 'child_process';\nimport denodeify from 'denodeify';\nimport setupDebug from 'debug';\n\nconst debug = setupDebug('react-chromatic:tester:git');\n\nasync function execGitCommand(command) {\n try {\n return (await denodeify(exec)(command)).trim();\n } catch (error) {\n // eslint-disable-next-line no-console\n if (error.message && error.message.match('Not a git repository')) {\n console.error(`Unable to execute git command '${command}'.\\n`);\n // eslint-disable-next-line no-console\n console.error(\n 'Chromatic only works in git projects.\\n' +\n 'Contact us at support@hichroma.com if you need to use Chromatic outside of one.\\n\\n'\n );\n }\n throw error;\n }\n}\n\nexport const FETCH_N_INITIAL_BUILD_COMMITS = 20;\nexport const MAX_N_FETCHES = 5;\nexport const LIMIT_HISTORY_TO_N_COMMITS = 1000;\n\nconst TesterGetRecentBuildCommitsQuery = `\n query TesterGetRecentBuildCommitsQuery($skip: Int!, $newestCommittedAt: Float!) {\n app {\n buildCommits(skip: $skip, limit: ${FETCH_N_INITIAL_BUILD_COMMITS}, newestCommittedAt: $newestCommittedAt)\n }\n }\n`;\n\nconst TesterGetAllPossibleBuildCommitsQuery = `\n query TesterGetAllPossibleBuildCommitsQuery($newestCommittedAt: Float!, $oldestCommittedAt: Float!) {\n app {\n buildCommits(skip: ${FETCH_N_INITIAL_BUILD_COMMITS}, newestCommittedAt: $newestCommittedAt, oldestCommittedAt: $oldestCommittedAt)\n }\n }\n`;\n\n// NOTE: At some point we should check that the commit has been pushed to the\n// remote and the branch matches with origin/REF, but for now we are naive about\n// adhoc builds.\n\nexport async function getCommit() {\n const [commit, committedAtSeconds] = (await execGitCommand(`git log -n 1 --format=\"%H %ct\"`))\n .trim()\n .split(' ');\n\n return { commit, committedAt: committedAtSeconds * 1000 };\n}\n\nexport async function getBranch() {\n const branch = (await execGitCommand(`git rev-parse --abbrev-ref HEAD`)).trim();\n\n // On certain CI systems, a branch is not checked out (instead a detached head)\n // is used for the commit. We can use this environment variable in such cases:\n // https://documentation.codeship.com/pro/builds-and-configuration/environment-variables/#default-environment-variables\n if (branch === 'HEAD') {\n return process.env.CI_BRANCH || branch;\n }\n return branch;\n}\n\nfunction commitsForCLI(commits) {\n return commits.map(c => c.trim()).join(' ');\n}\n\n// Given a list of commit hashes, ensure that at least one of them is from our\n// current git history\nasync function checkSomeCommitsAreInHistory(commits) {\n // This command will output a single commit hash if *any* of the commits are in history.\n // Otherwise it'll fail with error code 129\n try {\n await execGitCommand(`git rev-list -n 1 --ignore-missing ${commitsForCLI(commits)}`);\n return true;\n } catch (error) {\n if (error.code === 129) {\n return false;\n }\n throw error;\n }\n}\n\n// Get (at most) FETCH_N_INITIAL_BUILD_COMMITS most recent commits from this,\n// with a guarantee that at least *one* of the commits exists in this repository\n// (i.e. hasn't been rebased or squashed out of the repo)\n// If we need to do more than MAX_N_FETCHES to get them (i.e. the most recent\n// FETCH_N_INITIAL_BUILD_COMMITS * MAX_N_FETCHES commits are all gone), we throw\nasync function getRecentCommits(client, newestCommittedAt) {\n const max = FETCH_N_INITIAL_BUILD_COMMITS * MAX_N_FETCHES;\n\n function fail(count) {\n throw new Error(`Didn't find any commits in this git repository in the last ${count} builds.\n\nAre you sure you are running this command against the correct app-code?\n\nPlease find out more here: http://docs.chromaticqa.com/branching-and-baselines`);\n }\n\n async function getSince(skip) {\n if (skip >= max) {\n return fail(max);\n }\n\n // Get the (up to) X commits of the most recent builds of this app\n const recentCommits = (await client.runQuery(TesterGetRecentBuildCommitsQuery, {\n newestCommittedAt,\n skip,\n })).app.buildCommits;\n debug(`${FETCH_N_INITIAL_BUILD_COMMITS} after ${skip} commits: ${recentCommits}`);\n\n if (recentCommits.length === 0) {\n if (skip === 0) {\n // first build\n return recentCommits;\n }\n\n // We are out of commits on the server, show error\n return fail(skip);\n }\n\n if (await checkSomeCommitsAreInHistory(recentCommits)) {\n // It doesn't matter if we return commits here that are missing, as long\n // as *at least one* of the commits exists. We will pass these commits\n // to `rev-list --ignore-missing`, so it doesn't matter too much.\n return recentCommits;\n }\n return getSince(skip + recentCommits.length);\n }\n return getSince(0);\n}\n\n// We use rev-list to get all the commits that are ancestors of HEAD but not\n// ancestors of any of the <commits>.\n//\n// These commits naturally form a tree that meets up to the complete history of\n// <commits> (call that the \"known\" history, from chromatic's perspective).\n// git calls the commits in the known history where the tree joins the \"boundary\".\n// Of the boundary commits:\n// - Those that are actually members of <commits> correspond to builds that\n// we want to use as a baseline\n// - Otherwise they correspond to commits in the known history that we have\n// commit path to but no known build on that path.\n//\n// We are just going to follow a simple algorithm: on the first pass, grab\n// X commits, check which are boundaries. If there are boundaries not in those\n// commits, choose the *oldest*, and grab all builds that are more recent.\n// In the second pass we do not care which\nasync function getBaselinesFromCommits(commits) {\n const boundaryData = await execGitCommand(\n `git rev-list HEAD --boundary --format='%m%H %ct' --ignore-missing \\\n -n ${LIMIT_HISTORY_TO_N_COMMITS} --not ${commitsForCLI(commits)}`\n );\n\n const boundaryLines = boundaryData.trim().split('\\n');\n\n // If we don't find commit history within LIMIT_HISTORY_TO_N_COMMITS commits\n // we assume we never will. Otherwise commits that are detached from the\n // history can cause us to crash\n if (boundaryLines.length >= LIMIT_HISTORY_TO_N_COMMITS * 2) {\n throw new Error(`Failed to find common ancestors with most recent builds within ${LIMIT_HISTORY_TO_N_COMMITS} commits.\n\nPrevious builds used commits: ${commits}.\nAre you sure you are running this command against the correct app-code?\n\nPlease find out more here: http://docs.chromaticqa.com/branching-and-baselines`);\n }\n\n const baselineCommits = [];\n let oldestCommittedAt = null;\n\n // rev-list lists each commit like:\n // commit 4a1c922edd61fa0e9d3cb25d4e205816701557a5\n // >4a1c922edd61fa0e9d3cb25d4e205816701557a5 1495065352\n // We want the second line if it matches (\"-\")\n boundaryLines.filter(l => !l.match('commit') && l.match('-')).forEach(rawRow => {\n const [commitWithDash, committedAtSeconds] = rawRow.trim().split(' ');\n const commit = commitWithDash.slice(1);\n\n if (commits.find(c => c === commit)) {\n baselineCommits.push(commit);\n } else if (oldestCommittedAt === null) {\n oldestCommittedAt = committedAtSeconds * 1000;\n } else {\n oldestCommittedAt = Math.min(oldestCommittedAt, committedAtSeconds * 1000);\n }\n });\n\n return {\n baselineCommits,\n oldestCommittedAt,\n };\n}\n\n// eslint-disable-next-line import/prefer-default-export\nexport async function getBaselineCommits(client) {\n // NOTE: the rev-list command above doesn't work in the case that the last\n // commit is exactly this commit. However this is easy for us to deal with!\n const { commit: currentCommit, committedAt } = await getCommit();\n\n const recentCommits = await getRecentCommits(client, committedAt);\n debug(`Found commits: ${recentCommits}`);\n\n // Short-circuit: on first run, there's definitely no baseline!\n if (recentCommits.length === 0) {\n return [];\n }\n\n if (recentCommits.find(c => c === currentCommit)) {\n return [currentCommit];\n }\n\n const {\n baselineCommits: recentBaselineCommits,\n oldestCommittedAt,\n } = await getBaselinesFromCommits(recentCommits);\n debug(`Baselines from initial commits: ${recentBaselineCommits} [${oldestCommittedAt}]`);\n\n // console.log(recentBaselineCommits, oldestCommittedAt);\n // Important optimization. If we are sure that there aren't any older relevant\n // builds, we can avoid an extra query\n if (oldestCommittedAt === null || recentCommits.length < FETCH_N_INITIAL_BUILD_COMMITS) {\n return recentBaselineCommits;\n }\n\n // We aren't sure we know everything, so run a (potentially) more expensive query\n // to get *all* builds that are newer than oldestCommittedAt\n const allPossibleCommits = (await client.runQuery(TesterGetAllPossibleBuildCommitsQuery, {\n newestCommittedAt: committedAt,\n oldestCommittedAt,\n })).app.buildCommits;\n debug(`allPossibleCommits: ${allPossibleCommits}`);\n\n const { baselineCommits } = await getBaselinesFromCommits([\n ...recentCommits,\n ...allPossibleCommits,\n ]);\n debug(`allPossible baselineCommits: ${baselineCommits}`);\n return baselineCommits;\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/tester/git.js","import path from 'path';\nimport { readFileSync, writeFileSync } from 'jsonfile';\n\nexport function checkPackageJson({ appDir = process.cwd() } = {}) {\n const packageJson = readFileSync(path.resolve(appDir, './package.json'));\n\n return Object.values(packageJson.scripts || {}).find(script => script.match('chromatic test'));\n}\n\nexport function addScriptToPackageJson(scriptName, scriptCommand, { appDir = process.cwd() } = {}) {\n const filename = path.resolve(appDir, './package.json');\n const packageJson = readFileSync(filename);\n\n if (packageJson[scriptName]) {\n throw new Error(`Script named '${scriptName}' already exists in package.json`);\n }\n\n if (!packageJson.scripts) {\n packageJson.scripts = {};\n }\n packageJson.scripts[scriptName] = scriptCommand;\n writeFileSync(filename, packageJson, { spaces: 2 });\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/tester/package-json.js","/* eslint-disable no-console, class-methods-use-this */\nimport { JSDOM, VirtualConsole } from 'jsdom';\n\nfunction addShimsToJSDOM(dom) {\n Object.defineProperty(dom.window, 'matchMedia', {\n value: () => ({\n matches: true,\n addListener: () => {},\n removeListener: () => {},\n }),\n });\n\n class LocalStorageMock {\n constructor() {\n this.store = {};\n }\n getItem(key) {\n return this.store[key];\n }\n removeItem(key) {\n delete this.store[key];\n }\n setItem(key, value) {\n this.store[key] = value.toString();\n }\n clear() {\n this.store = {};\n }\n }\n Object.defineProperty(dom.window, 'localStorage', {\n value: new LocalStorageMock(),\n });\n\n class WorkerMock {\n addEventListener() {}\n removeEventLister() {}\n postMessage() {}\n terminate() {}\n }\n Object.defineProperty(dom.window, 'Worker', WorkerMock);\n\n Object.defineProperty(dom.window, 'crypto', {\n value: {\n getRandomValues: () => 0,\n },\n });\n}\n\nexport default async function getRuntimeSpecs(url, { verbose = false } = {}) {\n const logs = [];\n const virtualConsole = new VirtualConsole();\n Object.keys(console).forEach(logType => {\n virtualConsole.on(logType, log => logs.push({ logType, log }));\n });\n virtualConsole.on('jsdomError', log => logs.push({ logType: 'error', log }));\n\n if (verbose) {\n virtualConsole.sendTo(console);\n }\n\n const dom = await JSDOM.fromURL(url, {\n userAgent: 'Chromatic',\n // We need to execute the scripts on the page\n runScripts: 'dangerously',\n // We need to load scripts that are loaded via script tags\n resources: 'usable',\n // Send console.logs -> /dev/null (so to speak)\n virtualConsole,\n // Add a requestAnimationFrame polyfill, react@16 warns about it\n pretendToBeVisual: true,\n });\n\n // NOTE: this line runs immediately after the HTML for the page has been loaded\n // it's not possible that any external script tags have been executed.\n // It is possible that they have a <script> tag that need these shims, but\n // I highly doubt it. If we run into this we can always use JSDOM's old API\n // to inject our own scripts at 'create' time\n addShimsToJSDOM(dom);\n\n return new Promise((resolve, reject) =>\n dom.window.document.addEventListener('DOMContentLoaded', () => {\n const separator = '=========================';\n\n if (!dom.window.__chromaticRuntimeSpecs__) {\n console.error(\n `Didn't find 'window.__chromaticRuntimeSpecs__' at ${url}.\\n` +\n `Have you installed the Chromatic widget or addon correctly?\\n`\n );\n\n if (!verbose && logs.length) {\n console.error(`Your app's output:\\n${separator}\\n`);\n logs.forEach(({ logType, log }) => console[logType](log));\n console.error(`\\n${separator}\\n`);\n }\n reject(new Error(`Didn't find 'window.__chromaticRuntimeSpecs__' at ${url}.`));\n }\n\n // If their app logged something to console.error, it's probably, but\n // not definitely an issue. See https://github.com/hichroma/chromatic/issues/757\n if (logs.find(log => log.logType === 'error')) {\n console.error(`\\nYour app logged the following to the error console:\\n${separator}`);\n logs\n .filter(log => log.logType === 'error')\n .forEach(({ logType, log }) => console[logType](log));\n console.error(\n `\\n${separator}\\nThis may lead to some stories not working right or getting detected by Chromatic` +\n `\\nWe suggest you fix the errors, but we will continue anyway..\\n`\n );\n }\n\n const specs = dom.window.__chromaticRuntimeSpecs__();\n dom.window.close();\n resolve(specs);\n })\n );\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/tester/runtimes.js","import { spawn } from 'child_process';\nimport fetch from 'isomorphic-fetch';\n\nconst CHECK_EVERY = 1000;\nconst TIMEOUT = 5 * 60 * 1000;\n\nexport async function checkResponse(url) {\n try {\n await fetch(url);\n return true;\n } catch (e) {\n return false;\n }\n}\n\nasync function waitForResponse(child, url) {\n const timeoutAt = Date.now() + TIMEOUT;\n return new Promise((resolve, reject) => {\n let resolved = false;\n async function check() {\n if (Date.now() > timeoutAt) {\n resolved = true;\n reject(new Error(`No server responding at ${url} within ${TIMEOUT / 1000} seconds.`));\n return;\n }\n\n if (await checkResponse(url)) {\n resolved = true;\n resolve();\n return;\n }\n setTimeout(check, CHECK_EVERY);\n }\n check();\n\n if (child) {\n let output = '';\n child.stderr.on('data', e => {\n output += e.toString();\n });\n child.stdout.on('data', o => {\n output += o.toString();\n });\n\n child.on('close', () => {\n if (!resolved) {\n reject(new Error(`Script failed to start: ${output}\\n`));\n }\n });\n }\n });\n}\n\nexport default async function startApp({ scriptName = 'start', url }) {\n let child;\n if (scriptName !== 'none') {\n if (await checkResponse(url)) {\n throw new Error(\n `Detected process already running at ${url}` +\n `\\nIf you are sure this is your server, pass \\`--do-not-start\\` to skip this step.`\n );\n }\n\n child = spawn('npm', ['run', scriptName], {\n env: {\n ...process.env,\n NODE_ENV: 'development',\n BROWSER: 'none',\n },\n });\n }\n\n await waitForResponse(child, url);\n return child;\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/tester/start-app.js","module.exports = {\"name\":\"react-chromatic\",\"version\":\"0.7.11\",\"description\":\"Visual Testing for React Components\",\"browser\":\"./dist/client.js\",\"main\":\"./dist/assets/null-server.js\",\"scripts\":{\"prebuild\":\"rm -rf ./dist\",\"build:bin\":\"../../node_modules/.bin/babel -s -d ./dist ./src -D --only 'assets,bin'\",\"build:webpack\":\"../../node_modules/.bin/webpack\",\"build\":\"../../node_modules/.bin/npm-run-all --serial -l build:**\",\"prepare\":\"npm run build\",\"dev\":\"../../node_modules/.bin/npm-run-all --parallel -l 'build:** -- --watch'\"},\"bin\":{\"chromatic\":\"./dist/bin/chromatic.js\"},\"dependencies\":{\"apollo-fetch\":\"^0.6.0\",\"babel-runtime\":\"^6.26.0\",\"commander\":\"^2.9.0\",\"debug\":\"^3.0.1\",\"denodeify\":\"^1.2.1\",\"ejson\":\"^2.1.2\",\"es6-error\":\"^4.0.2\",\"isomorphic-fetch\":\"^2.2.1\",\"jsdom\":\"^11.5.1\",\"jsonfile\":\"^4.0.0\",\"localtunnel\":\"^1.8.3\",\"node-ask\":\"^1.0.1\",\"tree-kill\":\"^1.1.0\"},\"peerDependencies\":{\"react\":\"15.x || 16.x\",\"react-dom\":\"15.x || 16.x\"},\"devDependencies\":{\"babel-cli\":\"^6.26.0\",\"npm-run-all\":\"^4.0.2\",\"prettier-eslint\":\"^7.1.0\",\"webpack\":\"^3.10.0\",\"webpack-node-externals\":\"^1.6.0\"}}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./package.json\n// module id = 16\n// module chunks = 0","module.exports = require(\"babel-runtime/core-js/json/stringify\");\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"babel-runtime/core-js/json/stringify\"\n// module id = 17\n// module chunks = 0","module.exports = require(\"node-ask\");\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"node-ask\"\n// module id = 18\n// module chunks = 0","module.exports = require(\"tree-kill\");\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"tree-kill\"\n// module id = 19\n// module chunks = 0","import denodeify from 'denodeify';\nimport { confirm } from 'node-ask';\nimport setupDebug from 'debug';\nimport kill from 'tree-kill';\n\nimport getRuntimeSpecs from './runtimes';\nimport startApp, { checkResponse } from './start-app';\nimport openTunnel from '../lib/tunnel';\nimport { checkPackageJson, addScriptToPackageJson } from './package-json';\nimport GraphQLClient from '../../../../lib/util/GraphQLClient';\nimport { getBaselineCommits, getCommit, getBranch } from './git';\nimport { version as packageVersion } from '../../package.json';\nimport { CHROMATIC_INDEX_URL, CHROMATIC_TUNNEL_URL } from '../assets/environment';\n\nconst BUILD_POLL_INTERVAL = 1000;\n\nconst TesterCreateAppTokenMutation = `\n mutation TesterCreateAppTokenMutation($appCode: String!) {\n createAppToken(code: $appCode)\n }\n`;\n\nconst TesterCreateBuildMutation = `\n mutation TesterCreateBuildMutation($input: CreateBuildInput!, $isolatorUrl: String!) {\n createBuild(input: $input, isolatorUrl: $isolatorUrl) {\n id\n number\n specCount\n componentCount\n webUrl\n }\n }\n`;\n\nconst TesterBuildQuery = `\n query TesterBuildQuery($buildNumber: Int!) {\n app {\n build(number: $buildNumber) {\n id\n status\n inProgressCount: snapshotCount(statuses: [SNAPSHOT_IN_PROGRESS])\n specCount\n changeCount: snapshotCount(statuses: [SNAPSHOT_PENDING, SNAPSHOT_ACCEPTED, SNAPSHOT_DENIED])\n errorCount: snapshotCount(statuses: [SNAPSHOT_CAPTURE_ERROR])\n }\n }\n }\n`;\n\nconst debug = setupDebug('react-chromatic:tester');\n\nfunction log(msg) {\n // eslint-disable-next-line no-console\n console.log(`Chromatic Tester: ${msg}`);\n}\n\nfunction pluralize(n, noun, noNumber) {\n const pluralizedNoun = n === 1 ? noun : `${noun}s`;\n\n return noNumber ? pluralizedNoun : `${n} ${pluralizedNoun}`;\n}\n\nlet lastInProgressCount;\nasync function waitForBuild(client, variables) {\n const { app: { build } } = await client.runQuery(TesterBuildQuery, variables);\n debug(`build:${JSON.stringify(build)}`);\n const { status, inProgressCount, specCount, changeCount, errorCount } = build;\n if (status === 'BUILD_IN_PROGRESS') {\n if (inProgressCount !== lastInProgressCount) {\n lastInProgressCount = inProgressCount;\n log(\n `${inProgressCount}/${pluralize(specCount, 'spec')} remain to test. ` +\n `(${pluralize(changeCount, 'change')}, ${pluralize(errorCount, 'error')})`\n );\n }\n\n await new Promise(resolve => setTimeout(resolve, BUILD_POLL_INTERVAL));\n return waitForBuild(client, variables);\n }\n return build;\n}\n\nexport default async function runTest({\n appCode,\n scriptName,\n noStart = false,\n port,\n appPath = '/',\n url,\n exitZeroOnChanges = false,\n verbose = false,\n indexUrl = CHROMATIC_INDEX_URL,\n tunnelUrl = CHROMATIC_TUNNEL_URL,\n createTunnel = true,\n originalArgv = false,\n}) {\n const uri = `${indexUrl}/graphql`;\n const client = new GraphQLClient({ uri });\n\n if (!appCode) {\n throw new Error(\n 'You must provide an app code -- visit https://www.chromaticqa.com to get your code.' +\n `\\nPass your app code with the \\`CHROMATIC_APP_CODE\\` environment variable or the \\`--app-code\\` flag.`\n );\n }\n\n if ((!scriptName && !noStart) || !port) {\n throw new Error(\n 'You must provide a npm script name (`--script-name`) and port (`--port`) so we can start your app'\n );\n }\n\n try {\n const { createAppToken: jwtToken } = await client.runQuery(TesterCreateAppTokenMutation, {\n appCode,\n });\n client.setJwtToken(jwtToken);\n } catch (errors) {\n if (errors[0] && errors[0].message && errors[0].message.match('No app with code')) {\n throw new Error(\n `Incorrect app code '${appCode}' -- visit https://www.chromaticqa.com to get your code`\n );\n }\n throw errors;\n }\n\n const { commit, committedAt } = await getCommit();\n const branch = await getBranch();\n debug(`git info: ${JSON.stringify({ commit, committedAt, branch })}`);\n\n const baselineCommits = await getBaselineCommits(client);\n debug(`Found baselineCommits: ${baselineCommits}`);\n\n const appPathWithSlash = appPath[0] === '/' ? appPath : `/${appPath}`;\n const appUrl = url || `http://localhost:${port}${appPathWithSlash}`;\n let child;\n if (!noStart && !url) {\n log(`Starting app with \\`npm run ${scriptName}\\``);\n child = await startApp({ scriptName, url: appUrl });\n log(`Started app on port ${port}`);\n } else {\n if (!await checkResponse(appUrl)) {\n throw new Error(`No server responding at ${appUrl} -- make sure you've started it.`);\n }\n log(`Detected app on port ${port}`);\n }\n\n let isolatorUrl = appUrl;\n let tunnel;\n if (createTunnel && !url) {\n log(`Opening tunnel to Chromatic capture servers`);\n tunnel = await openTunnel({ tunnelUrl, port });\n debug(`Opened tunnel to ${tunnel.url}`);\n isolatorUrl = `${tunnel.url}${appPathWithSlash}`;\n }\n\n debug(`Connecting to ${isolatorUrl}`);\n log(`Uploading and verifying build (this may take a few minutes depending on your connection)`);\n const runtimeSpecs = await getRuntimeSpecs(isolatorUrl, { verbose });\n log(`Found ${runtimeSpecs.length} specs`);\n\n const fromCI = !!process.env.CI;\n debug(`Detected build fromCI:${fromCI}`);\n debug(`Detected package version:${packageVersion}`);\n\n let exitCode = 5;\n try {\n const { createBuild: { number, specCount, componentCount, webUrl } } = await client.runQuery(\n TesterCreateBuildMutation,\n {\n input: {\n branch,\n commit,\n committedAt,\n baselineCommits,\n runtimeSpecs,\n fromCI,\n packageVersion,\n },\n isolatorUrl,\n }\n );\n\n const onlineHint = `View it online at ${webUrl}`;\n log(\n `Started Build ${number} ` +\n `(${pluralize(componentCount, 'component')}, ${pluralize(specCount, 'spec')}).\n\n${onlineHint}.`\n );\n\n const { status, changeCount, errorCount } = await waitForBuild(client, {\n buildNumber: number,\n });\n\n switch (status) {\n case 'BUILD_PASSED':\n log(`Build ${number} passed! ${onlineHint}.`);\n exitCode = 0;\n break;\n // They may have sneakily looked at the build while we were waiting\n case 'BUILD_PENDING':\n case 'BUILD_ACCEPTED':\n case 'BUILD_DENIED':\n log(`Build ${number} has ${pluralize(changeCount, 'change')}. ${onlineHint}.`);\n if (!exitZeroOnChanges) {\n log(\n `Pass --exit-zero-on-changes if you want this command to exit successfully in this case. Read more: http://docs.chromaticqa.com/test`\n );\n }\n exitCode = exitZeroOnChanges ? 0 : 1;\n break;\n case 'BUILD_FAILED':\n log(`Build ${number} has ${pluralize(errorCount, 'error')}. ${onlineHint}.`);\n exitCode = 2;\n break;\n case 'BUILD_TIMED_OUT':\n log(\n `Build ${number} has timed out. Ensure your machine is connected to the internet and please try again.`\n );\n exitCode = 3;\n break;\n case 'BUILD_ERROR':\n log(`Build ${number} has failed to run. Our apologies. Please try again.`);\n exitCode = 4;\n break;\n default:\n throw new Error(`Unexpected build status: ${status}`);\n }\n } catch (e) {\n if (e.length && e[0] && e[0].message.match(/Cannot run a build with no specs./)) {\n log(e[0].message);\n exitCode = 255;\n } else {\n throw e;\n }\n } finally {\n if (tunnel) {\n tunnel.close();\n }\n if (child) {\n await denodeify(kill)(child.pid, 'SIGHUP');\n }\n }\n\n if (!checkPackageJson() && originalArgv) {\n const scriptCommand = `chromatic test ${originalArgv.slice(2).join(' ')}`.replace(\n /--app-code[= ]\\S+/,\n ''\n );\n\n const confirmed = await confirm(\n \"\\nYou have not added Chromatic's test script to your `package.json`. Would you like me to do it for you?\"\n );\n if (confirmed) {\n addScriptToPackageJson('chromatic', scriptCommand);\n // eslint-disable-next-line no-console\n console.log(\n '\\nAdded script `chromatic`. You can now run it here or in CI with `npm run chromatic` (or `yarn chromatic`)'\n );\n } else {\n // eslint-disable-next-line no-console\n console.log(`\nNo problem. You can add it later with:\n{\n \"scripts\": {\n \"chromatic\": \"${scriptCommand}\"\n }\n}`);\n }\n\n // eslint-disable-next-line no-console\n console.log(\n `\\nMake sure you set the \\`CHROMATIC_APP_CODE\\` environment variable when running builds (in particular on your CI server).`\n );\n }\n\n return exitCode;\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/tester/index.js","module.exports = require(\"apollo-fetch\");\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"apollo-fetch\"\n// module id = 21\n// module chunks = 0","module.exports = require(\"babel-runtime/core-js/object/keys\");\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"babel-runtime/core-js/object/keys\"\n// module id = 22\n// module chunks = 0","module.exports = require(\"babel-runtime/core-js/object/values\");\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"babel-runtime/core-js/object/values\"\n// module id = 23\n// module chunks = 0","module.exports = require(\"babel-runtime/helpers/slicedToArray\");\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"babel-runtime/helpers/slicedToArray\"\n// module id = 24\n// module chunks = 0","module.exports = require(\"babel-runtime/helpers/toConsumableArray\");\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"babel-runtime/helpers/toConsumableArray\"\n// module id = 25\n// module chunks = 0","module.exports = require(\"isomorphic-fetch\");\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"isomorphic-fetch\"\n// module id = 26\n// module chunks = 0","module.exports = require(\"jsdom\");\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"jsdom\"\n// module id = 27\n// module chunks = 0","module.exports = require(\"jsonfile\");\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"jsonfile\"\n// module id = 28\n// module chunks = 0","module.exports = require(\"localtunnel\");\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"localtunnel\"\n// module id = 29\n// module chunks = 0","module.exports = require(\"path\");\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"path\"\n// module id = 30\n// module chunks = 0"],"sourceRoot":""}
\No newline at end of file