From 439f786cd96f2a26704bae5d269313a1499b8397 Mon Sep 17 00:00:00 2001 From: Ben Smithett Date: Sat, 11 Jul 2020 22:39:46 +1000 Subject: [PATCH] =?UTF-8?q?snake=5Fcase=20=E2=9E=A1=EF=B8=8F=20camelCase/T?= =?UTF-8?q?itleCase?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .node-version | 2 +- .prettierrc | 7 +++ .storybook/config.js | 2 +- app/README.md | 47 ++++++++++++++++++ app/build.js | 4 +- app/{entry.client.js => client.js} | 6 +-- .../ExampleComponent.js} | 14 +++--- .../ExampleComponent.stories.js | 6 +++ .../ExampleComponent/gunayala.jpg} | Bin .../ExamplePostList.js} | 2 +- .../ExamplePostList.stories.js} | 6 +-- app/components/README.md | 12 ++--- app/components/{global_css.js => cssReset.js} | 2 +- .../welcome_banner/welcome_banner.stories.js | 6 --- ...dration_helpers.js => hydrationHelpers.js} | 0 .../{default_layout.js => DefaultLayout.js} | 0 app/layouts/README.md | 4 +- app/pages/example-post.mdx | 16 +++--- app/pages/index.js | 16 ++---- app/{entry.prerender.js => prerender.js} | 4 +- 20 files changed, 103 insertions(+), 53 deletions(-) create mode 100644 .prettierrc create mode 100644 app/README.md rename app/{entry.client.js => client.js} (86%) rename app/components/{welcome_banner/welcome_banner.js => ExampleComponent/ExampleComponent.js} (62%) create mode 100644 app/components/ExampleComponent/ExampleComponent.stories.js rename app/{images/island.jpg => components/ExampleComponent/gunayala.jpg} (100%) rename app/components/{post_list/post_list.js => ExamplePostList/ExamplePostList.js} (88%) rename app/components/{post_list/post_list.stories.js => ExamplePostList/ExamplePostList.stories.js} (68%) rename app/components/{global_css.js => cssReset.js} (72%) delete mode 100644 app/components/welcome_banner/welcome_banner.stories.js rename app/{hydration_helpers.js => hydrationHelpers.js} (100%) rename app/layouts/{default_layout.js => DefaultLayout.js} (100%) rename app/{entry.prerender.js => prerender.js} (98%) diff --git a/.node-version b/.node-version index 9bbd0cb..d184537 100644 --- a/.node-version +++ b/.node-version @@ -1 +1 @@ -12.16.0 +14.5.0 diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 0000000..b4352dc --- /dev/null +++ b/.prettierrc @@ -0,0 +1,7 @@ +{ + "printWidth": 120, + "quoteProps": "as-needed", + "semi": false, + "singleQuote": true, + "trailingComma": "none" +} diff --git a/.storybook/config.js b/.storybook/config.js index 2cdcd7e..3cc6226 100644 --- a/.storybook/config.js +++ b/.storybook/config.js @@ -2,7 +2,7 @@ import { configure, addDecorator, addParameters } from '@storybook/react' import React from 'react' import {createRenderer} from 'fela' import {RendererProvider} from 'react-fela' -import {cssReset} from '../app/components/global_css' +import cssReset from '../app/components/cssReset' // Setup Fela client runtime const renderer = createRenderer({devMode: true}) diff --git a/app/README.md b/app/README.md new file mode 100644 index 0000000..319f078 --- /dev/null +++ b/app/README.md @@ -0,0 +1,47 @@ +# Tropical's 4 core files + +## `build.js` + +A script run in Node.js that: + +- Uses Webpack to compile `prerender.js` and `client.js` so they can run, respectively, in Node.js and the browser. +- Calls the default export of `prerender.js` to (you guessed it!) prerender your static site. + +## `client.js` + +The JS file loaded by all pages in a `