Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add website #519

Merged
merged 3 commits into from
Jun 14, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions website/.babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"presets": [
[
"babel-preset-gatsby",
{
"targets": {
"browsers": [">0.25%", "not dead", "not ie <=11", "not ie_mob <=11", "not op_mini all"]
}
}
]
],
"plugins": [
[
"@babel/plugin-proposal-pipeline-operator",
{
"proposal": "minimal"
}
]
]
}
19 changes: 19 additions & 0 deletions website/.eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"parser": "@babel/eslint-parser",
"extends": ["eslint:recommended", "plugin:react/recommended", "plugin:react-hooks/recommended"],
"rules": {
"react/prop-types": 0
},
"parserOptions": {
"ecmaVersion": 12
},
"env": {
"browser": true,
"node": true
},
"settings": {
"react": {
"version": "detect"
}
}
}
80 changes: 63 additions & 17 deletions website/.gitignore
Original file line number Diff line number Diff line change
@@ -1,23 +1,69 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# dependencies
/node_modules
/.pnp
.pnp.js
# 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

# testing
/coverage
# Dependency directories
node_modules/
jspm_packages/

# production
/build
# Typescript v1 declaration files
typings/

# misc
# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# dotenv environment variable files
.env*

# gatsby files
.cache/
public

# Mac files
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*
# Yarn
yarn-error.log
.pnp/
.pnp.js
# Yarn Integrity file
.yarn-integrity
5 changes: 5 additions & 0 deletions website/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.cache
package.json
package-lock.json
yarn.lock
public
13 changes: 13 additions & 0 deletions website/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"arrowParens": "always",
"bracketSpacing": true,
"endOfLine": "lf",
"jsxSingleQuote": false,
"printWidth": 100,
"quoteProps": "consistent",
"semi": true,
"singleQuote": true,
"tabWidth": 2,
"tabs": false,
"trailingComma": "all"
}
70 changes: 0 additions & 70 deletions website/README.md

This file was deleted.

3 changes: 3 additions & 0 deletions website/gatsby-browser.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import './src/styles/app.css';

export { wrapRootElement } from './gatsby-ssr';
28 changes: 28 additions & 0 deletions website/gatsby-config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
require('dotenv').config();

module.exports = {
siteMetadata: {
title: `Jotai, primitive and flexible state management for React`,
description: `Jotai takes a bottom-up approach to React state management with an atomic model inspired by Recoil. One can build state by combining atoms and renders are optimized based on atom dependency. This solves the extra re-render issue of React context and avoids requiring the memoization technique.`,
siteUrl: `https://jotai.pmnd.rs`,
},
plugins: [
`gatsby-plugin-react-helmet`,
`gatsby-plugin-postcss`,
`gatsby-plugin-sitemap`,
{
resolve: `gatsby-plugin-google-gtag`,
options: {
trackingIds: ['G-WWJ8XD0QP0'],
gtagConfig: {
anonymize_ip: true,
cookie_expires: 0,
},
pluginConfig: {
head: false,
respectDNT: true,
},
},
},
],
};
12 changes: 12 additions & 0 deletions website/gatsby-node.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
const path = require('path');

exports.onCreateWebpackConfig = ({ actions }) => {
actions.setWebpackConfig({
resolve: {
alias: {
'~atoms': path.resolve(__dirname, 'src/atoms'),
'~components': path.resolve(__dirname, 'src/components'),
},
},
});
};
16 changes: 16 additions & 0 deletions website/gatsby-ssr.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import React from 'react';
import { Provider } from 'jotai';

import { menuAtom, textAtom, countAtom } from '~atoms';

export const wrapRootElement = ({ element }) => (
<Provider
initialValues={[
[menuAtom, false],
[textAtom, 'hello'],
[countAtom, 0],
]}
>
{element}
</Provider>
);
77 changes: 49 additions & 28 deletions website/package.json
Original file line number Diff line number Diff line change
@@ -1,35 +1,56 @@
{
"name": "website",
"version": "0.1.0",
"private": true,
"name": "jotai-website",
"version": "0.0.0",
"description": "👻 Primitive, flexible state management for React",
"homepage": "https://github.com/pmndrs/jotai",
"bugs": "https://github.com/pmndrs/jotai/issues",
"license": "MIT",
"author": "Sophia Michelle Andren <[email protected]> (https://candycode.com/)",
"scripts": {
"start": "yarn develop",
"develop": "gatsby develop",
"build": "gatsby build",
"serve": "gatsby serve",
"clean": "gatsby clean",
"deduplicate": "npx yarn-deduplicate yarn.lock",
"postdeduplicate": "yarn install"
},
"dependencies": {
"@testing-library/jest-dom": "^5.11.4",
"@testing-library/react": "^11.1.0",
"@testing-library/user-event": "^12.1.10",
"classnames": "^2.3.1",
"gatsby": "^3.7.1",
"gatsby-plugin-google-gtag": "^3.7.1",
"gatsby-plugin-postcss": "^4.7.1",
"gatsby-plugin-react-helmet": "^4.7.1",
"gatsby-plugin-sitemap": "^4.3.1",
"gatsby-source-filesystem": "^3.7.1",
"jotai": "^0.16.11",
"prism-react-renderer": "^1.2.1",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-scripts": "4.0.3",
"web-vitals": "^1.0.1"
"react-helmet": "^6.1.0"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"root": true
"devDependencies": {
"@babel/eslint-parser": "^7.14.5",
"@babel/plugin-proposal-pipeline-operator": "^7.14.5",
"@tailwindcss/forms": "^0.3.3",
"autoprefixer": "^10.2.6",
"babel-preset-gatsby": "^1.7.1",
"eslint": "^7.28.0",
"eslint-plugin-react": "^7.24.0",
"eslint-plugin-react-hooks": "^4.2.0",
"postcss": "^8.3.2",
"postcss-import": "^14.0.2",
"postcss-loader": "^6.1.0",
"postcss-nested": "^5.0.5",
"prettier": "^2.3.1",
"tailwindcss": "^2.1.4"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}
"private": true,
"browserslist": [
">0.25%",
"not dead",
"not ie <=11",
"not ie_mob <=11",
"not op_mini all"
]
}
8 changes: 8 additions & 0 deletions website/postcss.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module.exports = () => ({
plugins: [
require('postcss-import'),
require('postcss-nested'),
require('tailwindcss'),
require('autoprefixer'),
],
});
Binary file removed website/public/favicon.ico
Binary file not shown.
Loading