Skip to content

Commit e3387c6

Browse files
author
Jacob Roman
committed
init commit
0 parents  commit e3387c6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+39780
-0
lines changed

.eslintrc.js

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
module.exports = {
2+
parser: '@typescript-eslint/parser', // Specifies the ESLint parser
3+
extends: [
4+
'eslint:recommended',
5+
'plugin:react/recommended',
6+
'plugin:@typescript-eslint/recommended',
7+
'prettier/@typescript-eslint',
8+
'plugin:prettier/recommended',
9+
],
10+
settings: {
11+
react: {
12+
version: 'detect',
13+
},
14+
},
15+
env: {
16+
browser: true,
17+
node: true,
18+
es6: true,
19+
jest: true,
20+
},
21+
plugins: ['@typescript-eslint', 'react'],
22+
parserOptions: {
23+
ecmaFeatures: {
24+
jsx: true,
25+
},
26+
ecmaVersion: 2018, // Allows for the parsing of modern ECMAScript features
27+
sourceType: 'module', // Allows for the use of imports
28+
},
29+
rules: {
30+
'react/prop-types': 'off', // Disable prop-types as we use TypeScript for type checking
31+
'@typescript-eslint/explicit-function-return-type': 'off',
32+
},
33+
overrides: [
34+
// Override some TypeScript rules just for .js files
35+
{
36+
files: ['*.js'],
37+
rules: {
38+
'@typescript-eslint/no-var-requires': 'off',
39+
},
40+
},
41+
],
42+
};

.gitignore

+69
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
8+
# Runtime data
9+
pids
10+
*.pid
11+
*.seed
12+
*.pid.lock
13+
14+
# Directory for instrumented libs generated by jscoverage/JSCover
15+
lib-cov
16+
17+
# Coverage directory used by tools like istanbul
18+
coverage
19+
20+
# nyc test coverage
21+
.nyc_output
22+
23+
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
24+
.grunt
25+
26+
# Bower dependency directory (https://bower.io/)
27+
bower_components
28+
29+
# node-waf configuration
30+
.lock-wscript
31+
32+
# Compiled binary addons (http://nodejs.org/api/addons.html)
33+
build/Release
34+
35+
# Dependency directories
36+
node_modules/
37+
jspm_packages/
38+
39+
# Typescript v1 declaration files
40+
typings/
41+
42+
# Optional npm cache directory
43+
.npm
44+
45+
# Optional eslint cache
46+
.eslintcache
47+
48+
# Optional REPL history
49+
.node_repl_history
50+
51+
# Output of 'npm pack'
52+
*.tgz
53+
54+
# dotenv environment variable files
55+
.env*
56+
57+
# gatsby files
58+
.cache/
59+
public
60+
61+
# Mac files
62+
.DS_Store
63+
64+
# Yarn
65+
yarn-error.log
66+
.pnp/
67+
.pnp.js
68+
# Yarn Integrity file
69+
.yarn-integrity

.idea/.gitignore

+5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/codeStyles/Project.xml

+29
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/codeStyles/codeStyleConfig.xml

+5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/inspectionProfiles/Project_Default.xml

+6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

+6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/modules.xml

+8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/star-index.iml

+12
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.prettierignore

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.cache
2+
package.json
3+
package-lock.json
4+
public

.prettierrc

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"endOfLine": "lf",
3+
"semi": true,
4+
"singleQuote": true,
5+
"tabWidth": 4,
6+
"trailingComma": "es5",
7+
"bracketSpacing": true,
8+
"arrowParens": "always"
9+
}

LICENSE

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2015 gatsbyjs
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.
22+

README.md

