Resolve conflicts

This commit is contained in:
Hector Ramos 2017-12-12 12:49:02 -08:00
commit a7d81c629d
12 changed files with 79 additions and 58 deletions

View file

@ -3,7 +3,7 @@
"jsxBracketSameLine": true, "jsxBracketSameLine": true,
"parser": "flow", "parser": "flow",
"printWidth": 80, "printWidth": 80,
"proseWrap": false, "proseWrap": "never",
"singleQuote": true, "singleQuote": true,
"trailingComma": "es5" "trailingComma": "es5"
} }

View file

@ -60,9 +60,7 @@ class Head extends React.Component {
)} )}
<link <link
rel="stylesheet" rel="stylesheet"
href={`//cdnjs.cloudflare.com/ajax/libs/highlight.js/${ href={`//cdnjs.cloudflare.com/ajax/libs/highlight.js/${highlightVersion}/styles/${highlightTheme}.min.css`}
highlightVersion
}/styles/${highlightTheme}.min.css`}
/> />
{hasBlog && ( {hasBlog && (
<link <link

View file

@ -54,9 +54,7 @@ let remoteBranch;
if (USE_SSH === 'true') { if (USE_SSH === 'true') {
remoteBranch = `git@github.com:${ORGANIZATION_NAME}/${PROJECT_NAME}.git`; remoteBranch = `git@github.com:${ORGANIZATION_NAME}/${PROJECT_NAME}.git`;
} else { } else {
remoteBranch = `https://${GIT_USER}@github.com/${ORGANIZATION_NAME}/${ remoteBranch = `https://${GIT_USER}@github.com/${ORGANIZATION_NAME}/${PROJECT_NAME}.git`;
PROJECT_NAME
}.git`;
} }
if (IS_PULL_REQUEST) { if (IS_PULL_REQUEST) {
@ -120,9 +118,7 @@ excludePath = `${PROJECT_NAME}-${DEPLOYMENT_BRANCH}`;
// https://github.com/shelljs/shelljs/issues/79 // https://github.com/shelljs/shelljs/issues/79
if ( if (
shell.exec( shell.exec(
`rsync -rt --exclude=${excludePath} --exclude=.DS_Store ${fromPath} ${ `rsync -rt --exclude=${excludePath} --exclude=.DS_Store ${fromPath} ${toPath}`
toPath
}`
).code !== 0 ).code !== 0
) { ) {
shell.echo(`Error: Copying build assets failed`); shell.echo(`Error: Copying build assets failed`);
@ -136,9 +132,7 @@ const currentCommit = shell.exec('git rev-parse HEAD').stdout.trim();
shell.exec('git add --all'); shell.exec('git add --all');
shell.exec( shell.exec(
`git commit -m "Deploy website" -m "Deploy website version based on ${ `git commit -m "Deploy website" -m "Deploy website version based on ${currentCommit}"`
currentCommit
}"`
); );
if (shell.exec(`git push origin ${DEPLOYMENT_BRANCH}`).code !== 0) { if (shell.exec(`git push origin ${DEPLOYMENT_BRANCH}`).code !== 0) {
shell.echo('Error: Git push failed'); shell.echo('Error: Git push failed');

View file

@ -74,9 +74,7 @@ if (versionIndex < 0) {
console.error( console.error(
`${chalk.yellow( `${chalk.yellow(
'Version ' + currentVersion + ' does not currently exist!' 'Version ' + currentVersion + ' does not currently exist!'
)}\n Version ${ )}\n Version ${currentVersion} is not in the versions.json file. You can only rename existing versions.`
currentVersion
} is not in the versions.json file. You can only rename existing versions.`
); );
process.exit(1); process.exit(1);
} }

View file

@ -13,6 +13,7 @@ function execute() {
const readMetadata = require('./readMetadata.js'); const readMetadata = require('./readMetadata.js');
const renderToStaticMarkup = require('react-dom/server').renderToStaticMarkup; const renderToStaticMarkup = require('react-dom/server').renderToStaticMarkup;
const path = require('path'); const path = require('path');
const color = require('color');
const toSlug = require('../core/toSlug.js'); const toSlug = require('../core/toSlug.js');
const React = require('react'); const React = require('react');
const mkdirp = require('mkdirp'); const mkdirp = require('mkdirp');
@ -355,6 +356,13 @@ function execute() {
const color = siteConfig.colors[key]; const color = siteConfig.colors[key];
cssContent = cssContent.replace(new RegExp('\\$' + key, 'g'), color); cssContent = cssContent.replace(new RegExp('\\$' + key, 'g'), color);
}); });
const codeColor = color(siteConfig.colors.primaryColor)
.alpha(0.07)
.string();
cssContent = cssContent.replace(
new RegExp('\\$codeColor', 'g'),
codeColor
);
mkdirp.sync(targetFile.replace(new RegExp('/[^/]*$'), '')); mkdirp.sync(targetFile.replace(new RegExp('/[^/]*$'), ''));
fs.writeFileSync(targetFile, cssContent); fs.writeFileSync(targetFile, cssContent);

View file

@ -17,6 +17,7 @@ function execute(port) {
const fs = require('fs-extra'); const fs = require('fs-extra');
const os = require('os'); const os = require('os');
const path = require('path'); const path = require('path');
const color = require('color');
const toSlug = require('../core/toSlug.js'); const toSlug = require('../core/toSlug.js');
const mkdirp = require('mkdirp'); const mkdirp = require('mkdirp');
const glob = require('glob'); const glob = require('glob');
@ -479,6 +480,10 @@ function execute(port) {
const color = siteConfig.colors[key]; const color = siteConfig.colors[key];
cssContent = cssContent.replace(new RegExp('\\$' + key, 'g'), color); cssContent = cssContent.replace(new RegExp('\\$' + key, 'g'), color);
}); });
const codeColor = color(siteConfig.colors.primaryColor)
.alpha(0.07)
.string();
cssContent = cssContent.replace(new RegExp('\\$codeColor', 'g'), codeColor);
res.send(cssContent); res.send(cssContent);
}); });

View file

