From 952776c608d5bda67576817437bc5672b0ef60eb Mon Sep 17 00:00:00 2001 From: Nathan Wang Date: Sat, 20 Jun 2020 01:08:44 -0700 Subject: [PATCH] add prettier --- .prettierignore | 1 + .prettierrc | 9 +- Content Documentation.md | 12 +- README.md | 4 +- gatsby-browser.js | 122 +++-- gatsby-config.js | 160 ++++--- gatsby-node.esm.js | 82 ++-- gatsby-node.js | 2 +- package.json | 12 +- src/components/Markdown.js | 22 +- src/components/SyllabusModule.js | 164 ++++--- src/components/Transition.tsx | 184 ++++---- src/components/layout.tsx | 8 +- src/components/seo.js | 142 +++--- src/html.js | 62 +-- src/pages/index.tsx | 715 ++++++++++++++++++------------ src/styles/main.css | 2 +- src/styles/markdown.css | 90 ++-- src/styles/prism-theme.css | 164 +++---- src/templates/moduleTemplate.tsx | 603 ++++++++++++++----------- src/templates/syllabusTemplate.js | 437 ++++++++++-------- src/utils.js | 64 +-- tailwind.config.js | 12 +- yarn.lock | 139 +++++- 24 files changed, 1879 insertions(+), 1333 deletions(-) diff --git a/.prettierignore b/.prettierignore index 58d06c3..29fcced 100644 --- a/.prettierignore +++ b/.prettierignore @@ -2,3 +2,4 @@ package.json package-lock.json public +content \ No newline at end of file diff --git a/.prettierrc b/.prettierrc index 33d2cfa..8a0fa61 100644 --- a/.prettierrc +++ b/.prettierrc @@ -1,4 +1,9 @@ { - "arrowParens": "avoid", - "semi": false + "endOfLine": "lf", + "semi": true, + "singleQuote": true, + "tabWidth": 2, + "useTabs": true, + "trailingComma": "es5", + "arrowParens": "avoid" } diff --git a/Content Documentation.md b/Content Documentation.md index 78661b7..45899b4 100644 --- a/Content Documentation.md +++ b/Content Documentation.md @@ -13,13 +13,13 @@ Located at `content/ordering.js`, this file stores the ordering of the modules. ### Frontmatter -[Frontmatter](https://jekyllrb.com/docs/front-matter/) is the stuff in the beginning of each module that's surrounded +[Frontmatter](https://jekyllrb.com/docs/front-matter/) is the stuff in the beginning of each module that's surrounded by three dashes. Frontmatter is written in [YAML](https://yaml.org/). It stores the "metadata" for each module. YAML formatting is _extremely strict_. Be careful about spaces. - **ID**: _Required_. The ID of the module. Ex: `getting-started`, or `containers`. This ID is used to identify -the module, so make sure it is **unique** and **all lowercase with dashes only**. The URL will be generated based off this. + the module, so make sure it is **unique** and **all lowercase with dashes only**. The URL will be generated based off this. - **Title**: _Required_. The title of the module. Ex: `Getting Started` - **Author**: _Required_. The author of the module. Ex: `Unknown` - **Prerequisites**: _Optional_. Any prerequisites for this module. @@ -28,6 +28,7 @@ The prerequisite formatting is rather unintuitive. It expects an array of arrays the name of the prerequisite, and the optional second item is a link. **Note the number of spaces!** Example: + ``` prerequisites: - @@ -37,8 +38,8 @@ prerequisites: - Another Prerequisite Without a Link ``` -- **Problems**: _Optional_. A list of problems in the article. As we haven't figured out what we're going to do with - **it's best to not include this yet.** For USACO problems, enter each problem as `division_filename`. Ex: `bronze_promote`. +- **Problems**: _Optional_. A list of problems in the article. As we haven't figured out what we're going to do with + **it's best to not include this yet.** For USACO problems, enter each problem as `division_filename`. Ex: `bronze_promote`. ### Module Description @@ -52,6 +53,7 @@ If you want a description that appears only on the homepage but not the article, an HTML element with the class `syllabus-only`. Note that you can't use markdown in HTML elements. Example: + ``` @@ -149,4 +151,4 @@ problems: # Hello World! -``` \ No newline at end of file +``` diff --git a/README.md b/README.md index 907e450..41a84c0 100644 --- a/README.md +++ b/README.md @@ -4,8 +4,8 @@ A collection of curated, high-quality resources to take you from Bronze to Platinum. -All markdown files belong in `content/`. Other files are for the front-end dashboard interface. +All markdown files belong in `content/`. Other files are for the front-end dashboard interface. The content should not care about how the front-end interface is implemented. That way, we can easily change the front-end interface without having to rewrite the content. -Refer to "Content Documentation.md" and "Syllabus.md" for more info. \ No newline at end of file +Refer to "Content Documentation.md" and "Syllabus.md" for more info. diff --git a/gatsby-browser.js b/gatsby-browser.js index 6ce0b90..3d784d2 100644 --- a/gatsby-browser.js +++ b/gatsby-browser.js @@ -1,58 +1,86 @@ -import "./src/styles/main.css"; -import React from "react"; -import { MDXProvider } from "@mdx-js/react"; +import './src/styles/main.css'; +import React from 'react'; +import { MDXProvider } from '@mdx-js/react'; const SpoilerComponent = ({ children, title }) => { - const [show, setShow] = React.useState(false); + const [show, setShow] = React.useState(false); - return ( -
-

setShow(!show)} style={{ marginBottom: 0 }}> - {show && } - {!show && } - {title} -

+ return ( +
+

setShow(!show)} + style={{ marginBottom: 0 }} + > + {show && ( + + + + )} + {!show && ( + + + + )} + {title} +

- {show &&
{children}
} -
- ); + {show &&
{children}
} +
+ ); }; const components = { - wrapper: ({ excerptOnly = false, children }) => { - if (excerptOnly) { - for (let child of children) { - if (child.props.originalType === "module-excerpt") return child; - } - return null; - } + wrapper: ({ excerptOnly = false, children }) => { + if (excerptOnly) { + for (let child of children) { + if (child.props.originalType === 'module-excerpt') return child; + } + return null; + } - return children; - }, - "module-excerpt": (props) =>
, - spoiler: SpoilerComponent, - "info-block": ({ children }) => ( -
-
-
- - - -
-
- {children} -
-
-
- ), + return children; + }, + 'module-excerpt': props =>
, + spoiler: SpoilerComponent, + 'info-block': ({ children }) => ( +
+
+
+ + + +
+
{children}
+
+
+ ), }; export const wrapRootElement = ({ element }) => ( - - {element} - -); \ No newline at end of file + {element} +); diff --git a/gatsby-config.js b/gatsby-config.js index 606484a..e5874f7 100644 --- a/gatsby-config.js +++ b/gatsby-config.js @@ -4,84 +4,82 @@ const tailwindConfig = require('./tailwind.config.js'); const fullConfig = resolveConfig(tailwindConfig); module.exports = { - siteMetadata: { - title: `USACO Guide`, - description: `A collection of curated, high-quality resources to take you from Bronze to Platinum.`, - author: `@usacoteam`, - }, - plugins: [ - { - resolve: `gatsby-source-filesystem`, - options: { - path: `${__dirname}/content`, - name: `content`, - }, - }, - { - resolve: `gatsby-plugin-mdx`, - options: { - extensions: [`.mdx`, `.md`], - gatsbyRemarkPlugins: [ - `gatsby-remark-autolink-headers`, - { - resolve: "gatsby-remark-custom-blocks", - options: { - blocks: { - info: { - containerElement: "info-block", - title: "optional", - }, - }, - }, - }, - { - resolve: `gatsby-remark-katex`, - options: { - // Add any KaTeX options from https://github.com/KaTeX/KaTeX/blob/master/docs/options.md here - strict: `ignore` - } - }, - { - resolve: `gatsby-remark-prismjs`, - options: { - noInlineHighlight: true, - }, - }, - ], - plugins: [ - `gatsby-remark-autolink-headers`, - ] - }, - }, - { - resolve: `gatsby-plugin-postcss`, - options: { - postCssPlugins: [ - require(`tailwindcss`)(tailwindConfig), - require(`autoprefixer`), - ...(process.env.NODE_ENV === `production` - ? [require(`cssnano`)] - : []), - ], - }, - }, - `gatsby-plugin-react-helmet`, - `gatsby-transformer-sharp`, - `gatsby-plugin-sharp`, - // { - // resolve: `gatsby-plugin-manifest`, - // options: { - // name: `gatsby-starter-default`, - // short_name: `starter`, - // start_url: `/`, - // background_color: `#663399`, - // theme_color: `#663399`, - // display: `minimal-ui`, - // // icon: `src/images/gatsby-icon.png`, // This path is relative to the root of the site. - // }, - // }, - // this (optional) plugin enables Progressive Web App + Offline functionality - // To learn more, visit: https://gatsby.dev/offline - // `gatsby-plugin-offline`, - ], -} + siteMetadata: { + title: `USACO Guide`, + description: `A collection of curated, high-quality resources to take you from Bronze to Platinum.`, + author: `@usacoteam`, + }, + plugins: [ + { + resolve: `gatsby-source-filesystem`, + options: { + path: `${__dirname}/content`, + name: `content`, + }, + }, + { + resolve: `gatsby-plugin-mdx`, + options: { + extensions: [`.mdx`, `.md`], + gatsbyRemarkPlugins: [ + `gatsby-remark-autolink-headers`, + { + resolve: 'gatsby-remark-custom-blocks', + options: { + blocks: { + info: { + containerElement: 'info-block', + title: 'optional', + }, + }, + }, + }, + { + resolve: `gatsby-remark-katex`, + options: { + // Add any KaTeX options from https://github.com/KaTeX/KaTeX/blob/master/docs/options.md here + strict: `ignore`, + }, + }, + { + resolve: `gatsby-remark-prismjs`, + options: { + noInlineHighlight: true, + }, + }, + ], + plugins: [`gatsby-remark-autolink-headers`], + }, + }, + { + resolve: `gatsby-plugin-postcss`, + options: { + postCssPlugins: [ + require(`tailwindcss`)(tailwindConfig), + require(`autoprefixer`), + ...(process.env.NODE_ENV === `production` + ? [require(`cssnano`)] + : []), + ], + }, + }, + `gatsby-plugin-react-helmet`, + `gatsby-transformer-sharp`, + `gatsby-plugin-sharp`, + // { + // resolve: `gatsby-plugin-manifest`, + // options: { + // name: `gatsby-starter-default`, + // short_name: `starter`, + // start_url: `/`, + // background_color: `#663399`, + // theme_color: `#663399`, + // display: `minimal-ui`, + // // icon: `src/images/gatsby-icon.png`, // This path is relative to the root of the site. + // }, + // }, + // this (optional) plugin enables Progressive Web App + Offline functionality + // To learn more, visit: https://gatsby.dev/offline + // `gatsby-plugin-offline`, + ], +}; diff --git a/gatsby-node.esm.js b/gatsby-node.esm.js index 96204d3..e132170 100644 --- a/gatsby-node.esm.js +++ b/gatsby-node.esm.js @@ -1,51 +1,53 @@ -import ModuleOrdering, { divisions } from "./content/ordering"; +import ModuleOrdering, { divisions } from './content/ordering'; exports.createPages = async ({ actions, graphql, reporter }) => { - const { createPage } = actions; + const { createPage } = actions; - // Generate Module Pages // - const moduleTemplate = require.resolve(`./src/templates/moduleTemplate.tsx`); - Object.keys(ModuleOrdering).forEach(division => { - const processItem = item => { - if (typeof item === "object") { - // this is a nested module - item.items.forEach(x => processItem(x)); - } else { - createPage({ - path: `/${division}/${item}`, - component: moduleTemplate, - context: { - // additional data can be passed via context - id: item, - division: division, - }, - }); - } - }; - ModuleOrdering[division].forEach(item => processItem(item)); - }); - // End Generate Module Pages // + // Generate Module Pages // + const moduleTemplate = require.resolve(`./src/templates/moduleTemplate.tsx`); + Object.keys(ModuleOrdering).forEach(division => { + const processItem = item => { + if (typeof item === 'object') { + // this is a nested module + item.items.forEach(x => processItem(x)); + } else { + createPage({ + path: `/${division}/${item}`, + component: moduleTemplate, + context: { + // additional data can be passed via context + id: item, + division: division, + }, + }); + } + }; + ModuleOrdering[division].forEach(item => processItem(item)); + }); + // End Generate Module Pages // - // Generate Syllabus Pages // - const syllabusTemplate = require.resolve(`./src/templates/syllabusTemplate.js`); - divisions.forEach(division => { - createPage({ - path: `/${division}`, - component: syllabusTemplate, - context: { - division: division - }, - }); - }); - // End Generate Syllabus Pages // + // Generate Syllabus Pages // + const syllabusTemplate = require.resolve( + `./src/templates/syllabusTemplate.js` + ); + divisions.forEach(division => { + createPage({ + path: `/${division}`, + component: syllabusTemplate, + context: { + division: division, + }, + }); + }); + // End Generate Syllabus Pages // }; exports.createSchemaCustomization = ({ actions }) => { - const { createTypes } = actions; - const typeDefs = ` + const { createTypes } = actions; + const typeDefs = ` type MarkdownRemarkFrontmatter implements Node { prerequisites: [[String]] } `; - createTypes(typeDefs) -}; \ No newline at end of file + createTypes(typeDefs); +}; diff --git a/gatsby-node.js b/gatsby-node.js index a61ec91..cef1d62 100644 --- a/gatsby-node.js +++ b/gatsby-node.js @@ -1,2 +1,2 @@ require = require('esm')(module); -module.exports = require('./gatsby-node.esm.js'); \ No newline at end of file +module.exports = require('./gatsby-node.esm.js'); diff --git a/package.json b/package.json index 712a107..bcae87c 100644 --- a/package.json +++ b/package.json @@ -36,7 +36,9 @@ "tailwindcss": "^1.4.6" }, "devDependencies": { - "prettier": "2.0.5" + "husky": "^4.2.5", + "lint-staged": "^10.2.11", + "prettier": "^2.0.5" }, "keywords": [ "gatsby" @@ -57,5 +59,13 @@ }, "bugs": { "url": "https://github.com/gatsbyjs/gatsby/issues" + }, + "husky": { + "hooks": { + "pre-commit": "lint-staged" + } + }, + "lint-staged": { + "*.{js,jsx,json,md}": "prettier --write" } } diff --git a/src/components/Markdown.js b/src/components/Markdown.js index e3c393f..df36ea7 100644 --- a/src/components/Markdown.js +++ b/src/components/Markdown.js @@ -1,16 +1,16 @@ -import React from "react"; +import React from 'react'; -import "../styles/markdown.css"; -import "katex/dist/katex.min.css"; -import "../styles/prism-theme.css"; -import { MDXRenderer } from "gatsby-plugin-mdx"; +import '../styles/markdown.css'; +import 'katex/dist/katex.min.css'; +import '../styles/prism-theme.css'; +import { MDXRenderer } from 'gatsby-plugin-mdx'; const Markdown = ({ body, className, excerptOnly = false }) => { - return ( -
- {body} -
- ); + return ( +
+ {body} +
+ ); }; -export default Markdown; \ No newline at end of file +export default Markdown; diff --git a/src/components/SyllabusModule.js b/src/components/SyllabusModule.js index a1a7ba6..6979835 100644 --- a/src/components/SyllabusModule.js +++ b/src/components/SyllabusModule.js @@ -1,71 +1,119 @@ -import React from "react"; -import { Link } from "gatsby"; +import React from 'react'; +import { Link } from 'gatsby'; -const CompletedCheck = () => ( - -); +const CompletedCheck = () => ( + + + +); -const IncompleteCheck = () => ( - -); +const IncompleteCheck = () => ( + + + +); const renderProblem = (problem, idx) => { - return ( -
  • - {idx>0?:} - {/* todo make url legit */} - {problem} -
  • - ); + return ( +
  • + {idx > 0 ? : } + {/* todo make url legit */} + + {problem} + +
  • + ); }; -const renderPrerequisite = (prerequisite) => { - const link = prerequisite.length > 1 ? prerequisite[1] : null; - return ( -
  • - {link && {prerequisite[0]}} - {!link && prerequisite[0]} -
  • - ); +const renderPrerequisite = prerequisite => { + const link = prerequisite.length > 1 ? prerequisite[1] : null; + return ( +
  • + {link && ( + + {prerequisite[0]} + + )} + {!link && prerequisite[0]} +
  • + ); }; -const SyllabusModule = ({ title, children, author, problems, prerequisites, url }) => { - // in the future, fetch this data either from localStorage or from server. - const isComplete = title === "Prerequisites" || title === "Getting Started"; +const SyllabusModule = ({ + title, + children, + author, + problems, + prerequisites, + url, +}) => { + // in the future, fetch this data either from localStorage or from server. + const isComplete = title === 'Prerequisites' || title === 'Getting Started'; - return ( -
    -
    -

    - {title} -

    - {isComplete && - - - } -
    - {prerequisites&& -
    - Prerequisites:
      {prerequisites.map(renderPrerequisite)}
    -
    } -
    - {children} + return ( +
    +
    +

    {title}

    + {isComplete && ( + + + + )} +
    + {prerequisites && ( +
    + Prerequisites:{' '} +
      + {prerequisites.map(renderPrerequisite)} +
    +
    + )} +
    + {children} - {problems&&(<>Problems:
      {problems.map(renderProblem)}
    )} + {problems && ( + <> + Problems: +
      + {problems.map(renderProblem)} +
    + + )} - {author&&

    Author: {author}

    } -
    - - View Module - -
    - ); + {author &&

    Author: {author}

    } +
    + + View Module + +
    + ); }; -export default SyllabusModule; \ No newline at end of file +export default SyllabusModule; diff --git a/src/components/Transition.tsx b/src/components/Transition.tsx index 5ff44d2..b96e5f1 100644 --- a/src/components/Transition.tsx +++ b/src/components/Transition.tsx @@ -1,110 +1,110 @@ -import { CSSTransition as ReactCSSTransition } from 'react-transition-group' -import * as React from "react"; -import { useRef, useEffect, useContext } from 'react' +import { CSSTransition as ReactCSSTransition } from 'react-transition-group'; +import * as React from 'react'; +import { useRef, useEffect, useContext } from 'react'; const TransitionContext = React.createContext({ - parent: {}, -}) + parent: {}, +}); function useIsInitialRender() { - const isInitialRender = useRef(true) - useEffect(() => { - isInitialRender.current = false - }, []) - return isInitialRender.current + const isInitialRender = useRef(true); + useEffect(() => { + isInitialRender.current = false; + }, []); + return isInitialRender.current; } function CSSTransition({ - show, - enter = '', - enterFrom = '', - enterTo = '', - leave = '', - leaveFrom = '', - leaveTo = '', - appear, - children, - }) { - const enterClasses = enter.split(' ').filter((s) => s.length) - const enterFromClasses = enterFrom.split(' ').filter((s) => s.length) - const enterToClasses = enterTo.split(' ').filter((s) => s.length) - const leaveClasses = leave.split(' ').filter((s) => s.length) - const leaveFromClasses = leaveFrom.split(' ').filter((s) => s.length) - const leaveToClasses = leaveTo.split(' ').filter((s) => s.length) + show, + enter = '', + enterFrom = '', + enterTo = '', + leave = '', + leaveFrom = '', + leaveTo = '', + appear, + children, +}) { + const enterClasses = enter.split(' ').filter(s => s.length); + const enterFromClasses = enterFrom.split(' ').filter(s => s.length); + const enterToClasses = enterTo.split(' ').filter(s => s.length); + const leaveClasses = leave.split(' ').filter(s => s.length); + const leaveFromClasses = leaveFrom.split(' ').filter(s => s.length); + const leaveToClasses = leaveTo.split(' ').filter(s => s.length); - function addClasses(node, classes) { - classes.length && node.classList.add(...classes) - } + function addClasses(node, classes) { + classes.length && node.classList.add(...classes); + } - function removeClasses(node, classes) { - classes.length && node.classList.remove(...classes) - } + function removeClasses(node, classes) { + classes.length && node.classList.remove(...classes); + } - return ( - { - node.addEventListener('transitionend', done, false) - }} - onEnter={(node) => { - addClasses(node, [...enterClasses, ...enterFromClasses]) - }} - onEntering={(node) => { - removeClasses(node, enterFromClasses) - addClasses(node, enterToClasses) - }} - onEntered={(node) => { - removeClasses(node, [...enterToClasses, ...enterClasses]) - }} - onExit={(node) => { - addClasses(node, [...leaveClasses, ...leaveFromClasses]) - }} - onExiting={(node) => { - removeClasses(node, leaveFromClasses) - addClasses(node, leaveToClasses) - }} - onExited={(node) => { - removeClasses(node, [...leaveToClasses, ...leaveClasses]) - }} - > - {children} - - ) + return ( + { + node.addEventListener('transitionend', done, false); + }} + onEnter={node => { + addClasses(node, [...enterClasses, ...enterFromClasses]); + }} + onEntering={node => { + removeClasses(node, enterFromClasses); + addClasses(node, enterToClasses); + }} + onEntered={node => { + removeClasses(node, [...enterToClasses, ...enterClasses]); + }} + onExit={node => { + addClasses(node, [...leaveClasses, ...leaveFromClasses]); + }} + onExiting={node => { + removeClasses(node, leaveFromClasses); + addClasses(node, leaveToClasses); + }} + onExited={node => { + removeClasses(node, [...leaveToClasses, ...leaveClasses]); + }} + > + {children} + + ); } function Transition({ show, appear, ...rest }: any) { - const { parent }: { parent: any } = useContext(TransitionContext); - const isInitialRender = useIsInitialRender(); - const isChild = show === undefined; + const { parent }: { parent: any } = useContext(TransitionContext); + const isInitialRender = useIsInitialRender(); + const isChild = show === undefined; - if (isChild) { - return ( - // @ts-ignore - - ) - } + if (isChild) { + return ( + // @ts-ignore + + ); + } - return ( - - {/* + return ( + + {/* // @ts-ignore*/} - - - ) + + + ); } -export default Transition; \ No newline at end of file +export default Transition; diff --git a/src/components/layout.tsx b/src/components/layout.tsx index f1ba08b..018a6e6 100644 --- a/src/components/layout.tsx +++ b/src/components/layout.tsx @@ -1,11 +1,7 @@ -import * as React from "react" +import * as React from 'react'; const Layout = ({ children }) => { - return ( - <> - {children} - - ) + return <>{children}; }; export default Layout; diff --git a/src/components/seo.js b/src/components/seo.js index aee4d45..e1647f1 100644 --- a/src/components/seo.js +++ b/src/components/seo.js @@ -5,84 +5,84 @@ * See: https://www.gatsbyjs.org/docs/use-static-query/ */ -import React from "react" -import PropTypes from "prop-types" -import { Helmet } from "react-helmet" -import { useStaticQuery, graphql } from "gatsby" +import React from 'react'; +import PropTypes from 'prop-types'; +import { Helmet } from 'react-helmet'; +import { useStaticQuery, graphql } from 'gatsby'; function SEO({ description, lang, meta, title }) { - const { site } = useStaticQuery( - graphql` - query { - site { - siteMetadata { - title - description - author - } - } - } - ` - ) + const { site } = useStaticQuery( + graphql` + query { + site { + siteMetadata { + title + description + author + } + } + } + ` + ); - const metaDescription = description || site.siteMetadata.description + const metaDescription = description || site.siteMetadata.description; - return ( - - ) + return ( + + ); } SEO.defaultProps = { - lang: `en`, - meta: [], - description: ``, -} + lang: `en`, + meta: [], + description: ``, +}; SEO.propTypes = { - description: PropTypes.string, - lang: PropTypes.string, - meta: PropTypes.arrayOf(PropTypes.object), - title: PropTypes.string.isRequired, -} + description: PropTypes.string, + lang: PropTypes.string, + meta: PropTypes.arrayOf(PropTypes.object), + title: PropTypes.string.isRequired, +}; -export default SEO +export default SEO; diff --git a/src/html.js b/src/html.js index 457250f..20bbb3b 100644 --- a/src/html.js +++ b/src/html.js @@ -1,36 +1,36 @@ -import React from "react" -import PropTypes from "prop-types" +import React from 'react'; +import PropTypes from 'prop-types'; export default function HTML(props) { - return ( - - - - - - {props.headComponents} - - - {props.preBodyComponents} -
    - {props.postBodyComponents} - - - ) + return ( + + + + + + {props.headComponents} + + + {props.preBodyComponents} +
    + {props.postBodyComponents} + + + ); } HTML.propTypes = { - htmlAttributes: PropTypes.object, - headComponents: PropTypes.array, - bodyAttributes: PropTypes.object, - preBodyComponents: PropTypes.array, - body: PropTypes.string, - postBodyComponents: PropTypes.array, -} + htmlAttributes: PropTypes.object, + headComponents: PropTypes.array, + bodyAttributes: PropTypes.object, + preBodyComponents: PropTypes.array, + body: PropTypes.string, + postBodyComponents: PropTypes.array, +}; diff --git a/src/pages/index.tsx b/src/pages/index.tsx index 8ab8267..8c4d091 100644 --- a/src/pages/index.tsx +++ b/src/pages/index.tsx @@ -1,286 +1,451 @@ -import * as React from "react"; -import {Link, PageProps} from "gatsby"; -import Layout from "../components/layout"; -import SEO from "../components/seo"; +import * as React from 'react'; +import { Link, PageProps } from 'gatsby'; +import Layout from '../components/layout'; +import SEO from '../components/seo'; export default function IndexPage(props: PageProps) { - return ( - - + return ( + + - {/* Begin Hero */} -
    -
    - - - - - - - - - -
    + {/* Begin Hero */} +
    +
    + + + + + + + + + +
    -
    -
    -
    -
    -
    - Pre-Release -
    -

    - USACO Guide -

    -

    - A free collection of curated, high-quality resources to take you from Bronze to Platinum and beyond. -

    -
    -
    - - View Guide - -
    - -
    -
    -
    - - - - - - - - - - -
    -
    -
    -
    -
    - {/* End Hero */} +
    +
    +
    +
    +
    + Pre-Release +
    +

    + USACO Guide +

    +

    + A free collection of curated, high-quality resources to + take you from Bronze to Platinum and beyond. +

    +
    +
    + + View Guide + +
    + +
    +
    +
    + + + + + + + + + + +
    +
    +
    +
    +
    + {/* End Hero */} -
    -
    -
    -

    About This Guide

    -

    - Not Just Another Resource. -

    -

    - This is more than "just another resource." This is the first-ever comprehensive, organized roadmap carefully designed and crafted for USACO contestants – available to everyone, for free. -

    +
    +
    +
    +

    + About This Guide +

    +

    + Not Just Another Resource. +

    +

    + This is more than "just another resource." This is the first-ever + comprehensive, organized roadmap carefully designed and crafted + for USACO contestants – available to everyone, for free. +

    -
    -
    -
    - - - -
    -
    -

    - This guide is not a syllabus. Topics on this guide reflect past problems, not future problems. -

    -

    - - Learn More → - -

    -
    -
    -
    -
    +
    +
    +
    + + + +
    +
    +

    + This guide is not a syllabus. Topics on this guide reflect{' '} + past problems, not future problems. +

    +

    + + Learn More → + +

    +
    +
    +
    +
    -
    -
      -
    • -
      -
      -
      - - - -
      -
      -
      -

      Experienced Authors

      -

      - This guide is written by top USACO contestants, including two-time IOI winner and USACO Problemsetter Benjamin Qi. -

      -
      -
      -
    • -
    • -
      -
      -
      - - - -
      -
      -
      -

      Calibrated Difficulty

      -

      - This guide is targeted towards all contestants, regardless of their division. You'll find problems suitable for you. -

      -
      -
      -
    • -
    • -
      -
      -
      - - - -
      -
      -
      -

      Improve Faster

      -

      - Stop wasting time learning topics you already know. Skip over easy topics or delve deeper into difficult ones; the choice is yours. -

      -
      -
      -
    • -
    • -
      -
      -
      - - - -
      -
      -
      -

      Officially Recognized

      -

      - This guide is developed in collaboration with USACO Staff and USACO Director Dr. Brian Dean. -

      -
      -
      -
    • -
    -
    -
    -
    +
    +
      +
    • +
      +
      +
      + + + +
      +
      +
      +

      + Experienced Authors +

      +

      + This guide is written by top USACO contestants, including + two-time IOI winner and USACO Problemsetter{' '} + + Benjamin Qi + + . +

      +
      +
      +
    • +
    • +
      +
      +
      + + + +
      +
      +
      +

      + Calibrated Difficulty +

      +

      + This guide is targeted towards all contestants, regardless + of their division. You'll find problems suitable for you. +

      +
      +
      +
    • +
    • +
      +
      +
      + + + +
      +
      +
      +

      + Improve Faster +

      +

      + Stop wasting time learning topics you already know. Skip + over easy topics or delve deeper into difficult ones; the + choice is yours. +

      +
      +
      +
    • +
    • +
      +
      +
      + + + +
      +
      +
      +

      + Officially Recognized +

      +

      + This guide is developed in collaboration with USACO Staff + and USACO Director Dr. Brian Dean. +

      +
      +
      +
    • +
    +
    +
    +
    -
    -
    -

    - Unsure how to get started?
    - Overwhelmed by too many resources?
    - Looking to take your CP skills to the next level?
    -

    +
    +
    +

    + Unsure how to get started? +
    + Overwhelmed by too many resources? +
    + Looking to take your CP skills to the next level? +
    +

    -

    This is the guide for you.

    +

    + This is the guide for you. +

    -
    -
    - - View Guide - -
    -
    -
    -
    +
    +
    + + View Guide + +
    +
    +
    +
    - {/* Begin FAQ */} -
    -
    -

    - Frequently asked questions -

    -
    -
    -
    -
    -
    - Is this a Syllabus? -
    -
    -

    - No. This guide is NOT a syllabus. USACO does not have an official syllabus. This guide merely lists topics that have historically appeared in USACO contests; it makes no guarantees about the topics in future USACO contests. -

    -
    -
    -
    -
    - How can I contribute/report a problem? -
    -
    -

    - If you would like to contribute towards this guide or report an issue, please contact Nathan Wang at nathan.r.wang@gmail.com. -

    -
    -
    -
    -
    -
    -
    - Is this guide for Platinum contestants? -
    -
    -

    - While we offer some resources that platinum contestants may find useful, the platinum division has too many topics for us to effectively cover. For platinum contestants, we recommend you treat this as more of a resource than a guide. -

    -
    -
    -
    -
    - How can I get help? -
    -
    -

    - uh..... -

    -
    -
    -
    -
    -
    -
    -
    - {/*End FAQ*/} -
    - ) -} \ No newline at end of file + {/* Begin FAQ */} +
    +
    +

    + Frequently asked questions +

    +
    +
    +
    +
    +
    + Is this a Syllabus? +
    +
    +

    + No. This guide is NOT a syllabus. USACO does not + have an official syllabus. This guide merely lists topics + that have historically appeared in USACO contests; + it makes no guarantees about the topics in future USACO + contests. +

    +
    +
    +
    +
    + How can I contribute/report a problem? +
    +
    +

    + If you would like to contribute towards this guide or + report an issue, please contact Nathan Wang at{' '} + + nathan.r.wang@gmail.com + + . +

    +
    +
    +
    +
    +
    +
    + Is this guide for Platinum contestants? +
    +
    +

    + While we offer some resources that platinum contestants + may find useful, the platinum division has too many topics + for us to effectively cover. For platinum contestants, we + recommend you treat this as more of a resource than + a guide. +

    +
    +
    +
    +
    + How can I get help? +
    +
    +

    uh.....

    +
    +
    +
    +
    +
    +
    +
    + {/*End FAQ*/} +
    + ); +} diff --git a/src/styles/main.css b/src/styles/main.css index 3cedd07..8be576a 100644 --- a/src/styles/main.css +++ b/src/styles/main.css @@ -2,4 +2,4 @@ @tailwind base; @tailwind components; /*! purgecss end ignore */ -@tailwind utilities; \ No newline at end of file +@tailwind utilities; diff --git a/src/styles/markdown.css b/src/styles/markdown.css index 4cc09da..8c48419 100644 --- a/src/styles/markdown.css +++ b/src/styles/markdown.css @@ -1,155 +1,155 @@ /*! purgecss start ignore */ /* Additional vertical padding used by kbd tag. */ .py-05 { - padding-top: 0.125rem; - padding-bottom: 0.125rem; + padding-top: 0.125rem; + padding-bottom: 0.125rem; } .markdown { - @apply text-gray-900 leading-normal break-words; + @apply text-gray-900 leading-normal break-words; } .markdown > * + * { - @apply mt-0 mb-4; + @apply mt-0 mb-4; } .markdown li + li { - @apply mt-1; + @apply mt-1; } .markdown li > p + p { - @apply mt-6; + @apply mt-6; } .markdown strong { - @apply font-semibold; + @apply font-semibold; } .markdown a { - @apply text-blue-600 font-semibold; + @apply text-blue-600 font-semibold; } .markdown strong a { - @apply font-bold; + @apply font-bold; } .markdown h1 { - @apply leading-tight border-b text-4xl font-semibold mb-4 mt-6 pb-2; + @apply leading-tight border-b text-4xl font-semibold mb-4 mt-6 pb-2; } .markdown h2 { - @apply leading-tight border-b text-2xl font-semibold mb-4 mt-6 pb-2; + @apply leading-tight border-b text-2xl font-semibold mb-4 mt-6 pb-2; } .markdown h3 { - @apply leading-snug text-lg font-semibold mb-4 mt-6; + @apply leading-snug text-lg font-semibold mb-4 mt-6; } .markdown h4 { - @apply leading-none text-base font-semibold mb-4 mt-6; + @apply leading-none text-base font-semibold mb-4 mt-6; } .markdown h5 { - @apply leading-tight text-sm font-semibold mb-4 mt-6; + @apply leading-tight text-sm font-semibold mb-4 mt-6; } .markdown h6 { - @apply leading-tight text-sm font-semibold text-gray-600 mb-4 mt-6; + @apply leading-tight text-sm font-semibold text-gray-600 mb-4 mt-6; } .markdown blockquote { - @apply text-base border-l-4 border-gray-300 pl-4 pr-4 text-gray-600; + @apply text-base border-l-4 border-gray-300 pl-4 pr-4 text-gray-600; } -.markdown code:not([class*="language-"]) { - @apply font-mono text-sm inline bg-gray-200 rounded px-1 py-05; +.markdown code:not([class*='language-']) { + @apply font-mono text-sm inline bg-gray-200 rounded px-1 py-05; } .markdown pre { - @apply rounded; + @apply rounded; } -.markdown pre:not([class*="language-"]) { - @apply bg-gray-100 p-4; +.markdown pre:not([class*='language-']) { + @apply bg-gray-100 p-4; } -.markdown pre:not([class*="language-"]) code { - @apply block bg-transparent p-0 overflow-visible rounded-none; +.markdown pre:not([class*='language-']) code { + @apply block bg-transparent p-0 overflow-visible rounded-none; } .markdown ul { - @apply text-base list-disc mb-4; + @apply text-base list-disc mb-4; } .markdown ul ul { - list-style-type: circle; + list-style-type: circle; } .markdown ul ul ul { - list-style-type: square; + list-style-type: square; } .markdown--module ul { - @apply pl-8; + @apply pl-8; } .markdown--syllabus ul { - @apply pl-5; + @apply pl-5; } .markdown p { - @apply mb-4; + @apply mb-4; } .markdown ul ul { - @apply mb-0; + @apply mb-0; } .markdown ul p { - @apply mb-0; + @apply mb-0; } .markdown ol { - @apply text-base pl-8 list-decimal mb-4; + @apply text-base pl-8 list-decimal mb-4; } .markdown kbd { - @apply text-xs inline-block rounded border px-1 py-05 align-middle font-normal font-mono shadow; + @apply text-xs inline-block rounded border px-1 py-05 align-middle font-normal font-mono shadow; } .markdown table { - @apply text-base border-gray-600; + @apply text-base border-gray-600; } .markdown th { - @apply border py-1 px-3; + @apply border py-1 px-3; } .markdown td { - @apply border py-1 px-3; + @apply border py-1 px-3; } /* Override pygments style background color. */ .markdown .highlight pre { - @apply bg-gray-100 !important; + @apply bg-gray-100 !important; } .markdown--module .syllabus-only { - display: none; + display: none; } .spoiler-body pre { - margin-left: -1rem !important; - margin-right: -1rem !important; - margin-bottom: -1rem !important; + margin-left: -1rem !important; + margin-right: -1rem !important; + margin-bottom: -1rem !important; } .info-block .custom-block-heading { - @apply text-sm leading-5 font-medium text-blue-800; + @apply text-sm leading-5 font-medium text-blue-800; } .info-block .custom-block-body { - @apply text-sm leading-5 text-blue-700 mt-2; + @apply text-sm leading-5 text-blue-700 mt-2; } .info-block .custom-block-body p:last-child { - @apply mb-0; + @apply mb-0; } -/*! purgecss end ignore */ \ No newline at end of file +/*! purgecss end ignore */ diff --git a/src/styles/prism-theme.css b/src/styles/prism-theme.css index 17acd99..803c72e 100644 --- a/src/styles/prism-theme.css +++ b/src/styles/prism-theme.css @@ -1,212 +1,212 @@ /*! purgecss start ignore */ -code[class*="language-"], -pre[class*="language-"] { - text-align: left; - white-space: pre; - word-spacing: normal; - word-break: normal; - word-wrap: normal; - color: #c3cee3; - background: #263238; - font-family: Roboto Mono, monospace; - font-size: 1em; - line-height: 1.5em; +code[class*='language-'], +pre[class*='language-'] { + text-align: left; + white-space: pre; + word-spacing: normal; + word-break: normal; + word-wrap: normal; + color: #c3cee3; + background: #263238; + font-family: Roboto Mono, monospace; + font-size: 1em; + line-height: 1.5em; - -moz-tab-size: 4; - -o-tab-size: 4; - tab-size: 4; + -moz-tab-size: 4; + -o-tab-size: 4; + tab-size: 4; - -webkit-hyphens: none; - -moz-hyphens: none; - -ms-hyphens: none; - hyphens: none; + -webkit-hyphens: none; + -moz-hyphens: none; + -ms-hyphens: none; + hyphens: none; } -code[class*="language-"]::-moz-selection, -pre[class*="language-"]::-moz-selection, -code[class*="language-"] ::-moz-selection, -pre[class*="language-"] ::-moz-selection { - background: #363636; +code[class*='language-']::-moz-selection, +pre[class*='language-']::-moz-selection, +code[class*='language-'] ::-moz-selection, +pre[class*='language-'] ::-moz-selection { + background: #363636; } -code[class*="language-"]::selection, -pre[class*="language-"]::selection, -code[class*="language-"] ::selection, -pre[class*="language-"] ::selection { - background: #363636; +code[class*='language-']::selection, +pre[class*='language-']::selection, +code[class*='language-'] ::selection, +pre[class*='language-'] ::selection { + background: #363636; } -:not(pre) > code[class*="language-"] { - white-space: normal; - border-radius: 0.2em; - padding: 0.1em; +:not(pre) > code[class*='language-'] { + white-space: normal; + border-radius: 0.2em; + padding: 0.1em; } -pre[class*="language-"] { - overflow: auto; - position: relative; - margin: 0.5em 0; - padding: 1.25em 1em; +pre[class*='language-'] { + overflow: auto; + position: relative; + margin: 0.5em 0; + padding: 1.25em 1em; } .language-css > code, .language-sass > code, .language-scss > code { - color: #fd9170; + color: #fd9170; } -[class*="language-"] .namespace { - opacity: 0.7; +[class*='language-'] .namespace { + opacity: 0.7; } .token.atrule { - color: #c792ea; + color: #c792ea; } .token.attr-name { - color: #ffcb6b; + color: #ffcb6b; } .token.attr-value { - color: #c3e88d; + color: #c3e88d; } .token.attribute { - color: #c3e88d; + color: #c3e88d; } .token.boolean { - color: #c792ea; + color: #c792ea; } .token.builtin { - color: #ffcb6b; + color: #ffcb6b; } .token.cdata { - color: #80cbc4; + color: #80cbc4; } .token.char { - color: #80cbc4; + color: #80cbc4; } .token.class { - color: #ffcb6b; + color: #ffcb6b; } .token.class-name { - color: #f2ff00; + color: #f2ff00; } .token.color { - color: #f2ff00; + color: #f2ff00; } .token.comment { - color: #546e7a; + color: #546e7a; } .token.constant { - color: #c792ea; + color: #c792ea; } .token.deleted { - color: #f07178; + color: #f07178; } .token.doctype { - color: #546e7a; + color: #546e7a; } .token.entity { - color: #f07178; + color: #f07178; } .token.function { - color: #c792ea; + color: #c792ea; } .token.hexcode { - color: #f2ff00; + color: #f2ff00; } .token.id { - color: #c792ea; - font-weight: bold; + color: #c792ea; + font-weight: bold; } .token.important { - color: #c792ea; - font-weight: bold; + color: #c792ea; + font-weight: bold; } .token.inserted { - color: #80cbc4; + color: #80cbc4; } .token.keyword { - color: #c792ea; - font-style: italic; + color: #c792ea; + font-style: italic; } .token.number { - color: #fd9170; + color: #fd9170; } .token.operator { - color: #89ddff; + color: #89ddff; } .token.prolog { - color: #546e7a; + color: #546e7a; } .token.property { - color: #80cbc4; + color: #80cbc4; } .token.pseudo-class { - color: #c3e88d; + color: #c3e88d; } .token.pseudo-element { - color: #c3e88d; + color: #c3e88d; } .token.punctuation { - color: #89ddff; + color: #89ddff; } .token.regex { - color: #f2ff00; + color: #f2ff00; } .token.selector { - color: #f07178; + color: #f07178; } .token.string { - color: #c3e88d; + color: #c3e88d; } .token.symbol { - color: #c792ea; + color: #c792ea; } .token.tag { - color: #f07178; + color: #f07178; } .token.unit { - color: #f07178; + color: #f07178; } .token.url { - color: #fd9170; + color: #fd9170; } .token.variable { - color: #f07178; + color: #f07178; } -/*! purgecss end ignore */ \ No newline at end of file +/*! purgecss end ignore */ diff --git a/src/templates/moduleTemplate.tsx b/src/templates/moduleTemplate.tsx index b695474..2dbade0 100644 --- a/src/templates/moduleTemplate.tsx +++ b/src/templates/moduleTemplate.tsx @@ -1,286 +1,371 @@ -import * as React from "react"; -import {useState} from "react"; -import { graphql, Link } from "gatsby" -import Layout from "../components/layout"; +import * as React from 'react'; +import { useState } from 'react'; +import { graphql, Link } from 'gatsby'; +import Layout from '../components/layout'; -import Markdown from "../components/Markdown"; -import ModuleOrdering, { divisionLabels } from "../../content/ordering"; -import Transition from "../components/Transition"; -import {graphqlToModulesObject} from "../utils"; +import Markdown from '../components/Markdown'; +import ModuleOrdering, { divisionLabels } from '../../content/ordering'; +import Transition from '../components/Transition'; +import { graphqlToModulesObject } from '../utils'; -const renderPrerequisite = (prerequisite) => { - const link = prerequisite.length > 1 ? prerequisite[1] : null; - return ( -
  • - {link && {prerequisite[0]}} - {!link && prerequisite[0]} -
  • - ); +const renderPrerequisite = prerequisite => { + const link = prerequisite.length > 1 ? prerequisite[1] : null; + return ( +
  • + {link && ( + + {prerequisite[0]} + + )} + {!link && prerequisite[0]} +
  • + ); }; -const Breadcrumbs = ({division}) => ( - +const Breadcrumbs = ({ division }) => ( + ); const SidebarBottomButtons = () => ( - <> -
    - -
    -
    - -
    - + <> +
    + +
    +
    + +
    + ); interface NavLink { - kind: "link" - label: string - href: string + kind: 'link'; + label: string; + href: string; } interface NavLinkGroup { - kind: "group" - label: string - children: NavLink[] + kind: 'group'; + label: string; + children: NavLink[]; } type NavLinkItem = NavLink | NavLinkGroup; const SidebarNavLinks = ({ links }) => { - const renderLink = link => { - if (link.kind === "link") { - return ( - - {link.label} - - ); - } - return ( -
    -
    - {link.label} -
    - {link.children.map(renderLink)} -
    - ) - }; - return ( - <> - {links.map(renderLink)} - - ); + const renderLink = link => { + if (link.kind === 'link') { + return ( + + {link.label} + + ); + } + return ( +
    +
    + {link.label} +
    + {link.children.map(renderLink)} +
    + ); + }; + return <>{links.map(renderLink)}; }; export default function Template(props) { - const { mdx, allMdx } = props.data; // data.markdownRemark holds your post data - const { body } = mdx; - const prereqs = mdx.frontmatter.prerequisites; - const division = props.pageContext.division; + const { mdx, allMdx } = props.data; // data.markdownRemark holds your post data + const { body } = mdx; + const prereqs = mdx.frontmatter.prerequisites; + const division = props.pageContext.division; - const [isMobileNavOpen, setIsMobileNavOpen] = useState(false); - const navLinks: (NavLinkItem)[] = React.useMemo(() => { - const modules = graphqlToModulesObject(allMdx); - const getLinks = module => { - if (module.hasOwnProperty("name")) { - return { - kind: "group", - label: module.name, - children: module.items.map(getLinks) - }; - } - if (!modules.hasOwnProperty(module)) { - throw `${module} not found!`; - } - return { - kind: "link", - label: modules[module].frontmatter.title, - href: `/${division}/${module}` - }; - }; - return ModuleOrdering[division].map(getLinks); - }, []); + const [isMobileNavOpen, setIsMobileNavOpen] = useState(false); + const navLinks: NavLinkItem[] = React.useMemo(() => { + const modules = graphqlToModulesObject(allMdx); + const getLinks = module => { + if (module.hasOwnProperty('name')) { + return { + kind: 'group', + label: module.name, + children: module.items.map(getLinks), + }; + } + if (!modules.hasOwnProperty(module)) { + throw `${module} not found!`; + } + return { + kind: 'link', + label: modules[module].frontmatter.title, + href: `/${division}/${module}`, + }; + }; + return ModuleOrdering[division].map(getLinks); + }, []); - return ( - -
    - {/* Off-canvas menu for mobile */} - -
    -
    - -
    setIsMobileNavOpen(false)}> -
    -
    - + return ( + +
    + {/* Off-canvas menu for mobile */} + +
    +
    + +
    setIsMobileNavOpen(false)} + > +
    +
    + - -
    -
    - -
    -
    -
    - Workflow -
    -
    - -
    - -
    - -
    -
    -
    - {/* Force sidebar to shrink to fit close icon */} -
    -
    -
    - - {/* Static sidebar for desktop */} -
    -
    -
    -
    - Workflow -
    - {/* Sidebar component, swap this element with another sidebar if you like */} - -
    - -
    -
    -
    -
    - -
    -
    -
    -
    -
    - -
    -
    -
    -

    - {mdx.frontmatter.title} -

    -

    Author: {mdx.frontmatter.author}

    -
    -
    -
    -
    - {prereqs && -
    -
    -
    - - - -
    -
    -

    - Prerequisites -

    -
    -
      - {prereqs.map(renderPrerequisite)} -
    -
    -
    -
    -
    } + +
    +
    + +
    +
    +
    + Workflow +
    +
    + +
    + +
    + +
    +
    +
    + {/* Force sidebar to shrink to fit close icon */} +
    +
    +
    + + {/* Static sidebar for desktop */} +
    +
    +
    +
    + Workflow +
    + {/* Sidebar component, swap this element with another sidebar if you like */} + +
    + +
    +
    +
    +
    + +
    +
    +
    +
    +
    + +
    +
    +
    +

    + {mdx.frontmatter.title} +

    +

    + Author: {mdx.frontmatter.author} +

    +
    +
    +
    +
    + {prereqs && ( +
    +
    +
    + + + +
    +
    +

    + Prerequisites +

    +
    +
      + {prereqs.map(renderPrerequisite)} +
    +
    +
    +
    +
    + )} - - -
    -
    -
    -
    -
    - - ) + +
    +
    + +
    +
    + + ); } export const pageQuery = graphql` - query($id: String!) { - mdx(frontmatter: { id: { eq: $id } }) { - body - frontmatter { - title - author - id - prerequisites - } - } - allMdx { - edges { - node { - frontmatter { - title - id - } - } - } - } - } -`; \ No newline at end of file + query($id: String!) { + mdx(frontmatter: { id: { eq: $id } }) { + body + frontmatter { + title + author + id + prerequisites + } + } + allMdx { + edges { + node { + frontmatter { + title + id + } + } + } + } + } +`; diff --git a/src/templates/syllabusTemplate.js b/src/templates/syllabusTemplate.js index f83ed4b..087d5d2 100644 --- a/src/templates/syllabusTemplate.js +++ b/src/templates/syllabusTemplate.js @@ -1,53 +1,57 @@ -import React from "react" +import React from 'react'; -import Layout from "../components/layout" -import SEO from "../components/seo" -import { graphql, Link } from "gatsby"; -import { divisionLabels, divisions } from "../../content/ordering"; -import { getModule, graphqlToModulesObject } from "../utils"; -import SyllabusModule from "../components/SyllabusModule"; +import Layout from '../components/layout'; +import SEO from '../components/seo'; +import { graphql, Link } from 'gatsby'; +import { divisionLabels, divisions } from '../../content/ordering'; +import { getModule, graphqlToModulesObject } from '../utils'; +import SyllabusModule from '../components/SyllabusModule'; const renderModule = (node, idx, parentIdx = -1) => { - if (node.hasOwnProperty("items")) { - return node.items.map((x, i) => renderModule(x, i, idx)); - } + if (node.hasOwnProperty('items')) { + return node.items.map((x, i) => renderModule(x, i, idx)); + } - const data = node.frontmatter; - if (!data.title) return; + const data = node.frontmatter; + if (!data.title) return; - return ( - - {data.description} - - ); + return ( + + {data.description} + + ); }; export default function Template(props) { - const data = props.data; + const data = props.data; - const allModules = graphqlToModulesObject(data.modules); + const allModules = graphqlToModulesObject(data.modules); - const [selectedDivision, setSelectedDivision] = React.useState(props.pageContext.division); - const colors = { - "intro": "blue", - "general": "pink", - "bronze": "orange", - "silver": "teal", - "gold": "yellow", - "plat": "purple" - }; - const color = colors[selectedDivision]; - const module = getModule(allModules, selectedDivision); + const [selectedDivision, setSelectedDivision] = React.useState( + props.pageContext.division + ); + const colors = { + intro: 'blue', + general: 'pink', + bronze: 'orange', + silver: 'teal', + gold: 'yellow', + plat: 'purple', + }; + const color = colors[selectedDivision]; + const module = getModule(allModules, selectedDivision); - // for purgecss, we have to list all the classes that are dynamically generated... - /* + // for purgecss, we have to list all the classes that are dynamically generated... + /* bg-blue-500 hover:bg-blue-50 hover:text-blue-600 focus:shadow-outline-blue bg-pink-500 hover:bg-pink-50 hover:text-pink-600 focus:shadow-outline-pink bg-orange-500 hover:bg-orange-50 hover:text-orange-600 focus:shadow-outline-orange @@ -61,149 +65,230 @@ export default function Template(props) { border-yellow-500 text-yellow-600 focus:text-yellow-800 focus:border-yellow-700 border-yellow-300 focus:border-yellow-300 text-yellow-500 text-yellow-300 bg-yellow-600 border-purple-500 text-purple-600 focus:text-purple-800 focus:border-purple-700 border-purple-300 focus:border-purple-300 text-purple-500 text-purple-300 bg-purple-600 */ - // alternatively we can just not dynamically generate classes, but that seems more tedious. + // alternatively we can just not dynamically generate classes, but that seems more tedious. - const selectedTabClasses = `flex-1 py-4 px-1 text-center border-b-2 border-${color}-500 font-bold text-lg leading-5 text-${color}-600 focus:outline-none focus:text-${color}-800 focus:border-${color}-700`, - unselectedTabClasses = `flex-1 py-4 px-1 text-center border-b-2 border-transparent font-bold text-lg leading-5 text-gray-500 hover:text-gray-700 hover:border-gray-300 focus:outline-none focus:text-gray-700 focus:border-gray-300`; + const selectedTabClasses = `flex-1 py-4 px-1 text-center border-b-2 border-${color}-500 font-bold text-lg leading-5 text-${color}-600 focus:outline-none focus:text-${color}-800 focus:border-${color}-700`, + unselectedTabClasses = `flex-1 py-4 px-1 text-center border-b-2 border-transparent font-bold text-lg leading-5 text-gray-500 hover:text-gray-700 hover:border-gray-300 focus:outline-none focus:text-gray-700 focus:border-gray-300`; - const handleDivisionChange = d => { - setSelectedDivision(d); - window.history.pushState(null, "", `/${d}/`); - }; + const handleDivisionChange = d => { + setSelectedDivision(d); + window.history.pushState(null, '', `/${d}/`); + }; - return ( - - + return ( + + -
    +
    + {/* Begin Hero Section */} +
    +
    +
    + + + + + + + + + + + + + + + + +
    +
    +
    +
    +
    +

    + USACO Guide +

    +

    + A collection of curated, high-quality resources to take you + from Bronze to Platinum. +

    +
    +
    + + About This Guide + +
    +
    +
    +
    +
    +
    + {/* End Hero Section */} - {/* Begin Hero Section */} -
    -
    -
    - - - - - - - - - - - - - - - - -
    -
    -
    -
    -
    -

    - USACO Guide -

    -

    - A collection of curated, high-quality resources to take you from Bronze to Platinum. -

    -
    -
    - - About This Guide - -
    -
    -
    -
    -
    -
    - {/* End Hero Section */} +
    +
    +
    +
    + +
    + -
    -
    -
    -
    - -
    - +
      + {module.map((m, idx) => { + if (m.hasOwnProperty('items')) { + return ( +
    1. + + {idx + 1}.{' '} + + {m.name} +
        + {m.items.map((m, idx2) => ( +
      1. + + {idx + 1}.{idx2 + 1}.{' '} + + + {m.frontmatter.title} + +
      2. + ))} +
      +
    2. + ); + } + return ( +
    3. + + {idx + 1}.{' '} + + + {m.frontmatter.title} + +
    4. + ); + })} +
    +
    -
      - {module.map((m, idx) => { - if (m.hasOwnProperty("items")) { - return ( -
    1. - {idx+1}. {m.name} -
        - {m.items.map((m, idx2) => ( -
      1. - {idx+1}.{idx2+1}. {m.frontmatter.title} -
      2. - ))} -
      -
    2. - ) - } - return ( -
    3. - {idx+1}. {m.frontmatter.title} -
    4. - ); - })} -
    -
    - - {module.map((x, idx) => renderModule(x, idx))} -
    -
    -
    - - ); + {module.map((x, idx) => renderModule(x, idx))} +
    +
    +
    +
    + ); } export const pageQuery = graphql` - query { - modules: allMdx { - edges { - node { - id - frontmatter { - title - id - author - problems - prerequisites - description - } - } - } - } - } -`; \ No newline at end of file + query { + modules: allMdx { + edges { + node { + id + frontmatter { + title + id + author + problems + prerequisites + description + } + } + } + } + } +`; diff --git a/src/utils.js b/src/utils.js index 6743ad2..0b657eb 100644 --- a/src/utils.js +++ b/src/utils.js @@ -1,36 +1,36 @@ -import ModuleOrdering from "../content/ordering"; +import ModuleOrdering from '../content/ordering'; export const getModule = (allModules, division) => { - return ModuleOrdering[division].map(k => { - // rip spaghetti code, clean this up - if (typeof k === "object") { - return { - name: k.name, - items: k.items.map(k2 => { - if (!allModules.hasOwnProperty(k2)) { - throw "Module not found: " + k2; - } - return { - ...allModules[k2], - slug: `/${division}/${allModules[k2].frontmatter.id}` - }; - }) - } - } else { - if (!allModules.hasOwnProperty(k)) { - throw "Module not found: " + k; - } - return { - ...allModules[k], - slug: `/${division}/${allModules[k].frontmatter.id}` - }; - } - }); + return ModuleOrdering[division].map(k => { + // rip spaghetti code, clean this up + if (typeof k === 'object') { + return { + name: k.name, + items: k.items.map(k2 => { + if (!allModules.hasOwnProperty(k2)) { + throw 'Module not found: ' + k2; + } + return { + ...allModules[k2], + slug: `/${division}/${allModules[k2].frontmatter.id}`, + }; + }), + }; + } else { + if (!allModules.hasOwnProperty(k)) { + throw 'Module not found: ' + k; + } + return { + ...allModules[k], + slug: `/${division}/${allModules[k].frontmatter.id}`, + }; + } + }); }; -export const graphqlToModulesObject = (allMdx) => { - return allMdx.edges.reduce((acc, cur) => { - acc[cur.node.frontmatter.id] = cur.node; - return acc; - }, {}); -}; \ No newline at end of file +export const graphqlToModulesObject = allMdx => { + return allMdx.edges.reduce((acc, cur) => { + acc[cur.node.frontmatter.id] = cur.node; + return acc; + }, {}); +}; diff --git a/tailwind.config.js b/tailwind.config.js index 42d77f8..cd36b22 100644 --- a/tailwind.config.js +++ b/tailwind.config.js @@ -1,8 +1,6 @@ module.exports = { - plugins: [ - require('@tailwindcss/ui'), - ], - purge: { - content: ['./src/**/*.js', "./src/**/*.ts", "./src/**/*.tsx"], - }, -}; \ No newline at end of file + plugins: [require('@tailwindcss/ui')], + purge: { + content: ['./src/**/*.js', './src/**/*.ts', './src/**/*.tsx'], + }, +}; diff --git a/yarn.lock b/yarn.lock index bbfd7e7..6620c23 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2712,7 +2712,7 @@ ansi-align@^3.0.0: dependencies: string-width "^3.0.0" -ansi-colors@^3.0.0: +ansi-colors@^3.0.0, ansi-colors@^3.2.1: version "3.2.4" resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-3.2.4.tgz#e3a3da4bfbae6c86a9c285625de124a234026fbf" integrity sha512-hHUXGagefjN2iRrID63xckIvotOXOojhQKWIPUZ4mNUZ9nLZW+7FMNoE1lOkEhNWYsx/7ysGIuJYCiMAA9FnrA== @@ -2722,7 +2722,7 @@ ansi-escapes@^3.0.0, ansi-escapes@^3.1.0, ansi-escapes@^3.2.0: resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-3.2.0.tgz#8780b98ff9dbf5638152d1f1fe5c1d7b4442976b" integrity sha512-cBhpre4ma+U0T1oM5fXg7Dy1Jw7zzwv7lt/GoCpr+hDQJoYnKVPLL4dCvSEFMmQurOQvSrwT7SL/DAlhBI97RQ== -ansi-escapes@^4.2.1: +ansi-escapes@^4.2.1, ansi-escapes@^4.3.0: version "4.3.1" resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-4.3.1.tgz#a5c47cc43181f1f38ffd7076837700d395522a61" integrity sha512-JWF7ocqNrp8u9oqpgV+wH5ftbt+cfvv+PTjOvKLT3AdYly/LmORARfEVT1iyjwN+4MqE5UmVKoAdIBqeoCHgLA== @@ -4232,7 +4232,7 @@ cli-table3@^0.5.1: optionalDependencies: colors "^1.1.2" -cli-truncate@^2.1.0: +cli-truncate@2.1.0, cli-truncate@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/cli-truncate/-/cli-truncate-2.1.0.tgz#c39e28bf05edcde5be3b98992a22deed5a2b93c7" integrity sha512-n8fOixwDD6b/ObinzTrp1ZKFzbgvKZvuz/TvejnLn1aQfC6r52XEx85FmuC+3HI+JM7coBRXUvNqEU2PHVrHpg== @@ -4382,7 +4382,7 @@ commander@^2.11.0, commander@^2.19.0, commander@^2.20.0: resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33" integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ== -commander@^5.0.0: +commander@^5.0.0, commander@^5.1.0: version "5.1.0" resolved "https://registry.yarnpkg.com/commander/-/commander-5.1.0.tgz#46abbd1652f8e059bddaef99bbdcb2ad9cf179ae" integrity sha512-P0CysNDQ7rtVw4QIQtm+MRxV66vKFSvlsQvGYXZWR3qFU0jlMKHZZZgw8e+8DSah4UDKMqnknRDQz+xuQXQ/Zg== @@ -4404,6 +4404,11 @@ commondir@^1.0.1: resolved "https://registry.yarnpkg.com/commondir/-/commondir-1.0.1.tgz#ddd800da0c66127393cca5950ea968a3aaf1253b" integrity sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs= +compare-versions@^3.6.0: + version "3.6.0" + resolved "https://registry.yarnpkg.com/compare-versions/-/compare-versions-3.6.0.tgz#1a5689913685e5a87637b8d3ffca75514ec41d62" + integrity sha512-W6Af2Iw1z4CB7q4uU4hv646dW9GQuBM+YpC0UvUCWSD8w90SJjp+ujJuXaEMtAXBtSqGfMPuFOVn4/+FlaqfBA== + component-bind@1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/component-bind/-/component-bind-1.0.0.tgz#00c608ab7dcd93897c0009651b1d3a8e1e73bbd1" @@ -5156,6 +5161,11 @@ decompress@^4.0.0, decompress@^4.2.0: pify "^2.3.0" strip-dirs "^2.0.0" +dedent@^0.7.0: + version "0.7.0" + resolved "https://registry.yarnpkg.com/dedent/-/dedent-0.7.0.tgz#2495ddbaf6eb874abb0e1be9df22d2e5a544326c" + integrity sha1-JJXduvbrh0q7Dhvp3yLS5aVEMmw= + deep-equal@^1.0.1, deep-equal@^1.1.0: version "1.1.1" resolved "https://registry.yarnpkg.com/deep-equal/-/deep-equal-1.1.1.tgz#b5c98c942ceffaf7cb051e24e1434a25a2e6076a" @@ -5760,6 +5770,13 @@ enhanced-resolve@^4.1.0: memory-fs "^0.5.0" tapable "^1.0.0" +enquirer@^2.3.5: + version "2.3.5" + resolved "https://registry.yarnpkg.com/enquirer/-/enquirer-2.3.5.tgz#3ab2b838df0a9d8ab9e7dff235b0e8712ef92381" + integrity sha512-BNT1C08P9XD0vNg3J475yIUG+mVdp9T6towYFHUv897X0KoHBjB1shyrNmhmtHWKP17iSWgo7Gqh7BBuzLZMSA== + dependencies: + ansi-colors "^3.2.1" + entities@^1.1.1, entities@~1.1.1: version "1.1.2" resolved "https://registry.yarnpkg.com/entities/-/entities-1.1.2.tgz#bdfa735299664dfafd34529ed4f8522a275fea56" @@ -6518,7 +6535,7 @@ figures@^2.0.0: dependencies: escape-string-regexp "^1.0.5" -figures@^3.0.0: +figures@^3.0.0, figures@^3.2.0: version "3.2.0" resolved "https://registry.yarnpkg.com/figures/-/figures-3.2.0.tgz#625c18bd293c604dc4a8ddb2febf0c88341746af" integrity sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg== @@ -6687,7 +6704,7 @@ find-up@^4.0.0, find-up@^4.1.0: locate-path "^5.0.0" path-exists "^4.0.0" -find-versions@^3.0.0: +find-versions@^3.0.0, find-versions@^3.2.0: version "3.2.0" resolved "https://registry.yarnpkg.com/find-versions/-/find-versions-3.2.0.tgz#10297f98030a786829681690545ef659ed1d254e" integrity sha512-P8WRou2S+oe222TOCHitLy8zj+SIsVJh52VP4lvXkaFVnOFFdoWv1H1Jjvel1aI6NCFOAaeAVm8qrI0odiLcww== @@ -8538,6 +8555,22 @@ human-signals@^1.1.1: resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-1.1.1.tgz#c5b1cd14f50aeae09ab6c59fe63ba3395fe4dfa3" integrity sha512-SEQu7vl8KjNL2eoGBLF3+wAjpsNfA9XMlXAYj/3EdaNfAlxKthD1xjEQfGOUhllCGGJVNY34bRr6lPINhNjyZw== +husky@^4.2.5: + version "4.2.5" + resolved "https://registry.yarnpkg.com/husky/-/husky-4.2.5.tgz#2b4f7622673a71579f901d9885ed448394b5fa36" + integrity sha512-SYZ95AjKcX7goYVZtVZF2i6XiZcHknw50iXvY7b0MiGoj5RwdgRQNEHdb+gPDPCXKlzwrybjFjkL6FOj8uRhZQ== + dependencies: + chalk "^4.0.0" + ci-info "^2.0.0" + compare-versions "^3.6.0" + cosmiconfig "^6.0.0" + find-versions "^3.2.0" + opencollective-postinstall "^2.0.2" + pkg-dir "^4.2.0" + please-upgrade-node "^3.2.0" + slash "^3.0.0" + which-pm-runs "^1.0.0" + iconv-lite@0.4.24, iconv-lite@^0.4.17, iconv-lite@^0.4.24, iconv-lite@~0.4.13: version "0.4.24" resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b" @@ -9741,6 +9774,41 @@ lines-and-columns@^1.1.6: resolved "https://registry.yarnpkg.com/lines-and-columns/-/lines-and-columns-1.1.6.tgz#1c00c743b433cd0a4e80758f7b64a57440d9ff00" integrity sha1-HADHQ7QzzQpOgHWPe2SldEDZ/wA= +lint-staged@^10.2.11: + version "10.2.11" + resolved "https://registry.yarnpkg.com/lint-staged/-/lint-staged-10.2.11.tgz#713c80877f2dc8b609b05bc59020234e766c9720" + integrity sha512-LRRrSogzbixYaZItE2APaS4l2eJMjjf5MbclRZpLJtcQJShcvUzKXsNeZgsLIZ0H0+fg2tL4B59fU9wHIHtFIA== + dependencies: + chalk "^4.0.0" + cli-truncate "2.1.0" + commander "^5.1.0" + cosmiconfig "^6.0.0" + debug "^4.1.1" + dedent "^0.7.0" + enquirer "^2.3.5" + execa "^4.0.1" + listr2 "^2.1.0" + log-symbols "^4.0.0" + micromatch "^4.0.2" + normalize-path "^3.0.0" + please-upgrade-node "^3.2.0" + string-argv "0.3.1" + stringify-object "^3.3.0" + +listr2@^2.1.0: + version "2.1.8" + resolved "https://registry.yarnpkg.com/listr2/-/listr2-2.1.8.tgz#8af7ebc70cdbe866ddbb6c80909142bd45758f1f" + integrity sha512-Op+hheiChfAphkJ5qUxZtHgyjlX9iNnAeFS/S134xw7mVSg0YVrQo1IY4/K+ElY6XgOPg2Ij4z07urUXR+YEew== + dependencies: + chalk "^4.0.0" + cli-truncate "^2.1.0" + figures "^3.2.0" + indent-string "^4.0.0" + log-update "^4.0.0" + p-map "^4.0.0" + rxjs "^6.5.5" + through "^2.3.8" + load-bmfont@^1.3.1, load-bmfont@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/load-bmfont/-/load-bmfont-1.4.0.tgz#75f17070b14a8c785fe7f5bee2e6fd4f98093b6b" @@ -9973,6 +10041,13 @@ lodash@4.17.15, lodash@^4.11.1, lodash@^4.15.0, lodash@^4.17.11, lodash@^4.17.13 resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.15.tgz#b447f6670a0455bbfeedd11392eff330ea097548" integrity sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A== +log-symbols@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-4.0.0.tgz#69b3cc46d20f448eccdb75ea1fa733d9e821c920" + integrity sha512-FN8JBzLx6CzeMrB0tg6pqlGU1wCrXW+ZXGH481kfsBqer0hToTIiHdjH4Mq8xJUbvATujKCvaREGWpGUionraA== + dependencies: + chalk "^4.0.0" + log-update@^3.0.0: version "3.4.0" resolved "https://registry.yarnpkg.com/log-update/-/log-update-3.4.0.tgz#3b9a71e00ac5b1185cc193a36d654581c48f97b9" @@ -9982,6 +10057,16 @@ log-update@^3.0.0: cli-cursor "^2.1.0" wrap-ansi "^5.0.0" +log-update@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/log-update/-/log-update-4.0.0.tgz#589ecd352471f2a1c0c570287543a64dfd20e0a1" + integrity sha512-9fkkDevMefjg0mmzWFBW8YkFP91OrizzkW3diF7CpG+S2EYdy4+TVfGwz1zeF8x7hCx1ovSPTOE9Ngib74qqUg== + dependencies: + ansi-escapes "^4.3.0" + cli-cursor "^3.1.0" + slice-ansi "^4.0.0" + wrap-ansi "^6.2.0" + logalot@^2.0.0, logalot@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/logalot/-/logalot-2.1.0.tgz#5f8e8c90d304edf12530951a5554abb8c5e3f552" @@ -11109,6 +11194,11 @@ open@^6.4.0: dependencies: is-wsl "^1.1.0" +opencollective-postinstall@^2.0.2: + version "2.0.3" + resolved "https://registry.yarnpkg.com/opencollective-postinstall/-/opencollective-postinstall-2.0.3.tgz#7a0fff978f6dbfa4d006238fbac98ed4198c3259" + integrity sha512-8AV/sCtuzUeTo8gQK5qDZzARrulB3egtLzFgteqB2tcT4Mw7B8Kt7JcDHmltjz6FOAHsvTevk70gZEbhM4ZS9Q== + opentracing@^0.14.4: version "0.14.4" resolved "https://registry.yarnpkg.com/opentracing/-/opentracing-0.14.4.tgz#a113408ea740da3a90fde5b3b0011a375c2e4268" @@ -11275,6 +11365,13 @@ p-map@^3.0.0: dependencies: aggregate-error "^3.0.0" +p-map@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/p-map/-/p-map-4.0.0.tgz#bb2f95a5eda2ec168ec9274e06a747c3e2904d2b" + integrity sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ== + dependencies: + aggregate-error "^3.0.0" + p-pipe@^1.1.0: version "1.2.0" resolved "https://registry.yarnpkg.com/p-pipe/-/p-pipe-1.2.0.tgz#4b1a11399a11520a67790ee5a0c1d5881d6befe9" @@ -11749,6 +11846,13 @@ pkg-up@^2.0.0: dependencies: find-up "^2.1.0" +please-upgrade-node@^3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/please-upgrade-node/-/please-upgrade-node-3.2.0.tgz#aeddd3f994c933e4ad98b99d9a556efa0e2fe942" + integrity sha512-gQR3WpIgNIKwBMVLkpMUeR3e1/E1y42bqDQZfql+kDeXd8COYfM8PQA4X6y7a8u9Ua9FHmsrrmirW2vHs45hWg== + dependencies: + semver-compare "^1.0.0" + pngjs@^3.0.0, pngjs@^3.3.3: version "3.4.0" resolved "https://registry.yarnpkg.com/pngjs/-/pngjs-3.4.0.tgz#99ca7d725965fb655814eaf65f38f12bbdbf555f" @@ -12221,7 +12325,7 @@ prepend-http@^2.0.0: resolved "https://registry.yarnpkg.com/prepend-http/-/prepend-http-2.0.0.tgz#e92434bfa5ea8c19f41cdfd401d741a3c819d897" integrity sha1-6SQ0v6XqjBn0HN/UAddBo8gZ2Jc= -prettier@2.0.5, prettier@^2.0.5: +prettier@^2.0.5: version "2.0.5" resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.0.5.tgz#d6d56282455243f2f92cc1716692c08aa31522d4" integrity sha512-7PtVymN48hGcO4fGjybyBSIWDsLU4H4XlvOHfq91pz9kkGlonzwTfYkaIEwiRg/dAJF9YlbsduBAgtYLi+8cFg== @@ -13413,7 +13517,7 @@ rx-lite@*, rx-lite@^4.0.8: resolved "https://registry.yarnpkg.com/rx-lite/-/rx-lite-4.0.8.tgz#0b1e11af8bc44836f04a6407e92da42467b79444" integrity sha1-Cx4Rr4vESDbwSmQH6S2kJGe3lEQ= -rxjs@^6.5.3: +rxjs@^6.5.3, rxjs@^6.5.5: version "6.5.5" resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.5.5.tgz#c5c884e3094c8cfee31bf27eb87e54ccfc87f9ec" integrity sha512-WfQI+1gohdf0Dai/Bbmk5L5ItH5tYqm3ki2c5GdWhKjalzjg93N3avFjVStyZZz+A2Em+ZxKH5bNghw9UeylGQ== @@ -13541,6 +13645,11 @@ selfsigned@^1.10.7: dependencies: node-forge "0.9.0" +semver-compare@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/semver-compare/-/semver-compare-1.0.0.tgz#0dee216a1c941ab37e9efb1788f6afc5ff5537fc" + integrity sha1-De4hahyUGrN+nvsXiPavxf9VN/w= + semver-diff@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/semver-diff/-/semver-diff-2.1.0.tgz#4bbb8437c8d37e4b0cf1a68fd726ec6d645d6d36" @@ -13833,6 +13942,15 @@ slice-ansi@^3.0.0: astral-regex "^2.0.0" is-fullwidth-code-point "^3.0.0" +slice-ansi@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-4.0.0.tgz#500e8dd0fd55b05815086255b3195adf2a45fe6b" + integrity sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ== + dependencies: + ansi-styles "^4.0.0" + astral-regex "^2.0.0" + is-fullwidth-code-point "^3.0.0" + slugify@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/slugify/-/slugify-1.4.0.tgz#c9557c653c54b0c7f7a8e786ef3431add676d2cb" @@ -14273,6 +14391,11 @@ strict-uri-encode@^2.0.0: resolved "https://registry.yarnpkg.com/strict-uri-encode/-/strict-uri-encode-2.0.0.tgz#b9c7330c7042862f6b142dc274bbcc5866ce3546" integrity sha1-ucczDHBChi9rFC3CdLvMWGbONUY= +string-argv@0.3.1: + version "0.3.1" + resolved "https://registry.yarnpkg.com/string-argv/-/string-argv-0.3.1.tgz#95e2fbec0427ae19184935f816d74aaa4c5c19da" + integrity sha512-a1uQGz7IyVy9YwhqjZIZu1c8JO8dNIe20xBmSS6qu9kv++k3JGzCVmprbNN5Kn+BgzD5E7YYwg1CcjuJMRNsvg== + string-length@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/string-length/-/string-length-3.1.0.tgz#107ef8c23456e187a8abd4a61162ff4ac6e25837"