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
Mnigos committed Aug 9, 2024
1 parent ecf45c0 commit b2101d6
Show file tree
Hide file tree
Showing 38 changed files with 848 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = false
insert_final_newline = false
1 change: 1 addition & 0 deletions .eslintcache
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[{"/Users/igormakowski/Documents/repositories/rigtch/rigtch-fm-www/app/components/items/list/items-list.tsx":"1","/Users/igormakowski/Documents/repositories/rigtch/rigtch-fm-www/app/components/ui/use-toast.ts":"2","/Users/igormakowski/Documents/repositories/rigtch/rigtch-fm-www/app/utils/formatters/format-search-params.ts":"3","/Users/igormakowski/Documents/repositories/rigtch/rigtch-fm-www/app/profile/[id]/@top/@albums/page.tsx":"4","/Users/igormakowski/Documents/repositories/rigtch/rigtch-fm-www/app/profile/[id]/@top/@artists/page.tsx":"5","/Users/igormakowski/Documents/repositories/rigtch/rigtch-fm-www/app/profile/[id]/@top/@genres/page.tsx":"6","/Users/igormakowski/Documents/repositories/rigtch/rigtch-fm-www/app/profile/[id]/@top/@tracks/page.tsx":"7","/Users/igormakowski/Documents/repositories/rigtch/rigtch-fm-www/app/profile/[id]/top/albums/page.tsx":"8","/Users/igormakowski/Documents/repositories/rigtch/rigtch-fm-www/app/profile/[id]/top/artists/page.tsx":"9","/Users/igormakowski/Documents/repositories/rigtch/rigtch-fm-www/app/profile/[id]/top/genres/page.tsx":"10","/Users/igormakowski/Documents/repositories/rigtch/rigtch-fm-www/app/profile/[id]/top/tracks/page.tsx":"11","/Users/igormakowski/Documents/repositories/rigtch/rigtch-fm-www/app/profile/components/common/stats-options.tsx":"12","/Users/igormakowski/Documents/repositories/rigtch/rigtch-fm-www/app/profile/utils/validators/validate-time-range.ts":"13"},{"size":3895,"mtime":1722931780109,"results":"14","hashOfConfig":"15"},{"size":4108,"mtime":1722931766429,"results":"16","hashOfConfig":"15"},{"size":314,"mtime":1722931727137,"results":"17","hashOfConfig":"15"},{"size":1862,"mtime":1723198473337,"results":"18","hashOfConfig":"15"},{"size":2291,"mtime":1723198482889,"results":"19","hashOfConfig":"15"},{"size":2161,"mtime":1723198487913,"results":"20","hashOfConfig":"15"},{"size":2281,"mtime":1723198493721,"results":"21","hashOfConfig":"15"},{"size":1504,"mtime":1723198530180,"results":"22","hashOfConfig":"15"},{"size":2465,"mtime":1723198539519,"results":"23","hashOfConfig":"15"},{"size":2001,"mtime":1723198547449,"results":"24","hashOfConfig":"15"},{"size":2472,"mtime":1723198554446,"results":"25","hashOfConfig":"15"},{"size":1874,"mtime":1723198561802,"results":"26","hashOfConfig":"15"},{"size":1137,"mtime":1723198466029,"results":"27","hashOfConfig":"15"},{"filePath":"28","messages":"29","suppressedMessages":"30","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"nm2al6",{"filePath":"31","messages":"32","suppressedMessages":"33","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"34","messages":"35","suppressedMessages":"36","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"37","messages":"38","suppressedMessages":"39","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"40","messages":"41","suppressedMessages":"42","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"43","messages":"44","suppressedMessages":"45","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"46","messages":"47","suppressedMessages":"48","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"49","messages":"50","suppressedMessages":"51","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"52","messages":"53","suppressedMessages":"54","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"55","messages":"56","suppressedMessages":"57","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"58","messages":"59","suppressedMessages":"60","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"61","messages":"62","suppressedMessages":"63","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"64","messages":"65","suppressedMessages":"66","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"/Users/igormakowski/Documents/repositories/rigtch/rigtch-fm-www/app/components/items/list/items-list.tsx",[],[],"/Users/igormakowski/Documents/repositories/rigtch/rigtch-fm-www/app/components/ui/use-toast.ts",[],["67"],"/Users/igormakowski/Documents/repositories/rigtch/rigtch-fm-www/app/utils/formatters/format-search-params.ts",[],[],"/Users/igormakowski/Documents/repositories/rigtch/rigtch-fm-www/app/profile/[id]/@top/@albums/page.tsx",[],[],"/Users/igormakowski/Documents/repositories/rigtch/rigtch-fm-www/app/profile/[id]/@top/@artists/page.tsx",[],[],"/Users/igormakowski/Documents/repositories/rigtch/rigtch-fm-www/app/profile/[id]/@top/@genres/page.tsx",[],[],"/Users/igormakowski/Documents/repositories/rigtch/rigtch-fm-www/app/profile/[id]/@top/@tracks/page.tsx",[],[],"/Users/igormakowski/Documents/repositories/rigtch/rigtch-fm-www/app/profile/[id]/top/albums/page.tsx",[],[],"/Users/igormakowski/Documents/repositories/rigtch/rigtch-fm-www/app/profile/[id]/top/artists/page.tsx",[],[],"/Users/igormakowski/Documents/repositories/rigtch/rigtch-fm-www/app/profile/[id]/top/genres/page.tsx",[],[],"/Users/igormakowski/Documents/repositories/rigtch/rigtch-fm-www/app/profile/[id]/top/tracks/page.tsx",[],[],"/Users/igormakowski/Documents/repositories/rigtch/rigtch-fm-www/app/profile/components/common/stats-options.tsx",[],[],"/Users/igormakowski/Documents/repositories/rigtch/rigtch-fm-www/app/profile/utils/validators/validate-time-range.ts",[],[],{"ruleId":"68","severity":2,"message":"69","line":20,"column":7,"nodeType":null,"messageId":"70","endLine":20,"endColumn":18,"suppressions":"71"},"@typescript-eslint/no-unused-vars","'actionTypes' is assigned a value but only used as a type.","usedOnlyAsType",["72"],{"kind":"73","justification":"74"},"directive",""]
205 changes: 205 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,205 @@
module.exports = {
root: true,
env: {
browser: true,
es2021: true,
node: true,
},
parser: '@typescript-eslint/parser',
parserOptions: {
project: './tsconfig.json',
sourceType: 'module',
ecmaVersion: 'latest',
extraFileExtensions: ['.md', '.mdx'],
ecmaFeatures: {
jsx: true,
},
},
settings: {
react: {
version: 'detect',
},
'import/parsers': {
'@typescript-eslint/parser': ['.ts', '.tsx'],
},
'import/resolver': {
node: {
project: './tsconfig.json',
paths: ['@app/', '@tests/'],
extensions: ['.js', '.ts', '.tsx', '.jsx'],
},
typescript: {
project: './tsconfig.json',
alwaysTryTypes: true,
},
alias: {
map: [
['@app', './app'],
['@tests', './tests'],
],
extensions: ['.ts', '.js', '.tsx', '.jsx'],
},
},
'import/ignore': ['node_modules', '\\.(coffee|scss|css|less|hbs|html)$'],
},
plugins: [
'@typescript-eslint',
'eslint-plugin-import-helpers',
'react-refresh',
'testing-library',
'prettier',
],
extends: [
'plugin:@next/next/recommended',
'plugin:@typescript-eslint/strict-type-checked',
'plugin:@typescript-eslint/stylistic-type-checked',
'plugin:react/recommended',
'plugin:react/jsx-runtime',
'plugin:react-hooks/recommended',
'plugin:eslint-comments/recommended',
'plugin:vitest/recommended',
'plugin:import/recommended',
'plugin:import/typescript',
'plugin:jsx-a11y/recommended',
'plugin:sonarjs/recommended-legacy',
'plugin:unicorn/recommended',
'prettier',
],
overrides: [
{
files: ['**/__tests__/**/*.[jt]s?(x)', '**/?(*.)+(spec|test).[jt]s?(x)'],
extends: ['plugin:testing-library/react', 'plugin:vitest/recommended'],
rules: {
'sonarjs/no-duplicate-string': 'off',
'@typescript-eslint/unbound-method': 'off',
'@typescript-eslint/no-unsafe-member-access': 'off',
},
},
{
files: ['tailwind.config.ts'],
rules: {
'sonarjs/no-duplicate-string': 'off',
},
},
{
files: ['*.cjs'],
rules: {
'unicorn/no-empty-file': 'off',
},
},
{
files: ['**/actions/**/*.ts'],
rules: {
'@typescript-eslint/require-await': 'off',
},
},
{
files: ['app/components/ui/**/*.tsx'],
rules: {
'react-refresh/only-export-components': 'off',
},
},
],
ignorePatterns: [
'**/node_modules/**',
'**/dist/**',
'**/cypress/**',
'README.md',
'next.config.js',
'tailwind.config.ts',
'postcss.config.cjs',
'.eslintrc.cjs',
],
rules: {
'no-undef': 'off',
'prefer-const': 'warn',
'prettier/prettier': 'warn',
'@typescript-eslint/no-unused-vars': [
'error',
{ ignoreRestSiblings: true },
],
'@typescript-eslint/no-unused-vars': 'error',
'@typescript-eslint/no-empty-function': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/no-unsafe-assignment': 'off',
'@typescript-eslint/no-unsafe-argument': 'off',
'@typescript-eslint/no-unsafe-call': 'off',
'@typescript-eslint/no-misused-promises': [
'error',
{ checksVoidReturn: false },
],
'@typescript-eslint/no-base-to-string': [
'error',
{ ignoredTypeNames: ['Url'] },
],
'@typescript-eslint/unbound-method': 'off',
'@typescript-eslint/no-unsafe-member-access': 'off',
'@typescript-eslint/consistent-type-imports': 'warn',
'@typescript-eslint/no-namespace': 'off',
'@typescript-eslint/restrict-template-expressions': [
'error',
{
allowArray: true,
allowNumber: true,
allowRegExp: true,
},
],
'@typescript-eslint/restrict-plus-operands': [
'error',
{
allowNumberAndString: true,
},
],
'unicorn/prefer-node-protocol': 'off',
'unicorn/no-useless-undefined': 'off',
'unicorn/no-unreadable-array-destructuring': 'off',
'unicorn/filename-case': [
'error',
{
cases: {
kebabCase: true,
},
ignore: ['/^$/', 'README.md$'],
},
],
'unicorn/no-null': 'off',
'unicorn/prefer-spread': 'off',
'unicorn/prevent-abbreviations': [
'error',
{
allowList: {
ref: true,
props: true,
Props: true,
param: true,
params: true,
Param: true,
Params: true,
args: true,
env: true,
},
},
],
'import/no-cycle': 'warn',
'import/consistent-type-specifier-style': ['off'],
'import/order': [
'warn',
{
'newlines-between': 'always',
},
],
'react/prop-types': 'off',
'react-refresh/only-export-components': [
'warn',
{
allowConstantExport: true,
allowExportNames: [
'metadata',
'viewport',
'generateMetadata',
'generateViewport',
],
},
],
},
}
28 changes: 28 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: bug
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]

**Additional context**
Add any other context about the problem here.
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: enhancement
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
19 changes: 19 additions & 0 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: 'Setup Node Env, Get & Cache Dependencies'
description: 'Setup Node Env, Get & Cache Dependencies(via yarn) for faster builds'
runs:
using: 'composite'
steps:
- name: Setup node env 🏗
uses: oven-sh/setup-bun@v2

- name: 'Cache Dependencies 🕓'
uses: 'actions/cache@v4'
id: cache-node-modules
with:
path: 'node_modules'
key: deps-node-modules-${{ hashFiles('**/bun.lockb') }}

- name: Install Dependencies 👨🏻‍💻
if: steps.cache-node-modules.outputs.cache-hit != 'true'
run: bun install
shell: bash
66 changes: 66 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: CI

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
build:
name: 'Build 🧱'
runs-on: ubuntu-latest

steps:
- name: Checkout 🛎
uses: actions/checkout@master

- name: Setup 👨🏻‍💻
uses: ./.github/actions/setup

- name: Build Application 🧱
run: bun run build
env:
NEXT_PUBLIC_API_URL: https://api.example.com
AUTH_SPOTIFY_ID: secret
AUTH_SPOTIFY_SECRET: secret
NEXTAUTH_URL: https://example.com
NEXTAUTH_SECRET: secret

lint:
name: 'Lint 🐱'
needs: build
runs-on: ubuntu-latest

steps:
- name: Checkout 🛎
uses: actions/checkout@master

- name: Setup 👨🏻‍💻
uses: ./.github/actions/setup

- name: Lint JS files 🐱
run: bun run lint:js

- name: Lint CSS files 🐱
run: bun run lint:css

test:
name: 'Test 🧪'
needs: build
runs-on: ubuntu-latest

steps:
- name: Checkout 🛎
uses: actions/checkout@master

- name: Setup 👨🏻‍💻
uses: ./.github/actions/setup

- name: Run unit tests 🧪
run: bun run test:coverage

- name: Collect coverage
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
36 changes: 36 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# 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

# next.js
/.next/
/out/

# production
/build

# misc
.DS_Store
*.pem

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

# env files (can opt-in for commiting if needed)
.env*

# vercel
.vercel

# typescript
*.tsbuildinfo
next-env.d.ts
4 changes: 4 additions & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

bun run commitlint --edit $1
Loading

0 comments on commit b2101d6

Please sign in to comment.