-
-
Notifications
You must be signed in to change notification settings - Fork 2
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 a9d881c
Showing
20 changed files
with
8,152 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,3 @@ | ||
module.exports = { | ||
presets: ['babel-preset-gatsby-package'], | ||
}; |
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,44 @@ | ||
version: 2.1 | ||
|
||
defaults: &defaults | ||
docker: | ||
- image: circleci/node | ||
working_directory: ~/repo | ||
|
||
commands: | ||
setup-repo: | ||
steps: | ||
- checkout | ||
- restore_cache: | ||
name: Restore Yarn Package Cache | ||
keys: | ||
- yarn-packages-{{ checksum "yarn.lock" }} | ||
- run: | ||
name: Install Dependencies | ||
command: yarn install --frozen-lockfile | ||
- save_cache: | ||
name: Save Yarn Package Cache | ||
key: yarn-packages-{{ checksum "yarn.lock" }} | ||
paths: | ||
- ~/.cache | ||
|
||
jobs: | ||
validate: | ||
<<: *defaults | ||
steps: | ||
- setup-repo | ||
- run: yarn validate | ||
release: | ||
<<: *defaults | ||
steps: | ||
- setup-repo | ||
- run: yarn semantic-release | ||
|
||
workflows: | ||
version: 2 | ||
validate_and_release: | ||
jobs: | ||
- validate | ||
- release: | ||
requires: | ||
- validate |
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,4 @@ | ||
gatsby-ssr.js | ||
!src/gatsby-ssr.js | ||
theme-hydration-script-tag.js | ||
!src/theme-hydration-script-tag.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,3 @@ | ||
module.exports = { | ||
extends: ['@wkovacs64/eslint-config-react'], | ||
}; |
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,169 @@ | ||
# Created by https://www.gitignore.io/api/osx,node,linux,windows,visualstudiocode | ||
|
||
### Linux ### | ||
*~ | ||
|
||
# temporary files which can be created if a process still has a handle open of a deleted file | ||
.fuse_hidden* | ||
|
||
# KDE directory preferences | ||
.directory | ||
|
||
# Linux trash folder which might appear on any partition or disk | ||
.Trash-* | ||
|
||
# .nfs files are created when an open file is removed but is still being accessed | ||
.nfs* | ||
|
||
### Node ### | ||
# 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 (https://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 | ||
|
||
# Yarn Integrity file | ||
.yarn-integrity | ||
|
||
# dotenv environment variables file | ||
.env | ||
|
||
# parcel-bundler cache (https://parceljs.org/) | ||
.cache | ||
|
||
# next.js build output | ||
.next | ||
|
||
# nuxt.js build output | ||
.nuxt | ||
|
||
# vuepress build output | ||
.vuepress/dist | ||
|
||
# Serverless directories | ||
.serverless | ||
|
||
### OSX ### | ||
# General | ||
.DS_Store | ||
.AppleDouble | ||
.LSOverride | ||
|
||
# Icon must end with two \r | ||
Icon | ||
|
||
# Thumbnails | ||
._* | ||
|
||
# Files that might appear in the root of a volume | ||
.DocumentRevisions-V100 | ||
.fseventsd | ||
.Spotlight-V100 | ||
.TemporaryItems | ||
.Trashes | ||
.VolumeIcon.icns | ||
.com.apple.timemachine.donotpresent | ||
|
||
# Directories potentially created on remote AFP share | ||
.AppleDB | ||
.AppleDesktop | ||
Network Trash Folder | ||
Temporary Items | ||
.apdisk | ||
|
||
### VisualStudioCode ### | ||
.vscode/* | ||
# !.vscode/settings.json | ||
# !.vscode/tasks.json | ||
# !.vscode/launch.json | ||
# !.vscode/extensions.json | ||
|
||
### Windows ### | ||
# Windows thumbnail cache files | ||
Thumbs.db | ||
ehthumbs.db | ||
ehthumbs_vista.db | ||
|
||
# Dump file | ||
*.stackdump | ||
|
||
# Folder config file | ||
[Dd]esktop.ini | ||
|
||
# Recycle Bin used on file shares | ||
$RECYCLE.BIN/ | ||
|
||
# Windows Installer files | ||
*.cab | ||
*.msi | ||
*.msix | ||
*.msm | ||
*.msp | ||
|
||
# Windows shortcuts | ||
*.lnk | ||
|
||
|
||
# End of https://www.gitignore.io/api/osx,node,linux,windows,visualstudiocode | ||
|
||
# Build directory | ||
/public | ||
|
||
# npm | ||
package-lock.json | ||
|
||
# Netlify | ||
.netlify | ||
|
||
# build output | ||
gatsby-ssr.js | ||
!src/gatsby-ssr.js | ||
theme-hydration-script-tag.js | ||
!src/theme-hydration-script-tag.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,3 @@ | ||
package.json | ||
gatsby-ssr.js | ||
theme-hydration-script-tag.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,5 @@ | ||
# Change Log | ||
|
||
The changelog is automatically updated using | ||
[semantic-release](https://github.com/semantic-release/semantic-release). You | ||
can see it on the [releases page](../../releases). |
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,14 @@ | ||
# Contributing | ||
|
||
If you would like to contribute code to this project, you can do so by forking | ||
the repository and sending a pull request. | ||
|
||
When submitting code, please make every effort to follow existing conventions | ||
and style in order to keep the code as readable as possible. This project | ||
roughly adheres to the [Airbnb][airbnb] code style (particularly for linting) | ||
and is formatted using [prettier][prettier]. | ||
|
||
Thank you. | ||
|
||
[airbnb]: https://github.com/airbnb/javascript | ||
[prettier]: https://prettier.io |
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 @@ | ||
The MIT License (MIT) | ||
|
||
Copyright (c) 2019 Justin R. Hall | ||
|
||
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,64 @@ | ||
# [gatsby-plugin-use-dark-mode][home] | ||
|
||
[![npm version][npm-image]][npm-url] | ||
|
||
A [Gatsby][gatsby] plugin to prevent a flash of default styles when using the | ||
[`use-dark-mode`][udm] hook if the user is not using the default theme. | ||
Specifically, this plugin handles the injection of the | ||
[`noflash.js`][udm-noflash] logic. | ||
|
||
## Install | ||
|
||
```sh | ||
yarn add gatsby-plugin-use-dark-mode use-dark-mode | ||
``` | ||
|
||
## Usage | ||
|
||
Add the plugin to your `gatsby-config.js`. | ||
|
||
```js | ||
module.exports = { | ||
plugins: ['gatsby-plugin-use-dark-mode'], | ||
}; | ||
``` | ||
|
||
Follow the [`use-dark-mode`][udm] documentation for further instructions. | ||
|
||
### Advanced Configuration | ||
|
||
If you would like to specify the class names used (which you will also be | ||
passing to [`useDarkMode`][udm-parameters]) or skip the script minification | ||
process, you may do so through plugin options: | ||
|
||
```js | ||
// gatsby-config.js | ||
module.exports = { | ||
plugins: [ | ||
{ | ||
resolve: 'gatsby-plugin-use-dark-mode', | ||
options: { | ||
classNameDark: 'dark-mode', | ||
classNameLight: 'light-mode', | ||
minify: true, | ||
}, | ||
}, | ||
], | ||
}; | ||
``` | ||
|
||
## Limitations | ||
|
||
[`useDarkMode`][udm] can be [configured][udm-parameters] to specify which DOM | ||
element receives the class and to use an alternate storage provider if desired. | ||
This plugin does not currently support those options, so it will only work if | ||
you are using the defaults (`document.body` and `localStorage`). | ||
|
||
[home]: https://github.com/wKovacs64/gatsby-plugin-use-dark-mode | ||
[npm-image]: | ||
https://img.shields.io/npm/v/gatsby-plugin-use-dark-mode.svg?style=flat-square | ||
[npm-url]: https://www.npmjs.com/package/gatsby-plugin-use-dark-mode | ||
[gatsby]: https://www.gatsbyjs.org | ||
[udm]: https://github.com/donavon/use-dark-mode#readme | ||
[udm-noflash]: https://github.com/donavon/use-dark-mode#that-flash | ||
[udm-parameters]: https://github.com/donavon/use-dark-mode#parameters |
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,4 @@ | ||
# Releasing | ||
|
||
This package is released automatically using | ||
[semantic-release](https://github.com/semantic-release/semantic-release). |
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 @@ | ||
module.exports = { | ||
hooks: { | ||
'pre-commit': 'lint-staged', | ||
}, | ||
}; |
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 @@ | ||
// noop |
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,4 @@ | ||
module.exports = { | ||
'*.{js,ts,tsx}': ['prettier --write', 'eslint --fix', 'git add'], | ||
'*.{json,md,yml}': ['prettier --write', 'git add'], | ||
}; |
Oops, something went wrong.