corregir types + ci types

This commit is contained in:
Cat /dev/Nulo 2024-01-04 19:56:18 -03:00
parent 6a29ed257d
commit 92e814b13a
6 changed files with 12 additions and 6 deletions

View file

@ -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

View file

@ -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": "",

View file

@ -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);

View file

@ -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";

View file

@ -1,3 +1,4 @@
{
"extends": "../tsconfig.json"
"extends": "../tsconfig.json",
"exclude": ["../sitio"]
}

View file

@ -15,5 +15,6 @@
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"include": ["**/*.ts", "**/*.js"]
"include": ["**/*.ts", "**/*.js"],
"exclude": ["sitio/build"]
}