From e38614f51dd4ea1b66132073639d605c8b41095c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edixon=20Pi=C3=B1a?= Date: Tue, 7 Mar 2023 11:49:40 -0400 Subject: [PATCH] change task "start" in deno.json - changes in workspace and readme --- .gitignore | 3 +- README.md | 70 +++++++++++++++-------------------------- deno.json | 9 ++---- jobs-dev.code-workspace | 11 ++----- 4 files changed, 32 insertions(+), 61 deletions(-) diff --git a/.gitignore b/.gitignore index e1e52d3..d3bd0ad 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ # FOLDERS .husky/ -.vscode/ +.vscode/* +!.vscode/extensions # FILES .env* diff --git a/README.md b/README.md index 32e5830..8477bc1 100644 --- a/README.md +++ b/README.md @@ -30,51 +30,31 @@ cp .env.template .env | GET | /api/jobs | Obtener todas las ofertas de trabajo | | GET | /api/docs | Página de documentación de la api (Proximamente) | -Ejemplo de respuesta para `GET: /api/jobs` - -```json -{ - "total": 346, - "jobs": [ - { - "title": "Desarrollador/a Back-end Microservicios", - "role": "Semi Senior", - "time": "Full time", - "postulationFast": true, - "companyName": "Empresas SB", - "location": "Santiago (hybrid)", - "url": "https://www.getonbrd.com/jobs/programming/desarrollador-a-backend-empresas-sb-santiago", - "perks": [ - "accessible", - "meals provided", - "bicycle parking", - "commuting buses", - "free car parking", - "computer provided", - "education stipend", - "informal dresscode" - ], - "isNew": true, - "hasPublishedSalary": true, - "details": { - "postulations": 127, - "remote100": false, - "language": "spanish", - "skills": [ - "Agile", - "Back-end", - "Docker", - "Java", - "Microservices", - "Oracle", - "Software Analyst", - "Spring Boot", - "Virtualization" - ] - } - }, - { ... } - ] +Declaración de tipos de la respuesta entregada por el endpoint `GET: /api/jobs` + +```ts +type TResponseList = { + total: number + data: TJob[] +} + +type TJob = { + title: string + role: string + time: string + postulationFast: boolean + companyName: string + location: string + url: string + perks: string[] + isNew: boolean + hasPublishedSalary: boolean + details: { + postulations: number + remote100: boolean + language: string | 'spanish' + skills: string[] + } } ``` diff --git a/deno.json b/deno.json index 999eba1..e337053 100644 --- a/deno.json +++ b/deno.json @@ -1,7 +1,7 @@ { "tasks": { "dev": "deno run --allow-env --allow-read --allow-net --watch src/main.ts", - "start": "deno run --allow-env --allow-read --allow-net src/main.ts", + "start": "deno task prepare:db && deno run --allow-env --allow-read --allow-net src/main.ts", "prepare:db": "deno run --allow-env --allow-read --allow-net --allow-write ./src/scraping/jobs.ts", "update:lock": "deno cache --lock=deno.lock --lock-write ./deps.ts", "prepare:husky": "deno run --allow-env --allow-read --allow-write --allow-run ./tools/prepare-husky.ts", @@ -15,12 +15,7 @@ }, "fmt": { "files": { - "include": [ - "src/", - "test/", - "demo/", - "deps.ts" - ] + "include": ["src/", "test/", "demo/", "deps.ts"] }, "options": { "useTabs": true, diff --git a/jobs-dev.code-workspace b/jobs-dev.code-workspace index 2e9c65c..39eb7f9 100644 --- a/jobs-dev.code-workspace +++ b/jobs-dev.code-workspace @@ -16,9 +16,10 @@ "deno.config": "./deno.json", "deno.lint": true, "deno.importMap": "./import_map.json", + "deno.enablePaths": ["."], "editor.formatOnSave": true, "[typescriptreact]": { - "editor.defaultFormatter": "denoland.vscode-deno" + "editor.defaultFormatter": "esbenp.prettier-vscode" }, "[typescript]": { "editor.defaultFormatter": "denoland.vscode-deno" @@ -38,13 +39,7 @@ "thunder-client.saveToWorkspace": true }, "extensions": { - "recommendations": [ - "denoland.vscode-deno", - "rangav.vscode-thunder-client", - "dzannotti.vscode-babel-coloring", - "jabacchetta.javascript-snippets", - "esbenp.prettier-vscode" - ] + "recommendations": ["rangav.vscode-thunder-client", "irongeek.vscode-env", "esbenp.prettier-vscode"] }, "launch": { "version": "0.2.0",