From 9a6afa777fb378c740af45a3b8f9976875be6123 Mon Sep 17 00:00:00 2001 From: Luc Perkins Date: Sat, 20 Apr 2024 20:57:38 -0300 Subject: [PATCH] Switch to tsup-based build --- dist/index.d.ts | 1 - dist/index.js | 457 +++++++-------- dist/main.d.ts | 2 + dist/main.js | 261 +++++++++ dist/main.js.map | 1 + package.json | 9 +- pnpm-lock.yaml | 1147 ++++++++++++++++++++++++++++++++++++- src/{index.ts => main.ts} | 0 tsup.config.ts | 15 + 9 files changed, 1653 insertions(+), 240 deletions(-) delete mode 100644 dist/index.d.ts create mode 100644 dist/main.d.ts create mode 100644 dist/main.js create mode 100644 dist/main.js.map rename src/{index.ts => main.ts} (100%) create mode 100644 tsup.config.ts diff --git a/dist/index.d.ts b/dist/index.d.ts deleted file mode 100644 index cb0ff5c..0000000 --- a/dist/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/dist/index.js b/dist/index.js index 202dd0b..65eb300 100644 --- a/dist/index.js +++ b/dist/index.js @@ -95085,7 +95085,8 @@ function mungeDiagnosticEndpoint(inputUrl) { -;// CONCATENATED MODULE: ./dist/index.js +;// CONCATENATED MODULE: ./dist/main.js +// src/main.ts @@ -95097,266 +95098,254 @@ function mungeDiagnosticEndpoint(inputUrl) { -const ENV_CACHE_DAEMONDIR = "MAGIC_NIX_CACHE_DAEMONDIR"; -const gotClient = got_dist_source.extend({ - retry: { - limit: 1, - methods: ["POST", "GET", "PUT", "HEAD", "DELETE", "OPTIONS", "TRACE"], - }, - hooks: { - beforeRetry: [ - (error, retryCount) => { - core.info(`Retrying after error ${error.code}, retry #: ${retryCount}`); - }, - ], - }, +var ENV_CACHE_DAEMONDIR = "MAGIC_NIX_CACHE_DAEMONDIR"; +var gotClient = got_dist_source.extend({ + retry: { + limit: 1, + methods: ["POST", "GET", "PUT", "HEAD", "DELETE", "OPTIONS", "TRACE"] + }, + hooks: { + beforeRetry: [ + (error, retryCount) => { + core.info(`Retrying after error ${error.code}, retry #: ${retryCount}`); + } + ] + } }); async function fetchAutoCacher(toolbox) { - const closurePath = await toolbox.fetch(); - toolbox.recordEvent("load_closure"); - const { stdout } = await (0,external_node_util_.promisify)(external_node_child_process_namespaceObject.exec)(`cat "${closurePath}" | xz -d | nix-store --import`); - const paths = stdout.split(external_node_os_.EOL); - // Since the export is in reverse topologically sorted order, magic-nix-cache is always the penultimate entry in the list (the empty string left by split being the last). - const last_path = paths.at(-2); - return `${last_path}/bin/magic-nix-cache`; + const closurePath = await toolbox.fetch(); + toolbox.recordEvent("load_closure"); + const { stdout } = await (0,external_node_util_.promisify)(external_node_child_process_namespaceObject.exec)( + `cat "${closurePath}" | xz -d | nix-store --import` + ); + const paths = stdout.split(external_node_os_.EOL); + const last_path = paths.at(-2); + return `${last_path}/bin/magic-nix-cache`; } function tailLog(daemonDir) { - const log = new tail/* Tail */.x(external_node_path_namespaceObject.join(daemonDir, "daemon.log")); - core.debug(`tailing daemon.log...`); - log.on("line", (line) => { - core.info(line); - }); - return log; + const log = new tail/* Tail */.x(external_node_path_namespaceObject.join(daemonDir, "daemon.log")); + core.debug(`tailing daemon.log...`); + log.on("line", (line) => { + core.info(line); + }); + return log; } async function setUpAutoCache(toolbox) { - const tmpdir = process.env["RUNNER_TEMP"] || external_node_os_.tmpdir(); - const required_env = [ - "ACTIONS_CACHE_URL", - "ACTIONS_RUNTIME_URL", - "ACTIONS_RUNTIME_TOKEN", - ]; - let anyMissing = false; - for (const n of required_env) { - if (!process.env.hasOwnProperty(n)) { - anyMissing = true; - core.warning(`Disabling automatic caching since required environment ${n} isn't available`); - } + const tmpdir2 = process.env["RUNNER_TEMP"] || external_node_os_.tmpdir(); + const required_env = [ + "ACTIONS_CACHE_URL", + "ACTIONS_RUNTIME_URL", + "ACTIONS_RUNTIME_TOKEN" + ]; + let anyMissing = false; + for (const n of required_env) { + if (!process.env.hasOwnProperty(n)) { + anyMissing = true; + core.warning( + `Disabling automatic caching since required environment ${n} isn't available` + ); } - if (anyMissing) { - return; - } - core.debug(`GitHub Action Cache URL: ${process.env["ACTIONS_CACHE_URL"]}`); - const daemonDir = await promises_namespaceObject.mkdtemp(external_node_path_namespaceObject.join(tmpdir, "magic-nix-cache-")); - let daemonBin; - if (core.getInput("source-binary")) { - daemonBin = core.getInput("source-binary"); - } - else { - daemonBin = await fetchAutoCacher(toolbox); - } - let runEnv; - if (core.isDebug()) { - runEnv = { - RUST_LOG: "trace,magic_nix_cache=debug,gha_cache=debug", - RUST_BACKTRACE: "full", - ...process.env, - }; - } - else { - runEnv = process.env; - } - const notifyPort = core.getInput("startup-notification-port"); - const notifyPromise = new Promise((resolveListening) => { - const promise = new Promise(async (resolveQuit) => { - const notifyServer = external_http_.createServer((req, res) => { - if (req.method === "POST" && req.url === "/") { - core.debug(`Notify server shutting down.`); - res.writeHead(200, { "Content-Type": "application/json" }); - res.end("{}"); - notifyServer.close(() => { - resolveQuit(); - }); - } - }); - notifyServer.listen(notifyPort, () => { - core.debug(`Notify server running.`); - resolveListening(promise); - }); - }); - }); - // Start tailing the daemon log. - const outputPath = `${daemonDir}/daemon.log`; - const output = (0,external_node_fs_namespaceObject.openSync)(outputPath, "a"); - const log = tailLog(daemonDir); - const netrc = await netrcPath(); - const nixConfPath = `${process.env["HOME"]}/.config/nix/nix.conf`; - const daemonCliFlags = [ - "--startup-notification-url", - `http://127.0.0.1:${notifyPort}`, - "--listen", - core.getInput("listen"), - "--upstream", - core.getInput("upstream-cache"), - "--diagnostic-endpoint", - core.getInput("diagnostic-endpoint"), - "--nix-conf", - nixConfPath, - ] - .concat(core.getBooleanInput("use-flakehub") - ? [ - "--use-flakehub", - "--flakehub-cache-server", - core.getInput("flakehub-cache-server"), - "--flakehub-api-server", - core.getInput("flakehub-api-server"), - "--flakehub-api-server-netrc", - netrc, - "--flakehub-flake-name", - core.getInput("flakehub-flake-name"), - ] - : []) - .concat(core.getBooleanInput("use-gha-cache") ? ["--use-gha-cache"] : []); - const opts = { - stdio: ["ignore", output, output], - env: runEnv, - detached: true, + } + if (anyMissing) { + return; + } + core.debug(`GitHub Action Cache URL: ${process.env["ACTIONS_CACHE_URL"]}`); + const daemonDir = await promises_namespaceObject.mkdtemp(external_node_path_namespaceObject.join(tmpdir2, "magic-nix-cache-")); + let daemonBin; + if (core.getInput("source-binary")) { + daemonBin = core.getInput("source-binary"); + } else { + daemonBin = await fetchAutoCacher(toolbox); + } + let runEnv; + if (core.isDebug()) { + runEnv = { + RUST_LOG: "trace,magic_nix_cache=debug,gha_cache=debug", + RUST_BACKTRACE: "full", + ...process.env }; - // Display the final command for debugging purposes - core.debug("Full daemon start command:"); - core.debug(`${daemonBin} ${daemonCliFlags.join(" ")}`); - // Start the server. Once it is ready, it will notify us via the notification server. - const daemon = (0,external_node_child_process_namespaceObject.spawn)(daemonBin, daemonCliFlags, opts); - const pidFile = external_node_path_namespaceObject.join(daemonDir, "daemon.pid"); - await promises_namespaceObject.writeFile(pidFile, `${daemon.pid}`); - core.info("Waiting for magic-nix-cache to start..."); - await new Promise((resolve, reject) => { - notifyPromise - // eslint-disable-next-line github/no-then - .then((_value) => { - resolve(); - }) - // eslint-disable-next-line github/no-then - .catch((err) => { - reject(new Error(`error in notifyPromise: ${err}`)); - }); - daemon.on("exit", async (code, signal) => { - if (signal) { - reject(new Error(`Daemon was killed by signal ${signal}`)); - } - else if (code) { - reject(new Error(`Daemon exited with code ${code}`)); - } - else { - reject(new Error(`Daemon unexpectedly exited`)); - } - }); + } else { + runEnv = process.env; + } + const notifyPort = core.getInput("startup-notification-port"); + const notifyPromise = new Promise((resolveListening) => { + const promise = new Promise(async (resolveQuit) => { + const notifyServer = external_http_.createServer((req, res) => { + if (req.method === "POST" && req.url === "/") { + core.debug(`Notify server shutting down.`); + res.writeHead(200, { "Content-Type": "application/json" }); + res.end("{}"); + notifyServer.close(() => { + resolveQuit(); + }); + } + }); + notifyServer.listen(notifyPort, () => { + core.debug(`Notify server running.`); + resolveListening(promise); + }); }); - daemon.unref(); - core.info("Launched Magic Nix Cache"); - core.exportVariable(ENV_CACHE_DAEMONDIR, daemonDir); - log.unwatch(); + }); + const outputPath = `${daemonDir}/daemon.log`; + const output = (0,external_node_fs_namespaceObject.openSync)(outputPath, "a"); + const log = tailLog(daemonDir); + const netrc = await netrcPath(); + const nixConfPath = `${process.env["HOME"]}/.config/nix/nix.conf`; + const daemonCliFlags = [ + "--startup-notification-url", + `http://127.0.0.1:${notifyPort}`, + "--listen", + core.getInput("listen"), + "--upstream", + core.getInput("upstream-cache"), + "--diagnostic-endpoint", + core.getInput("diagnostic-endpoint"), + "--nix-conf", + nixConfPath + ].concat( + core.getBooleanInput("use-flakehub") ? [ + "--use-flakehub", + "--flakehub-cache-server", + core.getInput("flakehub-cache-server"), + "--flakehub-api-server", + core.getInput("flakehub-api-server"), + "--flakehub-api-server-netrc", + netrc, + "--flakehub-flake-name", + core.getInput("flakehub-flake-name") + ] : [] + ).concat(core.getBooleanInput("use-gha-cache") ? ["--use-gha-cache"] : []); + const opts = { + stdio: ["ignore", output, output], + env: runEnv, + detached: true + }; + core.debug("Full daemon start command:"); + core.debug(`${daemonBin} ${daemonCliFlags.join(" ")}`); + const daemon = (0,external_node_child_process_namespaceObject.spawn)(daemonBin, daemonCliFlags, opts); + const pidFile = external_node_path_namespaceObject.join(daemonDir, "daemon.pid"); + await promises_namespaceObject.writeFile(pidFile, `${daemon.pid}`); + core.info("Waiting for magic-nix-cache to start..."); + await new Promise((resolve, reject) => { + notifyPromise.then((_value) => { + resolve(); + }).catch((err) => { + reject(new Error(`error in notifyPromise: ${err}`)); + }); + daemon.on("exit", async (code, signal) => { + if (signal) { + reject(new Error(`Daemon was killed by signal ${signal}`)); + } else if (code) { + reject(new Error(`Daemon exited with code ${code}`)); + } else { + reject(new Error(`Daemon unexpectedly exited`)); + } + }); + }); + daemon.unref(); + core.info("Launched Magic Nix Cache"); + core.exportVariable(ENV_CACHE_DAEMONDIR, daemonDir); + log.unwatch(); } async function notifyAutoCache() { - const daemonDir = process.env[ENV_CACHE_DAEMONDIR]; - if (!daemonDir) { - return; - } - try { - core.debug(`Indicating workflow start`); - const res = await gotClient - .post(`http://${core.getInput("listen")}/api/workflow-start`) - .json(); - core.debug(`back from post: ${res}`); - } - catch (e) { - core.info(`Error marking the workflow as started:`); - core.info((0,external_node_util_.inspect)(e)); - core.info(`Magic Nix Cache may not be running for this workflow.`); - } + const daemonDir = process.env[ENV_CACHE_DAEMONDIR]; + if (!daemonDir) { + return; + } + try { + core.debug(`Indicating workflow start`); + const res = await gotClient.post(`http://${core.getInput("listen")}/api/workflow-start`).json(); + core.debug(`back from post: ${res}`); + } catch (e) { + core.info(`Error marking the workflow as started:`); + core.info((0,external_node_util_.inspect)(e)); + core.info(`Magic Nix Cache may not be running for this workflow.`); + } } async function netrcPath() { - const expectedNetrcPath = external_node_path_namespaceObject.join(process.env["RUNNER_TEMP"] || external_node_os_.tmpdir(), "determinate-nix-installer-netrc"); + const expectedNetrcPath = external_node_path_namespaceObject.join( + process.env["RUNNER_TEMP"] || external_node_os_.tmpdir(), + "determinate-nix-installer-netrc" + ); + try { + await promises_namespaceObject.access(expectedNetrcPath); + return expectedNetrcPath; + } catch { + const destinedNetrcPath = external_node_path_namespaceObject.join( + process.env["RUNNER_TEMP"] || external_node_os_.tmpdir(), + "magic-nix-cache-netrc" + ); try { - await promises_namespaceObject.access(expectedNetrcPath); - return expectedNetrcPath; - } - catch { - // `nix-installer` was not used, the user may be registered with FlakeHub though. - const destinedNetrcPath = external_node_path_namespaceObject.join(process.env["RUNNER_TEMP"] || external_node_os_.tmpdir(), "magic-nix-cache-netrc"); - try { - await flakehub_login(destinedNetrcPath); - } - catch (e) { - core.info("FlakeHub cache disabled."); - core.debug(`Error while logging into FlakeHub: ${e}`); - } - return destinedNetrcPath; + await flakehub_login(destinedNetrcPath); + } catch (e) { + core.info("FlakeHub cache disabled."); + core.debug(`Error while logging into FlakeHub: ${e}`); } + return destinedNetrcPath; + } } async function flakehub_login(netrc) { - const jwt = await core.getIDToken("api.flakehub.com"); - await promises_namespaceObject.writeFile(netrc, [ - `machine api.flakehub.com login flakehub password ${jwt}`, - `machine flakehub.com login flakehub password ${jwt}`, - `machine cache.flakehub.com login flakehub password ${jwt}`, - ].join("\n")); - core.info("Logged in to FlakeHub."); + const jwt = await core.getIDToken("api.flakehub.com"); + await promises_namespaceObject.writeFile( + netrc, + [ + `machine api.flakehub.com login flakehub password ${jwt}`, + `machine flakehub.com login flakehub password ${jwt}`, + `machine cache.flakehub.com login flakehub password ${jwt}` + ].join("\n") + ); + core.info("Logged in to FlakeHub."); } async function tearDownAutoCache() { - const daemonDir = process.env[ENV_CACHE_DAEMONDIR]; - if (!daemonDir) { - core.debug("magic-nix-cache not started - Skipping"); - return; + const daemonDir = process.env[ENV_CACHE_DAEMONDIR]; + if (!daemonDir) { + core.debug("magic-nix-cache not started - Skipping"); + return; + } + const pidFile = external_node_path_namespaceObject.join(daemonDir, "daemon.pid"); + const pid = parseInt(await promises_namespaceObject.readFile(pidFile, { encoding: "ascii" })); + core.debug(`found daemon pid: ${pid}`); + if (!pid) { + throw new Error("magic-nix-cache did not start successfully"); + } + const log = tailLog(daemonDir); + try { + core.debug(`about to post to localhost`); + const res = await gotClient.post(`http://${core.getInput("listen")}/api/workflow-finish`).json(); + core.debug(`back from post: ${res}`); + } finally { + core.debug(`unwatching the daemon log`); + log.unwatch(); + } + core.debug(`killing`); + try { + process.kill(pid, "SIGTERM"); + } catch (e) { + if (typeof e === "object" && e && "code" in e && e.code !== "ESRCH") { + throw e; } - const pidFile = external_node_path_namespaceObject.join(daemonDir, "daemon.pid"); - const pid = parseInt(await promises_namespaceObject.readFile(pidFile, { encoding: "ascii" })); - core.debug(`found daemon pid: ${pid}`); - if (!pid) { - throw new Error("magic-nix-cache did not start successfully"); - } - const log = tailLog(daemonDir); - try { - core.debug(`about to post to localhost`); - const res = await gotClient - .post(`http://${core.getInput("listen")}/api/workflow-finish`) - .json(); - core.debug(`back from post: ${res}`); - } - finally { - core.debug(`unwatching the daemon log`); - log.unwatch(); - } - core.debug(`killing`); - try { - process.kill(pid, "SIGTERM"); - } - catch (e) { - if (typeof e === "object" && e && "code" in e && e.code !== "ESRCH") { - throw e; - } - } - finally { - if (core.isDebug()) { - core.info("Entire log:"); - const entireLog = (0,external_node_fs_namespaceObject.readFileSync)(external_node_path_namespaceObject.join(daemonDir, "daemon.log")); - core.info(entireLog.toString()); - } + } finally { + if (core.isDebug()) { + core.info("Entire log:"); + const entireLog = (0,external_node_fs_namespaceObject.readFileSync)(external_node_path_namespaceObject.join(daemonDir, "daemon.log")); + core.info(entireLog.toString()); } + } } -const idslib = new IdsToolbox({ - name: "magic-nix-cache", - fetchStyle: "gh-env-style", - idsProjectName: "magic-nix-cache-closure", - requireNix: "warn", +var idslib = new IdsToolbox({ + name: "magic-nix-cache", + fetchStyle: "gh-env-style", + idsProjectName: "magic-nix-cache-closure", + requireNix: "warn" }); idslib.onMain(async () => { - await setUpAutoCache(idslib); - await notifyAutoCache(); + await setUpAutoCache(idslib); + await notifyAutoCache(); }); idslib.onPost(async () => { - await tearDownAutoCache(); + await tearDownAutoCache(); }); idslib.execute(); - +//# sourceMappingURL=main.js.map })(); diff --git a/dist/main.d.ts b/dist/main.d.ts new file mode 100644 index 0000000..223e65e --- /dev/null +++ b/dist/main.d.ts @@ -0,0 +1,2 @@ + +export { } diff --git a/dist/main.js b/dist/main.js new file mode 100644 index 0000000..87d68a3 --- /dev/null +++ b/dist/main.js @@ -0,0 +1,261 @@ +// src/main.ts +import * as fs from "node:fs/promises"; +import * as os from "node:os"; +import * as path from "node:path"; +import { spawn, exec } from "node:child_process"; +import { openSync, readFileSync } from "node:fs"; +import { inspect, promisify } from "node:util"; +import * as http from "http"; +import * as core from "@actions/core"; +import { Tail } from "tail"; +import got from "got"; +import { IdsToolbox } from "detsys-ts"; +var ENV_CACHE_DAEMONDIR = "MAGIC_NIX_CACHE_DAEMONDIR"; +var gotClient = got.extend({ + retry: { + limit: 1, + methods: ["POST", "GET", "PUT", "HEAD", "DELETE", "OPTIONS", "TRACE"] + }, + hooks: { + beforeRetry: [ + (error, retryCount) => { + core.info(`Retrying after error ${error.code}, retry #: ${retryCount}`); + } + ] + } +}); +async function fetchAutoCacher(toolbox) { + const closurePath = await toolbox.fetch(); + toolbox.recordEvent("load_closure"); + const { stdout } = await promisify(exec)( + `cat "${closurePath}" | xz -d | nix-store --import` + ); + const paths = stdout.split(os.EOL); + const last_path = paths.at(-2); + return `${last_path}/bin/magic-nix-cache`; +} +function tailLog(daemonDir) { + const log = new Tail(path.join(daemonDir, "daemon.log")); + core.debug(`tailing daemon.log...`); + log.on("line", (line) => { + core.info(line); + }); + return log; +} +async function setUpAutoCache(toolbox) { + const tmpdir2 = process.env["RUNNER_TEMP"] || os.tmpdir(); + const required_env = [ + "ACTIONS_CACHE_URL", + "ACTIONS_RUNTIME_URL", + "ACTIONS_RUNTIME_TOKEN" + ]; + let anyMissing = false; + for (const n of required_env) { + if (!process.env.hasOwnProperty(n)) { + anyMissing = true; + core.warning( + `Disabling automatic caching since required environment ${n} isn't available` + ); + } + } + if (anyMissing) { + return; + } + core.debug(`GitHub Action Cache URL: ${process.env["ACTIONS_CACHE_URL"]}`); + const daemonDir = await fs.mkdtemp(path.join(tmpdir2, "magic-nix-cache-")); + let daemonBin; + if (core.getInput("source-binary")) { + daemonBin = core.getInput("source-binary"); + } else { + daemonBin = await fetchAutoCacher(toolbox); + } + let runEnv; + if (core.isDebug()) { + runEnv = { + RUST_LOG: "trace,magic_nix_cache=debug,gha_cache=debug", + RUST_BACKTRACE: "full", + ...process.env + }; + } else { + runEnv = process.env; + } + const notifyPort = core.getInput("startup-notification-port"); + const notifyPromise = new Promise((resolveListening) => { + const promise = new Promise(async (resolveQuit) => { + const notifyServer = http.createServer((req, res) => { + if (req.method === "POST" && req.url === "/") { + core.debug(`Notify server shutting down.`); + res.writeHead(200, { "Content-Type": "application/json" }); + res.end("{}"); + notifyServer.close(() => { + resolveQuit(); + }); + } + }); + notifyServer.listen(notifyPort, () => { + core.debug(`Notify server running.`); + resolveListening(promise); + }); + }); + }); + const outputPath = `${daemonDir}/daemon.log`; + const output = openSync(outputPath, "a"); + const log = tailLog(daemonDir); + const netrc = await netrcPath(); + const nixConfPath = `${process.env["HOME"]}/.config/nix/nix.conf`; + const daemonCliFlags = [ + "--startup-notification-url", + `http://127.0.0.1:${notifyPort}`, + "--listen", + core.getInput("listen"), + "--upstream", + core.getInput("upstream-cache"), + "--diagnostic-endpoint", + core.getInput("diagnostic-endpoint"), + "--nix-conf", + nixConfPath + ].concat( + core.getBooleanInput("use-flakehub") ? [ + "--use-flakehub", + "--flakehub-cache-server", + core.getInput("flakehub-cache-server"), + "--flakehub-api-server", + core.getInput("flakehub-api-server"), + "--flakehub-api-server-netrc", + netrc, + "--flakehub-flake-name", + core.getInput("flakehub-flake-name") + ] : [] + ).concat(core.getBooleanInput("use-gha-cache") ? ["--use-gha-cache"] : []); + const opts = { + stdio: ["ignore", output, output], + env: runEnv, + detached: true + }; + core.debug("Full daemon start command:"); + core.debug(`${daemonBin} ${daemonCliFlags.join(" ")}`); + const daemon = spawn(daemonBin, daemonCliFlags, opts); + const pidFile = path.join(daemonDir, "daemon.pid"); + await fs.writeFile(pidFile, `${daemon.pid}`); + core.info("Waiting for magic-nix-cache to start..."); + await new Promise((resolve, reject) => { + notifyPromise.then((_value) => { + resolve(); + }).catch((err) => { + reject(new Error(`error in notifyPromise: ${err}`)); + }); + daemon.on("exit", async (code, signal) => { + if (signal) { + reject(new Error(`Daemon was killed by signal ${signal}`)); + } else if (code) { + reject(new Error(`Daemon exited with code ${code}`)); + } else { + reject(new Error(`Daemon unexpectedly exited`)); + } + }); + }); + daemon.unref(); + core.info("Launched Magic Nix Cache"); + core.exportVariable(ENV_CACHE_DAEMONDIR, daemonDir); + log.unwatch(); +} +async function notifyAutoCache() { + const daemonDir = process.env[ENV_CACHE_DAEMONDIR]; + if (!daemonDir) { + return; + } + try { + core.debug(`Indicating workflow start`); + const res = await gotClient.post(`http://${core.getInput("listen")}/api/workflow-start`).json(); + core.debug(`back from post: ${res}`); + } catch (e) { + core.info(`Error marking the workflow as started:`); + core.info(inspect(e)); + core.info(`Magic Nix Cache may not be running for this workflow.`); + } +} +async function netrcPath() { + const expectedNetrcPath = path.join( + process.env["RUNNER_TEMP"] || os.tmpdir(), + "determinate-nix-installer-netrc" + ); + try { + await fs.access(expectedNetrcPath); + return expectedNetrcPath; + } catch { + const destinedNetrcPath = path.join( + process.env["RUNNER_TEMP"] || os.tmpdir(), + "magic-nix-cache-netrc" + ); + try { + await flakehub_login(destinedNetrcPath); + } catch (e) { + core.info("FlakeHub cache disabled."); + core.debug(`Error while logging into FlakeHub: ${e}`); + } + return destinedNetrcPath; + } +} +async function flakehub_login(netrc) { + const jwt = await core.getIDToken("api.flakehub.com"); + await fs.writeFile( + netrc, + [ + `machine api.flakehub.com login flakehub password ${jwt}`, + `machine flakehub.com login flakehub password ${jwt}`, + `machine cache.flakehub.com login flakehub password ${jwt}` + ].join("\n") + ); + core.info("Logged in to FlakeHub."); +} +async function tearDownAutoCache() { + const daemonDir = process.env[ENV_CACHE_DAEMONDIR]; + if (!daemonDir) { + core.debug("magic-nix-cache not started - Skipping"); + return; + } + const pidFile = path.join(daemonDir, "daemon.pid"); + const pid = parseInt(await fs.readFile(pidFile, { encoding: "ascii" })); + core.debug(`found daemon pid: ${pid}`); + if (!pid) { + throw new Error("magic-nix-cache did not start successfully"); + } + const log = tailLog(daemonDir); + try { + core.debug(`about to post to localhost`); + const res = await gotClient.post(`http://${core.getInput("listen")}/api/workflow-finish`).json(); + core.debug(`back from post: ${res}`); + } finally { + core.debug(`unwatching the daemon log`); + log.unwatch(); + } + core.debug(`killing`); + try { + process.kill(pid, "SIGTERM"); + } catch (e) { + if (typeof e === "object" && e && "code" in e && e.code !== "ESRCH") { + throw e; + } + } finally { + if (core.isDebug()) { + core.info("Entire log:"); + const entireLog = readFileSync(path.join(daemonDir, "daemon.log")); + core.info(entireLog.toString()); + } + } +} +var idslib = new IdsToolbox({ + name: "magic-nix-cache", + fetchStyle: "gh-env-style", + idsProjectName: "magic-nix-cache-closure", + requireNix: "warn" +}); +idslib.onMain(async () => { + await setUpAutoCache(idslib); + await notifyAutoCache(); +}); +idslib.onPost(async () => { + await tearDownAutoCache(); +}); +idslib.execute(); +//# sourceMappingURL=main.js.map \ No newline at end of file diff --git a/dist/main.js.map b/dist/main.js.map new file mode 100644 index 0000000..ef0d905 --- /dev/null +++ b/dist/main.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../src/main.ts"],"sourcesContent":["import * as fs from \"node:fs/promises\";\nimport * as os from \"node:os\";\nimport * as path from \"node:path\";\nimport { spawn, exec, SpawnOptions } from \"node:child_process\";\nimport { openSync, readFileSync } from \"node:fs\";\nimport { inspect, promisify } from \"node:util\";\nimport * as http from \"http\";\n\nimport * as core from \"@actions/core\";\nimport { Tail } from \"tail\";\nimport got from \"got\";\nimport { IdsToolbox } from \"detsys-ts\";\n\nconst ENV_CACHE_DAEMONDIR = \"MAGIC_NIX_CACHE_DAEMONDIR\";\n\nconst gotClient = got.extend({\n retry: {\n limit: 1,\n methods: [\"POST\", \"GET\", \"PUT\", \"HEAD\", \"DELETE\", \"OPTIONS\", \"TRACE\"],\n },\n hooks: {\n beforeRetry: [\n (error, retryCount) => {\n core.info(`Retrying after error ${error.code}, retry #: ${retryCount}`);\n },\n ],\n },\n});\n\nasync function fetchAutoCacher(toolbox: IdsToolbox): Promise {\n const closurePath = await toolbox.fetch();\n toolbox.recordEvent(\"load_closure\");\n const { stdout } = await promisify(exec)(\n `cat \"${closurePath}\" | xz -d | nix-store --import`,\n );\n\n const paths = stdout.split(os.EOL);\n // Since the export is in reverse topologically sorted order, magic-nix-cache is always the penultimate entry in the list (the empty string left by split being the last).\n const last_path = paths.at(-2);\n return `${last_path}/bin/magic-nix-cache`;\n}\n\nfunction tailLog(daemonDir: string): Tail {\n const log = new Tail(path.join(daemonDir, \"daemon.log\"));\n core.debug(`tailing daemon.log...`);\n log.on(\"line\", (line) => {\n core.info(line);\n });\n return log;\n}\n\nasync function setUpAutoCache(toolbox: IdsToolbox): Promise {\n const tmpdir = process.env[\"RUNNER_TEMP\"] || os.tmpdir();\n const required_env = [\n \"ACTIONS_CACHE_URL\",\n \"ACTIONS_RUNTIME_URL\",\n \"ACTIONS_RUNTIME_TOKEN\",\n ];\n\n let anyMissing = false;\n for (const n of required_env) {\n if (!process.env.hasOwnProperty(n)) {\n anyMissing = true;\n core.warning(\n `Disabling automatic caching since required environment ${n} isn't available`,\n );\n }\n }\n\n if (anyMissing) {\n return;\n }\n\n core.debug(`GitHub Action Cache URL: ${process.env[\"ACTIONS_CACHE_URL\"]}`);\n\n const daemonDir = await fs.mkdtemp(path.join(tmpdir, \"magic-nix-cache-\"));\n\n let daemonBin: string;\n if (core.getInput(\"source-binary\")) {\n daemonBin = core.getInput(\"source-binary\");\n } else {\n daemonBin = await fetchAutoCacher(toolbox);\n }\n\n let runEnv;\n if (core.isDebug()) {\n runEnv = {\n RUST_LOG: \"trace,magic_nix_cache=debug,gha_cache=debug\",\n RUST_BACKTRACE: \"full\",\n ...process.env,\n };\n } else {\n runEnv = process.env;\n }\n\n const notifyPort = core.getInput(\"startup-notification-port\");\n\n const notifyPromise = new Promise>((resolveListening) => {\n const promise = new Promise(async (resolveQuit) => {\n const notifyServer = http.createServer((req, res) => {\n if (req.method === \"POST\" && req.url === \"/\") {\n core.debug(`Notify server shutting down.`);\n res.writeHead(200, { \"Content-Type\": \"application/json\" });\n res.end(\"{}\");\n notifyServer.close(() => {\n resolveQuit();\n });\n }\n });\n\n notifyServer.listen(notifyPort, () => {\n core.debug(`Notify server running.`);\n resolveListening(promise);\n });\n });\n });\n\n // Start tailing the daemon log.\n const outputPath = `${daemonDir}/daemon.log`;\n const output = openSync(outputPath, \"a\");\n const log = tailLog(daemonDir);\n const netrc = await netrcPath();\n const nixConfPath = `${process.env[\"HOME\"]}/.config/nix/nix.conf`;\n\n const daemonCliFlags: string[] = [\n \"--startup-notification-url\",\n `http://127.0.0.1:${notifyPort}`,\n \"--listen\",\n core.getInput(\"listen\"),\n \"--upstream\",\n core.getInput(\"upstream-cache\"),\n \"--diagnostic-endpoint\",\n core.getInput(\"diagnostic-endpoint\"),\n \"--nix-conf\",\n nixConfPath,\n ]\n .concat(\n core.getBooleanInput(\"use-flakehub\")\n ? [\n \"--use-flakehub\",\n \"--flakehub-cache-server\",\n core.getInput(\"flakehub-cache-server\"),\n \"--flakehub-api-server\",\n core.getInput(\"flakehub-api-server\"),\n \"--flakehub-api-server-netrc\",\n netrc,\n \"--flakehub-flake-name\",\n core.getInput(\"flakehub-flake-name\"),\n ]\n : [],\n )\n .concat(core.getBooleanInput(\"use-gha-cache\") ? [\"--use-gha-cache\"] : []);\n\n const opts: SpawnOptions = {\n stdio: [\"ignore\", output, output],\n env: runEnv,\n detached: true,\n };\n\n // Display the final command for debugging purposes\n core.debug(\"Full daemon start command:\");\n core.debug(`${daemonBin} ${daemonCliFlags.join(\" \")}`);\n\n // Start the server. Once it is ready, it will notify us via the notification server.\n const daemon = spawn(daemonBin, daemonCliFlags, opts);\n\n const pidFile = path.join(daemonDir, \"daemon.pid\");\n await fs.writeFile(pidFile, `${daemon.pid}`);\n\n core.info(\"Waiting for magic-nix-cache to start...\");\n\n await new Promise((resolve, reject) => {\n notifyPromise\n // eslint-disable-next-line github/no-then\n .then((_value) => {\n resolve();\n })\n // eslint-disable-next-line github/no-then\n .catch((err) => {\n reject(new Error(`error in notifyPromise: ${err}`));\n });\n daemon.on(\"exit\", async (code, signal) => {\n if (signal) {\n reject(new Error(`Daemon was killed by signal ${signal}`));\n } else if (code) {\n reject(new Error(`Daemon exited with code ${code}`));\n } else {\n reject(new Error(`Daemon unexpectedly exited`));\n }\n });\n });\n\n daemon.unref();\n\n core.info(\"Launched Magic Nix Cache\");\n core.exportVariable(ENV_CACHE_DAEMONDIR, daemonDir);\n\n log.unwatch();\n}\n\nasync function notifyAutoCache(): Promise {\n const daemonDir = process.env[ENV_CACHE_DAEMONDIR];\n\n if (!daemonDir) {\n return;\n }\n\n try {\n core.debug(`Indicating workflow start`);\n const res: Response = await gotClient\n .post(`http://${core.getInput(\"listen\")}/api/workflow-start`)\n .json();\n core.debug(`back from post: ${res}`);\n } catch (e) {\n core.info(`Error marking the workflow as started:`);\n core.info(inspect(e));\n core.info(`Magic Nix Cache may not be running for this workflow.`);\n }\n}\n\nasync function netrcPath(): Promise {\n const expectedNetrcPath = path.join(\n process.env[\"RUNNER_TEMP\"] || os.tmpdir(),\n \"determinate-nix-installer-netrc\",\n );\n try {\n await fs.access(expectedNetrcPath);\n return expectedNetrcPath;\n } catch {\n // `nix-installer` was not used, the user may be registered with FlakeHub though.\n const destinedNetrcPath = path.join(\n process.env[\"RUNNER_TEMP\"] || os.tmpdir(),\n \"magic-nix-cache-netrc\",\n );\n try {\n await flakehub_login(destinedNetrcPath);\n } catch (e) {\n core.info(\"FlakeHub cache disabled.\");\n core.debug(`Error while logging into FlakeHub: ${e}`);\n }\n return destinedNetrcPath;\n }\n}\n\nasync function flakehub_login(netrc: string): Promise {\n const jwt = await core.getIDToken(\"api.flakehub.com\");\n\n await fs.writeFile(\n netrc,\n [\n `machine api.flakehub.com login flakehub password ${jwt}`,\n `machine flakehub.com login flakehub password ${jwt}`,\n `machine cache.flakehub.com login flakehub password ${jwt}`,\n ].join(\"\\n\"),\n );\n\n core.info(\"Logged in to FlakeHub.\");\n}\n\nasync function tearDownAutoCache(): Promise {\n const daemonDir = process.env[ENV_CACHE_DAEMONDIR];\n\n if (!daemonDir) {\n core.debug(\"magic-nix-cache not started - Skipping\");\n return;\n }\n\n const pidFile = path.join(daemonDir, \"daemon.pid\");\n const pid = parseInt(await fs.readFile(pidFile, { encoding: \"ascii\" }));\n core.debug(`found daemon pid: ${pid}`);\n if (!pid) {\n throw new Error(\"magic-nix-cache did not start successfully\");\n }\n\n const log = tailLog(daemonDir);\n\n try {\n core.debug(`about to post to localhost`);\n const res: Response = await gotClient\n .post(`http://${core.getInput(\"listen\")}/api/workflow-finish`)\n .json();\n core.debug(`back from post: ${res}`);\n } finally {\n core.debug(`unwatching the daemon log`);\n log.unwatch();\n }\n\n core.debug(`killing`);\n try {\n process.kill(pid, \"SIGTERM\");\n } catch (e) {\n if (typeof e === \"object\" && e && \"code\" in e && e.code !== \"ESRCH\") {\n throw e;\n }\n } finally {\n if (core.isDebug()) {\n core.info(\"Entire log:\");\n const entireLog = readFileSync(path.join(daemonDir, \"daemon.log\"));\n core.info(entireLog.toString());\n }\n }\n}\n\nconst idslib = new IdsToolbox({\n name: \"magic-nix-cache\",\n fetchStyle: \"gh-env-style\",\n idsProjectName: \"magic-nix-cache-closure\",\n requireNix: \"warn\",\n});\n\nidslib.onMain(async () => {\n await setUpAutoCache(idslib);\n await notifyAutoCache();\n});\nidslib.onPost(async () => {\n await tearDownAutoCache();\n});\n\nidslib.execute();\n"],"mappings":"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","names":["tmpdir"]} \ No newline at end of file diff --git a/package.json b/package.json index c602600..a827d60 100644 --- a/package.json +++ b/package.json @@ -2,14 +2,14 @@ "name": "magic-nix-cache-action", "version": "1.0.0", "description": "", - "main": "./dist/index.js", - "types": "./dist/index.d.ts", + "main": "./dist/main.js", + "types": "./dist/main.d.ts", "type": "module", "scripts": { - "build": "tsc", + "build": "tsup", "format": "prettier --write .", "lint": "eslint src/**/*.ts", - "package": "ncc build", + "package": "ncc build ./dist/main.js", "all": "pnpm run format && pnpm run lint && pnpm run build && pnpm run package" }, "repository": { @@ -47,6 +47,7 @@ "eslint-plugin-import": "^2.29.1", "eslint-plugin-prettier": "^5.1.3", "prettier": "^3.2.5", + "tsup": "^8.0.2", "typescript": "^5.4.5" } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 89a9ef1..56a15ef 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -70,6 +70,9 @@ devDependencies: prettier: specifier: ^3.2.5 version: 3.2.5 + tsup: + specifier: ^8.0.2 + version: 8.0.2(typescript@5.4.5) typescript: specifier: ^5.4.5 version: 5.4.5 @@ -507,6 +510,282 @@ packages: to-fast-properties: 2.0.0 dev: true + /@esbuild/aix-ppc64@0.19.12: + resolution: + { + integrity: sha512-bmoCYyWdEL3wDQIVbcyzRyeKLgk2WtWLTWz1ZIAZF/EGbNOwSA6ew3PftJ1PqMiOOGu0OyFMzG53L0zqIpPeNA==, + } + engines: { node: ">=12" } + cpu: [ppc64] + os: [aix] + requiresBuild: true + dev: true + optional: true + + /@esbuild/android-arm64@0.19.12: + resolution: + { + integrity: sha512-P0UVNGIienjZv3f5zq0DP3Nt2IE/3plFzuaS96vihvD0Hd6H/q4WXUGpCxD/E8YrSXfNyRPbpTq+T8ZQioSuPA==, + } + engines: { node: ">=12" } + cpu: [arm64] + os: [android] + requiresBuild: true + dev: true + optional: true + + /@esbuild/android-arm@0.19.12: + resolution: + { + integrity: sha512-qg/Lj1mu3CdQlDEEiWrlC4eaPZ1KztwGJ9B6J+/6G+/4ewxJg7gqj8eVYWvao1bXrqGiW2rsBZFSX3q2lcW05w==, + } + engines: { node: ">=12" } + cpu: [arm] + os: [android] + requiresBuild: true + dev: true + optional: true + + /@esbuild/android-x64@0.19.12: + resolution: + { + integrity: sha512-3k7ZoUW6Q6YqhdhIaq/WZ7HwBpnFBlW905Fa4s4qWJyiNOgT1dOqDiVAQFwBH7gBRZr17gLrlFCRzF6jFh7Kew==, + } + engines: { node: ">=12" } + cpu: [x64] + os: [android] + requiresBuild: true + dev: true + optional: true + + /@esbuild/darwin-arm64@0.19.12: + resolution: + { + integrity: sha512-B6IeSgZgtEzGC42jsI+YYu9Z3HKRxp8ZT3cqhvliEHovq8HSX2YX8lNocDn79gCKJXOSaEot9MVYky7AKjCs8g==, + } + engines: { node: ">=12" } + cpu: [arm64] + os: [darwin] + requiresBuild: true + dev: true + optional: true + + /@esbuild/darwin-x64@0.19.12: + resolution: + { + integrity: sha512-hKoVkKzFiToTgn+41qGhsUJXFlIjxI/jSYeZf3ugemDYZldIXIxhvwN6erJGlX4t5h417iFuheZ7l+YVn05N3A==, + } + engines: { node: ">=12" } + cpu: [x64] + os: [darwin] + requiresBuild: true + dev: true + optional: true + + /@esbuild/freebsd-arm64@0.19.12: + resolution: + { + integrity: sha512-4aRvFIXmwAcDBw9AueDQ2YnGmz5L6obe5kmPT8Vd+/+x/JMVKCgdcRwH6APrbpNXsPz+K653Qg8HB/oXvXVukA==, + } + engines: { node: ">=12" } + cpu: [arm64] + os: [freebsd] + requiresBuild: true + dev: true + optional: true + + /@esbuild/freebsd-x64@0.19.12: + resolution: + { + integrity: sha512-EYoXZ4d8xtBoVN7CEwWY2IN4ho76xjYXqSXMNccFSx2lgqOG/1TBPW0yPx1bJZk94qu3tX0fycJeeQsKovA8gg==, + } + engines: { node: ">=12" } + cpu: [x64] + os: [freebsd] + requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-arm64@0.19.12: + resolution: + { + integrity: sha512-EoTjyYyLuVPfdPLsGVVVC8a0p1BFFvtpQDB/YLEhaXyf/5bczaGeN15QkR+O4S5LeJ92Tqotve7i1jn35qwvdA==, + } + engines: { node: ">=12" } + cpu: [arm64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-arm@0.19.12: + resolution: + { + integrity: sha512-J5jPms//KhSNv+LO1S1TX1UWp1ucM6N6XuL6ITdKWElCu8wXP72l9MM0zDTzzeikVyqFE6U8YAV9/tFyj0ti+w==, + } + engines: { node: ">=12" } + cpu: [arm] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-ia32@0.19.12: + resolution: + { + integrity: sha512-Thsa42rrP1+UIGaWz47uydHSBOgTUnwBwNq59khgIwktK6x60Hivfbux9iNR0eHCHzOLjLMLfUMLCypBkZXMHA==, + } + engines: { node: ">=12" } + cpu: [ia32] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-loong64@0.19.12: + resolution: + { + integrity: sha512-LiXdXA0s3IqRRjm6rV6XaWATScKAXjI4R4LoDlvO7+yQqFdlr1Bax62sRwkVvRIrwXxvtYEHHI4dm50jAXkuAA==, + } + engines: { node: ">=12" } + cpu: [loong64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-mips64el@0.19.12: + resolution: + { + integrity: sha512-fEnAuj5VGTanfJ07ff0gOA6IPsvrVHLVb6Lyd1g2/ed67oU1eFzL0r9WL7ZzscD+/N6i3dWumGE1Un4f7Amf+w==, + } + engines: { node: ">=12" } + cpu: [mips64el] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-ppc64@0.19.12: + resolution: + { + integrity: sha512-nYJA2/QPimDQOh1rKWedNOe3Gfc8PabU7HT3iXWtNUbRzXS9+vgB0Fjaqr//XNbd82mCxHzik2qotuI89cfixg==, + } + engines: { node: ">=12" } + cpu: [ppc64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-riscv64@0.19.12: + resolution: + { + integrity: sha512-2MueBrlPQCw5dVJJpQdUYgeqIzDQgw3QtiAHUC4RBz9FXPrskyyU3VI1hw7C0BSKB9OduwSJ79FTCqtGMWqJHg==, + } + engines: { node: ">=12" } + cpu: [riscv64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-s390x@0.19.12: + resolution: + { + integrity: sha512-+Pil1Nv3Umes4m3AZKqA2anfhJiVmNCYkPchwFJNEJN5QxmTs1uzyy4TvmDrCRNT2ApwSari7ZIgrPeUx4UZDg==, + } + engines: { node: ">=12" } + cpu: [s390x] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-x64@0.19.12: + resolution: + { + integrity: sha512-B71g1QpxfwBvNrfyJdVDexenDIt1CiDN1TIXLbhOw0KhJzE78KIFGX6OJ9MrtC0oOqMWf+0xop4qEU8JrJTwCg==, + } + engines: { node: ">=12" } + cpu: [x64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@esbuild/netbsd-x64@0.19.12: + resolution: + { + integrity: sha512-3ltjQ7n1owJgFbuC61Oj++XhtzmymoCihNFgT84UAmJnxJfm4sYCiSLTXZtE00VWYpPMYc+ZQmB6xbSdVh0JWA==, + } + engines: { node: ">=12" } + cpu: [x64] + os: [netbsd] + requiresBuild: true + dev: true + optional: true + + /@esbuild/openbsd-x64@0.19.12: + resolution: + { + integrity: sha512-RbrfTB9SWsr0kWmb9srfF+L933uMDdu9BIzdA7os2t0TXhCRjrQyCeOt6wVxr79CKD4c+p+YhCj31HBkYcXebw==, + } + engines: { node: ">=12" } + cpu: [x64] + os: [openbsd] + requiresBuild: true + dev: true + optional: true + + /@esbuild/sunos-x64@0.19.12: + resolution: + { + integrity: sha512-HKjJwRrW8uWtCQnQOz9qcU3mUZhTUQvi56Q8DPTLLB+DawoiQdjsYq+j+D3s9I8VFtDr+F9CjgXKKC4ss89IeA==, + } + engines: { node: ">=12" } + cpu: [x64] + os: [sunos] + requiresBuild: true + dev: true + optional: true + + /@esbuild/win32-arm64@0.19.12: + resolution: + { + integrity: sha512-URgtR1dJnmGvX864pn1B2YUYNzjmXkuJOIqG2HdU62MVS4EHpU2946OZoTMnRUHklGtJdJZ33QfzdjGACXhn1A==, + } + engines: { node: ">=12" } + cpu: [arm64] + os: [win32] + requiresBuild: true + dev: true + optional: true + + /@esbuild/win32-ia32@0.19.12: + resolution: + { + integrity: sha512-+ZOE6pUkMOJfmxmBZElNOx72NKpIa/HFOMGzu8fqzQJ5kgf6aTGrcJaFsNiVMH4JKpMipyK+7k0n2UXN7a8YKQ==, + } + engines: { node: ">=12" } + cpu: [ia32] + os: [win32] + requiresBuild: true + dev: true + optional: true + + /@esbuild/win32-x64@0.19.12: + resolution: + { + integrity: sha512-T1QyPSDCyMXaO3pzBkF96E8xMkiRYbUEZADd29SyPGabqxMViNoii+NcK7eWJAEoU6RZyEm5lVSIjTmcdoB9HA==, + } + engines: { node: ">=12" } + cpu: [x64] + os: [win32] + requiresBuild: true + dev: true + optional: true + /@eslint-community/eslint-utils@4.4.0(eslint@8.57.0): resolution: { @@ -600,6 +879,21 @@ packages: } dev: true + /@isaacs/cliui@8.0.2: + resolution: + { + integrity: sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==, + } + engines: { node: ">=12" } + dependencies: + string-width: 5.1.2 + string-width-cjs: /string-width@4.2.3 + strip-ansi: 7.1.0 + strip-ansi-cjs: /strip-ansi@6.0.1 + wrap-ansi: 8.1.0 + wrap-ansi-cjs: /wrap-ansi@7.0.0 + dev: true + /@jridgewell/gen-mapping@0.3.5: resolution: { @@ -801,6 +1095,16 @@ packages: engines: { node: ">=8.0.0" } dev: false + /@pkgjs/parseargs@0.11.0: + resolution: + { + integrity: sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==, + } + engines: { node: ">=14" } + requiresBuild: true + dev: true + optional: true + /@pkgr/core@0.1.1: resolution: { @@ -809,6 +1113,182 @@ packages: engines: { node: ^12.20.0 || ^14.18.0 || >=16.0.0 } dev: true + /@rollup/rollup-android-arm-eabi@4.15.0: + resolution: + { + integrity: sha512-O63bJ7p909pRRQfOJ0k/Jp8gNFMud+ZzLLG5EBWquylHxmRT2k18M2ifg8WyjCgFVdpA7+rI0YZ8EkAtg6dSUw==, + } + cpu: [arm] + os: [android] + requiresBuild: true + dev: true + optional: true + + /@rollup/rollup-android-arm64@4.15.0: + resolution: + { + integrity: sha512-5UywPdmC9jiVOShjQx4uuIcnTQOf85iA4jgg8bkFoH5NYWFfAfrJpv5eeokmTdSmYwUTT5IrcrBCJNkowhrZDA==, + } + cpu: [arm64] + os: [android] + requiresBuild: true + dev: true + optional: true + + /@rollup/rollup-darwin-arm64@4.15.0: + resolution: + { + integrity: sha512-hNkt75uFfWpRxHItCBmbS0ba70WnibJh6yz60WShSWITLlVRbkvAu1E/c7RlliPY4ajhqJd0UPZz//gNalTd4g==, + } + cpu: [arm64] + os: [darwin] + requiresBuild: true + dev: true + optional: true + + /@rollup/rollup-darwin-x64@4.15.0: + resolution: + { + integrity: sha512-HnC5bTP7qdfO9nUw/mBhNcjOEZfbS8NwV+nFegiMhYOn1ATAGZF4kfAxR9BuZevBrebWCxMmxm8NCU1CUoz+wQ==, + } + cpu: [x64] + os: [darwin] + requiresBuild: true + dev: true + optional: true + + /@rollup/rollup-linux-arm-gnueabihf@4.15.0: + resolution: + { + integrity: sha512-QGOIQIJZeIIqMsc4BUGe8TnV4dkXhSW2EhaQ1G4LqMUNpkyeLztvlDlOoNHn7SR7a4dBANdcEbPkkEzz3rzjzA==, + } + cpu: [arm] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@rollup/rollup-linux-arm-musleabihf@4.15.0: + resolution: + { + integrity: sha512-PS/Cp8CinYgoysQ8i4UXYH/TZl06fXszvY/RDkyBYgUB1+tKyOMS925/4FZhfrhkl3XQEKjMc3BKtsxpB9Tz9Q==, + } + cpu: [arm] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@rollup/rollup-linux-arm64-gnu@4.15.0: + resolution: + { + integrity: sha512-XzOsnD6lGDP+k+vGgTYAryVGu8N89qpjMN5BVFUj75dGVFP3FzIVAufJAraxirpDwEQZA7Gjs0Vo5p4UmnnjsA==, + } + cpu: [arm64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@rollup/rollup-linux-arm64-musl@4.15.0: + resolution: + { + integrity: sha512-+ScJA4Epbx/ZQGjDnbvTAcb8ZD06b+TlIka2UkujbKf1I/A+yrvEcJwG3/27zMmvcWMQyeCJhbL9TlSjzL0B7Q==, + } + cpu: [arm64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@rollup/rollup-linux-powerpc64le-gnu@4.15.0: + resolution: + { + integrity: sha512-1cUSvYgnyTakM4FDyf/GxUCDcqmj/hUh1NOizEOJU7+D5xEfFGCxgcNOs3hYBeRMUCcGmGkt01EhD3ILgKpGHQ==, + } + cpu: [ppc64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@rollup/rollup-linux-riscv64-gnu@4.15.0: + resolution: + { + integrity: sha512-3A1FbHDbBUvpJXFAZwVsiROIcstVHP9AX/cwnyIhAp+xyQ1cBCxywKtuzmw0Av1MDNNg/y/9dDHtNypfRa8bdw==, + } + cpu: [riscv64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@rollup/rollup-linux-s390x-gnu@4.15.0: + resolution: + { + integrity: sha512-hYPbhg9ow6/mXIkojc8LOeiip2sCTuw1taWyoOXTOWk9vawIXz8x7B4KkgWUAtvAElssxhSyEXr2EZycH/FGzQ==, + } + cpu: [s390x] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@rollup/rollup-linux-x64-gnu@4.15.0: + resolution: + { + integrity: sha512-511qln5mPSUKwv7HI28S1jCD1FK+2WbX5THM9A9annr3c1kzmfnf8Oe3ZakubEjob3IV6OPnNNcesfy+adIrmw==, + } + cpu: [x64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@rollup/rollup-linux-x64-musl@4.15.0: + resolution: + { + integrity: sha512-4qKKGTDIv2bQZ+afhPWqPL+94+dLtk4lw1iwbcylKlLNqQ/Yyjof2CFYBxf6npiDzPV+zf4EWRiHb26/4Vsm9w==, + } + cpu: [x64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@rollup/rollup-win32-arm64-msvc@4.15.0: + resolution: + { + integrity: sha512-nEtaFBHp1OnbOf+tz66DtID579sNRHGgMC23to8HUyVuOCpCMD0CvRNqiDGLErLNnwApWIUtUl1VvuovCWUxwg==, + } + cpu: [arm64] + os: [win32] + requiresBuild: true + dev: true + optional: true + + /@rollup/rollup-win32-ia32-msvc@4.15.0: + resolution: + { + integrity: sha512-5O49NykwSgX6iT2HgZ6cAoGHt6T/FqNMB5OqFOGxU/y1GyFSHquox1sK2OqApQc0ANxiHFQEMNDLNVCL7AUDnQ==, + } + cpu: [ia32] + os: [win32] + requiresBuild: true + dev: true + optional: true + + /@rollup/rollup-win32-x64-msvc@4.15.0: + resolution: + { + integrity: sha512-YA0hTwCunmKNeTOFWdJuKhdXse9jBqgo34FDo+9aS0spfCkp+wj0o1bCcOOTu+0P48O95GTfkLTAaVonwNuIdQ==, + } + cpu: [x64] + os: [win32] + requiresBuild: true + dev: true + optional: true + /@sindresorhus/is@6.2.0: resolution: { @@ -850,6 +1330,13 @@ packages: - supports-color dev: true + /@types/estree@1.0.5: + resolution: + { + integrity: sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==, + } + dev: true + /@types/http-cache-semantics@4.0.4: resolution: { @@ -1251,6 +1738,14 @@ packages: engines: { node: ">=8" } dev: true + /ansi-regex@6.0.1: + resolution: + { + integrity: sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==, + } + engines: { node: ">=12" } + dev: true + /ansi-styles@3.2.1: resolution: { @@ -1271,6 +1766,32 @@ packages: color-convert: 2.0.1 dev: true + /ansi-styles@6.2.1: + resolution: + { + integrity: sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==, + } + engines: { node: ">=12" } + dev: true + + /any-promise@1.3.0: + resolution: + { + integrity: sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A==, + } + dev: true + + /anymatch@3.1.3: + resolution: + { + integrity: sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==, + } + engines: { node: ">= 8" } + dependencies: + normalize-path: 3.0.0 + picomatch: 2.3.1 + dev: true + /argparse@2.0.1: resolution: { @@ -1433,6 +1954,14 @@ packages: } dev: false + /binary-extensions@2.3.0: + resolution: + { + integrity: sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==, + } + engines: { node: ">=8" } + dev: true + /brace-expansion@1.1.11: resolution: { @@ -1475,6 +2004,27 @@ packages: update-browserslist-db: 1.0.13(browserslist@4.23.0) dev: true + /bundle-require@4.0.2(esbuild@0.19.12): + resolution: + { + integrity: sha512-jwzPOChofl67PSTW2SGubV9HBQAhhR2i6nskiOThauo9dzwDUgOWQScFVaJkjEfYX+UXiD+LEx8EblQMc2wIag==, + } + engines: { node: ^12.20.0 || ^14.13.1 || >=16.0.0 } + peerDependencies: + esbuild: ">=0.17" + dependencies: + esbuild: 0.19.12 + load-tsconfig: 0.2.5 + dev: true + + /cac@6.7.14: + resolution: + { + integrity: sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==, + } + engines: { node: ">=8" } + dev: true + /cacheable-lookup@7.0.0: resolution: { @@ -1551,6 +2101,24 @@ packages: supports-color: 7.2.0 dev: true + /chokidar@3.6.0: + resolution: + { + integrity: sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==, + } + engines: { node: ">= 8.10.0" } + dependencies: + anymatch: 3.1.3 + braces: 3.0.2 + glob-parent: 5.1.2 + is-binary-path: 2.1.0 + is-glob: 4.0.3 + normalize-path: 3.0.0 + readdirp: 3.6.0 + optionalDependencies: + fsevents: 2.3.3 + dev: true + /color-convert@1.9.3: resolution: { @@ -1594,6 +2162,14 @@ packages: delayed-stream: 1.0.0 dev: false + /commander@4.1.1: + resolution: + { + integrity: sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==, + } + engines: { node: ">= 6" } + dev: true + /concat-map@0.0.1: resolution: { @@ -1786,6 +2362,13 @@ packages: esutils: 2.0.3 dev: true + /eastasianwidth@0.2.0: + resolution: + { + integrity: sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==, + } + dev: true + /electron-to-chromium@1.4.735: resolution: { @@ -1793,6 +2376,13 @@ packages: } dev: true + /emoji-regex@8.0.0: + resolution: + { + integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==, + } + dev: true + /emoji-regex@9.2.2: resolution: { @@ -1950,6 +2540,40 @@ packages: is-symbol: 1.0.4 dev: true + /esbuild@0.19.12: + resolution: + { + integrity: sha512-aARqgq8roFBj054KvQr5f1sFu0D65G+miZRCuJyJ0G13Zwx7vRar5Zhn2tkQNzIXcBrNVsv/8stehpj+GAjgbg==, + } + engines: { node: ">=12" } + hasBin: true + requiresBuild: true + optionalDependencies: + "@esbuild/aix-ppc64": 0.19.12 + "@esbuild/android-arm": 0.19.12 + "@esbuild/android-arm64": 0.19.12 + "@esbuild/android-x64": 0.19.12 + "@esbuild/darwin-arm64": 0.19.12 + "@esbuild/darwin-x64": 0.19.12 + "@esbuild/freebsd-arm64": 0.19.12 + "@esbuild/freebsd-x64": 0.19.12 + "@esbuild/linux-arm": 0.19.12 + "@esbuild/linux-arm64": 0.19.12 + "@esbuild/linux-ia32": 0.19.12 + "@esbuild/linux-loong64": 0.19.12 + "@esbuild/linux-mips64el": 0.19.12 + "@esbuild/linux-ppc64": 0.19.12 + "@esbuild/linux-riscv64": 0.19.12 + "@esbuild/linux-s390x": 0.19.12 + "@esbuild/linux-x64": 0.19.12 + "@esbuild/netbsd-x64": 0.19.12 + "@esbuild/openbsd-x64": 0.19.12 + "@esbuild/sunos-x64": 0.19.12 + "@esbuild/win32-arm64": 0.19.12 + "@esbuild/win32-ia32": 0.19.12 + "@esbuild/win32-x64": 0.19.12 + dev: true + /escalade@3.1.2: resolution: { @@ -2455,6 +3079,24 @@ packages: engines: { node: ">=0.8.x" } dev: false + /execa@5.1.1: + resolution: + { + integrity: sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==, + } + engines: { node: ">=10" } + dependencies: + cross-spawn: 7.0.3 + get-stream: 6.0.1 + human-signals: 2.1.0 + is-stream: 2.0.1 + merge-stream: 2.0.0 + npm-run-path: 4.0.1 + onetime: 5.1.2 + signal-exit: 3.0.7 + strip-final-newline: 2.0.0 + dev: true + /fast-deep-equal@3.1.3: resolution: { @@ -2572,6 +3214,17 @@ packages: is-callable: 1.2.7 dev: true + /foreground-child@3.1.1: + resolution: + { + integrity: sha512-TMKDUnIte6bfb5nWv7V/caI169OHgvwjb7V4WkeUvbQQdjr5rWKqHFiKWb/fcOwB+CzBT+qbWjvj+DVwRskpIg==, + } + engines: { node: ">=14" } + dependencies: + cross-spawn: 7.0.3 + signal-exit: 4.1.0 + dev: true + /form-data-encoder@4.0.2: resolution: { @@ -2611,6 +3264,17 @@ packages: } dev: true + /fsevents@2.3.3: + resolution: + { + integrity: sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==, + } + engines: { node: ^8.16.0 || ^10.6.0 || >=11.0.0 } + os: [darwin] + requiresBuild: true + dev: true + optional: true + /function-bind@1.1.2: resolution: { @@ -2658,7 +3322,6 @@ packages: integrity: sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==, } engines: { node: ">=10" } - dev: false /get-stream@8.0.1: resolution: @@ -2709,6 +3372,21 @@ packages: is-glob: 4.0.3 dev: true + /glob@10.3.12: + resolution: + { + integrity: sha512-TCNv8vJ+xz4QiqTpfOJA7HvYv+tNIRHKfUWw/q+v2jdgN4ebz+KY9tGx5J4rHP0o84mNP+ApH66HRX8us3Khqg==, + } + engines: { node: ">=16 || 14 >=14.17" } + hasBin: true + dependencies: + foreground-child: 3.1.1 + jackspeak: 2.3.6 + minimatch: 9.0.4 + minipass: 7.0.4 + path-scurry: 1.10.2 + dev: true + /glob@7.2.3: resolution: { @@ -2895,6 +3573,14 @@ packages: resolve-alpn: 1.2.1 dev: false + /human-signals@2.1.0: + resolution: + { + integrity: sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==, + } + engines: { node: ">=10.17.0" } + dev: true + /ignore@5.3.1: resolution: { @@ -2981,6 +3667,16 @@ packages: has-bigints: 1.0.2 dev: true + /is-binary-path@2.1.0: + resolution: + { + integrity: sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==, + } + engines: { node: ">=8" } + dependencies: + binary-extensions: 2.3.0 + dev: true + /is-boolean-object@1.1.2: resolution: { @@ -3046,6 +3742,14 @@ packages: call-bind: 1.0.7 dev: true + /is-fullwidth-code-point@3.0.0: + resolution: + { + integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==, + } + engines: { node: ">=8" } + dev: true + /is-generator-function@1.0.10: resolution: { @@ -3145,6 +3849,14 @@ packages: call-bind: 1.0.7 dev: true + /is-stream@2.0.1: + resolution: + { + integrity: sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==, + } + engines: { node: ">=8" } + dev: true + /is-string@1.0.7: resolution: { @@ -3230,6 +3942,18 @@ packages: set-function-name: 2.0.2 dev: true + /jackspeak@2.3.6: + resolution: + { + integrity: sha512-N3yCS/NegsOBokc8GAdM8UcmfsKiSS8cipheD/nivzr700H+nsMOxJjQnvwOcRYVuFkdH0wGUvW2WbXGmrZGbQ==, + } + engines: { node: ">=14" } + dependencies: + "@isaacs/cliui": 8.0.2 + optionalDependencies: + "@pkgjs/parseargs": 0.11.0 + dev: true + /javascript-natural-sort@0.7.1: resolution: { @@ -3237,6 +3961,14 @@ packages: } dev: true + /joycon@3.1.1: + resolution: + { + integrity: sha512-34wB/Y7MW7bzjKRjUKTa46I2Z7eV62Rkhva+KkopW7Qvv/OSWBqvkSY7vusOPrNuZcUG3tApvdVgNB8POj3SPw==, + } + engines: { node: ">=10" } + dev: true + /js-tokens@4.0.0: resolution: { @@ -3342,6 +4074,29 @@ packages: type-check: 0.4.0 dev: true + /lilconfig@3.1.1: + resolution: + { + integrity: sha512-O18pf7nyvHTckunPWCV1XUNXU1piu01y2b7ATJ0ppkUkk8ocqVWBrYjJBCwHDjD/ZWcfyrA0P4gKhzWGi5EINQ==, + } + engines: { node: ">=14" } + dev: true + + /lines-and-columns@1.2.4: + resolution: + { + integrity: sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==, + } + dev: true + + /load-tsconfig@0.2.5: + resolution: + { + integrity: sha512-IXO6OCs9yg8tMKzfPZ1YmheJbZCiEsnBdcB03l0OcfK9prKnJb96siuHCr5Fl37/yo9DnKU+TLpxzTUspw9shg==, + } + engines: { node: ^12.20.0 || ^14.13.1 || >=16.0.0 } + dev: true + /locate-path@6.0.0: resolution: { @@ -3380,6 +4135,13 @@ packages: } dev: true + /lodash.sortby@4.7.0: + resolution: + { + integrity: sha512-HDWXG8isMntAyRF5vZ7xKuEvOhT4AhlRt/3czTSjvGUxjYCBVRQY48ViDHyfYz9VIoBkW4TMGQNapx+l3RUwdA==, + } + dev: true + /lodash.upperfirst@4.3.1: resolution: { @@ -3402,6 +4164,14 @@ packages: engines: { node: ^12.20.0 || ^14.13.1 || >=16.0.0 } dev: false + /lru-cache@10.2.0: + resolution: + { + integrity: sha512-2bIM8x+VAf6JT4bKAljS1qUWgMsqZRPGJS6FSahIMPVvctcNhyVp7AJu7quxOW9jwkryBReKZY5tY5JYv2n/7Q==, + } + engines: { node: 14 || >=16.14 } + dev: true + /lru-cache@6.0.0: resolution: { @@ -3412,6 +4182,13 @@ packages: yallist: 4.0.0 dev: true + /merge-stream@2.0.0: + resolution: + { + integrity: sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==, + } + dev: true + /merge2@1.4.1: resolution: { @@ -3449,6 +4226,14 @@ packages: mime-db: 1.52.0 dev: false + /mimic-fn@2.1.0: + resolution: + { + integrity: sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==, + } + engines: { node: ">=6" } + dev: true + /mimic-response@3.1.0: resolution: { @@ -3490,6 +4275,14 @@ packages: } dev: true + /minipass@7.0.4: + resolution: + { + integrity: sha512-jYofLM5Dam9279rdkWzqHozUo4ybjdZmCsDHePy5V/PbBcVMiSZR97gmAy45aqi8CK1lG2ECd356FU86avfwUQ==, + } + engines: { node: ">=16 || 14 >=14.17" } + dev: true + /ms@2.1.2: resolution: { @@ -3504,6 +4297,17 @@ packages: } dev: true + /mz@2.7.0: + resolution: + { + integrity: sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==, + } + dependencies: + any-promise: 1.3.0 + object-assign: 4.1.1 + thenify-all: 1.6.0 + dev: true + /natural-compare@1.4.0: resolution: { @@ -3533,6 +4337,14 @@ packages: } dev: true + /normalize-path@3.0.0: + resolution: + { + integrity: sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==, + } + engines: { node: ">=0.10.0" } + dev: true + /normalize-url@8.0.1: resolution: { @@ -3541,6 +4353,24 @@ packages: engines: { node: ">=14.16" } dev: false + /npm-run-path@4.0.1: + resolution: + { + integrity: sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==, + } + engines: { node: ">=8" } + dependencies: + path-key: 3.1.1 + dev: true + + /object-assign@4.1.1: + resolution: + { + integrity: sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==, + } + engines: { node: ">=0.10.0" } + dev: true + /object-inspect@1.13.1: resolution: { @@ -3626,6 +4456,16 @@ packages: dependencies: wrappy: 1.0.2 + /onetime@5.1.2: + resolution: + { + integrity: sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==, + } + engines: { node: ">=6" } + dependencies: + mimic-fn: 2.1.0 + dev: true + /optionator@0.9.3: resolution: { @@ -3710,6 +4550,17 @@ packages: } dev: true + /path-scurry@1.10.2: + resolution: + { + integrity: sha512-7xTavNy5RQXnsjANvVvMkEjvloOinkAjv/Z6Ildz9v2RinZ4SBKTWFOVRbaF8p0vpHnyjV/UwNDdKuUv6M5qcA==, + } + engines: { node: ">=16 || 14 >=14.17" } + dependencies: + lru-cache: 10.2.0 + minipass: 7.0.4 + dev: true + /path-type@4.0.0: resolution: { @@ -3733,6 +4584,14 @@ packages: engines: { node: ">=8.6" } dev: true + /pirates@4.0.6: + resolution: + { + integrity: sha512-saLsH7WeYYPiD25LDuLRRY/i+6HaPYr6G1OUlN39otzkSTxKnubR9RTxS3/Kk50s1g2JTgFwWQDQyplC5/SHZg==, + } + engines: { node: ">= 6" } + dev: true + /possible-typed-array-names@1.0.0: resolution: { @@ -3741,6 +4600,25 @@ packages: engines: { node: ">= 0.4" } dev: true + /postcss-load-config@4.0.2: + resolution: + { + integrity: sha512-bSVhyJGL00wMVoPUzAVAnbEoWyqRxkjv64tUl427SKnPrENtq6hJwUojroMz2VB+Q1edmi4IfrAPpami5VVgMQ==, + } + engines: { node: ">= 14" } + peerDependencies: + postcss: ">=8.0.9" + ts-node: ">=9.0.0" + peerDependenciesMeta: + postcss: + optional: true + ts-node: + optional: true + dependencies: + lilconfig: 3.1.1 + yaml: 2.4.1 + dev: true + /prelude-ls@1.2.1: resolution: { @@ -3799,6 +4677,16 @@ packages: engines: { node: ">=10" } dev: false + /readdirp@3.6.0: + resolution: + { + integrity: sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==, + } + engines: { node: ">=8.10.0" } + dependencies: + picomatch: 2.3.1 + dev: true + /reflect.getprototypeof@1.0.6: resolution: { @@ -3850,6 +4738,14 @@ packages: engines: { node: ">=4" } dev: true + /resolve-from@5.0.0: + resolution: + { + integrity: sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==, + } + engines: { node: ">=8" } + dev: true + /resolve-pkg-maps@1.0.0: resolution: { @@ -3897,6 +4793,35 @@ packages: glob: 7.2.3 dev: true + /rollup@4.15.0: + resolution: + { + integrity: sha512-i0ir57IMF5o7YvNYyUNeIGG+IZaaucnGZAOsSctO2tPLXlCEaZzyBa+QhpHNSgtpyLMoDev2DyN6a7J1dQA8Tw==, + } + engines: { node: ">=18.0.0", npm: ">=8.0.0" } + hasBin: true + dependencies: + "@types/estree": 1.0.5 + optionalDependencies: + "@rollup/rollup-android-arm-eabi": 4.15.0 + "@rollup/rollup-android-arm64": 4.15.0 + "@rollup/rollup-darwin-arm64": 4.15.0 + "@rollup/rollup-darwin-x64": 4.15.0 + "@rollup/rollup-linux-arm-gnueabihf": 4.15.0 + "@rollup/rollup-linux-arm-musleabihf": 4.15.0 + "@rollup/rollup-linux-arm64-gnu": 4.15.0 + "@rollup/rollup-linux-arm64-musl": 4.15.0 + "@rollup/rollup-linux-powerpc64le-gnu": 4.15.0 + "@rollup/rollup-linux-riscv64-gnu": 4.15.0 + "@rollup/rollup-linux-s390x-gnu": 4.15.0 + "@rollup/rollup-linux-x64-gnu": 4.15.0 + "@rollup/rollup-linux-x64-musl": 4.15.0 + "@rollup/rollup-win32-arm64-msvc": 4.15.0 + "@rollup/rollup-win32-ia32-msvc": 4.15.0 + "@rollup/rollup-win32-x64-msvc": 4.15.0 + fsevents: 2.3.3 + dev: true + /run-parallel@1.2.0: resolution: { @@ -4015,6 +4940,21 @@ packages: object-inspect: 1.13.1 dev: true + /signal-exit@3.0.7: + resolution: + { + integrity: sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==, + } + dev: true + + /signal-exit@4.1.0: + resolution: + { + integrity: sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==, + } + engines: { node: ">=14" } + dev: true + /slash@3.0.0: resolution: { @@ -4031,6 +4971,16 @@ packages: engines: { node: ">=0.10.0" } dev: true + /source-map@0.8.0-beta.0: + resolution: + { + integrity: sha512-2ymg6oRBpebeZi9UUNsgQ89bhx01TcTkmNTGnNO88imTmbSgy4nfujrgVEFKWpMTEGA11EDkTt7mqObTPdigIA==, + } + engines: { node: ">= 8" } + dependencies: + whatwg-url: 7.1.0 + dev: true + /string-argv@0.3.2: resolution: { @@ -4039,6 +4989,30 @@ packages: engines: { node: ">=0.6.19" } dev: false + /string-width@4.2.3: + resolution: + { + integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==, + } + engines: { node: ">=8" } + dependencies: + emoji-regex: 8.0.0 + is-fullwidth-code-point: 3.0.0 + strip-ansi: 6.0.1 + dev: true + + /string-width@5.1.2: + resolution: + { + integrity: sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==, + } + engines: { node: ">=12" } + dependencies: + eastasianwidth: 0.2.0 + emoji-regex: 9.2.2 + strip-ansi: 7.1.0 + dev: true + /string.prototype.trim@1.2.9: resolution: { @@ -4085,6 +5059,16 @@ packages: ansi-regex: 5.0.1 dev: true + /strip-ansi@7.1.0: + resolution: + { + integrity: sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==, + } + engines: { node: ">=12" } + dependencies: + ansi-regex: 6.0.1 + dev: true + /strip-bom@3.0.0: resolution: { @@ -4093,6 +5077,14 @@ packages: engines: { node: ">=4" } dev: true + /strip-final-newline@2.0.0: + resolution: + { + integrity: sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==, + } + engines: { node: ">=6" } + dev: true + /strip-json-comments@3.1.1: resolution: { @@ -4101,6 +5093,23 @@ packages: engines: { node: ">=8" } dev: true + /sucrase@3.35.0: + resolution: + { + integrity: sha512-8EbVDiu9iN/nESwxeSxDKe0dunta1GOlHufmSSXxMD2z2/tMZpDMpvXQGsc+ajGo8y2uYUmixaSRUc/QPoQ0GA==, + } + engines: { node: ">=16 || 14 >=14.17" } + hasBin: true + dependencies: + "@jridgewell/gen-mapping": 0.3.5 + commander: 4.1.1 + glob: 10.3.12 + lines-and-columns: 1.2.4 + mz: 2.7.0 + pirates: 4.0.6 + ts-interface-checker: 0.1.13 + dev: true + /supports-color@5.5.0: resolution: { @@ -4170,6 +5179,25 @@ packages: } dev: true + /thenify-all@1.6.0: + resolution: + { + integrity: sha512-RNxQH/qI8/t3thXJDwcstUO4zeqo64+Uy/+sNVRBx4Xn2OX+OZ9oP+iJnNFqplFra2ZUVeKCSa2oVWi3T4uVmA==, + } + engines: { node: ">=0.8" } + dependencies: + thenify: 3.3.1 + dev: true + + /thenify@3.3.1: + resolution: + { + integrity: sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw==, + } + dependencies: + any-promise: 1.3.0 + dev: true + /to-fast-properties@2.0.0: resolution: { @@ -4195,6 +5223,23 @@ packages: } dev: false + /tr46@1.0.1: + resolution: + { + integrity: sha512-dTpowEjclQ7Kgx5SdBkqRzVhERQXov8/l9Ft9dVM9fmg0W0KQSVaXX9T4i6twCPNtYiZM53lpSSUAwJbFPOHxA==, + } + dependencies: + punycode: 2.3.1 + dev: true + + /tree-kill@1.2.2: + resolution: + { + integrity: sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A==, + } + hasBin: true + dev: true + /ts-api-utils@1.3.0(typescript@5.4.5): resolution: { @@ -4207,6 +5252,13 @@ packages: typescript: 5.4.5 dev: true + /ts-interface-checker@0.1.13: + resolution: + { + integrity: sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==, + } + dev: true + /tsconfig-paths@3.15.0: resolution: { @@ -4232,6 +5284,48 @@ packages: integrity: sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==, } + /tsup@8.0.2(typescript@5.4.5): + resolution: + { + integrity: sha512-NY8xtQXdH7hDUAZwcQdY/Vzlw9johQsaqf7iwZ6g1DOUlFYQ5/AtVAjTvihhEyeRlGo4dLRVHtrRaL35M1daqQ==, + } + engines: { node: ">=18" } + hasBin: true + peerDependencies: + "@microsoft/api-extractor": ^7.36.0 + "@swc/core": ^1 + postcss: ^8.4.12 + typescript: ">=4.5.0" + peerDependenciesMeta: + "@microsoft/api-extractor": + optional: true + "@swc/core": + optional: true + postcss: + optional: true + typescript: + optional: true + dependencies: + bundle-require: 4.0.2(esbuild@0.19.12) + cac: 6.7.14 + chokidar: 3.6.0 + debug: 4.3.4 + esbuild: 0.19.12 + execa: 5.1.1 + globby: 11.1.0 + joycon: 3.1.1 + postcss-load-config: 4.0.2 + resolve-from: 5.0.0 + rollup: 4.15.0 + source-map: 0.8.0-beta.0 + sucrase: 3.35.0 + tree-kill: 1.2.2 + typescript: 5.4.5 + transitivePeerDependencies: + - supports-color + - ts-node + dev: true + /tunnel@0.0.6: resolution: { @@ -4413,6 +5507,13 @@ packages: } dev: false + /webidl-conversions@4.0.2: + resolution: + { + integrity: sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg==, + } + dev: true + /whatwg-url@5.0.0: resolution: { @@ -4423,6 +5524,17 @@ packages: webidl-conversions: 3.0.1 dev: false + /whatwg-url@7.1.0: + resolution: + { + integrity: sha512-WUu7Rg1DroM7oQvGWfOiAK21n74Gg+T4elXEQYkOhtyLeWiJFoOGLXPKI/9gzIie9CtwVLm8wtw6YJdKyxSjeg==, + } + dependencies: + lodash.sortby: 4.7.0 + tr46: 1.0.1 + webidl-conversions: 4.0.2 + dev: true + /which-boxed-primitive@1.0.2: resolution: { @@ -4495,6 +5607,30 @@ packages: isexe: 2.0.0 dev: true + /wrap-ansi@7.0.0: + resolution: + { + integrity: sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==, + } + engines: { node: ">=10" } + dependencies: + ansi-styles: 4.3.0 + string-width: 4.2.3 + strip-ansi: 6.0.1 + dev: true + + /wrap-ansi@8.1.0: + resolution: + { + integrity: sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==, + } + engines: { node: ">=12" } + dependencies: + ansi-styles: 6.2.1 + string-width: 5.1.2 + strip-ansi: 7.1.0 + dev: true + /wrappy@1.0.2: resolution: { @@ -4527,6 +5663,15 @@ packages: } dev: true + /yaml@2.4.1: + resolution: + { + integrity: sha512-pIXzoImaqmfOrL7teGUBt/T7ZDnyeGBWyXQBvOVhLkWLN37GXv8NMLK406UY6dS51JfcQHsmcW5cJ441bHg6Lg==, + } + engines: { node: ">= 14" } + hasBin: true + dev: true + /yocto-queue@0.1.0: resolution: { diff --git a/src/index.ts b/src/main.ts similarity index 100% rename from src/index.ts rename to src/main.ts diff --git a/tsup.config.ts b/tsup.config.ts new file mode 100644 index 0000000..d9a29e5 --- /dev/null +++ b/tsup.config.ts @@ -0,0 +1,15 @@ +import { defineConfig } from "tsup"; + +export default defineConfig({ + name: "detsys-ts", + entry: ["src/main.ts"], + format: ["esm"], + target: "node20", + bundle: true, + splitting: false, + sourcemap: true, + clean: true, + dts: { + resolve: true, + }, +});