mirror of
https://github.com/catdevnull/preciazo.git
synced 2024-11-22 14:16:19 +00:00
corregir types + ci types
This commit is contained in:
parent
6a29ed257d
commit
92e814b13a
6 changed files with 12 additions and 6 deletions
6
.github/workflows/container.yml
vendored
6
.github/workflows/container.yml
vendored
|
@ -10,7 +10,7 @@ env:
|
|||
|
||||
jobs:
|
||||
check:
|
||||
name: chequear typescript del sitio
|
||||
name: chequear typescript
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
@ -20,6 +20,10 @@ jobs:
|
|||
working-directory: ./sitio
|
||||
- run: bun check
|
||||
working-directory: ./sitio
|
||||
- run: bun install
|
||||
working-directory: ./scraper
|
||||
- run: bun check
|
||||
working-directory: ./scraper
|
||||
|
||||
build-and-push-scraper:
|
||||
runs-on: ubuntu-latest
|
||||
|
|
|
@ -5,8 +5,7 @@
|
|||
"description": "",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"build:container": "podman build -t gitea.nulo.in/nulo/preciazo/scraper -f ./Containerfile ..",
|
||||
"push:container": "bun build:container && podman push gitea.nulo.in/nulo/preciazo/scraper"
|
||||
"check": "tsc"
|
||||
},
|
||||
"keywords": [],
|
||||
"author": "",
|
||||
|
|
|
@ -21,7 +21,7 @@ function parseJsonLds(dom: Window): object[] {
|
|||
const scripts = dom.window.document.querySelectorAll(
|
||||
'script[type="application/ld+json"]'
|
||||
);
|
||||
return [...scripts].map((scripts) => JSON.parse(scripts.innerHTML));
|
||||
return Array.from(scripts, (script) => JSON.parse(script.innerHTML));
|
||||
}
|
||||
function findJsonLd(dom: Window, type: string): object | undefined {
|
||||
return parseJsonLds(dom).find((x) => "@type" in x && x["@type"] === type);
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/// <reference lib="dom" />
|
||||
import * as schema from "db-datos/schema.js";
|
||||
import { writeFile, mkdir } from "fs/promises";
|
||||
import { createHash } from "crypto";
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
{
|
||||
"extends": "../tsconfig.json"
|
||||
"extends": "../tsconfig.json",
|
||||
"exclude": ["../sitio"]
|
||||
}
|
||||
|
|
|
@ -15,5 +15,6 @@
|
|||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"include": ["**/*.ts", "**/*.js"]
|
||||
"include": ["**/*.ts", "**/*.js"],
|
||||
"exclude": ["sitio/build"]
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue