-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 9b22d72
Showing
51 changed files
with
17,306 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"endOfLine": "lf", | ||
"semi": false, | ||
"singleQuote": false, | ||
"tabWidth": 2, | ||
"trailingComma": "es5" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
||
|
||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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", | ||
}, | ||
], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"baseUrl": "http://localhost:3000", | ||
"chromeWebSecurity": false, | ||
"video": false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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") | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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") | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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") | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
}, | ||
}) |
Oops, something went wrong.