Skip to content

Commit

Permalink
Novo: Adição do deepsource para monitorar falhas no repositório / For…
Browse files Browse the repository at this point in the history
…matação com o Prettier / Linting com o ESLint
  • Loading branch information
gepetojj committed Nov 8, 2021
1 parent 3ed4296 commit 5d18ec4
Show file tree
Hide file tree
Showing 31 changed files with 2,656 additions and 2,795 deletions.
20 changes: 20 additions & 0 deletions .deepsource.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
version = 1

test_patterns = ["tests/**"]

exclude_patterns = [
"public/**",
"dist/**",
"build/**"
]

[[analyzers]]
name = "javascript"
enabled = true

[analyzers.meta]
plugins = ["react"]

[[transformers]]
name = "prettier"
enabled = true
4 changes: 4 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/node_modules
/public
/build
/dist
1 change: 1 addition & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{ "extends": ["react-app"] }
4 changes: 4 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/node_modules
/public
/build
/dist
19 changes: 19 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"arrowParens": "always",
"bracketSpacing": true,
"endOfLine": "crlf",
"htmlWhitespaceSensitivity": "css",
"insertPragma": false,
"jsxSingleQuote": false,
"printWidth": 80,
"proseWrap": "preserve",
"quoteProps": "as-needed",
"requirePragma": false,
"semi": true,
"singleQuote": false,
"tabWidth": 4,
"trailingComma": "es5",
"useTabs": true,
"importOrder": ["^[^./](.*)$", "^[./]"],
"importOrderSeparation": true
}
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,34 +6,34 @@

O MeetScheduler tem como objetivo principal, alertar e abrir automaticamente chamadas do Google Meet.
Por causa de sua facilidade, pode ser usado também para alertar compromissos de outras fontes.
Porém, o MeetScheduler só funciona com atividades rotineiras que acontecem todo determinado dia, e não programadas (com dias específicos).
Porém, o MeetScheduler só funciona com atividades rotineiras que acontecem todo determinado dia, e não com datas específicas.

## Download

