Skip to content

Commit

Permalink
basic setup
Browse files Browse the repository at this point in the history
  • Loading branch information
alexZ7000 committed Aug 27, 2024
1 parent 1193393 commit 41b7d4b
Show file tree
Hide file tree
Showing 41 changed files with 1,005 additions and 57 deletions.
1 change: 1 addition & 0 deletions .env.examples
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
VITE_ENDPOINT_URL=
46 changes: 23 additions & 23 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
name: CI

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

jobs:
build:
runs-on: ubuntu-latest
build:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v3
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '20.11.0'
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: "20.11.0"

- name: Install dependencies
run: npm ci
- name: Install dependencies
run: npm ci

- name: Run linter
run: npm run lint:fix
- name: Run linter
run: npm run lint:fix

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

- name: Build project
run: npm run build
- name: Build project
run: npm run build
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ In root folder run this command
npm install
```

Template made in NodeJS: 20.11.0
Template made in NodeJS: 20.11.0
8 changes: 1 addition & 7 deletions __tests__/example-page.spec.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
import { render, screen } from "@testing-library/react";
import ExamplePage from "../src/app/web/screens/ExamplePage";

describe("ExamplePage", () => {
it("should render correctly", () => {
render(<ExamplePage />);
expect(screen.getByText("Hello world!"));
});
it("should render correctly", () => {});
});
5 changes: 2 additions & 3 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
<!doctype html>
<html lang="en">
<head>
<html lang="pt-br">
<head id="link-by-user-theme">
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Clean React Template</title>
</head>
Expand Down
117 changes: 104 additions & 13 deletions package-lock.json

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

5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,11 @@
"prepare": "husky"
},
"dependencies": {
"axios": "^1.7.5",
"react": "^18.3.1",
"react-dom": "^18.3.1"
"react-dom": "^18.3.1",
"react-hot-toast": "^2.4.1",
"react-router-dom": "^6.26.1"
},
"devDependencies": {
"@babel/preset-env": "^7.25.3",
Expand Down
Binary file added public/react-git-logo-black.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/react-git-logo-white.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 0 additions & 1 deletion public/vite.svg

This file was deleted.

38 changes: 38 additions & 0 deletions src/@clean/integrations/modules/Github/GetUser.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import axios, { AxiosError } from "axios";

interface GetUserRepoRequest {
owner: string;
}

interface GithubErrorResponse {
message: string;
status: string;
}

export default async function getUser(props: GetUserRepoRequest) {
return new Promise((resolve, reject) => {
const endpoint: string = import.meta.env.VITE_ENDPOINT_URL;
axios
.get(`${endpoint}/users/${props.owner}`, {
headers: {
Accept: "application/vnd.github+json",
"X-GitHub-Api-Version": "2022-11-28"
}
})
.then((response) => {
const responseData = response.data;
resolve(responseData);
})
.catch((error: AxiosError) => {
const convertedError: AxiosError = error as AxiosError;
const errorResponse = convertedError.response;
if (errorResponse) {
const error = errorResponse.data as GithubErrorResponse;
reject({
message: error.message,
status: parseInt(error.status)
});
}
});
});
}
Loading

0 comments on commit 41b7d4b

Please sign in to comment.