Skip to content
This repository was archived by the owner on Feb 27, 2024. It is now read-only.

Commit df8e8ee

Browse files
committed
Merge branch 'staging' into develop
2 parents d21353a + 591630d commit df8e8ee

File tree

24 files changed

+818
-696
lines changed

24 files changed

+818
-696
lines changed

.env.sample

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,35 @@
1+
# Tells next.js we're in development mode
12
VERCEL_ENV="development"
3+
4+
# Allows node to work with local self-signed certificates.
25
NODE_TLS_REJECT_UNAUTHORIZED="0"
6+
7+
# Your local WordPress URL.
38
LOCAL_WORDPRESS_API_URL="https://nextjswp.test/"
4-
PROD_WORDPRESS_API_URL="https://myproductionwordpress.com/"
9+
10+
# Your development WordPress URL.
11+
DEV_WORDPRESS_API_URL="https://devwordpress.com"
12+
13+
# Your staging WordPress URL.
14+
STAGING_WORDPRESS_API_URL="https://stagingwordpress.com/"
15+
16+
# Your production WordPress URL.
17+
PROD_WORDPRESS_API_URL="https://productionwordpress.com/"
18+
19+
# This needs to match PREVIEW_SECRET_TOKEN constant in wp-config.php. It can be any random string.
520
WORDPRESS_PREVIEW_SECRET="ANY_RANDOM_STRING_SEE_README"
21+
22+
# Your WordPress username.
623
WORDPRESS_APPLICATION_USERNAME="YOUR_WORDPRESS_USERNAME"
24+
25+
# Your WordPress application password. Requires WordPress 5.6 and above. See https://make.wordpress.org/core/2020/11/05/application-passwords-integration-guide/
726
WORDPRESS_APPLICATION_PASSWORD="YOUR_GENERATED_APPLICATION_PASSWORD"
27+
28+
# Your Algolia index name.
829
NEXT_PUBLIC_LOCAL_ALGOLIA_INDEX_NAME="YOUR_ALGOLIA_INDEX_NAME"
30+
31+
# Your Algolia application ID.
932
NEXT_PUBLIC_ALGOLIA_APPLICATION_ID="YOUR_ALGOLIA_APP_ID"
33+
34+
# Your Algolia search only key.
1035
NEXT_PUBLIC_ALGOLIA_SEARCH_ONLY_KEY="YOUR_ALGOLIA_SEARCH_ONLY_KEY"

.github/CONTRIBUTING.md

Lines changed: 64 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,72 @@
1-
Thanks for contributing — you rock! 🤘
1+
# Thanks for contributing — you rock! 🤘 <!-- omit in toc -->
22

3-
## Maintainers
3+
- [Development](#development)
4+
- [Git Workflow](#git-workflow)
5+
- [Deployments](#deployments)
6+
- [Storybook](#storybook)
7+
- [Coding standards](#coding-standards)
8+
- [Tips to help your PR get approved](#tips-to-help-your-pr-get-approved)
9+
- [Submitting bug reports and feature requests](#submitting-bug-reports-and-feature-requests)
410

5-
This repo is maintained by [WebDevStudios](https://webdevstudios.com).
11+
## Development
612

7-
## Submitting issues
13+
### Git Workflow
814

9-
Before submitting your issue, make sure it has not been discussed earlier. You can search for existing tickets [here](https://github.com/WebDevStudios/nextjs-wordpress-starter/issues).
15+
1. Create a `feature` branch off `staging`
16+
2. Work locally adhereing to coding standards
17+
3. When ready, open a draft Pull Request on Github
18+
4. When finished, fill out the PR template and publish your PR
19+
5. Your PR must pass assertions and deploy successfully
20+
6. After peer review, the PR will be merged back into `staging`
21+
7. Repeat ♻️
1022

11-
## Contributing code
23+
### Deployments
1224

13-
Found a bug you can fix? Fantastic! Patches are always welcome. Here's a few tips for crafting a great pull request:
25+
[Vercel](https://nextjs-wordpress-starter-gregrickaby.webdevstudios.vercel.app) is connected to this Github repository and will automatically build and deploy. Learn more about [Vercel + Github integration](https://vercel.com/docs/git/vercel-for-github).
1426

15-
- Include the purpose of your PR. Be explicit about the issue your PR solves. Fill out the Pull Request template completely.
16-
- Reference any existing issues that relate to your PR. This allows everyone to easily see all related discussions.
27+
### Storybook
1728

18-
By contributing code to Kindergarten Flashcards, you grant its use under the [GNU General Public License v2 (or later)](LICENSE).
29+
To work with Storybook on your Local, run the following command:
30+
31+
```bash
32+
yarn storybook
33+
```
34+
35+
Stories are written in `.mdx` and should be placed next to the component. Learn more about [Storybook](https://storybook.js.org/).
36+
37+
## Coding standards
38+
39+
Pull requests _must pass_ all assertions and component changes will be reviewed in Chromatic prior to consideration.
40+
41+
### Tips to help your PR get approved
42+
43+
1. Make sure your code editor supports real-time linting.
44+
2. JSDocs are important and must be completely filled out.
45+
3. Run `yarn build && yarn start` before submitting your PR, to ensure a build will be successful
46+
4. Be courteous
47+
48+
In addition to real-time linting, you could run the following commands in your terminal (these commands are also used by Husky during a commit!)
49+
50+
Lint JavaScript:
51+
52+
```bash
53+
yarn run lint:js
54+
```
55+
56+
Lint CSS:
57+
58+
```bash
59+
yarn run lint:css
60+
```
61+
62+
Format your code:
63+
64+
```bash
65+
yarn run format
66+
```
67+
68+
## Submitting bug reports and feature requests
69+
70+
Before submitting an issue or making a feature request, please search for existing [issues](https://github.com/WebDevStudios/nextjs-wordpress-starter/issues) or look at our [Github Discussions](https://github.com/WebDevStudios/nextjs-wordpress-starter/discussions).
71+
72+
If you do fill out a bug report, be sure to fill out the report completely!

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
---
8+
9+
Thanks for taking the time to file a bug report! Please fill out this form as completely as possible.
10+
11+
If you leave out sections there is a high likelihood it will be moved to our [GitHub Discussions](https://github.com/WebDevStudios/nextjs-wordpress-starter/discussions).
12+
13+
**Describe the bug**
14+
A clear and concise description of what the bug is.
15+
16+
**To Reproduce**
17+
Steps to reproduce the behavior:
18+
19+
1. Go to '...'
20+
2. Click on '....'
21+
3. Scroll down to '....'
22+
4. See error
23+
24+
**Expected behavior**
25+
A clear and concise description of what you expected to happen.
26+
27+
**Screenshots**
28+
If applicable, add screenshots to help explain your problem.
29+
30+
**Desktop (please complete the following information):**
31+
32+
- OS: [e.g. iOS]
33+
- Browser [e.g. chrome, safari]
34+
- Version [e.g. 22]
35+
36+
**Smartphone (please complete the following information):**
37+
38+
- Device: [e.g. iPhone6]
39+
- OS: [e.g. iOS8.1]
40+
- Browser [e.g. stock browser, safari]
41+
- Version [e.g. 22]
42+
43+
**Additional context**
44+
Add any other context about the problem here.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
---
8+
9+
**Please create your feature request as a [GitHub Discussion](https://github.com/WebDevStudios/nextjs-wordpress-starter/discussions).**
10+
11+
Thank you!

README.md

Lines changed: 33 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -25,19 +25,15 @@ https://nextjs-wordpress-starter-staging.vercel.app/
2525
- [Dependencies](#dependencies-1)
2626
- [Install](#install-1)
2727
- [Enable Previews](#enable-previews)
28-
- [💻 Frontend Development](#-frontend-development)
29-
- [Git Workflow](#git-workflow)
30-
- [Deployments](#deployments)
31-
- [Storybook](#storybook)
32-
- [WebDevStudios Specific Info](#webdevstudios-specific-info)
28+
- [💻 WebDevStudios Specific Info](#-webdevstudios-specific-info)
3329
- [WordPress Github](#wordpress-github)
3430
- [WP Engine](#wp-engine-1)
3531
- [Chromatic](#chromatic-1)
3632
- [1Password](#1password)
3733
- [Migrate DB Pro](#migrate-db-pro)
3834
- [Algolia](#algolia-1)
3935
- [Copy WP Engine Environments](#copy-wp-engine-environments)
40-
- [:octocat: Contributing](#octocat-contributing)
36+
- [:octocat: Development and Contributing](#octocat-development-and-contributing)
4137

4238
---
4339

@@ -126,7 +122,9 @@ yarn
126122

127123
**Step 4: Setup ENV Variables**
128124

129-
ENV variables are like constants in `wp-config.php`. Copy the sample ENV file, then add your credentials:
125+
ENV variables are like constants in `wp-config.php`. They're required in order for authentication and 3rd party services to work.
126+
127+
Copy the [sample ENV file](https://github.com/WebDevStudios/nextjs-wordpress-starter/blob/staging/.env.sample), then modify it to match your credentials:
130128

131129
```bash
132130
cp .env.sample .env
@@ -138,28 +136,40 @@ cp .env.sample .env
138136

139137
<details>
140138

141-
The following steps require A) access to a Vercel account and B) assumes the ENV vars are already set up on Vercel. If you need access to the WDS Team account on Vercel, please reach out to Greg.
139+
The preferred workflow is to add ENV variables to Vercel first, then pull them down.
140+
141+
**Step 1: Add ENV vars to Vercel**
142+
143+
Go to:
144+
145+
```text
146+
Your Project --> Settings --> Environment Variables
147+
```
148+
149+
![vercel settings](https://dl.dropbox.com/s/7ljvynnez0c5q8y/Screen%20Shot%202021-01-29%20at%2014.07.58.png?dl=0)
142150

143-
**Step 1: Install the [Vercel CLI](https://vercel.com/download)**
151+
**Step 2: Install the [Vercel CLI](https://vercel.com/download)**
144152

145153
```bash
146154
npm i -g vercel
147155
```
148156

149-
**Step 2: Initialize Vercel**
157+
**Step 3: Initialize Vercel**
158+
159+
Answer the questions in the command line when prompted.
150160

151161
```bash
152162
vercel init
153163
```
154164

155-
Answer the questions in the command line when prompted.
156-
157-
**Step 3: Pull down the ENV variables**
165+
**Step 4: Pull down the ENV variables**
158166

159167
```bash
160168
vercel env pull
161169
```
162170

171+
Now Next.js has what it needs to talk to 3rd party services.
172+
163173
</details>
164174

165175
---
@@ -195,41 +205,15 @@ define('PREVIEW_SECRET_TOKEN', 'ANY_RANDOM_STRING');
195205

196206
**Step 4: Start the `nextjs-wp` site**
197207

198-
**Note:** Make sure your local URL matches the `LOCAL_WORDPRESS_API_URL` in the frontend `.env` file!
199-
200208
### Enable Previews
201209

202-
To enable previews, you'll need both a `PREVIEW_SECRET_TOKEN` constant in `wp-config.php` and `WORDPRESS_PREVIEW_SECRET` ENV variable in `.env`. The token can be any random string so long as they match.
210+
To enable previews, you'll need both a `PREVIEW_SECRET_TOKEN` constant in `wp-config.php` and `WORDPRESS_PREVIEW_SECRET` ENV variable in `.env`.
203211

204-
---
212+
The token can be any random string as long as they match.
205213

206-
## 💻 Frontend Development
207-
208-
### Git Workflow
209-
210-
1. Create a `feature` branch off `staging`
211-
2. Work locally adhereing to coding standards
212-
3. When ready, open a draft Pull Request on Github
213-
4. When finished, fill out the PR template and publish your PR
214-
5. Your PR must pass assertions and deploy successfully
215-
6. After peer review, the PR will be merged back into `staging`
216-
7. Repeat ♻️
217-
218-
### Deployments
219-
220-
[Vercel](https://nextjs-wordpress-starter-gregrickaby.webdevstudios.vercel.app) is connected to this Github repository and will automatically build and deploy. Learn more about [Vercel + Github integration](https://vercel.com/docs/git/vercel-for-github).
221-
222-
### Storybook
223-
224-
To work with Storybook on your Local, run the following command:
225-
226-
```bash
227-
yarn storybook
228-
```
229-
230-
Stories are written in `.mdx` and should be placed next to the component. Learn more about [Storybook](https://storybook.js.org/).
214+
---
231215

232-
## WebDevStudios Specific Info
216+
## 💻 WebDevStudios Specific Info
233217

234218
The following information pertains to internal tools and workflows at WebDevStudios.
235219

@@ -293,6 +277,10 @@ WP Engine supports [copying environments](https://wpengine.com/support/copy-site
293277

294278
---
295279

296-
## :octocat: Contributing
280+
## :octocat: Development and Contributing
281+
282+
At WebDevStudios we are committed to open-source technologies and welcome feedback, [discussions](https://github.com/WebDevStudios/nextjs-wordpress-starter/discussions), and contributions from the community.
283+
284+
Please see [CONTRIBUTING.md](https://github.com/WebDevStudios/nextjs-wordpress-starter/blob/staging/.github/CONTRIBUTING.md) for more info on how to get started.
297285

298-
[Contributions](https://github.com/WebDevStudios/nextjs-wordpress-starter/blob/main/.github/CONTRIBUTING.md) are welcome. 🍻
286+
Stay safe! 🍻

components/atoms/Columns/Columns.js

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
import cn from 'classnames'
2+
import PropTypes from 'prop-types'
3+
import React from 'react'
4+
import styles from './Columns.module.css'
5+
6+
/**
7+
* Render the Columns component.
8+
*
9+
* @param {object} props Container component props.
10+
* @param {string} props.id Optional ID/Anchor.
11+
* @param {string} props.className Optional className.
12+
* @param {string} props.columnCount Total number of columns.
13+
* @param {object} props.children React children.
14+
* @return {Element} The Columns component.
15+
*/
16+
export default function Columns({id, className, columnCount, children}) {
17+
return (
18+
<div
19+
id={id || null}
20+
className={cn(
21+
styles.columns,
22+
columnCount && styles[`columns-${columnCount}`],
23+
className
24+
)}
25+
>
26+
{children && children}
27+
</div>
28+
)
29+
}
30+
31+
Columns.propTypes = {
32+
id: PropTypes.string,
33+
className: PropTypes.string,
34+
columnCount: PropTypes.number,
35+
children: PropTypes.node
36+
}
37+
Columns.defaultProps = {
38+
columnCount: 3
39+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
.columns {
2+
@apply grid gap-16 grid-cols-3;
3+
4+
&.columns-1 {
5+
@apply grid-cols-1;
6+
}
7+
8+
&.columns-2 {
9+
@apply grid-cols-2;
10+
}
11+
12+
&.columns-3 {
13+
@apply grid-cols-3;
14+
}
15+
16+
&.columns-4 {
17+
@apply grid-cols-4;
18+
}
19+
20+
&.columns-5 {
21+
@apply grid-cols-5;
22+
}
23+
24+
&.columns-6 {
25+
@apply grid-cols-6;
26+
}
27+
}

components/atoms/Columns/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export {default} from './Columns'

0 commit comments

Comments
 (0)