Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
anna-liepina committed Jan 14, 2024
0 parents commit d0d3266
Show file tree
Hide file tree
Showing 185 changed files with 52,662 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .contentful/vault-secrets.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
version: 1
services:
github-action:
policies:
- dependabot
- npm-read

18 changes: 18 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# EditorConfig: http://EditorConfig.org

# top-most EditorConfig file
root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false

# Ignore paths
[/.next/**]
15 changes: 15 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
BUNDLE_ANALYZE=false
ENVIRONMENT_NAME=local

# The URL for the domain your app is hosted on (used for generating the urls needed for SEO)
# If you deploy to Vercel or Netlify it is configured through the respective config files (`vercel.json` and `netlify.toml`)
NEXT_PUBLIC_BASE_URL=http://localhost:3000/

# Your current space ID: https://www.contentful.com/help/find-space-id/
CONTENTFUL_SPACE_ID=

# Your current space Content Delivery API access token: https://www.contentful.com/developers/docs/references/content-delivery-api/
CONTENTFUL_ACCESS_TOKEN=

# Your current space Content Preview API access token: https://www.contentful.com/developers/docs/references/content-preview-api/
CONTENTFUL_PREVIEW_ACCESS_TOKEN=
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
scripts/**/*.js
src/**/__generated
117 changes: 117 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
module.exports = {
root: true,
parser: '@babel/eslint-parser',
parserOptions: {
requireConfigFile: false,
},
env: {
browser: true,
commonjs: true,
es6: true,
jest: true,
node: true,
},
plugins: ['react-hooks'],
settings: {
react: {
version: 'detect',
},
},
extends: [
'plugin:prettier/recommended',
'plugin:import/errors',
'plugin:import/warnings',
'plugin:import/typescript',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'plugin:react/recommended',
'plugin:jsx-a11y/recommended',
'plugin:@next/next/recommended',
],
rules: {
'@typescript-eslint/no-var-requires': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-use-before-define': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/no-unused-vars': [
'warn',
{
argsIgnorePattern: '^_|req|res|next|err|ctx|args|context|info',
},
],
'@typescript-eslint/no-object-literal-type-assertion': 'off',
'@typescript-eslint/explicit-member-accessibility': 'off',
'@typescript-eslint/camelcase': 'off',
'@typescript-eslint/no-empty-interface': 'off',
'@typescript-eslint/ban-ts-ignore': 'off',
'prettier/prettier': 'off',
'import/no-named-as-default': 'off',
'import/no-named-as-default-member': 'off',
'import/default': 'off',
'import/named': 'off',
'import/namespace': 'off',
'import/order': [
'warn',
{
groups: ['builtin', 'external', ['parent', 'sibling'], 'index'],
'newlines-between': 'always',
pathGroups: [
{
pattern: '@/**',
group: 'external',
position: 'after',
},
{
pattern: '@test/**',
group: 'external',
position: 'after',
},
],
alphabetize: {
order: 'asc' /* sort in ascending order. Options: ['ignore', 'asc', 'desc'] */,
caseInsensitive: true /* ignore case. Options: [true, false] */,
},
},
],
'jsx-a11y/click-events-have-key-events': 'off',
'jsx-a11y/anchor-is-valid': 'off',
'react/prop-types': 'off',
'react/display-name': 'off',
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'warn',
'react/jsx-uses-react': 'off',
'react/react-in-jsx-scope': 'off',
'react/self-closing-comp': 'warn',
},
overrides: [
{
files: ['**/*.ts?(x)'],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 2018,
sourceType: 'module',
ecmaFeatures: {
jsx: true,
},
// typescript-eslint specific options
warnOnUnsupportedTypeScriptVersion: true,
},
settings: {
'import/parsers': {
'@typescript-eslint/parser': ['.ts', '.tsx'],
},
'import/resolver': {
typescript: {
alwaysTryTypes: true,
},
},
},
},
],
globals: {
React: 'writable',
},
};
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @contentful/team-plato
38 changes: 38 additions & 0 deletions .github/ISSUE_TEMPLATE/bug-report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
name: "\U0001F41B Bug Report"
about: Spotted a bug? Add a report to help us improve this template
title: "\U0001F41B Bug - "
labels: bug, needs triage
---

# Bug report

## Summary

<!--
Please provide us with a brief summary of the bug, a few words will do. Providing screenshots is encouraged
-->

## Environment

<!--
Which browser/operating system did you encounter this bug in?
-->

## Steps to reproduce

<!--
Please provide us the steps for how to reproduce this bug
-->

## Expected results

<!--
What did you expect to experience?
-->

## Actual results

<!--
What did you experience instead of the above?
-->
17 changes: 17 additions & 0 deletions .github/ISSUE_TEMPLATE/feedback.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
name: "\U0001F4AC Give feedback on a component"
about: Give us feedback to help us improve this template
title: "\U0001F4AC Feedback - "
labels: needs triage
---

<!--
🎉❤️ Thank you for taking time to contribute to our template! ❤️🎉
Please use this template for reporting any component feedback.
-->

# Template feedback

<!--
Please provide us with your feedback on the template
-->
31 changes: 31 additions & 0 deletions .github/ISSUE_TEMPLATE/proposal.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
name: "\U0001F4A1 Proposal"
about: Want to extend the template or modify existing functionality? Send us a proposal
title: "\U0001F4A1 Proposal - "
labels: needs review, needs triage, proposal
---

<!--
🎉❤️ Thank you for taking time to contribute to the template! ❤️🎉
Please use this template to propose a change you'd like to make
-->

# Template contribution proposal

## The problem

<!--
Start with describing the problem you want to solve
-->

## The proposed solution

<!--
Detail the solution you're proposing to the problem above
-->

## Breaking changes

<!--
Are there any breaking changes with this proposal? If so, please detail them here
-->
33 changes: 33 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
## Purpose of PR

* Stuff that is going to change
* even more interesting stuff that is going to change

<!-- If this has a larger context, uncomment and put it here
_Purpose_
Why do we introduce this change? What problem do we solve? What is the
story/background for it?
-->

<!-- # If there is deployment related information, uncomment and put it here
## Deployment & Risks
* [ ] There is a migration necessary for this to work
* [ ] There is a dependent PR that needs to be deployed first
* [ ] I have read the relevant `readme.md` file(s)
* [ ] Tests are added/updated/not required
* [ ] Tests are passing
* [ ] Usage notes are added/updated/not required
* [ ] Has been tested based on [Contentful's browser support](https://www.contentful.com/faq/about-contentful/#which-browsers-does-contentful-support)
* [ ] Doesn't contain any sensitive information
-->

## Security

_Before you click Merge, take a step back and think how someone could break the [Confidentiality, Integrity and Availability](https://docs.google.com/presentation/d/1YdFlYBLnbNoiSAMOKjopiF4u34StXTK2qYdOLkMsEKo/edit?usp=sharing) of the code you've just written. Are secrets secret? Is there any sensitive information disclosed in logs or error messages? How does your code ensure that information is accurate, complete and protected from modification? Will your code keep Contentful working and functioning?_

<!-- # Reminders
* [Write good pull requests!](https://seesparkbox.com/foundry/github_pull_requests_for_everyone) 👼
* [Be a good reviewer!](https://seesparkbox.com/foundry/stop_giving_depressing_code_reviews) 🧐
-->
39 changes: 39 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
version: 2

registries:
npm-registry-registry-npmjs-org:
type: npm-registry
url: https://registry.npmjs.org
token: '${{secrets.NPM_REGISTRY_REGISTRY_NPMJS_ORG_TOKEN}}'

updates:
- package-ecosystem: 'npm'
directory: '/'
schedule:
interval: 'daily'
time: '05:00'
timezone: UTC
commit-message:
prefix: build
include: scope
labels:
- 'dependencies'
- 'dependabot'
open-pull-requests-limit: 2
reviewers:
- 'contentful/team-tolkien'
registries:
- npm-registry-registry-npmjs-org
allow:
- dependency-name: '@contentful/live-preview'

- package-ecosystem: github-actions
directory: '/'
schedule:
interval: daily
time: '05:00'
timezone: UTC
open-pull-requests-limit: 15
commit-message:
prefix: build
include: scope
15 changes: 15 additions & 0 deletions .github/workflows/auto-merge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: 'dependabot approve-and-request-merge'

on: pull_request_target

jobs:
worker:
permissions:
contents: write
id-token: write
runs-on: ubuntu-latest
if: github.actor == 'dependabot[bot]'
steps:
- uses: contentful/github-auto-merge@v1
with:
VAULT_URL: ${{ secrets.VAULT_URL }}
45 changes: 45 additions & 0 deletions .github/workflows/eslint-tsc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Workflow name
name: ESLint & TSC

# Event for the workflow
on: [pull_request]

# List of jobs
jobs:
eslint-tsc:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Read .nvmrc
run: echo "##[set-output name=NVMRC;]$(cat .nvmrc)"
id: nvm

- name: Use Node.js (.nvmrc)
uses: actions/setup-node@v3
with:
node-version: "${{ steps.nvm.outputs.NVMRC }}"

- name: Get Yarn cache directory
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"

- name: Use Yarn cache
uses: actions/cache@v3.2.3
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }}

- name: Install dependencies
run: yarn install --frozen-lockfile --prefer-offline
# `--prefer-offline` gives cache priority

- name: ESLint
run: yarn lint

- name: TSC
run: yarn type-check
Loading

0 comments on commit d0d3266

Please sign in to comment.