Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
epilande committed Aug 4, 2019
0 parents commit e7ec6fd
Show file tree
Hide file tree
Showing 26 changed files with 10,510 additions and 0 deletions.
13 changes: 13 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
max_line_length = 80
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false
7 changes: 7 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.vscode

node_modules/

dist/
public/
build/
32 changes: 32 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"parser": "@typescript-eslint/parser",
"extends": [
"plugin:@typescript-eslint/recommended",
"prettier/@typescript-eslint",
"plugin:react/recommended"
],
"parserOptions": {
"ecmaVersion": 2018,
"ecmaFeatures": {
"jsx": true
},
"sourceType": "module"
},
"rules": {
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-var-requires": "off",
"@typescript-eslint/no-unused-vars": [
"error",
{ "argsIgnorePattern": "^_", "ignoreRestSiblings": true }
],
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/explicit-function-return-type": "off",

"react/prop-types": "off"
},
"settings": {
"react": {
"version": "detect"
}
}
}
72 changes: 72 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# nyc test coverage
.nyc_output

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# Typescript v1 declaration files
typings/

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# dotenv environment variables file
.env.*
!.env.example

# gatsby files
.cache/
public

# Mac files
.DS_Store

# Yarn
yarn-error.log
.pnp/
.pnp.js
# Yarn Integrity file
.yarn-integrity

.vscode
6 changes: 6 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"endOfLine": "lf",
"singleQuote": false,
"tabWidth": 2,
"trailingComma": "all"
}
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) 2019 Emmanuel Pilande

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.
1 change: 1 addition & 0 deletions README.md
12 changes: 12 additions & 0 deletions demo/gatsby-config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
module.exports = {
plugins: [
{
resolve: "gatsby-theme-minimal",
options: {
basePath: "/minimal",
},
},
"gatsby-plugin-typescript",
"gatsby-plugin-emotion",
],
};
24 changes: 24 additions & 0 deletions demo/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"name": "demo",
"private": true,
"version": "1.0.0",
"description": "Demo for gatsby-theme-minimal",
"scripts": {
"dev": "gatsby develop",
"build": "gatsby build",
"serve": "gatsby serve",
"clean": "gatsby clean"
},
"dependencies": {
"@emotion/core": "^10.0.14",
"@emotion/styled": "^10.0.14",
"gatsby": "^2.13.25",
"gatsby-plugin-emotion": "^4.1.2",
"gatsby-plugin-typescript": "^2.1.2",
"gatsby-theme-minimal": "*",
"react": "^16.8.6",
"react-dom": "^16.8.6"
},
"author": "Emmanuel Pilande",
"license": "MIT"
}
28 changes: 28 additions & 0 deletions demo/src/components/GlobalStyles.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import * as React from "react";
import { Global, css } from "@emotion/core";

const GlobalStyles = () => {
return (
<Global
styles={css`
/* * {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
height: 100vh;
font-family: -apple-system, "BlinkMacSystemFont", "Segoe UI", "Roboto",
"Helvetica Neue", "Arial", "Noto Sans", sans-serif,
"Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol",
"Noto Color Emoji";
letter-spacing: 0.1px;
-webkit-font-smoothing: antialiased;
} */
`}
/>
);
};

export default GlobalStyles;
11 changes: 11 additions & 0 deletions demo/src/components/Layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import * as React from "react";
import GlobalStyles from "./GlobalStyles";

const Layout: React.FunctionComponent<{}> = ({ children }) => (
<div>
<GlobalStyles />
{children}
</div>
);

export default Layout;
2 changes: 2 additions & 0 deletions demo/src/components/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export { default as GlobalStyles } from "./GlobalStyles";
export { default as Layout } from "./Layout";
13 changes: 13 additions & 0 deletions demo/src/pages/404.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import * as React from "react";
import { Layout } from "../components";

const NotFound = () => {
return (
<Layout>
<h1>Not Found</h1>
<p>You just hit a route that doesn&#39;t exist...</p>
</Layout>
);
};

export default NotFound;
16 changes: 16 additions & 0 deletions demo/src/pages/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import * as React from "react";
import { Link } from "gatsby";
import { Layout } from "../components";

const HomePage = () => {
return (
<Layout>
<h1>
<pre>Hello, Demo Site</pre>
</h1>
<Link to="/minimal">Theme Page</Link>
</Layout>
);
};

export default HomePage;
4 changes: 4 additions & 0 deletions demo/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"extends": "../tsconfig",
"compilerOptions": {}
}
28 changes: 28 additions & 0 deletions gatsby-theme-minimal/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<div align="center">
<h1>gatsby-starter-theme-ts 🚀</h1>
</div>

<p align="center">
<strong>A starter for creating a Gatsby Theme with TypeScript.</strong>
</p>

## What's in the box?

- [x] TypeScript
- [x] Yarn workspaces
- [x] Minimal Gatsby Theme
- [x] Demo site
- [x] ESLint + Prettier + Husky

## Quick Start

```sh
$ npx gatsby new my-theme https://github.com/epilande/gatsby-starter-theme-ts
$ cd my-theme
```

### Start demo dev environment

```sh
$ yarn dev
```
3 changes: 3 additions & 0 deletions gatsby-theme-minimal/gatsby-config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = () => ({
plugins: ["gatsby-plugin-typescript"],
});
11 changes: 11 additions & 0 deletions gatsby-theme-minimal/gatsby-node.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
const path = require("path");

exports.createPages = ({ actions }, options) => {
const { createPage } = actions;
const { basePath } = options;

createPage({
path: basePath || "/",
component: path.resolve(`${__dirname}/src/pages/index.tsx`),
});
};
Empty file added gatsby-theme-minimal/index.d.ts
Empty file.
1 change: 1 addition & 0 deletions gatsby-theme-minimal/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
// noop
37 changes: 37 additions & 0 deletions gatsby-theme-minimal/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"name": "gatsby-theme-minimal",
"version": "1.0.0",
"description": "A minimal Gatsby Theme",
"main": "index.js",
"types": "index.d.ts",
"scripts": {},
"peerDependencies": {
"gatsby": "^2.13.25",
"react": "^16.8.6",
"react-dom": "^16.8.6"
},
"devDependencies": {
"gatsby": "^2.13.25",
"react": "^16.8.6",
"react-dom": "^16.8.6"
},
"dependencies": {
"gatsby-plugin-typescript": "^2.1.2"
},
"author": "Emmanuel Pilande",
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/epilande/gatsby-theme-minimal.git",
"directory": "gatsby-theme-minimal"
},
"bugs": {
"url": "https://github.com/epilande/gatsby-theme-minimal/issues"
},
"keywords": [
"gatsby",
"gatsby-theme",
"gatsby-plugin",
"react"
]
}
15 changes: 15 additions & 0 deletions gatsby-theme-minimal/src/pages/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import * as React from "react";
import { Link } from "gatsby";

const HomePage = () => {
return (
<div>
<h1>
<pre>Hello, gatsby-theme-minimal</pre>
</h1>
<Link to="/">Back</Link>
</div>
);
};

export default HomePage;
4 changes: 4 additions & 0 deletions gatsby-theme-minimal/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"extends": "../tsconfig",
"compilerOptions": {}
}
Loading

0 comments on commit e7ec6fd

Please sign in to comment.