+75
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
<p align="center">
2+
<a href="https://www.gatsbyjs.org">
3+
<img alt="Gatsby" src="https://www.gatsbyjs.org/monogram.svg" width="60" />
4+
</a>
5+
</p>
6+
<h2 align="center">
7+
Gatsby's default starter, but with TypeScript and Tailwind CSS support
8+
</h2>
9+
10+
This starter uses Gatsby's default starter as a base and adds support
11+
for [TypeScript](https://www.typescriptlang.org/) and [Tailwind
12+
CSS](https://tailwindcss.com/) on top. Also, includes support for
13+
unit testing with [Jest](https://jestjs.io/).
14+
15+
- there are 16 new dependencies
16+
- [typescript](https://www.npmjs.com/package/typescript)
17+
- [ts-node](https://www.npmjs.com/package/ts-node)
18+
- [gatsby-plugin-typescript](https://www.npmjs.com/package/gatsby-plugin-typescript)
19+
- [tailwindcss](https://www.npmjs.com/package/tailwindcss)
20+
- [gatsby-plugin-postcss](https://www.npmjs.com/package/gatsby-plugin-postcss)
21+
- [eslint](https://www.npmjs.com/package/eslint)
22+
- [@typescript-eslint/eslint-plugin](https://www.npmjs.com/package/@typescript-eslint/eslint-plugin)
23+
- [@typescript-eslint/parser](https://www.npmjs.com/package/@typescript-eslint/parser)
24+
- [eslint-config-prettier](https://www.npmjs.com/package/eslint-config-prettier)
25+
- [eslint-plugin-prettier](https://www.npmjs.com/package/eslint-plugin-prettier)
26+
- [eslint-plugin-react](https://www.npmjs.com/package/eslint-plugin-react)
27+
- [jest](https://www.npmjs.com/package/jest)
28+
- [babel-jest](https://www.npmjs.com/package/babel-jest)
29+
- [react-test-renderer](https://www.npmjs.com/package/react-test-renderer)
30+
- [babel-preset-gatsby](https://www.npmjs.com/package/babel-preset-gatsby)
31+
- [identity-obj-proxy](https://www.npmjs.com/package/identity-obj-proxy)
32+
- the files in [src/components/](./src/components/) and
33+
[src/pages/](./src/pages/) have been updated with TypeScript support
34+
- the default Gatsby CSS file (layout.css) has been deleted; you'll find
35+
[src/components/main.css](./src/components/main.css) in its place
36+
37+
## 🚀 Quick start
38+
39+
1. **Create a Gatsby site.**
40+
41+
Use the Gatsby CLI to create a new site, specifying this starter.
42+
43+
```shell
44+
# create a new Gatsby site using gatsby-typescript-tailwind-starter
45+
gatsby new my-tswind-starter https://github.com/jagdcake/gatsby-typescript-tailwind-starter
46+
```
47+
48+
1. **Start developing.**
49+
50+
Navigate into your new site’s directory and start it up.
51+
52+
```shell
53+
cd my-tswind-starter/
54+
gatsby develop
55+
```
56+
57+
1. **Open the source code and start editing!**
58+
59+
Your site is now running at `http://localhost:8000`!
60+
61+
_Note: You'll also see a second link: _`http://localhost:8000/___graphql`_. This is a tool you can use to experiment with querying your data. Learn more about using this tool in the [Gatsby tutorial](https://www.gatsbyjs.org/tutorial/part-five/#introducing-graphiql)._
62+
63+
Open the `my-tswind-starter` directory in your code editor of choice and edit `src/pages/index.js`. Save your changes and the browser will update in real time!
64+
65+
## 🎓 Learning Gatsby
66+
67+
Looking for more guidance? Full documentation for Gatsby lives [on the website](https://www.gatsbyjs.org/). Here are some places to start:
68+
69+
- **For most developers, we recommend starting with our [in-depth tutorial for creating a site with Gatsby](https://www.gatsbyjs.org/tutorial/).** It starts with zero assumptions about your level of ability and walks through every step of the process.
70+
71+
- **To dive straight into code samples, head [to our documentation](https://www.gatsbyjs.org/docs/).** In particular, check out the _Guides_, _API Reference_, and _Advanced Tutorials_ sections in the sidebar.
72+
73+
## 💫 Deploy
74+
75+
[![Deploy to Netlify](https://www.netlify.com/img/deploy/button.svg)](https://app.netlify.com/start/deploy?repository=https://github.com/JagdCake/gatsby-typescript-tailwind-starter)

__mocks__/file-mock.js

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module.exports = 'test-file-stub';

__mocks__/gatsby.js

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
const React = require('react');
2+
const gatsby = jest.requireActual('gatsby');
3+
4+
module.exports = {
5+
...gatsby,
6+
graphql: jest.fn(),
7+
Link: jest.fn().mockImplementation(
8+
// these props are invalid for an `a` tag
9+
({
10+
activeClassName,
11+
activeStyle,
12+
getProps,
13+
innerRef,
14+
partiallyActive,
15+
ref,
16+
replace,
17+
to,
18+
...rest
19+
}) =>
20+
React.createElement('a', {
21+
...rest,
22+
href: to,
23+
})
24+
),
25+
StaticQuery: jest.fn(),
26+
useStaticQuery: jest.fn().mockImplementation(() => {
27+
return {
28+
site: {
29+
siteMetadata: {
30+
title: `Starter`,
31+
},
32+
},
33+
placeholderImage: {
34+
childImageSharp: {
35+
fluid: {
36+
aspectRatio: 1,
37+
sizes: `100 200 300`,
38+
src: `base64-encoded-image`,
39+
srcSet: `gatsby-astronaut`,
40+
},
41+
},
42+
},
43+
};
44+
}),
45+
};

gatsby-browser.js

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/**
2+
* Implement Gatsby's Browser APIs in this file.
3+
*
4+
* See: https://www.gatsbyjs.org/docs/browser-apis/
5+
*/
6+
7+
// You can delete this file if you're not using it

0 commit comments

Comments
 (0)