Baixe a versão mais recente, clicando [aqui](https://github.com/gepetojj/meetscheduler/releases/latest).
Baixe a versão mais recente, clicando [aqui](https://github.com/gepetojj/meetscheduler/releases/latest).

## Tecnologias
## Tecnologias

Todas as tecnologias e libs estão listadas no [package.json](https://github.com/gepetojj/meetscheduler/blob/master/package.json).
Todas as tecnologias e libs estão listadas no [package.json](https://github.com/gepetojj/meetscheduler/blob/master/package.json).

### Electron
### Electron

Framework de apps nativos.

### React
### React

Framework para interfaces.

## Funcionalidades

* Receba atualizações automáticas.
* Crie compromissos e seja lembrando assim que eles iniciarem.
* Edite-os sem complicações.
* Receba notificações no seu computador quando um compromisso iniciar.
- Receba atualizações automáticas.
- Crie compromissos e seja lembrando assim que eles iniciarem.
- Edite-os sem complicações.
- Receba notificações no seu computador quando um compromisso iniciar.

## Design

O projeto de design foi feito no [Figma](https://www.figma.com/file/qM0LLHndNKCirTJAr7EpdO/MeetScheduler?node-id=4%3A114).
O projeto de design foi feito no [Figma](https://www.figma.com/file/qM0LLHndNKCirTJAr7EpdO/MeetScheduler?node-id=4%3A114).

### Página inicial

Expand Down
9 changes: 6 additions & 3 deletions electron/devElectron.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,12 @@ client.on("connect", () => {
electronStarted = true;
console.log("Starting electron connection...");

childProcess.exec('nodemon --watch "public" --exec "electron public/main.js"', {
windowsHide: true,
});
childProcess.exec(
'nodemon --watch "public" --exec "electron public/main.js"',
{
windowsHide: true,
}
);
}
});

Expand Down
12 changes: 5 additions & 7 deletions electron/main.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import "v8-compile-cache";
import { app, BrowserWindow, Tray, Menu } from "electron";
import { BrowserWindow, Menu, Tray, app } from "electron";
import * as path from "path";
import * as url from "url";
import "v8-compile-cache";

import { config } from "./config";
import { Updater } from "./updater";
Expand All @@ -26,9 +26,7 @@ function createTray() {
},
{
label: "Fechar",
click: () => {
app.quit();
},
click: app.quit,
},
]);

Expand Down Expand Up @@ -73,8 +71,8 @@ function createWindow() {
);
}

window.on("minimize", (event: Electron.Event) => {
event.preventDefault();
window.on("minimize", ({ preventDefault }: Electron.Event) => {
preventDefault();
if (window) {
window.hide();
tray = createTray();
Expand Down
15 changes: 7 additions & 8 deletions electron/updater.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { BrowserWindow, dialog, app } from "electron";
import { autoUpdater } from "electron-updater";
import { BrowserWindow, dialog } from "electron";
import logger from "electron-log";
import { autoUpdater } from "electron-updater";

export class Updater {
constructor(window: BrowserWindow) {
Expand All @@ -9,21 +9,20 @@ export class Updater {
autoUpdater.autoDownload = false;

autoUpdater.on("checking-for-update", () => {
window.setTitle(
`${app.getName()} - Procurando por atualizações...`
);
window.setTitle("MeetScheduler - Procurando por atualizações...");
});

autoUpdater.on("update-available", () => {
dialog
.showMessageBox(window, {
message: `Uma atualização para o ${app.getName()} está disponível.`,
message:
"Uma atualização para o MeetScheduler está disponível.",
type: "info",
buttons: ["Atualizar", "Ignorar"],
title: "Atualização disponível!",
})
.then((response) => {
if (response.response === 0) {
.then(({ response }) => {
if (response === 0) {
window.webContents.emit("update-started");
autoUpdater.downloadUpdate();
}
Expand Down
39 changes: 20 additions & 19 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "meetscheduler",
"description": "Seja lembrado de seus compromissos no Google Meet, com o MeetScheduler.",
"version": "1.6.7",
"version": "1.7.0",
"author": "Gepetojj",
"homepage": "./",
"main": "build/main.js",
Expand All @@ -10,18 +10,15 @@
"start:electron": "ts-node --skip-project \"electron/devElectron.ts\"",
"build": "react-scripts build",
"build:electron": "tsc --project electron/tsconfig.json",
"test": "react-scripts test",
"eject": "react-scripts eject",
"watch:electron": "tsc --watch --project electron/tsconfig.json",
"dev": "concurrently \"yarn watch:electron\" \"yarn start:electron\"",
"dist": "yarn build && yarn build:electron && electron-builder build -w --publish always"
"dist": "yarn build && yarn build:electron && electron-builder build -w --publish always",
"format": "prettier --write .",
"lint": "eslint ."
},
"dependencies": {
"@material-ui/core": "^4.12.3",
"@material-ui/icons": "^4.11.2",
"@testing-library/jest-dom": "^5.11.4",
"@testing-library/react": "^11.1.0",
"@testing-library/user-event": "^12.1.10",
"dayjs": "^1.10.6",
"dotenv": "^10.0.0",
"electron-log": "^4.4.1",
Expand All @@ -32,34 +29,38 @@
"react-dom": "^17.0.2",
"react-icons": "^4.2.0",
"react-router-dom": "^5.2.0",
"react-scripts": "4.0.3",
"react-scripts": "^4.0.3",
"reactjs-popup": "^2.0.5",
"styled-components": "^5.3.0",
"styled-components": "^5.3.3",
"uniqid": "^5.3.0",
"v8-compile-cache": "^2.3.0"
},
"devDependencies": {
"@types/jest": "^27.0.1",
"@trivago/prettier-plugin-sort-imports": "^3.1.0",
"@types/node": "^16.6.1",
"@types/react": "^17.0.18",
"@types/react": "^17.0.34",
"@types/react-beautiful-dnd": "^13.1.1",
"@types/react-dom": "^17.0.9",
"@types/react-dom": "^17.0.11",
"@types/react-router-dom": "^5.1.8",
"@types/styled-components": "^5.1.12",
"@types/styled-components": "^5.1.15",
"@types/uniqid": "^5.3.1",
"@typescript-eslint/eslint-plugin": "^5.3.0",
"@typescript-eslint/parser": "^5.3.0",
"babel-eslint": "^10.1.0",
"concurrently": "^6.2.1",
"electron": "^13.2.0",
"electron-builder": "^22.11.7",
"eslint-config-react-app": "^6.0.0",
"eslint-plugin-flowtype": "^8.0.3",
"eslint-plugin-import": "^2.25.2",
"eslint-plugin-jsx-a11y": "^6.4.1",
"eslint-plugin-react": "^7.26.1",
"eslint-plugin-react-hooks": "^4.2.0",
"nodemon": "^2.0.12",
"prettier": "^2.4.1",
"ts-node": "^10.2.0",
"typescript": "^4.3.5"
},
"eslintConfig": {
"extends": [
"react-app",
"react-app/jest"
]
},
"browserslist": {
"production": [
">0.2%",
Expand Down
25 changes: 12 additions & 13 deletions src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
import { useState, useEffect } from "react";
import Collapse from "@material-ui/core/Collapse";
import { SnackbarProvider } from "notistack";
import { useEffect, useState } from "react";
import { ThemeProvider } from "styled-components";
import Collapse from "@material-ui/core/Collapse";

import { Header } from "./components/Header";
import { MSCProvider } from "./components/MSContext";
import { Update } from "./components/Update";
import Routes from "./routes";
import { Globals } from "./styles/globals";
import { theme } from "./styles/theme";
import Header from "./components/Header";
import Update from "./components/Update";
import Routes from "./routes";

const electron = window.require("electron");
const ipcRenderer = window.require("electron").ipcRenderer;

export default function App() {
const [isUpdating, setIsUpdating] = useState<boolean>(false);
const [updateData, setUpdateData] = useState(null);

useEffect(() => {
electron.ipcRenderer.on("update-started", () => {
ipcRenderer.on("update-started", () => {
setIsUpdating(true);
});
electron.ipcRenderer.on("update-progress", (_, info) => {
ipcRenderer.on("update-progress", (_, info) => {
setUpdateData(info);
});
electron.ipcRenderer.on("update-finished", () => {
ipcRenderer.on("update-finished", () => {
setIsUpdating(false);
});
}, []);
Expand All @@ -37,10 +37,9 @@ export default function App() {
TransitionComponent={Collapse}
>
<MSCProvider>
<Header>
<Update isVisible={isUpdating} data={updateData} />
<Routes />
</Header>
<Header />
<Update isVisible={isUpdating} data={updateData} />
<Routes />
</MSCProvider>
</SnackbarProvider>
</ThemeProvider>
Expand Down
Loading

0 comments on commit 5d18ec4

Please sign in to comment.