Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
johnpolacek committed Jul 27, 2020
0 parents commit 9b22d72
Show file tree
Hide file tree
Showing 51 changed files with 17,306 additions and 0 deletions.
22 changes: 22 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# See https://help.github.com/ignore-files/ for more about ignoring files.

# dependencies
/node_modules

# testing
/coverage
/cypress/screenshots

# production
/build
/dist
/.next

# misc
.DS_Store
.env
npm-debug.log*
yarn-debug.log*
yarn-error.log*

.now
9 changes: 9 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.cache
.next
package.json
package-lock.json
public
api/socks.js
node-modules
*.md
*.mdx
7 changes: 7 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"endOfLine": "lf",
"semi": false,
"singleQuote": false,
"tabWidth": 2,
"trailingComma": "es5"
}
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2020 John Polacek

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Next.js MDX Blog Starter for building blogs with [Next.js](https://nextjs.org/) and [MDX](https://mdxjs.com/), including [Theme UI](https://theme-ui.com/home/) Component Design System, [Vercel Deployment](https://vercel.com/) and more.

## Demo

[link here]

Build and deploy with vercel

```
npm install && vc deploy
```

## Customize






22 changes: 22 additions & 0 deletions blog.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
module.exports = {
title: "Next.js MDX Blog Starter",
subtitle: "Content authoring with MDX. Powered by Next.js.", // longDescription : appears in landing page meta description
description:
"Next.js MDX Blog Starter for building blogs with Next.js and MDX, including Theme UI Component Design System, Vercel Deployment and more.",
author: "John Polacek",
analytics: "UA-2821890-19",
shareImage: "https://nextjs-mdx-blog-starter.now.sh/screenshot.png",
shareImageAlt: "Next.js MDX Blog Starter Screenshot",
footerLinks: [
{
label: "Twitter",
text: "@johnpolacek",
href: "https://twitter.com/johnpolacek",
},
{
label: "Github",
text: "github.com/johnpolacek",
href: "https://github.com/johnpolacek",
},
],
}
5 changes: 5 additions & 0 deletions cypress.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"baseUrl": "http://localhost:3000",
"chromeWebSecurity": false,
"video": false
}
5 changes: 5 additions & 0 deletions cypress/fixtures/example.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"name": "Using fixtures to represent data",
"email": "hello@cypress.io",
"body": "Fixtures are a great way to mock data for responses to routes"
}
17 changes: 17 additions & 0 deletions cypress/integration/App.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
const modes = ["Red", "Green", "Blue"]

describe("App", function () {
it("loads", function () {
cy.visit("/app")
cy.get("h2").should("contain", "Select a mode").should("be.visible")
})

it("can switch modes", function () {
cy.visit("/app")
cy.switchModes(modes) // see cypress/support/commands.js
})

it("can load modes", function () {
cy.loadModes(modes) // see cypress/support/commands.js
})
})
6 changes: 6 additions & 0 deletions cypress/integration/Docs.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
describe("Docs", function () {
it("loads", function () {
cy.visit("/docs")
cy.get("#docs").should("be.visible")
})
})
23 changes: 23 additions & 0 deletions cypress/integration/Index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
describe("Home Page", function () {
it("loads", function () {
cy.visit("/")
cy.get("h1").contains("Project Starter").should("be.visible")
cy.get("#home").should("be.visible")
})

it("can navigate to docs", function () {
cy.visit("/")
cy.get("a").contains("Docs").click()
cy.get("h2").should("contain", "Getting Started").should("be.visible")
cy.get("a").contains("Project Starter").click()
cy.get("#home").should("be.visible")
})

it("can navigate to app", function () {
cy.visit("/")
cy.get("a").contains("App").click()
cy.get("h2").should("contain", "Select a mode").should("be.visible")
cy.get("a").contains("Project Starter").click()
cy.get("#home").should("be.visible")
})
})
21 changes: 21 additions & 0 deletions cypress/plugins/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/// <reference types="cypress" />
// ***********************************************************
// This example plugins/index.js can be used to load plugins
//
// You can change the location of this file or turn off loading
// the plugins file with the 'pluginsFile' configuration option.
//
// You can read more here:
// https://on.cypress.io/plugins-guide
// ***********************************************************

// This function is called when a project is opened or re-opened (e.g. due to
// the project's config changing)

/**
* @type {Cypress.PluginConfig}
*/
module.exports = (on, config) => {
// `on` is used to hook into various events Cypress emits
// `config` is the resolved Cypress config
}
24 changes: 24 additions & 0 deletions cypress/support/commands.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
Cypress.Commands.add("switchModes", (modes) => {
modes.forEach((mode) => {
// switch mode
cy.get("a").contains(mode).click()
cy.get("h2")
.should("contain", "You selected " + mode.toUpperCase())
.should("be.visible")
cy.get("h2").should("not.contain", "Select a mode")
// click again to switch back
cy.get("a").contains(mode).click()
cy.get("h2").should("not.contain", "You selected " + mode.toUpperCase())
cy.get("h2").should("contain", "Select a mode").should("be.visible")
})
})

Cypress.Commands.add("loadModes", (modes) => {
modes.forEach((mode) => {
// switch mode
cy.visit("/app/" + mode.toLowerCase())
cy.get("h2")
.should("contain", "You selected " + mode.toUpperCase())
.should("be.visible")
})
})
20 changes: 20 additions & 0 deletions cypress/support/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// ***********************************************************
// This example support/index.js is processed and
// loaded automatically before your test files.
//
// This is a great place to put global configuration and
// behavior that modifies Cypress.
//
// You can change the location of this file or turn off
// automatically serving support files with the
// 'supportFile' configuration option.
//
// You can read more here:
// https://on.cypress.io/configuration
// ***********************************************************

// Import commands.js using ES2015 syntax:
import "./commands"

// Alternatively you can use CommonJS syntax:
// require('./commands')
15 changes: 15 additions & 0 deletions next.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
const withMDX = require("@next/mdx")({
extension: /\.mdx?$/,
})
module.exports = withMDX({
pageExtensions: ["js", "jsx", "md", "mdx"],
webpack: (config, { isServer }) => {
// Fixes npm packages (mdx) that depend on `fs` module
if (!isServer) {
config.node = {
fs: "empty",
}
}
return config
},
})
Loading

0 comments on commit 9b22d72

Please sign in to comment.