@ -98,14 +98,10 @@ files.forEach(file => {
if (!metadata.original_id) { if (!metadata.original_id) {
console.error( console.error(
`No 'original_id' field found in ${ `No 'original_id' field found in ${file}. Perhaps you forgot to add it when importing prior versions of your docs?`
file
}. Perhaps you forgot to add it when importing prior versions of your docs?`
); );
throw new Error( throw new Error(
`No 'original_id' field found in ${ `No 'original_id' field found in ${file}. Perhaps you forgot to add it when importing prior versions of your docs?`
file
}. Perhaps you forgot to add it when importing prior versions of your docs?`
); );
} }
if (!metadata.id) { if (!metadata.id) {
@ -113,14 +109,10 @@ files.forEach(file => {
throw new Error(`No 'id' field found in ${file}.`); throw new Error(`No 'id' field found in ${file}.`);
} else if (metadata.id.indexOf('version-') === -1) { } else if (metadata.id.indexOf('version-') === -1) {
console.error( console.error(
`The 'id' field in ${ `The 'id' field in ${file} is missing the expected 'version-XX-' prefix. Perhaps you forgot to add it when importing prior versions of your docs?`
file
} is missing the expected 'version-XX-' prefix. Perhaps you forgot to add it when importing prior versions of your docs?`
); );
throw new Error( throw new Error(
`The 'id' field in ${ `The 'id' field in ${file} is missing the expected 'version-XX-' prefix. Perhaps you forgot to add it when importing prior versions of your docs?`
file
} is missing the expected 'version-XX-' prefix. Perhaps you forgot to add it when importing prior versions of your docs?`
); );
} }
@ -141,9 +133,7 @@ files.forEach(file => {
function docVersion(id, req_version) { function docVersion(id, req_version) {
if (!available[id]) { if (!available[id]) {
throw new Error( throw new Error(
`Document with id '${ `Document with id '${id}' was requested but no document with that id could be located.`
id
}' was requested but no document with that id could be located.`
); );
} }
// iterate through versions until a version less than or equal to the requested // iterate through versions until a version less than or equal to the requested
@ -286,9 +276,7 @@ function sidebarVersion(req_version) {
} }
} }
throw new Error( throw new Error(
`No sidebar file available to use for version ${ `No sidebar file available to use for version ${req_version}. Verify that 'version-${req_version}-sidebars.json' exists.`
req_version
}. Verify that 'version-${req_version}-sidebars.json' exists.`
); );
} }

View file

@ -719,19 +719,17 @@ input::placeholder {
color: #e5e5e5; color: #e5e5e5;
} }
code, code {
a code, padding: 2px 0;
.mainContainer .wrapper a code, background-color: $codeColor;
.mainContainer .wrapper a:focus code { /* box-shadow acts as padding around inline code snippets
color: $primaryColor; * while not adding any extra spacing between words. */
box-shadow: 2px 0 $codeColor, -2px 0 $codeColor;
color: inherit;
border-radius: .3em;
font-family: "SFMono-Regular",source-code-pro,Menlo,Monaco,Consolas,"Roboto Mono","Droid Sans Mono","Liberation Mono",Consolas,"Courier New",Courier,monospace; font-family: "SFMono-Regular",source-code-pro,Menlo,Monaco,Consolas,"Roboto Mono","Droid Sans Mono","Liberation Mono",Consolas,"Courier New",Courier,monospace;
} /* avoids scale issues on mobile */
word-break: break-word;
a code {
text-decoration: underline;
}
a:hover code {
text-decoration: none;
} }
pre code { pre code {

View file

@ -92,9 +92,7 @@ function execute() {
if (!file.endsWith('-sidebars.json')) { if (!file.endsWith('-sidebars.json')) {
if (file.endsWith('-sidebar.json')) { if (file.endsWith('-sidebar.json')) {
console.warn( console.warn(
`Skipping ${ `Skipping ${file}. Make sure your sidebar filenames follow this format: 'version-VERSION-sidebars.json'.`
file
}. Make sure your sidebar filenames follow this format: 'version-VERSION-sidebars.json'.`
); );
} }
return; return;

7
package-lock.json generated
View file

@ -1600,9 +1600,10 @@
"integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=" "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns="
}, },
"prettier": { "prettier": {
"version": "1.8.2", "version": "1.9.1",
"resolved": "https://registry.npmjs.org/prettier/-/prettier-1.8.2.tgz", "resolved": "https://registry.npmjs.org/prettier/-/prettier-1.9.1.tgz",
"integrity": "sha512-fHWjCwoRZgjP1rvLP7OGqOznq7xH1sHMQUFLX8qLRO79hI57+6xbc5vB904LxEkCfgFgyr3vv06JkafgCSzoZg==" "integrity": "sha512-oYpQsZk7/0o8+YJUB0LfjkTYQa79gUIF2ESeqvG23IzcgqqvmeOE4+lMG7E/UKX3q3RIj8JHSfhrXWhon1L+zA==",
"dev": true
}, },
"private": { "private": {
"version": "0.1.8", "version": "0.1.8",

View file

@ -16,6 +16,7 @@
"babylon": "^6.17.4", "babylon": "^6.17.4",
"chalk": "^2.1.0", "chalk": "^2.1.0",
"classnames": "^2.2.5", "classnames": "^2.2.5",
"color": "^2.0.1",
"commander": "^2.11.0", "commander": "^2.11.0",
"crowdin-cli": "^0.3.0", "crowdin-cli": "^0.3.0",
"escape-string-regexp": "^1.0.5", "escape-string-regexp": "^1.0.5",
@ -24,7 +25,6 @@
"fs-extra": "^3.0.1", "fs-extra": "^3.0.1",
"glob": "^7.1.2", "glob": "^7.1.2",
"highlight.js": "^9.12.0", "highlight.js": "^9.12.0",
"prettier": "1.8.2",
"react": "^15.5.4", "react": "^15.5.4",
"react-dom": "^15.5.4", "react-dom": "^15.5.4",
"react-dom-factories": "^1.0.1", "react-dom-factories": "^1.0.1",
@ -49,5 +49,8 @@
"docusaurus-version": "./lib/version.js", "docusaurus-version": "./lib/version.js",
"docusaurus-rename-version": "./lib/rename-version.js", "docusaurus-rename-version": "./lib/rename-version.js",
"docusaurus-feed": "./lib/generate-feed.js" "docusaurus-feed": "./lib/generate-feed.js"
},
"devDependencies": {
"prettier": "^1.9.1"
} }
} }

View file

@ -698,10 +698,30 @@ color-convert@^1.9.0:
dependencies: dependencies:
color-name "^1.1.1" color-name "^1.1.1"
color-name@^1.1.1: color-convert@^1.9.1:
version "1.9.1"
resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.1.tgz#c1261107aeb2f294ebffec9ed9ecad529a6097ed"
dependencies:
color-name "^1.1.1"
color-name@^1.0.0, color-name@^1.1.1:
version "1.1.3" version "1.1.3"
resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25"
color-string@^1.5.2:
version "1.5.2"
resolved "https://registry.yarnpkg.com/color-string/-/color-string-1.5.2.tgz#26e45814bc3c9a7cbd6751648a41434514a773a9"
dependencies:
color-name "^1.0.0"
simple-swizzle "^0.2.2"
color@^2.0.1:
version "2.0.1"
resolved "https://registry.yarnpkg.com/color/-/color-2.0.1.tgz#e4ed78a3c4603d0891eba5430b04b86314f4c839"
dependencies:
color-convert "^1.9.1"
color-string "^1.5.2"
combined-stream@^1.0.5, combined-stream@~1.0.5: combined-stream@^1.0.5, combined-stream@~1.0.5:
version "1.0.5" version "1.0.5"
resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.5.tgz#938370a57b4a51dea2c77c15d5c5fdf895164009" resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.5.tgz#938370a57b4a51dea2c77c15d5c5fdf895164009"
@ -1077,6 +1097,10 @@ ipaddr.js@1.5.2:
version "1.5.2" version "1.5.2"
resolved "https://registry.yarnpkg.com/ipaddr.js/-/ipaddr.js-1.5.2.tgz#d4b505bde9946987ccf0fc58d9010ff9607e3fa0" resolved "https://registry.yarnpkg.com/ipaddr.js/-/ipaddr.js-1.5.2.tgz#d4b505bde9946987ccf0fc58d9010ff9607e3fa0"
is-arrayish@^0.3.1:
version "0.3.1"
resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.3.1.tgz#c2dfc386abaa0c3e33c48db3fe87059e69065efd"
is-finite@^1.0.0: is-finite@^1.0.0:
version "1.0.2" version "1.0.2"
resolved "https://registry.yarnpkg.com/is-finite/-/is-finite-1.0.2.tgz#cc6677695602be550ef11e8b4aa6305342b6d0aa" resolved "https://registry.yarnpkg.com/is-finite/-/is-finite-1.0.2.tgz#cc6677695602be550ef11e8b4aa6305342b6d0aa"
@ -1274,9 +1298,9 @@ performance-now@^2.1.0:
version "2.1.0" version "2.1.0"
resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b" resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b"
prettier@1.8.2: prettier@^1.9.1:
version "1.8.2" version "1.9.1"
resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.8.2.tgz#bff83e7fd573933c607875e5ba3abbdffb96aeb8" resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.9.1.tgz#41638a0d47c1efbd1b7d5a742aaa5548eab86d70"
private@^0.1.6, private@^0.1.7: private@^0.1.6, private@^0.1.7:
version "0.1.8" version "0.1.8"
@ -1492,6 +1516,12 @@ shelljs@^0.7.8:
interpret "^1.0.0" interpret "^1.0.0"
rechoir "^0.6.2" rechoir "^0.6.2"
simple-swizzle@^0.2.2:
version "0.2.2"
resolved "https://registry.yarnpkg.com/simple-swizzle/-/simple-swizzle-0.2.2.tgz#a4da6b635ffcccca33f70d17cb92592de95e557a"
dependencies:
is-arrayish "^0.3.1"
sitemap@^1.13.0: sitemap@^1.13.0:
version "1.13.0" version "1.13.0"
resolved "https://registry.yarnpkg.com/sitemap/-/sitemap-1.13.0.tgz#569cbe2180202926a62a266cd3de09c9ceb43f83" resolved "https://registry.yarnpkg.com/sitemap/-/sitemap-1.13.0.tgz#569cbe2180202926a62a266cd3de09c9ceb43f83"