mirror of
https://github.com/catdevnull/preciazo.git
synced 2024-11-26 11:36:20 +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:
|
jobs:
|
||||||
check:
|
check:
|
||||||
name: chequear typescript del sitio
|
name: chequear typescript
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
@ -20,6 +20,10 @@ jobs:
|
||||||
working-directory: ./sitio
|
working-directory: ./sitio
|
||||||
- run: bun check
|
- run: bun check
|
||||||
working-directory: ./sitio
|
working-directory: ./sitio
|
||||||
|
- run: bun install
|
||||||
|
working-directory: ./scraper
|
||||||
|
- run: bun check
|
||||||
|
working-directory: ./scraper
|
||||||
|
|
||||||
build-and-push-scraper:
|
build-and-push-scraper:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
|
@ -5,8 +5,7 @@
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build:container": "podman build -t gitea.nulo.in/nulo/preciazo/scraper -f ./Containerfile ..",
|
"check": "tsc"
|
||||||
"push:container": "bun build:container && podman push gitea.nulo.in/nulo/preciazo/scraper"
|
|
||||||
},
|
},
|
||||||
"keywords": [],
|
"keywords": [],
|
||||||
"author": "",
|
"author": "",
|
||||||
|
|
|
@ -21,7 +21,7 @@ function parseJsonLds(dom: Window): object[] {
|
||||||
const scripts = dom.window.document.querySelectorAll(
|
const scripts = dom.window.document.querySelectorAll(
|
||||||
'script[type="application/ld+json"]'
|
'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 {
|
function findJsonLd(dom: Window, type: string): object | undefined {
|
||||||
return parseJsonLds(dom).find((x) => "@type" in x && x["@type"] === type);
|
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 * as schema from "db-datos/schema.js";
|
||||||
import { writeFile, mkdir } from "fs/promises";
|
import { writeFile, mkdir } from "fs/promises";
|
||||||
import { createHash } from "crypto";
|
import { createHash } from "crypto";
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
{
|
{
|
||||||
"extends": "../tsconfig.json"
|
"extends": "../tsconfig.json",
|
||||||
|
"exclude": ["../sitio"]
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,5 +15,6 @@
|
||||||
"noEmit": true,
|
"noEmit": true,
|
||||||
"forceConsistentCasingInFileNames": true
|
"forceConsistentCasingInFileNames": true
|
||||||
},
|
},
|
||||||
"include": ["**/*.ts", "**/*.js"]
|
"include": ["**/*.ts", "**/*.js"],
|
||||||
|
"exclude": ["sitio/build"]
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue