Skip to content

Commit

Permalink
Initial commit from Create Next App
Browse files Browse the repository at this point in the history
  • Loading branch information
vicasas committed Jun 22, 2024
0 parents commit 1017ee5
Show file tree
Hide file tree
Showing 40 changed files with 12,127 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# EditorConfig is awesome: https://editorconfig.org/
root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
insert_final_newline = true
trim_trailing_whitespace = true
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.next
22 changes: 22 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"extends": ["next/core-web-vitals", "plugin:prettier/recommended"],
"overrides": [
// Configuration for testing (Jest)
{
"files": ["**/*.test.ts", "**/*.test.tsx"],
"env": { "jest/globals": true },
"plugins": ["jest", "jest-formatting", "testing-library", "jest-dom"],
"extends": [
"plugin:jest/recommended",
"plugin:jest-formatting/recommended",
"plugin:testing-library/react",
"plugin:jest-dom/recommended"
]
},
// Configuration for e2e testing (Playwright)
{
"files": ["**/*.spec.ts"],
"extends": ["plugin:playwright/recommended"]
}
]
}
53 changes: 53 additions & 0 deletions .github/ISSUE_TEMPLATE/bug.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Bug report 🐛
description: Create a bug report for Next.js Boilerplate.
labels: ['waiting for maintainer']
body:
- type: markdown
attributes:
value: Thanks for contributing by creating an issue! ❤️.
- type: checkboxes
attributes:
label: Latest version
description: We roll bug fixes, performance enhancements, and other improvements into new releases.
options:
- label: I have tested the latest version
required: true
- type: textarea
attributes:
label: 🕹 Steps to reproduce
description: |
**⚠️ Issues that we can't reproduce can't be fixed.**
Please provide a link to a live example and an unambiguous set of steps to reproduce this bug.
value: |
Link to live example: (required)
Steps:
1.
2.
3.
- type: textarea
attributes:
label: 😯 Current behavior
description: Describe what happens instead of the expected behavior.
- type: textarea
attributes:
label: 🤔 Expected behavior
description: Describe what should happen.
- type: textarea
attributes:
label: 🔦 Context
description: What are you trying to accomplish? Providing context helps us come up with a solution that is more useful in the real world.
- type: textarea
attributes:
label: 🌎 Your environment
description: Run `npx next info` and post the results. If you encounter issues with TypeScript please include the used tsconfig.
value: |
<details>
<summary><code>npx next info</code></summary>
```
Don't forget to mention which browser you used.
Output from `npx next info` goes here.
```
</details>
26 changes: 26 additions & 0 deletions .github/ISSUE_TEMPLATE/feature.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Feature request 💄
description: Suggest a new idea for Next.js Boilerplate.
labels: ['waiting for maintainer']
body:
- type: markdown
attributes:
value: Thanks for contributing by creating an issue! ❤️.
- type: checkboxes
attributes:
label: Latest version
description: We roll bug fixes, performance enhancements, and other improvements into new releases.
options:
- label: I have tested the latest version
required: true
- type: textarea
attributes:
label: 💡 Description
description: Describe how it should work.
- type: textarea
attributes:
label: 🛠️ Proposed solution
description: Describe a possible solution or approach to implement the feature.
- type: textarea
attributes:
label: 🌟 Motivation
description: What are you trying to accomplish? Providing context helps us come up with a solution that is more useful in the real world.
9 changes: 9 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<!-- Thanks so much for your PR, your contribution is appreciated! ♥️ -->

- [ ] I have followed (at least) the [PR section of the contributing guide](https://github.com/vicasas/next.js-boilerplate/blob/HEAD/CONTRIBUTING.md#sending-a-pull-request).

<!-- Please provide a brief description of the changes introduced by this PR -->

<!-- If this pull request closes an issue, please mention the issue number below -->

Closes # <!-- Github issue # here -->
139 changes: 139 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
name: CI

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout branch
uses: actions/checkout@v4

- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Build packages
run: npm run build

- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: build-artifacts
path: .next/
retention-days: 1

tests:
name: Tests
runs-on: ubuntu-latest
steps:
- name: Checkout branch
uses: actions/checkout@v4

- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Run tests
run: npm test -- --coverage

- name: Upload Jest report
uses: actions/upload-artifact@v4
if: always()
with:
name: coverage-report
path: coverage/
retention-days: 1

e2e:
name: Playwright
needs: build
timeout-minutes: 5
runs-on: ubuntu-latest
steps:
- name: Checkout branch
uses: actions/checkout@v4

- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Download build artifacts
uses: actions/download-artifact@v4
with:
name: build-artifacts
path: .next/

- name: Install Playwright Browsers
run: npx playwright install --with-deps

- name: Run Playwright tests
run: npx playwright test

- name: Upload Playwright Report
uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report
path: playwright-report/
retention-days: 1

eslint:
name: ESLint
runs-on: ubuntu-latest
steps:
- name: Checkout branch
uses: actions/checkout@v4

- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Run ESLint
run: npm run lint

format:
name: Prettier
runs-on: ubuntu-latest
steps:
- name: Checkout branch
uses: actions/checkout@v4

- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Run prettier
run: npm run format
40 changes: 40 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js
.yarn/install-state.gz

# testing
/coverage
/test-results/
/playwright-report/
/blob-report/
/playwright/.cache/

# next.js
/.next/
/out/

# production
/build

# misc
.DS_Store
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# local env files
.env*.local

# vercel
.vercel

# typescript
*.tsbuildinfo
next-env.d.ts
1 change: 1 addition & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
npm run lint-staged
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
18
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.next
6 changes: 6 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"$schema": "https://json.schemastore.org/prettierrc",
"experimentalTernaries": true,
"semi": false,
"singleQuote": true
}
11 changes: 11 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"recommendations": [
"esbenp.prettier-vscode",
"dbaeumer.vscode-eslint",
"editorconfig.editorconfig",
"gruntfuggly.todo-tree",
"ms-playwright.playwright",
"github.vscode-github-actions",
"yoavbls.pretty-ts-errors"
]
}
17 changes: 17 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"typescript.tsdk": "node_modules/typescript/lib",
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.codeActionsOnSave": {
"source.fixAll": "explicit",
"source.fixAll.eslint": "explicit"
},
"todo-tree.general.tags": [
"BUG", // Used to identify bugs in the code.
"HACK", // Used to indicate temporary solutions.
"FIXME", // Used to mark code that needs fixing.
"TODO", // Used for pending tasks.
"XXX", // Used for critical or risky points in the code.
"[ ]", // Used for tasks to be done.
"[X]" // Used for completed tasks.
]
}
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Changelog

All notable changes to this project will be documented in this file.
Loading

0 comments on commit 1017ee5

Please sign in to comment.