Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NEXT] - add lint check #46

Merged
merged 7 commits into from
Dec 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions .github/workflows/lint-on-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: 'Lint Check'

on:
pull_request:
branches: [ next ]

jobs:
lint-job:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Use Node.js
uses: actions/setup-node@v2
with:
node-version: '20.10'

- name: Cache Node.js modules
uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.OS }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.OS }}-node-
${{ runner.OS }}-

- name: Install Dependencies
run: npm ci

- name: Run Linter
run: npm run lint
23 changes: 20 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,19 @@
This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app).
# Dolar En Bancos

## Pre-requisites

- [Doppler (for secrets management)](https://doppler.com/)
- [Node.js](https://nodejs.org/en/) **v20.10**

## Getting Started

First, run the development server:
First, prepare environment running:

```bash
npm run prepare
```

Then run the development server:

```bash
npm run dev
Expand All @@ -12,4 +23,10 @@ Open [http://localhost:3000](http://localhost:3000) with your browser to see the

You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file.

This project uses [`next/font`](https://nextjs.org/docs/basic-features/font-optimization) to automatically optimize and load Inter, a custom Google Font.
This project uses [`next/font`](https://nextjs.org/docs/basic-features/font-optimization) to automatically optimize and
load Inter, a custom Google Font.

## Environment Variables

We use Doppler to manage secrets. Please request access and run the project with `doppler run -- npm` or
add your own token.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"name": "dolarenbancos",
"version": "0.1.2",
"version": "0.1.4",
"private": true,
"scripts": {
"prepare": "panda codegen",
"prepare": "panda codegen && husky install",
"dev": "rm -rf .next && next dev",
"build": "next build",
"start": "next start",
Expand Down
14 changes: 7 additions & 7 deletions src/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import './globals.css'
import type { Metadata } from 'next'
import { Anton, Courier_Prime, Montserrat } from 'next/font/google'
import { ReactNode, Suspense } from 'react'
import type {Metadata} from 'next'
import {Anton, Courier_Prime, Montserrat} from 'next/font/google'
import {ReactNode, Suspense} from 'react'

import {PHProvider, PostHogPageview} from '~/app/providers'
import { meta, Prices } from '~/lib/constants'
import {meta, Prices} from '~/lib/constants'

import { cx } from '../../styled-system/css'
import {cx} from '../../styled-system/css'

const montserrat = Montserrat({
subsets: ['latin'],
Expand All @@ -27,7 +27,7 @@ const courier = Courier_Prime({

export async function generateMetadata (): Promise<Metadata> {
// fetch data
const today: Prices = await fetch(`${ getBaseUrl() }/api/report/now`).then((res) => res.json())
const today: Prices = await fetch(`${getBaseUrl()}/api/report/now`).then((res) => res.json())

return {
title: meta.title,
Expand All @@ -42,7 +42,7 @@ export async function generateMetadata (): Promise<Metadata> {
url: meta.url,
type: 'website',
siteName: meta.title,
images: [`${ getBaseUrl() }/api/og?price=${ today.banxico.buy }`],
images: [`${getBaseUrl()}/api/og?price=${today.banxico.buy}`],
},
} satisfies Metadata
}
Expand Down
Loading