diff --git a/.circleci/config.yml b/.circleci/config.yml index 0bc661d77e..47edffa43c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -27,10 +27,6 @@ workflows: - lint: requires: - build - - upload_docs: - requires: - - test_a11y - - build - deploy: requires: - build @@ -66,6 +62,10 @@ jobs: - run: name: Build Site command: npm run build:site + - run: + name: Upload docs + command: node .circleci/upload-preview.js public + when: always - persist_to_workspace: root: ~/project paths: *build_cache_paths @@ -80,40 +80,42 @@ jobs: - run: name: a11y Tests command: npm run test:a11y:ci + - run: + name: Upload a11y report + command: node .circleci/upload-preview.js coverage + when: always - store_artifacts: path: coverage/ - persist_to_workspace: root: ~/project paths: - coverage/ - upload_docs: - docker: - - image: circleci/node:10 - steps: - - *attach_workspace - - run: - name: Upload docs to surge.sh - command: .circleci/upload-docs.sh lint: docker: - image: circleci/node:10 steps: - - *attach_workspace - - restore_cache: - keys: - - *js_deps_cache_key - - run: - name: Lint SASS - command: npm run lint:sass - - run: - name: Lint JS - command: npm run lint:js - - run: - name: Lint CSS Size - command: npm run lint:size - - run: - name: Lint CSS - command: npm run lint:css + - *attach_workspace + - restore_cache: + keys: + - *js_deps_cache_key + - run: + name: Lint SASS + command: npm run lint:sass + - run: + name: Lint JS + command: npm run lint:js + when: always + - run: + name: Lint CSS + command: npm run lint:css + when: always + - run: + name: Lint CSS Size + command: .circleci/css-size-report/sizeReport.js run + when: always + - store_artifacts: + path: .circleci/css-size-report/report.html + destination: lint deploy: docker: - image: circleci/node:10 diff --git a/.circleci/css-size-report/package.json b/.circleci/css-size-report/package.json new file mode 100644 index 0000000000..b87f4bae76 --- /dev/null +++ b/.circleci/css-size-report/package.json @@ -0,0 +1,15 @@ +{ + "name": "tmp", + "version": "1.0.0", + "description": "", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "keywords": [], + "author": "", + "license": "", + "devDependencies": { + "@patternfly/patternfly": "^2.57.0" + } +} diff --git a/.circleci/css-size-report/sizeReport.js b/.circleci/css-size-report/sizeReport.js new file mode 100755 index 0000000000..40d305c5ee --- /dev/null +++ b/.circleci/css-size-report/sizeReport.js @@ -0,0 +1,177 @@ +#!/usr/bin/env node +const execSync = require('child_process').execSync; +const path = require('path'); +const fs = require('fs'); +const glob = require('glob'); +const { Octokit } = require('@octokit/rest'); + +const octokit = new Octokit({ auth: process.env.GH_PR_TOKEN }); +const owner = process.env.CIRCLE_PROJECT_USERNAME; // patternfly +const repo = process.env.CIRCLE_PROJECT_REPONAME; +const prnum = process.env.CIRCLE_PR_NUMBER; + +let exitCode = 0; + +// download previous package to do the compares against +function npmInstall(package) { + let lastTag = execSync('git describe --match "v*" --tags --abbrev=0').toString(); + lastTag = lastTag.substr(1, lastTag.length).trim(); + console.log(`npm i -D ${package}@${lastTag}`) + execSync(`npm i -D ${package}@${lastTag}`, { cwd: __dirname, encoding: 'utf-8' }); +} + +// build a Map object( = file, = size in kb) +function buildValueMap(distDir) { + const res = {}; + glob + .sync(`${distDir}/**/*.css`) + .forEach(file => + res[file.replace(distDir, '').substr(1)] = fs.statSync(file).size + ); + + return res; +} + +// compare value maps. +function compareMaps(curMap, prevMap) { + const differences = []; + + let html = ''; + html += ''; + html += ''; + html += ``; + html += ``; + html += ``; + html += ``; + html += ''; + + Object.entries(curMap) + .filter(([_file, size]) => size !== 0) + .forEach(([file, size]) => { + let psize; + let diff; + if (prevMap[file] !== undefined) { + psize = prevMap[file]; + diff = (size - psize) / size * 100; + } else { + psize = "-"; + diff = "-"; + } + + if (parseFloat(diff) !== parseFloat('0')) { + differences.push({ + file, + size, + psize, + diff + }); + } + }); + + if (differences.length == 0) { + html += ''; + html += `` + html += ''; + } else { + differences + .sort((diff1, diff2) => diff1.diff < diff2.diff) + .forEach(diff => { + let style = ''; + console.log(diff.file, 'diff', diff.diff); + if ( + diff.diff > 50 || // component file + diff.diff > 10 && !diff.file.includes('/') // Root patternfly.css file + ) { + exitCode = -1; + } + // Styles don't show up on github :( + if (diff.diff > 10) { + style += 'background-color: lightsalmon;'; + } else if (diff.diff > 5) { + style += 'background-color: goldenrodyellow;'; + } else if (diff.diff < 0) { + style += 'background-color: lightgreen;'; + } + html += ``; + html += ``; // Name + html += ``; // Current + html += ``; // Previous + html += ``; + html += ''; + }); + } + + html += '
CSS Size Report
NameCurrentPreviousDiff %
There are no changes in CSS file sizes
${diff.file}${humanFileSize(diff.size, true)}${humanFileSize(diff.psize, true)}${parseFloat(diff.diff).toFixed(2)}
'; + + fs.writeFileSync(path.join(__dirname, './report.html'), html); + return html; +} + +function humanFileSize(bytes, si) { + const thresh = si ? 1000 : 1024; + if (Math.abs(bytes) < thresh) { + return `${bytes} B`; + } + const units = si + ? ['kB','MB','GB','TB','PB','EB','ZB','YB'] + : ['KiB','MiB','GiB','TiB','PiB','EiB','ZiB','YiB']; + var u = -1; + do { + bytes /= thresh; + ++u; + } while(Math.abs(bytes) >= thresh && u < units.length - 1); + return `${bytes.toFixed(1)} ${units[u]}`; +} + +async function postToPR(html) { + let commentBody = ''; + const { data } = await octokit.issues + .listComments({ + owner, + repo, + issue_number: prnum + }); + const existingComment = data.find(comment => comment.user.login === 'patternfly-build'); + if (existingComment) { + commentBody = existingComment.body.replace(/(.*)<\/table>/, '').trim(); + } + + commentBody += '\n'; + commentBody += html; + + if (existingComment) { + await octokit.issues + .updateComment({ + owner, + repo, + comment_id: existingComment.id, + body: commentBody + }); + console.log('Updated comment'); + } else { + await octokit.issues + .createComment({ + owner, + repo, + issue_number: prnum, + body: commentBody + }); + console.log('Created comment'); + } +} + +async function run(package) { + npmInstall(package); + const htmlReport = compareMaps( + buildValueMap(path.join(__dirname, '../../dist')), + buildValueMap(path.join(__dirname, './node_modules/', package)) + ); + + // post report to PR, if running in circleCI + if (prnum) { + await postToPR(htmlReport); + process.exit(exitCode); + } +} + +run('@patternfly/patternfly'); diff --git a/.circleci/upload-docs.sh b/.circleci/upload-docs.sh deleted file mode 100755 index bd4f7842cb..0000000000 --- a/.circleci/upload-docs.sh +++ /dev/null @@ -1,40 +0,0 @@ -#!/bin/bash -USERNAME=${CIRCLE_PROJECT_USERNAME} -REPONAME=${CIRCLE_PROJECT_REPONAME} -PR_NUM=${CIRCLE_PR_NUMBER} -PR_BRANCH=${CIRCLE_BRANCH} - -if [ -f "./coverage/report.html" ]; then - cp coverage/report.html public/a11y-report.html -fi - -if [ -n "${PR_NUM}" ] # If build is a PR -then - # Domain names follow the RFC1123 spec [a-Z] [0-9] [-] limited to 253 characters - # https://en.wikipedia.org/wiki/Domain_Name_System#Domain_name_syntax - # So, just replace "/" or "." with "-" - DEPLOY_SUBDOMAIN=`echo "${REPONAME}-pr-${PR_NUM}" | tr '[\/|\.]' '-' | cut -c1-253` - ALREADY_DEPLOYED=`npx surge list | grep ${DEPLOY_SUBDOMAIN}` - DEPLOY_DOMAIN="https://${DEPLOY_SUBDOMAIN}.surge.sh" - npx surge --project public --domain $DEPLOY_DOMAIN -elif [ "${PR_BRANCH}" = "master" ] -then - # Use CNAME - npx surge --project public -else - DEPLOY_SUBDOMAIN=`echo "${REPONAME}-pr-${PR_BRANCH}" | tr '[\/|\.]' '-' | cut -c1-253` - ALREADY_DEPLOYED=`npx surge list | grep ${DEPLOY_SUBDOMAIN}` - DEPLOY_DOMAIN="https://${DEPLOY_SUBDOMAIN}.surge.sh" - npx surge --project public --domain $DEPLOY_DOMAIN -fi - -if [ -n "${PR_NUM}" ] && [ -z "${ALREADY_DEPLOYED}" ] # Leave a Github comment -then - # Use Issues api instead of PR api because - # PR api requires comments be made on specific files of specific commits - GITHUB_PR_COMMENTS="https://api.github.com/repos/${USERNAME}/${REPONAME}/issues/${PR_NUM}/comments" - echo "Adding github PR comment ${GITHUB_PR_COMMENTS}" - curl -H "Authorization: token ${GH_PR_TOKEN}" --request POST ${GITHUB_PR_COMMENTS} --data '{"body":"PatternFly-Next preview: '${DEPLOY_DOMAIN}'"}' -else - echo "Already deployed ${DEPLOY_DOMAIN}" -fi diff --git a/.circleci/upload-preview.js b/.circleci/upload-preview.js new file mode 100644 index 0000000000..7f6a309efc --- /dev/null +++ b/.circleci/upload-preview.js @@ -0,0 +1,88 @@ +const fs = require('fs'); +const path = require('path'); +const { Octokit } = require('@octokit/rest'); +const octokit = new Octokit({ auth: process.env.GH_PR_TOKEN }); +const surge = require('surge'); +const publishFn = surge().publish(); + +const owner = process.env.CIRCLE_PROJECT_USERNAME; // patternfly +const repo = process.env.CIRCLE_PROJECT_REPONAME; +const prnum = process.env.CIRCLE_PR_NUMBER; +const prbranch = process.env.CIRCLE_BRANCH; + +const uploadFolder = process.argv[2]; +if (!uploadFolder) { + console.log('Usage: upload-preview uploadFolder'); + process.exit(1); +} + +const uploadFolderName = path.basename(uploadFolder); +let uploadURL = `${repo}${prnum ? `-pr-${prnum || prbranch}` : ''}`.replace(/[\/|\.]/g, '-'); + +if (uploadFolderName === 'coverage') { + fs.copyFileSync( + path.join(uploadFolder, 'report.html'), + path.join(uploadFolder, 'index.html') + ); +} +if (uploadFolderName !== 'public') { + uploadURL += `-${uploadFolderName}`; +} + +uploadURL += '.surge.sh'; + +publishFn({ + project: uploadFolder, + p: uploadFolder, + domain: uploadURL, + d: uploadURL, + e: 'https://surge.surge.sh', + endpoint: 'https://surge.surge.sh' +}); + +function tryAddComment(comment, commentBody) { + if (!commentBody.includes(comment)) { + return comment; + } + return ''; +} + +if (prnum) { + octokit.issues.listComments({ + owner, + repo, + issue_number: prnum + }) + .then(res => res.data) + .then(comments => { + let commentBody = ''; + const existingComment = comments.find(comment => comment.user.login === 'patternfly-build'); + if (existingComment) { + commentBody += existingComment.body.trim(); + commentBody += '\n\n'; + } + + if (uploadFolderName === 'public') { + commentBody += tryAddComment(`Preview: https://${uploadURL}`, commentBody); + } + else if (uploadFolderName === 'coverage') { + commentBody += tryAddComment(`A11y report: https://${uploadURL}`, commentBody); + } + + if (existingComment) { + octokit.issues.updateComment({ + owner, + repo, + comment_id: existingComment.id, + body: commentBody + }).then(() => console.log('Updated comment!')); + } else { + octokit.issues.createComment({ + owner, + repo, + issue_number: prnum, + body: commentBody + }).then(() => console.log('Created comment!')); + } + }); +} diff --git a/.gitignore b/.gitignore index 115f039a48..13ee462471 100644 --- a/.gitignore +++ b/.gitignore @@ -21,4 +21,6 @@ yarn.lock coverage/ *.swp workspace/ -assets/ \ No newline at end of file +assets/ +.circleci/css-size-report/package-lock.json +.circleci/css-size-report/report.html \ No newline at end of file diff --git a/gulpfile.js b/gulpfile.js index 0c0f121a15..0da51954cd 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -6,7 +6,7 @@ const { compileSASS, minifyCSS, watchSASS } = require('./build/gulp/sass'); const { pfIconFont, pfIcons } = require('./build/gulp/icons'); const { compileHBS, compileMD, watchHBS, watchMD } = require('./build/gulp/html'); const { buildIE11 } = require('./build/gulp/ie11'); -const { lintCSSComments, lintCSSFunctions, lintCSSSize } = require('./build/gulp/lint'); +const { lintCSSComments, lintCSSFunctions } = require('./build/gulp/lint'); const sassFiles = [ './src/patternfly/patternfly*.scss', @@ -87,6 +87,5 @@ module.exports = { copyAssets, lintCSSFunctions, lintCSSComments, - lintCSSSize, - lintCSS: parallel(lintCSSFunctions, lintCSSComments, lintCSSSize) + lintCSS: parallel(lintCSSFunctions, lintCSSComments) }; diff --git a/package-lock.json b/package-lock.json index 67d1938526..92877cb2b3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8392,45 +8392,6 @@ } } }, - "cliui": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz", - "integrity": "sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==", - "dev": true, - "requires": { - "string-width": "^3.1.0", - "strip-ansi": "^5.2.0", - "wrap-ansi": "^5.1.0" - }, - "dependencies": { - "ansi-regex": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", - "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", - "dev": true - }, - "string-width": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", - "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", - "dev": true, - "requires": { - "emoji-regex": "^7.0.1", - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^5.1.0" - } - }, - "strip-ansi": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", - "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", - "dev": true, - "requires": { - "ansi-regex": "^4.1.0" - } - } - } - }, "clone": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/clone/-/clone-2.1.2.tgz", @@ -9567,6 +9528,122 @@ "noms": "0.0.0", "through2": "^2.0.1", "yargs": "^13.2.4" + }, + "dependencies": { + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "dev": true + }, + "camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "dev": true + }, + "cliui": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz", + "integrity": "sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==", + "dev": true, + "requires": { + "string-width": "^3.1.0", + "strip-ansi": "^5.2.0", + "wrap-ansi": "^5.1.0" + } + }, + "find-up": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", + "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "dev": true, + "requires": { + "locate-path": "^3.0.0" + } + }, + "locate-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", + "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", + "dev": true, + "requires": { + "p-locate": "^3.0.0", + "path-exists": "^3.0.0" + } + }, + "p-limit": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.2.2.tgz", + "integrity": "sha512-WGR+xHecKTr7EbUEhyLSh5Dube9JtdiG78ufaeLxTgpudf/20KqyMioIUZJAezlTIi6evxuoUs9YXc11cU+yzQ==", + "dev": true, + "requires": { + "p-try": "^2.0.0" + } + }, + "p-locate": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", + "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", + "dev": true, + "requires": { + "p-limit": "^2.0.0" + } + }, + "p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "dev": true + }, + "string-width": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "dev": true, + "requires": { + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" + } + }, + "strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dev": true, + "requires": { + "ansi-regex": "^4.1.0" + } + }, + "yargs": { + "version": "13.3.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.3.0.tgz", + "integrity": "sha512-2eehun/8ALW8TLoIl7MVaRUrg+yCnenu8B4kBlRxj3GJGDKU1Og7sMXPNm1BYyM1DOJmTZ4YeN/Nwxv+8XJsUA==", + "dev": true, + "requires": { + "cliui": "^5.0.0", + "find-up": "^3.0.0", + "get-caller-file": "^2.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^2.0.0", + "set-blocking": "^2.0.0", + "string-width": "^3.0.0", + "which-module": "^2.0.0", + "y18n": "^4.0.0", + "yargs-parser": "^13.1.1" + } + }, + "yargs-parser": { + "version": "13.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.1.1.tgz", + "integrity": "sha512-oVAVsHz6uFrg3XQheFII8ESO2ssAf9luWuAd6Wexsu4F3OtIW0o8IribPXYrD4WC24LWtPrJlGy87y5udK+dxQ==", + "dev": true, + "requires": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + } + } } }, "core-js": { @@ -10116,6 +10193,12 @@ "find-pkg": "^0.1.0" } }, + "cycle": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/cycle/-/cycle-1.0.3.tgz", + "integrity": "sha1-IegLK+hYD5i0aPN5QwZisEbDStI=", + "dev": true + }, "cyclist": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/cyclist/-/cyclist-1.0.1.tgz", @@ -12372,6 +12455,12 @@ "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=", "dev": true }, + "eyes": { + "version": "0.1.8", + "resolved": "https://registry.npmjs.org/eyes/-/eyes-0.1.8.tgz", + "integrity": "sha1-Ys8SAjTGg3hdkCNIqADvPgzCC8A=", + "dev": true + }, "fancy-log": { "version": "1.3.3", "resolved": "https://registry.npmjs.org/fancy-log/-/fancy-log-1.3.3.tgz", @@ -19069,6 +19158,12 @@ } } }, + "i": { + "version": "0.3.6", + "resolved": "https://registry.npmjs.org/i/-/i-0.3.6.tgz", + "integrity": "sha1-2WyScyB28HJxG2sQ/X1PZa2O4j0=", + "dev": true + }, "iconv-lite": { "version": "0.4.24", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", @@ -19855,6 +19950,12 @@ "integrity": "sha512-pJEdRugimx4fBMra5z2/5iRdZ63OhYV0vr0Dwm5+xtW4D1FvRkB8hamMIhnWfyJeDdyr/aa7BDyNbtG38VxgoQ==", "dev": true }, + "is-domain": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/is-domain/-/is-domain-0.0.1.tgz", + "integrity": "sha1-f/sojVzO1rB8Ty35HJvpFTURNI4=", + "dev": true + }, "is-extendable": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", @@ -23013,6 +23114,12 @@ "integrity": "sha512-bV7f+6l2QigeBBZSM/6yTNq4P2fNpSWj/0e7jQcy87A8e7o2nAfP/34/2ky5Vw4B9S446EtIhodAzkFCcR4dQg==", "dev": true }, + "moniker": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/moniker/-/moniker-0.1.2.tgz", + "integrity": "sha1-hy37pXXc6o+gSlE1sT1fJL7MyX4=", + "dev": true + }, "move-concurrently": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/move-concurrently/-/move-concurrently-1.0.1.tgz", @@ -23153,6 +23260,12 @@ "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", "dev": true }, + "ncp": { + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/ncp/-/ncp-0.4.2.tgz", + "integrity": "sha1-q8xsvT7C7Spyn/bnwfqPAXhKhXQ=", + "dev": true + }, "neatequal": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/neatequal/-/neatequal-1.0.0.tgz", @@ -23180,6 +23293,12 @@ "integrity": "sha1-5tq3/r9a2Bbqgc9cYpxaDr3nLBo=", "dev": true }, + "netrc": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/netrc/-/netrc-0.1.4.tgz", + "integrity": "sha1-a+lPysqNd63gqWcNxGCRTJRHJEQ=", + "dev": true + }, "next-tick": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/next-tick/-/next-tick-1.0.0.tgz", @@ -29366,6 +29485,12 @@ "find-up": "^2.1.0" } }, + "pkginfo": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/pkginfo/-/pkginfo-0.4.1.tgz", + "integrity": "sha1-tUGO8EOd5UJfxJlQQtztFPsqhP8=", + "dev": true + }, "please-upgrade-node": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/please-upgrade-node/-/please-upgrade-node-3.2.0.tgz", @@ -30691,6 +30816,19 @@ } } }, + "prompt": { + "version": "0.2.14", + "resolved": "https://registry.npmjs.org/prompt/-/prompt-0.2.14.tgz", + "integrity": "sha1-V3VPZPVD/XsIRXB8gY7OYY8F/9w=", + "dev": true, + "requires": { + "pkginfo": "0.x.x", + "read": "1.0.x", + "revalidator": "0.1.x", + "utile": "0.2.x", + "winston": "0.8.x" + } + }, "prompts": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/prompts/-/prompts-2.3.0.tgz", @@ -32203,6 +32341,12 @@ "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", "dev": true }, + "revalidator": { + "version": "0.1.8", + "resolved": "https://registry.npmjs.org/revalidator/-/revalidator-0.1.8.tgz", + "integrity": "sha1-/s5hv6DBtSoga9axgZgYS91SOjs=", + "dev": true + }, "rgb-regex": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/rgb-regex/-/rgb-regex-1.0.1.tgz", @@ -35105,6 +35249,131 @@ } } }, + "surge": { + "version": "0.21.3", + "resolved": "https://registry.npmjs.org/surge/-/surge-0.21.3.tgz", + "integrity": "sha512-2rTlyC6ku3alrMAyI/8xexCZeiQu0X11rc3Sg8k2SC+9+V+X2dsohCnsTgFbDANZzlL2WojzxmnzLsJFEu/WIQ==", + "dev": true, + "requires": { + "cli-table3": "^0.5.1", + "inquirer": "^6.2.2", + "is-domain": "0.0.1", + "minimist": "1.1.1", + "moniker": "0.1.2", + "netrc": "0.1.4", + "progress": "1.1.8", + "prompt": "~0.2.14", + "read": "1.0.5", + "request": "^2.88.0", + "split": "0.3.1", + "surge-fstream-ignore": "^1.0.6", + "surge-ignore": "0.2.0", + "tarr": "1.1.0", + "url-parse-as-address": "1.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "dev": true + }, + "chardet": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz", + "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==", + "dev": true + }, + "external-editor": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.1.0.tgz", + "integrity": "sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==", + "dev": true, + "requires": { + "chardet": "^0.7.0", + "iconv-lite": "^0.4.24", + "tmp": "^0.0.33" + } + }, + "inquirer": { + "version": "6.5.2", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-6.5.2.tgz", + "integrity": "sha512-cntlB5ghuB0iuO65Ovoi8ogLHiWGs/5yNrtUcKjFhSSiVeAIVpD7koaSU9RM8mpXw5YDi9RdYXGQMaOURB7ycQ==", + "dev": true, + "requires": { + "ansi-escapes": "^3.2.0", + "chalk": "^2.4.2", + "cli-cursor": "^2.1.0", + "cli-width": "^2.0.0", + "external-editor": "^3.0.3", + "figures": "^2.0.0", + "lodash": "^4.17.12", + "mute-stream": "0.0.7", + "run-async": "^2.2.0", + "rxjs": "^6.4.0", + "string-width": "^2.1.0", + "strip-ansi": "^5.1.0", + "through": "^2.3.6" + } + }, + "minimist": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.1.1.tgz", + "integrity": "sha1-G8K8cWWM3KVxJHVoQ2NhWwtPaVs=", + "dev": true + }, + "progress": { + "version": "1.1.8", + "resolved": "https://registry.npmjs.org/progress/-/progress-1.1.8.tgz", + "integrity": "sha1-4mDHj2Fhzdmw5WzD4Khd4Xx6V74=", + "dev": true + }, + "read": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/read/-/read-1.0.5.tgz", + "integrity": "sha1-AHo9FpR4qnEKSRcn5FPv+5LnYgM=", + "dev": true, + "requires": { + "mute-stream": "~0.0.4" + } + }, + "split": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/split/-/split-0.3.1.tgz", + "integrity": "sha1-zrzxQr9hu7ZLFBYo5ttIKikUZUw=", + "dev": true, + "requires": { + "through": "2" + } + }, + "strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dev": true, + "requires": { + "ansi-regex": "^4.1.0" + } + } + } + }, + "surge-fstream-ignore": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/surge-fstream-ignore/-/surge-fstream-ignore-1.0.6.tgz", + "integrity": "sha512-hNN52cz2fYCAzhlHmWPn4aE3bFbpBt01AkWFLljrtSzFvxlipLAeLuLtQ3t4f0RKoUkjzXWCAFK13WoET2iM1A==", + "dev": true, + "requires": { + "fstream": ">=1.0.12", + "inherits": "2", + "minimatch": "^3.0.0" + } + }, + "surge-ignore": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/surge-ignore/-/surge-ignore-0.2.0.tgz", + "integrity": "sha1-Wn+KIKcRiM+edaLP6OsYLekNrzs=", + "dev": true + }, "sver-compat": { "version": "1.5.0", "resolved": "https://registry.npmjs.org/sver-compat/-/sver-compat-1.5.0.tgz", @@ -35321,6 +35590,17 @@ "xtend": "^4.0.0" } }, + "tarr": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/tarr/-/tarr-1.1.0.tgz", + "integrity": "sha512-tENbQ43IQckay71stp1p1lljRhoEZpZk10FzEZKW2tJcMcnLwV3CfZdxBAERlH6nwnFvnHMS9eJOJl6IzSsG0g==", + "dev": true, + "requires": { + "block-stream": "*", + "fstream": ">=1.0.12", + "inherits": "2" + } + }, "temp": { "version": "0.8.4", "resolved": "https://registry.npmjs.org/temp/-/temp-0.8.4.tgz", @@ -36676,6 +36956,12 @@ "requires-port": "^1.0.0" } }, + "url-parse-as-address": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/url-parse-as-address/-/url-parse-as-address-1.0.0.tgz", + "integrity": "sha1-+4CQGIPzOLPL7TU49fqiatr38uc=", + "dev": true + }, "url-parse-lax": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/url-parse-lax/-/url-parse-lax-3.0.0.tgz", @@ -36753,6 +37039,28 @@ "integrity": "sha1-ihagXURWV6Oupe7MWxKk+lN5dyw=", "dev": true }, + "utile": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/utile/-/utile-0.2.1.tgz", + "integrity": "sha1-kwyI6ZCY1iIINMNWy9mncFItkNc=", + "dev": true, + "requires": { + "async": "~0.2.9", + "deep-equal": "*", + "i": "0.3.x", + "mkdirp": "0.x.x", + "ncp": "0.4.x", + "rimraf": "2.x.x" + }, + "dependencies": { + "async": { + "version": "0.2.10", + "resolved": "https://registry.npmjs.org/async/-/async-0.2.10.tgz", + "integrity": "sha1-trvgsGdLnXGXCMo43owjfLUmw9E=", + "dev": true + } + } + }, "utils-merge": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", @@ -37816,6 +38124,41 @@ } } }, + "winston": { + "version": "0.8.3", + "resolved": "https://registry.npmjs.org/winston/-/winston-0.8.3.tgz", + "integrity": "sha1-ZLar9M0Brcrv1QCTk7HY6L7BnbA=", + "dev": true, + "requires": { + "async": "0.2.x", + "colors": "0.6.x", + "cycle": "1.0.x", + "eyes": "0.1.x", + "isstream": "0.1.x", + "pkginfo": "0.3.x", + "stack-trace": "0.0.x" + }, + "dependencies": { + "async": { + "version": "0.2.10", + "resolved": "https://registry.npmjs.org/async/-/async-0.2.10.tgz", + "integrity": "sha1-trvgsGdLnXGXCMo43owjfLUmw9E=", + "dev": true + }, + "colors": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/colors/-/colors-0.6.2.tgz", + "integrity": "sha1-JCP+ZnisDF2uiFLl0OW+CMmXq8w=", + "dev": true + }, + "pkginfo": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/pkginfo/-/pkginfo-0.3.1.tgz", + "integrity": "sha1-Wyn2qB9wcXFC4J52W76rl7T4HiE=", + "dev": true + } + } + }, "with-open-file": { "version": "0.1.7", "resolved": "https://registry.npmjs.org/with-open-file/-/with-open-file-0.1.7.tgz", @@ -38064,111 +38407,6 @@ "js-yaml": "^3.5.2" } }, - "yargs": { - "version": "13.3.0", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.3.0.tgz", - "integrity": "sha512-2eehun/8ALW8TLoIl7MVaRUrg+yCnenu8B4kBlRxj3GJGDKU1Og7sMXPNm1BYyM1DOJmTZ4YeN/Nwxv+8XJsUA==", - "dev": true, - "requires": { - "cliui": "^5.0.0", - "find-up": "^3.0.0", - "get-caller-file": "^2.0.1", - "require-directory": "^2.1.1", - "require-main-filename": "^2.0.0", - "set-blocking": "^2.0.0", - "string-width": "^3.0.0", - "which-module": "^2.0.0", - "y18n": "^4.0.0", - "yargs-parser": "^13.1.1" - }, - "dependencies": { - "ansi-regex": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", - "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", - "dev": true - }, - "camelcase": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", - "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", - "dev": true - }, - "find-up": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", - "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", - "dev": true, - "requires": { - "locate-path": "^3.0.0" - } - }, - "locate-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", - "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", - "dev": true, - "requires": { - "p-locate": "^3.0.0", - "path-exists": "^3.0.0" - } - }, - "p-limit": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.2.1.tgz", - "integrity": "sha512-85Tk+90UCVWvbDavCLKPOLC9vvY8OwEX/RtKF+/1OADJMVlFfEHOiMTPVyxg7mk/dKa+ipdHm0OUkTvCpMTuwg==", - "dev": true, - "requires": { - "p-try": "^2.0.0" - } - }, - "p-locate": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", - "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", - "dev": true, - "requires": { - "p-limit": "^2.0.0" - } - }, - "p-try": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", - "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", - "dev": true - }, - "string-width": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", - "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", - "dev": true, - "requires": { - "emoji-regex": "^7.0.1", - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^5.1.0" - } - }, - "strip-ansi": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", - "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", - "dev": true, - "requires": { - "ansi-regex": "^4.1.0" - } - }, - "yargs-parser": { - "version": "13.1.1", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.1.1.tgz", - "integrity": "sha512-oVAVsHz6uFrg3XQheFII8ESO2ssAf9luWuAd6Wexsu4F3OtIW0o8IribPXYrD4WC24LWtPrJlGy87y5udK+dxQ==", - "dev": true, - "requires": { - "camelcase": "^5.0.0", - "decamelize": "^1.2.0" - } - } - } - }, "yargs-parser": { "version": "10.1.0", "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-10.1.0.tgz", diff --git a/package.json b/package.json index 7186ad0443..8f67006fb8 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,7 @@ "build:pficonfont": "gulp pfIconFont", "build:ie11": "gulp buildIE11", "build:site": "npm run copy-assets && gatsby build", - "clean": "gatsby clean", + "clean": "gatsby clean && shx -rf tmp", "cli:setup": "cd build/patternfly-cli && npm install && cd ../../ && npm link ./build/patternfly-cli", "copy-assets": "gulp copyAssets", "dev": "concurrently \"npm run copy-assets\" \"gulp watchSASS\" \"gatsby develop\"", @@ -23,7 +23,7 @@ "develop": "npm run dev", "format": "prettier --trailing-comma es5 --no-semi --single-quote --write src/**/*.js", "lint": "npm run lint:css && npm run lint:styles && npm run lint:js", - "lint:size": "gulp lintCSSSize", + "lint:size": "./.circleci/css-size-report/sizeReport.js run", "lint:css": "gulp lintCSS", "lint:fix": "npm run lint:js --fix && npm run lint:styles --fix", "lint:sass": "stylelint 'src/**/*.scss'", @@ -44,6 +44,7 @@ "@fortawesome/fontawesome": "^1.1.8", "@mdx-js/mdx": "^1.1.5", "@mdx-js/react": "^1.1.5", + "@octokit/rest": "^16.40.1", "@patternfly/patternfly-a11y": "0.0.15", "@patternfly/react-core": "3.120.8", "@patternfly/react-icons": "3.14.19", @@ -109,7 +110,8 @@ "stylelint-config-standard": "^18.0.0", "stylelint-order": "^0.8.0", "stylelint-scss": "^2.5.0", - "stylelint-value-no-unknown-custom-properties": "^2.0.0" + "stylelint-value-no-unknown-custom-properties": "^2.0.0", + "surge": "^0.21.3" }, "engines": { "node": ">=8.0.0",