-
Create a Github repository.
Setup a Github repository for the project
-
Create a Gatsby-ts site.
Use the Gatsby CLI to create a new site, specifying the minimal TypeScript starter.
# create a new Gatsby site using the minimal TypeScript starter npm init gatsby -y -ts my-site-name
Navigate to newly created folder
cd my-site-name
-
Create a .nvmrc with a value of "16" on line 1.
16;
-
Install global yarn(if not already).
delete package-lock.json
-
Install current dependencies
nvm use yarn install
-
Push the starter Gatsby site to the Github repository.
Use Github to create a repository.
# create a origin path to the Github URL and push git remote add origin 'github repository URL' git branch -M main git push -u origin main
-
eslint dependencies.
# install eslint dependencies yarn add eslint prettier eslint-config-prettier eslint-plugin-import eslint-plugin-jsx-a11y eslint-plugin-prettier eslint-plugin-react eslint-plugin-react-hooks eslint-plugin-simple-import-sort eslint-plugin-unused-imports
# install eslint ts types yarn add -D @typescript-eslint/eslint-plugin @typescript-eslint/parser
-
tailwindcss dependencies
# install tailwind dependencies yarn add tailwind @tailwindcss/aspect-ratio @tailwindcss/forms @tailwindcss/line-clamp @tailwindcss/typography autoprefixer classnames
# install tailwind ts types yarn add -D @types/tailwindcss
-
Gatsby plugins
# install ease of life gatsby plugins yarn add gatsby-plugin-root-import gatsby-source-filesystem
# install ts types for Gatsby Link yarn add -D @types/reach__router
-
Other plugins that are needed
# install the rest of the other plugins yarn add @babel/plugin-transform-runtime @headlessui/react @testing-library/jest-dom slugify
# install other ts types yarn add -D @types/jest
-
Lets push the new dependencies up to main and keep a good track of operations
git add . git commit -m "added all starter dependencies" git push
-
Copy over .gitignore contents in the root of the project with Gatsby's
# Logs logs *.log # Runtime data pids *.pid *.seed # Directory for instrumented libs generated by jscoverage/JSCover lib-cov # Coverage directory used by tools like istanbul coverage junit.xml # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) .grunt # node-waf configuration .lock-wscript # Compiled binary addons (http://nodejs.org/api/addons.html) build/Release # Dependency directory # https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git node_modules integration-tests/gatsby-cli/execution-folder/* *.un~ dist bin/published.js # Build Path of Test Fixtures test/**/public .gatsby-context.js .DS_Store public/ node_modules/ e2e-tests/gatsby-pnp/ __diff_output__/ .cache/ .netlify .Rhistory # IDE specific .idea/ *.sw* # misc .serverless/ .eslintcache scripts/.env # lock files yarn.lock package-lock.json # ignore any lock file other than main lock file !/yarn.lock # starters are special; we want to persist the lock files !starters/*/package-lock.json !themes/gatsby-starter-blog-theme/package-lock.json !themes/gatsby-starter-notes-theme/package-lock.json !themes/gatsby-starter-theme/package-lock.json !themes/gatsby-starter-theme-workspace/package-lock.json .parcel-cache # yarn yarn-error.log
-
Create a folder in the root of the project directory.
-
.vscode
-
Create a files in .vscode
{ "version": "0.2", "ignorePaths": [], "dictionaryDefinitions": [], "dictionaries": [], "words": [ "gtag", "headlessui", "heroicons", "tailwindcss", "typecheck" ], "ignoreWords": [], "import": [] }
{ "editor.codeActionsOnSave": { "source.fixAll.eslint": true }, "typescript.tsdk": "node_modules/typescript/lib", "search.exclude": { "public/**": true, "node_modules/**": true }, "files.exclude": { "**/.cache": false, "**/.DS_Store": true, "**/.git": true, "**/.husky": true, "**/.idea": true, "**/public": true, "**/Thumbs.db": true, "node_modules/**": true }, "javascript.preferences.importModuleSpecifier": "shortest" }
-
-
-
Create files in the root of the project directory
-
Learn more
Deploy this starter with one click on Gatsby Cloud: