Version 1.9 (#6)
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
import path from "path"
|
||||
import fs from "fs"
|
||||
import metrics from "../src/metrics.mjs"
|
||||
import setup from "../src/setup.mjs"
|
||||
import build from "../utils/build.mjs"
|
||||
import octokit from "@octokit/graphql"
|
||||
import OctokitRest from "@octokit/rest"
|
||||
@@ -19,11 +20,9 @@
|
||||
const graphql = octokit.graphql.defaults({headers:{authorization: `token ${token}`}})
|
||||
const rest = new OctokitRest.Octokit({auth:token})
|
||||
|
||||
//Load svg template, style and query
|
||||
const [template, style, query] = await Promise.all(["template.svg", "style.css", "query.graphql"].map(async file => `${await fs.promises.readFile(path.join("src", file))}`))
|
||||
|
||||
//Compute render
|
||||
const rendered = await metrics({login:"lowlighter", q:{}}, {template, style, query, graphql, rest, plugins:{}})
|
||||
const conf = await setup()
|
||||
const rendered = await metrics({login:"lowlighter", q:{}}, {graphql, rest, plugins:{}, conf})
|
||||
|
||||
//Ensure it's a well-formed SVG image
|
||||
const parsed = libxmljs.parseXml(rendered)
|
||||
|
||||
Reference in New Issue
Block a user