Skip to content

Commit

Permalink
Merge pull request #16 from cjambrosi/feat/package-2
Browse files Browse the repository at this point in the history
Feat/package 2
  • Loading branch information
cjambrosi authored Aug 3, 2023
2 parents 5ad7062 + 7f5e9a3 commit c2dfb1d
Show file tree
Hide file tree
Showing 11 changed files with 6,952 additions and 17 deletions.
44 changes: 40 additions & 4 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,42 @@
node_modules
dist
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# next.js
.next
build
/.next/
/out/

# production
/build

# misc
.DS_Store
*.pem

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

# local env files
.env.local
.env.development.local
.env.test.local
.env.production.local

# vercel
.vercel

# changelog
CHANGELOG.md

# other folders
dist
public
coverage
4 changes: 1 addition & 3 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,11 @@
[//]: <> (List the main changes made in this PR. It might be helpful to list important commits here.)

<!--
Example:
- feat: description
- fix: description
- docs(readme): description
-->

## Expected Behavior
Expand All @@ -39,7 +37,7 @@ Example:

[//]: <> (Check the items as you complete the PR. This serves as a guide for you and reviewers.)

- [ ] I have read all the [contribution](../CONTRIBUTING.md) requirements.
- [ ] I have read all the [contribution](https://github.com/cjambrosi/ts-nextjs-boilerplate-starter/blob/main/CONTRIBUTING.md) requirements.
- [ ] Updated the documentation (if necessary).
- [ ] Commits follow the [conventional commits](https://www.conventionalcommits.org)
- [ ] Removed dead code or unnecessary comments.
Expand Down
41 changes: 41 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Code Check

on:
push:
branches:
- main
pull_request: {}

concurrency:
group: ${{ github.job }}-${{ github.ref }}
cancel-in-progress: true

jobs:
lint:
name: ESLint, TypeScript, Prettier and Unit Test
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v2

- name: Setup node
uses: actions/setup-node@v3
with:
node-version: 18

- name: Download dependencies
uses: u0reo/npm-install@fix/restore-failure
with:
useRollingCache: true

- name: Lint
run: yarn lint:strict

- name: Type check
run: yarn typecheck

- name: Prettier check
run: yarn format:check

- name: Run jest
run: yarn test
19 changes: 19 additions & 0 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: release-please

on:
push:
branches:
- main

permissions:
contents: write
pull-requests: write

jobs:
release-please:
runs-on: ubuntu-latest
steps:
- uses: google-github-actions/release-please-action@v3
with:
release-type: node
package-name: release-please-action
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,4 @@ yarn-error.log*
next-env.d.ts

# lock file
*.lock
*-lock.json
44 changes: 40 additions & 4 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,42 @@
node_modules
dist
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# next.js
.next
build
/.next/
/out/

# production
/build

# misc
.DS_Store
*.pem

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

# local env files
.env.local
.env.development.local
.env.test.local
.env.production.local

# vercel
.vercel

# changelog
CHANGELOG.md

# other folders
dist
public
coverage
16 changes: 12 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,16 @@
"build": "next build",
"start": "next start",
"lint": "next lint",
"type-check": "tsc --pretty --noEmit",
"lint:fix": "eslint src --fix && yarn format",
"lint:strict": "eslint --max-warnings=0 src",
"typecheck": "tsc --pretty --noEmit",
"test": "jest --maxWorkers=50% --silent",
"test:unit": "jest --watch",
"test:staged": "jest --maxWorkers=25% --bail --silent --coverage --coverageReporters=cobertura",
"test:debug": "jest --no-cache --watch",
"test-all": "yarn lint && yarn type-check && yarn test",
"test-all": "yarn lint && yarn typecheck && yarn test",
"format": "prettier -w src",
"format:check": "prettier -c src",
"prepare": "husky install",
"pre-commit": "lint-staged"
},
Expand Down Expand Up @@ -86,8 +90,12 @@
"prettier": "^2.8.8"
},
"lint-staged": {
"src/**/*.{js,jsx,ts,tsx,json,css,scss,md}": [
"prettier --write"
"src/**/*.{js,jsx,ts,tsx}": [
"eslint --max-warnings=0",
"prettier -w"
],
"**/*.{json,css,scss,md,webmanifest}": [
"prettier -w"
]
}
}
3 changes: 2 additions & 1 deletion src/themes/styled.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@ interface IColorIntensity {
strongLight?: string;
}

// TODO: Remove ignores
declare module 'styled-components' {
export interface DefaultTheme {
id: string;
name: tThemeName;
fonts: {};
fonts: any; // eslint-disable-line
color: {
black: IColorIntensity;
white: IColorIntensity;
Expand Down
6 changes: 6 additions & 0 deletions src/themes/theme.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
import { DefaultTheme } from 'styled-components/dist/types';

// TODO: Remove ignores
// eslint-disable-next-line
// @ts-ignore
const lightTheme: DefaultTheme = {
id: 'T_001',
name: 'light'
};

// TODO: Remove ignores
// eslint-disable-next-line
// @ts-ignore
const darkTheme: DefaultTheme = {
id: 'T_002',
name: 'dark'
Expand Down
10 changes: 10 additions & 0 deletions src/utils/__tests__/getI18nLocales.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { getI18nLocales } from '@utils/getI18nLocales';

describe('getI18nLocales', () => {
const mockLocales = [{ locale: 'pt-br' }, { locale: 'en' }];
it('Should return the correct locales list', () => {
const locales = getI18nLocales();

expect(locales).toEqual(mockLocales);
});
});
Loading

0 comments on commit c2dfb1d

Please sign in to comment.