Skip to content

Commit

Permalink
Restructure and update imports
Browse files Browse the repository at this point in the history
  • Loading branch information
kamranahmedse committed Nov 13, 2019
1 parent 5b4cc86 commit 51b2c70
Show file tree
Hide file tree
Showing 30 changed files with 32 additions and 32 deletions.
2 changes: 1 addition & 1 deletion components/featured-content/roadmaps.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Link from 'next/link';
import { FeaturedContentWrap } from './style';
import roadmaps from 'data/roadmaps';
import roadmaps from 'storage/roadmaps';
import FeaturedRoadmap from 'components/featured-roadmap';

const FeaturedRoadmaps = () => (
Expand Down
2 changes: 1 addition & 1 deletion components/helmet/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import NextHead from 'next/head';
import siteConfig from 'data/site';
import siteConfig from 'storage/site';
import { GA_TRACKING_ID } from 'lib/gtag';

const prepareTitle = (givenTitle) => {
Expand Down
2 changes: 1 addition & 1 deletion components/mdx-components/heading.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import styled from 'styled-components';
import Link from '../icons/link.svg';
import Link from 'components/icons/link.svg';

const linkify = (Component) => {
return (props) => {
Expand Down
2 changes: 1 addition & 1 deletion components/page-footer/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Link from 'next/link';
import siteConfig from "data/site";
import siteConfig from "storage/site";
import { FooterWrap } from './style.js'

const PageFooter = () => (
Expand Down
8 changes: 4 additions & 4 deletions components/roadmap-summary/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import Link from 'next/link';
import classNames from 'classnames';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { faEnvelope, faClock, faHandshake, faArrowLeft } from '@fortawesome/free-solid-svg-icons';
import {
SummaryContainer,
Title,
Expand All @@ -12,17 +14,15 @@ import {
} from './style';
import SharePage from 'components/share-page';
import { BadgeLink, BadgesList, PrimaryBadge, SecondaryBadge, DarkBadge } from 'components/badges';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { faEnvelope, faClock, faHandshake, faArrowLeft } from '@fortawesome/free-solid-svg-icons';
import GuideBody from 'components/guide-body';
import siteConfig from "data/site";
import siteConfig from "storage/site";

const isActiveRoadmap = (loadedVersion, roadmapVersion) => (
(loadedVersion === roadmapVersion) ||
(loadedVersion === 'latest' && parseInt(roadmapVersion, 10) === (new Date()).getFullYear())
);

const UpcomingGuide = require(`../../data/roadmaps/upcoming.md`).default;
const UpcomingGuide = require(`../../storage/roadmaps/upcoming.md`).default;

const RoadmapSummary = ({ roadmap }) => (
<SummaryContainer>
Expand Down
2 changes: 1 addition & 1 deletion layouts/default/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import Helmet from 'components/helmet';
import './global.scss';
import { firePageView } from '../../lib/gtag';
import { firePageView } from 'lib/gtag';

class DefaultLayout extends React.Component {
componentDidMount() {
Expand Down
2 changes: 1 addition & 1 deletion lib/author.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import authors from "data/authors";
import authors from "storage/authors";

export const findByUsername = (username) => authors.find(author => author.username === username) || {};
6 changes: 3 additions & 3 deletions lib/guide.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import guides from "data/guides";
import authors from "data/authors";
import siteConfig from "data/site";
import guides from "storage/guides";
import authors from "storage/authors";
import siteConfig from "storage/site";

export const getAllGuides = () => {
return guides.filter(guide => !guide.draft)
Expand Down
2 changes: 1 addition & 1 deletion lib/roadmap.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import roadmaps from "data/roadmaps";
import roadmaps from "storage/roadmaps";

export const getRequestedRoadmap = req => {
// Considering it a new roadmap URL e.g. `/roadmaps/frontend`
Expand Down
2 changes: 1 addition & 1 deletion lib/url.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import queryString from 'query-string';
import siteConfig from 'data/site';
import siteConfig from 'storage/site';

export const prefixHost = (url) => {
return /^\//.test(url) ? `${siteConfig.url}${url}` : url;
Expand Down
2 changes: 1 addition & 1 deletion pages/guides/[guide].js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const Guide = ({ guide }) => {
return <Error statusCode={ 404 } />
}

const GuideContent = require(`../../data/guides/${guide.fileName}.md`).default;
const GuideContent = require(`../../storage/guides/${guide.fileName}.md`).default;

return (
<GuideLayout>
Expand Down
12 changes: 6 additions & 6 deletions pages/guides/index.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { faCodeBranch, faEnvelope } from '@fortawesome/free-solid-svg-icons/index';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { BadgeLink, BadgesList, PrimaryBadge, SecondaryBadge } from 'components/badges';
import FeaturedGuide from 'components/featured-guide';
import DefaultLayout from 'layouts/default/index';
import SiteNav from 'components/site-nav';
import PageHeader from 'components/page-header';
import PageFooter from 'components/page-footer';
import SiteNav from 'components/site-nav';
import { getAllGuides } from 'lib/guide';
import FeaturedGuide from '../../components/featured-guide';
import { faCodeBranch, faEnvelope } from '@fortawesome/free-solid-svg-icons/index';
import { BadgeLink, BadgesList, PrimaryBadge, SecondaryBadge } from 'components/badges';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import siteConfig from "data/site";
import siteConfig from 'storage/site';

const Roadmap = () => (
<DefaultLayout>
Expand Down
6 changes: 3 additions & 3 deletions pages/roadmaps.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ import DefaultLayout from 'layouts/default/index';
import SiteNav from 'components/site-nav';
import PageFooter from 'components/page-footer';
import PageHeader from 'components/page-header';
import roadmaps from "data/roadmaps";
import roadmaps from "storage/roadmaps";
import RowBlock from 'components/row-block';
import IconRowBlock from 'components/icon-row-block';
import siteConfig from "data/site";
import { BadgeLink, BadgesList, PrimaryBadge, SecondaryBadge } from '../components/badges';
import siteConfig from "storage/site";
import { BadgeLink, BadgesList, PrimaryBadge, SecondaryBadge } from 'components/badges';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { faEnvelope, faCodeBranch } from '@fortawesome/free-solid-svg-icons';

Expand Down
4 changes: 2 additions & 2 deletions path-map.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
const path = require('path');
const glob = require('glob');

const guides = require('./data/guides.json');
const roadmaps = require('./data/roadmaps');
const guides = require('./storage/guides.json');
const roadmaps = require('./storage/roadmaps');

const PAGES_PATH = path.join(__dirname, 'pages');

Expand Down
4 changes: 2 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ If you think that these can be improved in anyway, please do suggest.

![Frontend Roadmap](./static/roadmaps/latest/frontend.png)

## Back-end Roadmap
## Backend Roadmap

![Back-end Roadmap](./static/roadmaps/latest/backend.png)
![Backend Roadmap](./static/roadmaps/latest/backend.png)

## DevOps Roadmap

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions test/path-map.spec.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const path = require('path');
const fs = require('fs');
const guides = require('../data/guides');
const roadmaps = require('../data/roadmaps');
const guides = require('../storage/guides');
const roadmaps = require('../storage/roadmaps');

const {
getPageRoutes,
Expand Down Expand Up @@ -50,7 +50,7 @@ describe("Build scripts tests", () => {
guides.forEach(guide => {
const [,, slug] = guide.url.split('/');

const expectedFile = path.join(__dirname, `../data/guides/${slug}.md`);
const expectedFile = path.join(__dirname, `../storage/guides/${slug}.md`);
const foundFile = fs.existsSync(expectedFile) ? expectedFile : '';

expect(foundFile).toEqual(expectedFile);
Expand Down

0 comments on commit 51b2c70

Please sign in to comment.