From cd53feb7526b7cda1b5011e9321e074037e2bb7e Mon Sep 17 00:00:00 2001 From: ~noodlez1232 Date: Tue, 29 Oct 2024 12:27:15 -0700 Subject: [PATCH 01/10] Get package version straight from package.json --- src/lib/helpers/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/helpers/index.ts b/src/lib/helpers/index.ts index c12eb5a..62b4b76 100644 --- a/src/lib/helpers/index.ts +++ b/src/lib/helpers/index.ts @@ -15,8 +15,8 @@ import "dotenv/config"; import json5 from "json5"; const { parse } = json5; -import { isSea, getAsset } from "node:sea"; -export const DownloaderVersion = isSea() ? getAsset("./version", "utf-8") : JSON.parse(readFileSync("./package.json", "utf-8")).version; +import pjson from "../../../package.json" with { type: "json" }; +export const DownloaderVersion = pjson.version; import type { PartialArgs, Settings } from "../types.js"; From f67d4a39297a7d5fb7b2c98a040eb63f333165f7 Mon Sep 17 00:00:00 2001 From: ~noodlez1232 Date: Tue, 29 Oct 2024 13:06:48 -0700 Subject: [PATCH 02/10] Fix argument/settings parsing Before, both structs were being polluted with the environment variables. The way it's done now, it is no longer poluted and (in my opinion) is a bit cleaner as well. --- src/lib/helpers/index.ts | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/src/lib/helpers/index.ts b/src/lib/helpers/index.ts index 62b4b76..dfcc135 100644 --- a/src/lib/helpers/index.ts +++ b/src/lib/helpers/index.ts @@ -58,15 +58,19 @@ fApi.extend({ }, }); -export const settings = db("./db/settings.json", { template: defaultSettings, pretty: true, forceCreate: true, updateOnExternalChanges: true }); -recursiveUpdate(settings, defaultSettings); - const argv = ARGV(process.argv.slice(2))({}); -rebuildTypes(argv, { ...defaultSettings, ...defaultArgs }); -recursiveUpdate(settings, argv, { setUndefined: false, setDefined: true }); - const env = getEnv(); -rebuildTypes(env, { ...defaultSettings, ...defaultArgs }); + +export const args = defaultArgs; +recursiveUpdate(args, env, { setUndefined: false, setDefined: true }); +recursiveUpdate(args, argv, { setUndefined: false, setDefined: true }); + +export const settings = defaultSettings; +recursiveUpdate(settings, + db("./db/settings.json", { template: defaultSettings, pretty: true, forceCreate: true, updateOnExternalChanges: true }), + { setUndefined: true, setDefined: true }); + +recursiveUpdate(settings, argv, { setUndefined: false, setDefined: true }); if (env.__FPDSettings !== undefined) { if (typeof env.__FPDSettings !== "string") throw new Error("The __FPDSettings environment variable cannot be parsed!"); @@ -74,8 +78,9 @@ if (env.__FPDSettings !== undefined) { } recursiveUpdate(settings, env, { setUndefined: false, setDefined: true }); +console.log(settings); + -export const args = { ...argv, ...env }; // eslint-disable-next-line no-control-regex const headlessStdoutRegex = /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g; From 20deec1373d0ba6ab5b1515649a5f433edb79298 Mon Sep 17 00:00:00 2001 From: ~noodlez1232 Date: Tue, 29 Oct 2024 14:03:27 -0700 Subject: [PATCH 03/10] Remove hardcoded paths All paths can now be set in the arguments, and are all derived from the workPath (by default: ./db). This *should* require no change from the outside users as well, a transparent change. --- src/lib/Attachment.ts | 4 +-- src/lib/Video.ts | 2 +- src/lib/defaults.ts | 20 ++++++++++++++ src/lib/helpers/fetchFFMPEG.ts | 12 +++++---- src/lib/helpers/index.ts | 48 ++++++++++++++++++---------------- src/lib/types.ts | 5 ++++ 6 files changed, 61 insertions(+), 30 deletions(-) diff --git a/src/lib/Attachment.ts b/src/lib/Attachment.ts index ae15eb9..6b3f0ae 100644 --- a/src/lib/Attachment.ts +++ b/src/lib/Attachment.ts @@ -1,7 +1,7 @@ import db from "@inrixia/db"; import { nPad } from "@inrixia/helpers/math"; import { ValueOfA } from "@inrixia/helpers/ts"; -import { settings } from "./helpers/index.js"; +import { settings, args } from "./helpers/index.js"; import sanitize from "sanitize-filename"; import { dirname, basename, extname } from "path"; @@ -31,7 +31,7 @@ enum Extensions { } export class Attachment implements AttachmentAttributes { - private static readonly AttachmentsDB: Record = db>(`./db/attachments.json`); + private static readonly AttachmentsDB: Record = db>(args.attachmentsPath); public static readonly Extensions = Extensions; public readonly attachmentId: string; diff --git a/src/lib/Video.ts b/src/lib/Video.ts index af755fe..ac8a287 100644 --- a/src/lib/Video.ts +++ b/src/lib/Video.ts @@ -363,7 +363,7 @@ export class Video extends Attachment { await new Promise((resolve, reject) => execFile( - "./db/ffmpeg", + args.ffmpegPath, [ "-i", this.partialPath, diff --git a/src/lib/defaults.ts b/src/lib/defaults.ts index bf37956..84ee5fe 100644 --- a/src/lib/defaults.ts +++ b/src/lib/defaults.ts @@ -1,4 +1,5 @@ import { Resolutions, Channels, Settings, Args } from "./types.js"; +import { getBinaryFilename, detectPlatform } from "ffbinaries"; export const defaultResolutions: Resolutions = ["360", "720", "1080", "2160"]; export const defaultSubChannels: Record = { @@ -34,7 +35,26 @@ export const defaultArgs: Args = { plexUsername: "", plexPassword: "", sanityCheck: false, + workPath: "./db", + ffmpegPath: "", + settingsPath: "", + cookiesPath: "", + attachmentsPath: "", }; +export function fixArgs(args: Args) { + if (args.ffmpegPath === "") { + args.ffmpegPath = `${args.workPath}/${getBinaryFilename("ffmpeg", detectPlatform() )}`; + } + if (args.settingsPath === "") { + args.settingsPath = `${args.workPath}/settings.json`; + } + if (args.cookiesPath === "") { + args.cookiesPath = `${args.workPath}/cookies.json`; + } + if (args.attachmentsPath === "") { + args.attachmentsPath = `${args.workPath}/attachments.json`; + } +} export const defaultSettings: Settings = { __SettingsWiki: "https://github.com/Inrixia/Floatplane-Downloader/blob/master/wiki/settings.md", diff --git a/src/lib/helpers/fetchFFMPEG.ts b/src/lib/helpers/fetchFFMPEG.ts index b3499ac..9d1440b 100644 --- a/src/lib/helpers/fetchFFMPEG.ts +++ b/src/lib/helpers/fetchFFMPEG.ts @@ -1,16 +1,18 @@ import { downloadBinaries, detectPlatform, getBinaryFilename } from "ffbinaries"; +import { args } from "./index.js"; import fs from "fs"; +import { dirname, basename } from "path"; export const fetchFFMPEG = (): Promise => new Promise((resolve, reject) => { - const platform = detectPlatform(); - const path = "./db/"; - if (fs.existsSync(`${path}${getBinaryFilename("ffmpeg", platform)}`) === false) { + let platform = detectPlatform(); + let path = args.ffmpegPath; + if (fs.existsSync(path) === false) { process.stdout.write("> Ffmpeg binary missing! Downloading... "); downloadBinaries( - "ffmpeg", + basename(path), { - destination: path, + destination: dirname(path), platform, }, (err) => { diff --git a/src/lib/helpers/index.ts b/src/lib/helpers/index.ts index dfcc135..3522d29 100644 --- a/src/lib/helpers/index.ts +++ b/src/lib/helpers/index.ts @@ -1,5 +1,5 @@ import { getEnv, rebuildTypes, recursiveUpdate } from "@inrixia/helpers/object"; -import { defaultArgs, defaultSettings } from "../defaults.js"; +import { defaultArgs, defaultSettings, fixArgs } from "../defaults.js"; import { Histogram } from "prom-client"; import db from "@inrixia/db"; @@ -22,9 +22,31 @@ import type { PartialArgs, Settings } from "../types.js"; import { FileCookieStore } from "tough-cookie-file-store"; import { CookieJar } from "tough-cookie"; -export const cookieJar = new CookieJar(new FileCookieStore("./db/cookies.json")); import { Floatplane } from "floatplane"; + +const argv = ARGV(process.argv.slice(2))({}); +const env = getEnv(); + +export const args = defaultArgs; +recursiveUpdate(args, env, { setUndefined: false, setDefined: true }); +recursiveUpdate(args, argv, { setUndefined: false, setDefined: true }); +fixArgs(args); + +export const settings = defaultSettings; +let newSettings = db(args.settingsPath, { template: defaultSettings, pretty: true, forceCreate: true, updateOnExternalChanges: true }); +recursiveUpdate(settings, newSettings, { setUndefined: true, setDefined: true }); + +recursiveUpdate(settings, argv, { setUndefined: false, setDefined: true }); + +if (env.__FPDSettings !== undefined) { + if (typeof env.__FPDSettings !== "string") throw new Error("The __FPDSettings environment variable cannot be parsed!"); + recursiveUpdate(settings, parse(env.__FPDSettings.replaceAll('\\"', '"')), { setUndefined: false, setDefined: true }); +} + +recursiveUpdate(settings, env, { setUndefined: false, setDefined: true }); + +export const cookieJar = new CookieJar(new FileCookieStore(args.cookiesPath)); export const fApi = new Floatplane( cookieJar, `Floatplane-Downloader/${DownloaderVersion} (Inrix, +https://github.com/Inrixia/Floatplane-Downloader), CFNetwork`, @@ -58,27 +80,7 @@ fApi.extend({ }, }); -const argv = ARGV(process.argv.slice(2))({}); -const env = getEnv(); -export const args = defaultArgs; -recursiveUpdate(args, env, { setUndefined: false, setDefined: true }); -recursiveUpdate(args, argv, { setUndefined: false, setDefined: true }); - -export const settings = defaultSettings; -recursiveUpdate(settings, - db("./db/settings.json", { template: defaultSettings, pretty: true, forceCreate: true, updateOnExternalChanges: true }), - { setUndefined: true, setDefined: true }); - -recursiveUpdate(settings, argv, { setUndefined: false, setDefined: true }); - -if (env.__FPDSettings !== undefined) { - if (typeof env.__FPDSettings !== "string") throw new Error("The __FPDSettings environment variable cannot be parsed!"); - recursiveUpdate(settings, parse(env.__FPDSettings.replaceAll('\\"', '"')), { setUndefined: false, setDefined: true }); -} - -recursiveUpdate(settings, env, { setUndefined: false, setDefined: true }); -console.log(settings); @@ -94,3 +96,5 @@ if (args.headless === true) { return originalStdoutWrite(...params); }) as typeof process.stdout.write; } + + diff --git a/src/lib/types.ts b/src/lib/types.ts index 488c4b8..0c3059d 100644 --- a/src/lib/types.ts +++ b/src/lib/types.ts @@ -33,6 +33,11 @@ export type Args = { plexUsername: string; plexPassword: string; sanityCheck: boolean; + workPath: string; + settingsPath: string; + ffmpegPath: string; + cookiesPath: string; + attachmentsPath: string; }; export type PartialArgs = Partial; From 5c43d4e567b89ae6474c54fba1ddb695e476acbe Mon Sep 17 00:00:00 2001 From: ~noodlez1232 Date: Thu, 7 Nov 2024 09:51:14 -0800 Subject: [PATCH 04/10] Fix up package.json and pnpm-lock.yaml Including the sentinel was confusing postject. That's been moved to a different file outside the package.json. postject has also been added to the package.json, since it was being used, but was not included in the lock. Mostly for completeness. --- package.json | 7 +- pnpm-lock.yaml | 353 ++++++++++++++++++++++-------------------- postject-sentinel.txt | 1 + sea-config.json | 8 +- 4 files changed, 198 insertions(+), 171 deletions(-) create mode 100644 postject-sentinel.txt diff --git a/package.json b/package.json index c26cc3a..ddd0a42 100644 --- a/package.json +++ b/package.json @@ -16,8 +16,8 @@ "bundle": "pnpm run tsc && npx esbuild ./src/float.ts --bundle --platform=node --outfile=./dist/float.cjs", "build-windows-latest": "node make.js ./build/float-win.exe && pnpm run bundle && pnpm run makeBlob && pnpm run injectWin", "build-ubuntu-latest": "node make.js ./build/float-linux && pnpm run bundle && pnpm run makeBlob && pnpm run injectLinux", - "injectWin": "npx postject ./build/float-win.exe NODE_SEA_BLOB ./dist/float.blob --sentinel-fuse NODE_SEA_FUSE_fce680ab2cc467b6e072b8b5df1996b2", - "injectLinux": "npx postject ./build/float-linux NODE_SEA_BLOB ./dist/float.blob --sentinel-fuse NODE_SEA_FUSE_fce680ab2cc467b6e072b8b5df1996b2" + "injectWin": "npx postject ./build/float-win.exe NODE_SEA_BLOB ./dist/float.blob --sentinel-fuse $(cat ./postject-sentinel.txt)", + "injectLinux": "npx postject ./build/float-linux NODE_SEA_BLOB ./dist/float.blob --sentinel-fuse $(cat ./postject-sentinel.txt)" }, "dependencies": { "@ctrl/plex": "^3.4.0", @@ -35,6 +35,7 @@ "json5": "^2.2.3", "mime-types": "^3.0.0", "multi-progress-bars": "^5.0.3", + "postject": "1.0.0-alpha.6", "process.argv": "^0.6.1", "prom-client": "^15.1.3", "prompts": "^2.4.2", @@ -66,4 +67,4 @@ "got": "^14.4.3", "typescript": "^5.7.0-beta" } -} \ No newline at end of file +} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index fa69c04..65af29c 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -28,7 +28,7 @@ importers: version: 1.1.0 default-import: specifier: ^2.0.1 - version: 2.0.1 + version: 2.0.4 dotenv: specifier: ^16.4.5 version: 16.4.5 @@ -53,6 +53,9 @@ importers: multi-progress-bars: specifier: ^5.0.3 version: 5.0.3 + postject: + specifier: 1.0.0-alpha.6 + version: 1.0.0-alpha.6 process.argv: specifier: ^0.6.1 version: 0.6.1 @@ -89,7 +92,7 @@ importers: version: 3.1.0 '@eslint/js': specifier: ^9.12.0 - version: 9.12.0 + version: 9.14.0 '@types/html-to-text': specifier: ^9.0.4 version: 9.0.4 @@ -113,31 +116,31 @@ importers: version: 2.0.4 '@types/ws': specifier: ^8.5.12 - version: 8.5.12 + version: 8.5.13 '@typescript-eslint/eslint-plugin': specifier: ^8.8.1 - version: 8.8.1(@typescript-eslint/parser@8.8.1(eslint@9.12.0)(typescript@5.7.0-dev.20241012))(eslint@9.12.0)(typescript@5.7.0-dev.20241012) + version: 8.13.0(@typescript-eslint/parser@8.13.0(eslint@9.14.0)(typescript@5.7.0-dev.20241105))(eslint@9.14.0)(typescript@5.7.0-dev.20241105) '@typescript-eslint/parser': specifier: ^8.8.1 - version: 8.8.1(eslint@9.12.0)(typescript@5.7.0-dev.20241012) + version: 8.13.0(eslint@9.14.0)(typescript@5.7.0-dev.20241105) esbuild: specifier: ^0.24.0 version: 0.24.0 eslint: specifier: ^9.12.0 - version: 9.12.0 + version: 9.14.0 eslint-config-prettier: specifier: ^9.1.0 - version: 9.1.0(eslint@9.12.0) + version: 9.1.0(eslint@9.14.0) eslint-plugin-prettier: specifier: ^5.2.1 - version: 5.2.1(eslint-config-prettier@9.1.0(eslint@9.12.0))(eslint@9.12.0)(prettier@3.3.3) + version: 5.2.1(eslint-config-prettier@9.1.0(eslint@9.14.0))(eslint@9.14.0)(prettier@3.3.3) got: specifier: ^14.4.3 - version: 14.4.3 + version: 14.4.4 typescript: specifier: ^5.7.0-beta - version: 5.7.0-dev.20241012 + version: 5.7.0-dev.20241105 packages: @@ -293,46 +296,46 @@ packages: cpu: [x64] os: [win32] - '@eslint-community/eslint-utils@4.4.0': - resolution: {integrity: sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==} + '@eslint-community/eslint-utils@4.4.1': + resolution: {integrity: sha512-s3O3waFUrMV8P/XaF/+ZTp1X9XBZW1a4B97ZnjQF2KYWaFD2A8KyFBsrsfSjEmjn3RGWAIuvlneuZm3CUK3jbA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: eslint: ^6.0.0 || ^7.0.0 || >=8.0.0 - '@eslint-community/regexpp@4.11.1': - resolution: {integrity: sha512-m4DVN9ZqskZoLU5GlWZadwDnYo3vAEydiUayB9widCl9ffWx2IvPnp6n3on5rJmziJSw9Bv+Z3ChDVdMwXCY8Q==} + '@eslint-community/regexpp@4.12.1': + resolution: {integrity: sha512-CCZCDJuduB9OUkFkY2IgppNZMi2lBQgD2qzwXkEia16cge2pijY/aXi96CJMquDMn3nJdlPV1A5KrJEXwfLNzQ==} engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0} '@eslint/config-array@0.18.0': resolution: {integrity: sha512-fTxvnS1sRMu3+JjXwJG0j/i4RT9u4qJ+lqS/yCGap4lH4zZGzQ7tu+xZqQmcMZq5OBZDL4QRxQzRjkWcGt8IVw==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@eslint/core@0.6.0': - resolution: {integrity: sha512-8I2Q8ykA4J0x0o7cg67FPVnehcqWTBehu/lmY+bolPFHGjh49YzGBMXTvpqVgEbBdvNCSxj6iFgiIyHzf03lzg==} + '@eslint/core@0.7.0': + resolution: {integrity: sha512-xp5Jirz5DyPYlPiKat8jaq0EmYvDXKKpzTbxXMpT9eqlRJkRKIz9AGMdlvYjih+im+QlhWrpvVjl8IPC/lHlUw==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} '@eslint/eslintrc@3.1.0': resolution: {integrity: sha512-4Bfj15dVJdoy3RfZmmo86RK1Fwzn6SstsvK9JS+BaVKqC6QQQQyXekNaC+g+LKNgkQ+2VhGAzm6hO40AhMR3zQ==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@eslint/js@9.12.0': - resolution: {integrity: sha512-eohesHH8WFRUprDNyEREgqP6beG6htMeUYeCpkEgBCieCMme5r9zFWjzAJp//9S+Kub4rqE+jXe9Cp1a7IYIIA==} + '@eslint/js@9.14.0': + resolution: {integrity: sha512-pFoEtFWCPyDOl+C6Ift+wC7Ro89otjigCf5vcuWqWgqNSQbRrpjSvdeE6ofLz4dHmyxD5f7gIdGT4+p36L6Twg==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} '@eslint/object-schema@2.1.4': resolution: {integrity: sha512-BsWiH1yFGjXXS2yvrf5LyuoSIIbPrGUWob917o+BTKuZ7qJdxX8aJLRxs1fS9n6r7vESrq1OUqb68dANcFXuQQ==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@eslint/plugin-kit@0.2.0': - resolution: {integrity: sha512-vH9PiIMMwvhCx31Af3HiGzsVNULDbyVkHXwlemn/B0TFj/00ho3y55efXrUZTfQipxoHC5u4xq6zblww1zm1Ig==} + '@eslint/plugin-kit@0.2.2': + resolution: {integrity: sha512-CXtq5nR4Su+2I47WPOlWud98Y5Lv8Kyxp2ukhgFx/eW6Blm18VXJO5WuQylPugRo8nbluoi6GvvxBLqHcvqUUw==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@humanfs/core@0.19.0': - resolution: {integrity: sha512-2cbWIHbZVEweE853g8jymffCA+NCMiuqeECeBBLm8dg2oFdjuGJhgN4UAbI+6v0CKbbhvtXA4qV8YR5Ji86nmw==} + '@humanfs/core@0.19.1': + resolution: {integrity: sha512-5DyQ4+1JEUzejeK1JGICcideyfUbGixgS9jNgex5nqkW+cY7WZhxBigmieN5Qnw9ZosSNVC9KQKyb+GUaGyKUA==} engines: {node: '>=18.18.0'} - '@humanfs/node@0.16.5': - resolution: {integrity: sha512-KSPA4umqSG4LHYRodq31VDwKAvaTF4xmVlzM8Aeh4PlU1JQ3IG0wiA8C25d3RQ9nJyM3mBHyI53K06VVL/oFFg==} + '@humanfs/node@0.16.6': + resolution: {integrity: sha512-YuI2ZHQL78Q5HbhDiBA1X4LmYdXCKCMQIfw0pw7piHJwyREFebJUvrQN4cMssyES6x+vfUbx1CIpaQUKYdQZOw==} engines: {node: '>=18.18.0'} '@humanwhocodes/module-importer@1.0.1': @@ -343,6 +346,10 @@ packages: resolution: {integrity: sha512-JBxkERygn7Bv/GbN5Rv8Ul6LVknS+5Bp6RgDC/O8gEBU/yeH5Ui5C/OlWrTb6qct7LjjfT6Re2NxB0ln0yYybA==} engines: {node: '>=18.18'} + '@humanwhocodes/retry@0.4.1': + resolution: {integrity: sha512-c7hNEllBlenFTHBky65mhq8WD2kbN9Q6gk0bTk8lSBvc554jpXSkST1iePudpt7+A/AQvuHs9EMqjHDXMY1lrA==} + engines: {node: '>=18.18'} + '@inrixia/db@2.0.2': resolution: {integrity: sha512-7AcZRa7ZGeH6L2Z6XR9uWQHsxYGaI69s+/7HClxrm/X7Dk1683gyTQexN/5/wvyIHgVedhK3fS/VUIR+X6hnPg==} @@ -373,8 +380,8 @@ packages: resolution: {integrity: sha512-YW6PZ99sc1Q4DINEY2td5z9Z3rwbbsx7CyCnOc7UXUUdePXh5gPi1UeaoQVmKQMVbIU7aOwX2l1OG5ZfjgGi5g==} engines: {node: ^18.17.0 || >=20.5.0} - '@npmcli/promise-spawn@8.0.1': - resolution: {integrity: sha512-ZscqKtJqy7oj6MgXEJcHQ1om4utU0Q84QtC28UVuiO6ALSO9sDPanXdu6Wd1oYhItW8fx2u96zRFUE8BuPlAjA==} + '@npmcli/promise-spawn@8.0.2': + resolution: {integrity: sha512-/bNJhjc+o6qL+Dwz/bqfTQClkEO5nTQ1ZEcdCkAQjhkZMHIh22LPG7fNh1enJP1NKWDqYiiABnjFCY7E0zHYtQ==} engines: {node: ^18.17.0 || >=20.5.0} '@oozcitak/dom@1.15.10': @@ -437,8 +444,8 @@ packages: '@types/multi-progress@2.0.6': resolution: {integrity: sha512-S+DW6NQdvwJ6liFUmGNbGtUwFwHm/qx2D2hrlX5HY5f55hRpteS1F1pHfrC2AoCvPNAeVuFVlZTDyIkPssMujg==} - '@types/node@22.7.5': - resolution: {integrity: sha512-jML7s2NAzMWc//QSJ1a3prpk78cOPchGvXJsC3C6R6PSMoooztvRVQEz89gmBTBY1SPMaqo5teB4uNHPdetShQ==} + '@types/node@22.9.0': + resolution: {integrity: sha512-vuyHg81vvWA1Z1ELfvLko2c8f34gyA0zaic0+Rllc5lbCnbSyuvb2Oxpm6TAUAC/2xZN3QGqxBNggD1nNR2AfQ==} '@types/progress@2.0.7': resolution: {integrity: sha512-iadjw02vte8qWx7U0YM++EybBha2CQLPGu9iJ97whVgJUT5Zq9MjAPYUnbfRI2Kpehimf1QjFJYxD0t8nqzu5w==} @@ -458,11 +465,11 @@ packages: '@types/tough-cookie@4.0.5': resolution: {integrity: sha512-/Ad8+nIOV7Rl++6f1BdKxFSMgmoqEoYbHRpPcx3JEfv8VRsQe9Z4mCXeJBzxs7mbHY/XOZZuXlRNfhpVPbs6ZA==} - '@types/ws@8.5.12': - resolution: {integrity: sha512-3tPRkv1EtkDpzlgyKyI8pGsGZAGPEaXeu0DOj5DI25Ja91bdAYddYHbADRYVrZMRbfW+1l5YwXVDKohDJNQxkQ==} + '@types/ws@8.5.13': + resolution: {integrity: sha512-osM/gWBTPKgHV8XkTunnegTRIsvF6owmf5w+JtAfOw472dptdm0dlGv4xCt6GwQRcC2XVOvvRE/0bAoQcL2QkA==} - '@typescript-eslint/eslint-plugin@8.8.1': - resolution: {integrity: sha512-xfvdgA8AP/vxHgtgU310+WBnLB4uJQ9XdyP17RebG26rLtDrQJV3ZYrcopX91GrHmMoH8bdSwMRh2a//TiJ1jQ==} + '@typescript-eslint/eslint-plugin@8.13.0': + resolution: {integrity: sha512-nQtBLiZYMUPkclSeC3id+x4uVd1SGtHuElTxL++SfP47jR0zfkZBJHc+gL4qPsgTuypz0k8Y2GheaDYn6Gy3rg==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: '@typescript-eslint/parser': ^8.0.0 || ^8.0.0-alpha.0 @@ -472,8 +479,8 @@ packages: typescript: optional: true - '@typescript-eslint/parser@8.8.1': - resolution: {integrity: sha512-hQUVn2Lij2NAxVFEdvIGxT9gP1tq2yM83m+by3whWFsWC+1y8pxxxHUFE1UqDu2VsGi2i6RLcv4QvouM84U+ow==} + '@typescript-eslint/parser@8.13.0': + resolution: {integrity: sha512-w0xp+xGg8u/nONcGw1UXAr6cjCPU1w0XVyBs6Zqaj5eLmxkKQAByTdV/uGgNN5tVvN/kKpoQlP2cL7R+ajZZIQ==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: eslint: ^8.57.0 || ^9.0.0 @@ -482,12 +489,12 @@ packages: typescript: optional: true - '@typescript-eslint/scope-manager@8.8.1': - resolution: {integrity: sha512-X4JdU+66Mazev/J0gfXlcC/dV6JI37h+93W9BRYXrSn0hrE64IoWgVkO9MSJgEzoWkxONgaQpICWg8vAN74wlA==} + '@typescript-eslint/scope-manager@8.13.0': + resolution: {integrity: sha512-XsGWww0odcUT0gJoBZ1DeulY1+jkaHUciUq4jKNv4cpInbvvrtDoyBH9rE/n2V29wQJPk8iCH1wipra9BhmiMA==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@typescript-eslint/type-utils@8.8.1': - resolution: {integrity: sha512-qSVnpcbLP8CALORf0za+vjLYj1Wp8HSoiI8zYU5tHxRVj30702Z1Yw4cLwfNKhTPWp5+P+k1pjmD5Zd1nhxiZA==} + '@typescript-eslint/type-utils@8.13.0': + resolution: {integrity: sha512-Rqnn6xXTR316fP4D2pohZenJnp+NwQ1mo7/JM+J1LWZENSLkJI8ID8QNtlvFeb0HnFSK94D6q0cnMX6SbE5/vA==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: typescript: '*' @@ -495,12 +502,12 @@ packages: typescript: optional: true - '@typescript-eslint/types@8.8.1': - resolution: {integrity: sha512-WCcTP4SDXzMd23N27u66zTKMuEevH4uzU8C9jf0RO4E04yVHgQgW+r+TeVTNnO1KIfrL8ebgVVYYMMO3+jC55Q==} + '@typescript-eslint/types@8.13.0': + resolution: {integrity: sha512-4cyFErJetFLckcThRUFdReWJjVsPCqyBlJTi6IDEpc1GWCIIZRFxVppjWLIMcQhNGhdWJJRYFHpHoDWvMlDzng==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@typescript-eslint/typescript-estree@8.8.1': - resolution: {integrity: sha512-A5d1R9p+X+1js4JogdNilDuuq+EHZdsH9MjTVxXOdVFfTJXunKJR/v+fNNyO4TnoOn5HqobzfRlc70NC6HTcdg==} + '@typescript-eslint/typescript-estree@8.13.0': + resolution: {integrity: sha512-v7SCIGmVsRK2Cy/LTLGN22uea6SaUIlpBcO/gnMGT/7zPtxp90bphcGf4fyrCQl3ZtiBKqVTG32hb668oIYy1g==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: typescript: '*' @@ -508,14 +515,14 @@ packages: typescript: optional: true - '@typescript-eslint/utils@8.8.1': - resolution: {integrity: sha512-/QkNJDbV0bdL7H7d0/y0qBbV2HTtf0TIyjSDTvvmQEzeVx8jEImEbLuOA4EsvE8gIgqMitns0ifb5uQhMj8d9w==} + '@typescript-eslint/utils@8.13.0': + resolution: {integrity: sha512-A1EeYOND6Uv250nybnLZapeXpYMl8tkzYUxqmoKAWnI4sei3ihf2XdZVd+vVOmHGcp3t+P7yRrNsyyiXTvShFQ==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: eslint: ^8.57.0 || ^9.0.0 - '@typescript-eslint/visitor-keys@8.8.1': - resolution: {integrity: sha512-0/TdC3aeRAsW7MDvYRwEc1Uwm0TIBfzjPFgg60UU2Haj5qsCs9cc3zNgY71edqE3LbWfF/WoZQd3lJoDXFQpag==} + '@typescript-eslint/visitor-keys@8.13.0': + resolution: {integrity: sha512-7N/+lztJqH4Mrf0lb10R/CbI1EaAMMGyF5y0oJvFoAhafwgiRA7TXyd8TFn8FC8k5y2dTsYogg238qavRGNnlw==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} acorn-jsx@5.3.2: @@ -523,8 +530,8 @@ packages: peerDependencies: acorn: ^6.0.0 || ^7.0.0 || ^8.0.0 - acorn@8.12.1: - resolution: {integrity: sha512-tcpGyI9zbizT9JbV6oYE477V6mTlXvvi0T0G3SNIYE2apm/G5huBa1+K89VGeovbg+jycCrfhl3ADxErOuO6Jg==} + acorn@8.14.0: + resolution: {integrity: sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA==} engines: {node: '>=0.4.0'} hasBin: true @@ -649,6 +656,10 @@ packages: commander@2.20.3: resolution: {integrity: sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==} + commander@9.5.0: + resolution: {integrity: sha512-KRs7WVDKg86PWiuAqhDrAQnTXZKraVcCc6vFdL14qrZ/DcWwuRo7VoiYXalXO7S5GKpqYiVEwCbgFDfxNHKJBQ==} + engines: {node: ^12.20.0 || >=14} + concat-map@0.0.1: resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} @@ -667,8 +678,8 @@ packages: engines: {node: '>=10.14', npm: '>=6', yarn: '>=1'} hasBin: true - cross-spawn@7.0.3: - resolution: {integrity: sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==} + cross-spawn@7.0.5: + resolution: {integrity: sha512-ZVJrKKYunU38/76t0RMOulHOnUcbU9GbpWKAOZ0mhjr7CX6FVrH+4FrAapSOekrgFQ3f/8gwMEuIft0aKq6Hug==} engines: {node: '>= 8'} dashdash@1.14.1: @@ -703,8 +714,8 @@ packages: resolution: {integrity: sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==} engines: {node: '>=0.10.0'} - default-import@2.0.1: - resolution: {integrity: sha512-qboSd4Q+X5SYO50GTuTr2yaLyQTCHCnxz4bQkjLBVtOvLvmbGLjKpAe2h3s7n6B8fjkYsguMjiGUSS84Mj1VFw==} + default-import@2.0.4: + resolution: {integrity: sha512-Yjy+E8BDSNHhfuBs3/+67IAtFETF+z3Nzp/HW5Tup+Bqq4HlTDIXn/d8QrO77vQsDC77vi+80pMatOA0Z0AXuw==} engines: {node: '>=20'} defer-to-connect@2.0.1: @@ -787,20 +798,20 @@ packages: eslint-config-prettier: optional: true - eslint-scope@8.1.0: - resolution: {integrity: sha512-14dSvlhaVhKKsa9Fx1l8A17s7ah7Ef7wCakJ10LYk6+GYmP9yDti2oq2SEwcyndt6knfcZyhyxwY3i9yL78EQw==} + eslint-scope@8.2.0: + resolution: {integrity: sha512-PHlWUfG6lvPc3yvP5A4PNyBL1W8fkDUccmI21JUu/+GKZBoH/W5u6usENXUrWFRsyoW5ACUjFGgAFQp5gUlb/A==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} eslint-visitor-keys@3.4.3: resolution: {integrity: sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - eslint-visitor-keys@4.1.0: - resolution: {integrity: sha512-Q7lok0mqMUSf5a/AdAZkA5a/gHcO6snwQClVNNvFKCAVlxXucdU8pKydU5ZVZjBx5xr37vGbFFWtLQYreLzrZg==} + eslint-visitor-keys@4.2.0: + resolution: {integrity: sha512-UyLnSehNt62FFhSwjZlHmeokpRK59rcz29j+F1/aDgbkbRTk7wIc9XzdoasMUbRNKDM0qQt/+BJ4BrpFeABemw==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - eslint@9.12.0: - resolution: {integrity: sha512-UVIOlTEWxwIopRL1wgSQYdnVDcEvs2wyaO6DGo5mXqe3r16IoCNWkR29iHhyaP4cICWjbgbmFUGAhh0GJRuGZw==} + eslint@9.14.0: + resolution: {integrity: sha512-c2FHsVBr87lnUtjP4Yhvk4yEhKrQavGafRA/Se1ouse8PfbfC/Qh9Mxa00yWsZRlqeUB9raXip0aiiUZkgnr9g==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} hasBin: true peerDependencies: @@ -809,8 +820,8 @@ packages: jiti: optional: true - espree@10.2.0: - resolution: {integrity: sha512-upbkBJbckcCNBDBDXEbuhjbP68n+scUd3k/U2EkyM9nw+I/jPiL4cLF/Al06CF96wRltFda16sxDFrxsI1v0/g==} + espree@10.3.0: + resolution: {integrity: sha512-0QYC8b24HWY8zjRnDTL6RiHfDbAWn63qb4LMj1Z4b076A4une81+z03Kg7l7mn/48PUTqoLptSXez8oknU8Clg==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} esprima@4.0.1: @@ -938,8 +949,8 @@ packages: resolution: {integrity: sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==} engines: {node: '>=18'} - got@14.4.3: - resolution: {integrity: sha512-iTC0Z87yxSijWTh/IpvGpwOhIQK7+GgWkYrMRoN/hB9qeRj9RPuLGODwevs0p5idUf7nrxCVa5IlOmK3b8z+KA==} + got@14.4.4: + resolution: {integrity: sha512-tqiF7eSgTBwQkxb1LxsEpva8TaMYVisbhplrFVmw9GQE3855Z+MH/mnsXLLOkDxR6hZJRFMj5VTAZ8lmTF8ZOA==} engines: {node: '>=20'} graceful-fs@4.2.11: @@ -1283,6 +1294,11 @@ packages: resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==} engines: {node: '>=8.6'} + postject@1.0.0-alpha.6: + resolution: {integrity: sha512-b9Eb8h2eVqNE8edvKdwqkrY6O7kAwmI8kcnBv1NScolYJbo59XUF0noFq+lxbC1yN20bmC0WBEbDC5H/7ASb0A==} + engines: {node: '>=14.0.0'} + hasBin: true + prelude-ls@1.2.1: resolution: {integrity: sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==} engines: {node: '>= 0.8.0'} @@ -1503,14 +1519,14 @@ packages: truncate-utf8-bytes@1.0.2: resolution: {integrity: sha512-95Pu1QXQvruGEhv62XCMO3Mm90GscOCClvrIUwCM0PYOXK3kaF3l3sIHxx71ThJfcbM2O5Au6SO3AWCSEfW4mQ==} - ts-api-utils@1.3.0: - resolution: {integrity: sha512-UQMIo7pb8WRomKR1/+MFVLTroIvDVtMX3K6OUir8ynLyzB8Jeriont2bTAtmNPa1ekAgN7YPDyf6V+ygrdU+eQ==} + ts-api-utils@1.4.0: + resolution: {integrity: sha512-032cPxaEKwM+GT3vA5JXNzIaizx388rhsSW79vGRNGXfRRAdEAn2mvk36PvK5HnOchyWZ7afLEXqYCvPCrzuzQ==} engines: {node: '>=16'} peerDependencies: typescript: '>=4.2.0' - tslib@2.7.0: - resolution: {integrity: sha512-gLXCKdN1/j47AiHiOkJN69hJmcbGTHI0ImLmbYLHykhgeN0jVGola9yVjFgzCUklsZQMW55o+dW7IXv3RCXDzA==} + tslib@2.8.1: + resolution: {integrity: sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==} tunnel-agent@0.6.0: resolution: {integrity: sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w==} @@ -1529,8 +1545,8 @@ packages: typedarray@0.0.6: resolution: {integrity: sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==} - typescript@5.7.0-dev.20241012: - resolution: {integrity: sha512-xUN6gQ9zYVFBgF0nO37e2juz5Mjc9qWbxN0D0j2vryVZlAonSNufOR/DCjqKAk5YRICIGbim8BFT4ePSu2bOHg==} + typescript@5.7.0-dev.20241105: + resolution: {integrity: sha512-vA2PUOj2bV0HJSD6/y+Zs6cJvGpvrAtgfHB4UtK6ABFA5s3rCcs2d+zK5WZfzt0hxgI15RI8UzUFj6A4FE/0YQ==} engines: {node: '>=14.17'} hasBin: true @@ -1717,12 +1733,12 @@ snapshots: '@esbuild/win32-x64@0.24.0': optional: true - '@eslint-community/eslint-utils@4.4.0(eslint@9.12.0)': + '@eslint-community/eslint-utils@4.4.1(eslint@9.14.0)': dependencies: - eslint: 9.12.0 + eslint: 9.14.0 eslint-visitor-keys: 3.4.3 - '@eslint-community/regexpp@4.11.1': {} + '@eslint-community/regexpp@4.12.1': {} '@eslint/config-array@0.18.0': dependencies: @@ -1732,13 +1748,13 @@ snapshots: transitivePeerDependencies: - supports-color - '@eslint/core@0.6.0': {} + '@eslint/core@0.7.0': {} '@eslint/eslintrc@3.1.0': dependencies: ajv: 6.12.6 debug: 4.3.7 - espree: 10.2.0 + espree: 10.3.0 globals: 14.0.0 ignore: 5.3.2 import-fresh: 3.3.0 @@ -1748,25 +1764,27 @@ snapshots: transitivePeerDependencies: - supports-color - '@eslint/js@9.12.0': {} + '@eslint/js@9.14.0': {} '@eslint/object-schema@2.1.4': {} - '@eslint/plugin-kit@0.2.0': + '@eslint/plugin-kit@0.2.2': dependencies: levn: 0.4.1 - '@humanfs/core@0.19.0': {} + '@humanfs/core@0.19.1': {} - '@humanfs/node@0.16.5': + '@humanfs/node@0.16.6': dependencies: - '@humanfs/core': 0.19.0 + '@humanfs/core': 0.19.1 '@humanwhocodes/retry': 0.3.1 '@humanwhocodes/module-importer@1.0.1': {} '@humanwhocodes/retry@0.3.1': {} + '@humanwhocodes/retry@0.4.1': {} + '@inrixia/db@2.0.2': {} '@inrixia/helpers@2.0.11': {} @@ -1794,7 +1812,7 @@ snapshots: '@npmcli/git@6.0.1': dependencies: - '@npmcli/promise-spawn': 8.0.1 + '@npmcli/promise-spawn': 8.0.2 ini: 5.0.0 lru-cache: 10.4.3 npm-pick-manifest: 10.0.0 @@ -1818,7 +1836,7 @@ snapshots: transitivePeerDependencies: - bluebird - '@npmcli/promise-spawn@8.0.1': + '@npmcli/promise-spawn@8.0.2': dependencies: which: 5.0.0 @@ -1871,27 +1889,27 @@ snapshots: '@types/multi-progress@2.0.6': dependencies: - '@types/node': 22.7.5 + '@types/node': 22.9.0 '@types/progress': 2.0.7 - '@types/node@22.7.5': + '@types/node@22.9.0': dependencies: undici-types: 6.19.8 '@types/progress@2.0.7': dependencies: - '@types/node': 22.7.5 + '@types/node': 22.9.0 '@types/prompts@2.4.9': dependencies: - '@types/node': 22.7.5 + '@types/node': 22.9.0 kleur: 3.0.3 '@types/semver@7.5.8': {} '@types/stream-throttle@0.1.4': dependencies: - '@types/node': 22.7.5 + '@types/node': 22.9.0 '@types/tough-cookie-file-store@2.0.4': dependencies: @@ -1899,96 +1917,96 @@ snapshots: '@types/tough-cookie@4.0.5': {} - '@types/ws@8.5.12': + '@types/ws@8.5.13': dependencies: - '@types/node': 22.7.5 + '@types/node': 22.9.0 - '@typescript-eslint/eslint-plugin@8.8.1(@typescript-eslint/parser@8.8.1(eslint@9.12.0)(typescript@5.7.0-dev.20241012))(eslint@9.12.0)(typescript@5.7.0-dev.20241012)': + '@typescript-eslint/eslint-plugin@8.13.0(@typescript-eslint/parser@8.13.0(eslint@9.14.0)(typescript@5.7.0-dev.20241105))(eslint@9.14.0)(typescript@5.7.0-dev.20241105)': dependencies: - '@eslint-community/regexpp': 4.11.1 - '@typescript-eslint/parser': 8.8.1(eslint@9.12.0)(typescript@5.7.0-dev.20241012) - '@typescript-eslint/scope-manager': 8.8.1 - '@typescript-eslint/type-utils': 8.8.1(eslint@9.12.0)(typescript@5.7.0-dev.20241012) - '@typescript-eslint/utils': 8.8.1(eslint@9.12.0)(typescript@5.7.0-dev.20241012) - '@typescript-eslint/visitor-keys': 8.8.1 - eslint: 9.12.0 + '@eslint-community/regexpp': 4.12.1 + '@typescript-eslint/parser': 8.13.0(eslint@9.14.0)(typescript@5.7.0-dev.20241105) + '@typescript-eslint/scope-manager': 8.13.0 + '@typescript-eslint/type-utils': 8.13.0(eslint@9.14.0)(typescript@5.7.0-dev.20241105) + '@typescript-eslint/utils': 8.13.0(eslint@9.14.0)(typescript@5.7.0-dev.20241105) + '@typescript-eslint/visitor-keys': 8.13.0 + eslint: 9.14.0 graphemer: 1.4.0 ignore: 5.3.2 natural-compare: 1.4.0 - ts-api-utils: 1.3.0(typescript@5.7.0-dev.20241012) + ts-api-utils: 1.4.0(typescript@5.7.0-dev.20241105) optionalDependencies: - typescript: 5.7.0-dev.20241012 + typescript: 5.7.0-dev.20241105 transitivePeerDependencies: - supports-color - '@typescript-eslint/parser@8.8.1(eslint@9.12.0)(typescript@5.7.0-dev.20241012)': + '@typescript-eslint/parser@8.13.0(eslint@9.14.0)(typescript@5.7.0-dev.20241105)': dependencies: - '@typescript-eslint/scope-manager': 8.8.1 - '@typescript-eslint/types': 8.8.1 - '@typescript-eslint/typescript-estree': 8.8.1(typescript@5.7.0-dev.20241012) - '@typescript-eslint/visitor-keys': 8.8.1 + '@typescript-eslint/scope-manager': 8.13.0 + '@typescript-eslint/types': 8.13.0 + '@typescript-eslint/typescript-estree': 8.13.0(typescript@5.7.0-dev.20241105) + '@typescript-eslint/visitor-keys': 8.13.0 debug: 4.3.7 - eslint: 9.12.0 + eslint: 9.14.0 optionalDependencies: - typescript: 5.7.0-dev.20241012 + typescript: 5.7.0-dev.20241105 transitivePeerDependencies: - supports-color - '@typescript-eslint/scope-manager@8.8.1': + '@typescript-eslint/scope-manager@8.13.0': dependencies: - '@typescript-eslint/types': 8.8.1 - '@typescript-eslint/visitor-keys': 8.8.1 + '@typescript-eslint/types': 8.13.0 + '@typescript-eslint/visitor-keys': 8.13.0 - '@typescript-eslint/type-utils@8.8.1(eslint@9.12.0)(typescript@5.7.0-dev.20241012)': + '@typescript-eslint/type-utils@8.13.0(eslint@9.14.0)(typescript@5.7.0-dev.20241105)': dependencies: - '@typescript-eslint/typescript-estree': 8.8.1(typescript@5.7.0-dev.20241012) - '@typescript-eslint/utils': 8.8.1(eslint@9.12.0)(typescript@5.7.0-dev.20241012) + '@typescript-eslint/typescript-estree': 8.13.0(typescript@5.7.0-dev.20241105) + '@typescript-eslint/utils': 8.13.0(eslint@9.14.0)(typescript@5.7.0-dev.20241105) debug: 4.3.7 - ts-api-utils: 1.3.0(typescript@5.7.0-dev.20241012) + ts-api-utils: 1.4.0(typescript@5.7.0-dev.20241105) optionalDependencies: - typescript: 5.7.0-dev.20241012 + typescript: 5.7.0-dev.20241105 transitivePeerDependencies: - eslint - supports-color - '@typescript-eslint/types@8.8.1': {} + '@typescript-eslint/types@8.13.0': {} - '@typescript-eslint/typescript-estree@8.8.1(typescript@5.7.0-dev.20241012)': + '@typescript-eslint/typescript-estree@8.13.0(typescript@5.7.0-dev.20241105)': dependencies: - '@typescript-eslint/types': 8.8.1 - '@typescript-eslint/visitor-keys': 8.8.1 + '@typescript-eslint/types': 8.13.0 + '@typescript-eslint/visitor-keys': 8.13.0 debug: 4.3.7 fast-glob: 3.3.2 is-glob: 4.0.3 minimatch: 9.0.5 semver: 7.6.3 - ts-api-utils: 1.3.0(typescript@5.7.0-dev.20241012) + ts-api-utils: 1.4.0(typescript@5.7.0-dev.20241105) optionalDependencies: - typescript: 5.7.0-dev.20241012 + typescript: 5.7.0-dev.20241105 transitivePeerDependencies: - supports-color - '@typescript-eslint/utils@8.8.1(eslint@9.12.0)(typescript@5.7.0-dev.20241012)': + '@typescript-eslint/utils@8.13.0(eslint@9.14.0)(typescript@5.7.0-dev.20241105)': dependencies: - '@eslint-community/eslint-utils': 4.4.0(eslint@9.12.0) - '@typescript-eslint/scope-manager': 8.8.1 - '@typescript-eslint/types': 8.8.1 - '@typescript-eslint/typescript-estree': 8.8.1(typescript@5.7.0-dev.20241012) - eslint: 9.12.0 + '@eslint-community/eslint-utils': 4.4.1(eslint@9.14.0) + '@typescript-eslint/scope-manager': 8.13.0 + '@typescript-eslint/types': 8.13.0 + '@typescript-eslint/typescript-estree': 8.13.0(typescript@5.7.0-dev.20241105) + eslint: 9.14.0 transitivePeerDependencies: - supports-color - typescript - '@typescript-eslint/visitor-keys@8.8.1': + '@typescript-eslint/visitor-keys@8.13.0': dependencies: - '@typescript-eslint/types': 8.8.1 + '@typescript-eslint/types': 8.13.0 eslint-visitor-keys: 3.4.3 - acorn-jsx@5.3.2(acorn@8.12.1): + acorn-jsx@5.3.2(acorn@8.14.0): dependencies: - acorn: 8.12.1 + acorn: 8.14.0 - acorn@8.12.1: {} + acorn@8.14.0: {} aggregate-error@4.0.1: dependencies: @@ -2102,6 +2120,8 @@ snapshots: commander@2.20.3: {} + commander@9.5.0: {} + concat-map@0.0.1: {} concat-stream@1.6.2: @@ -2117,9 +2137,9 @@ snapshots: cross-env@7.0.3: dependencies: - cross-spawn: 7.0.3 + cross-spawn: 7.0.5 - cross-spawn@7.0.3: + cross-spawn@7.0.5: dependencies: path-key: 3.1.1 shebang-command: 2.0.0 @@ -2145,7 +2165,7 @@ snapshots: deepmerge@4.3.1: {} - default-import@2.0.1: {} + default-import@2.0.4: {} defer-to-connect@2.0.1: {} @@ -2219,50 +2239,50 @@ snapshots: escape-string-regexp@5.0.0: {} - eslint-config-prettier@9.1.0(eslint@9.12.0): + eslint-config-prettier@9.1.0(eslint@9.14.0): dependencies: - eslint: 9.12.0 + eslint: 9.14.0 - eslint-plugin-prettier@5.2.1(eslint-config-prettier@9.1.0(eslint@9.12.0))(eslint@9.12.0)(prettier@3.3.3): + eslint-plugin-prettier@5.2.1(eslint-config-prettier@9.1.0(eslint@9.14.0))(eslint@9.14.0)(prettier@3.3.3): dependencies: - eslint: 9.12.0 + eslint: 9.14.0 prettier: 3.3.3 prettier-linter-helpers: 1.0.0 synckit: 0.9.2 optionalDependencies: - eslint-config-prettier: 9.1.0(eslint@9.12.0) + eslint-config-prettier: 9.1.0(eslint@9.14.0) - eslint-scope@8.1.0: + eslint-scope@8.2.0: dependencies: esrecurse: 4.3.0 estraverse: 5.3.0 eslint-visitor-keys@3.4.3: {} - eslint-visitor-keys@4.1.0: {} + eslint-visitor-keys@4.2.0: {} - eslint@9.12.0: + eslint@9.14.0: dependencies: - '@eslint-community/eslint-utils': 4.4.0(eslint@9.12.0) - '@eslint-community/regexpp': 4.11.1 + '@eslint-community/eslint-utils': 4.4.1(eslint@9.14.0) + '@eslint-community/regexpp': 4.12.1 '@eslint/config-array': 0.18.0 - '@eslint/core': 0.6.0 + '@eslint/core': 0.7.0 '@eslint/eslintrc': 3.1.0 - '@eslint/js': 9.12.0 - '@eslint/plugin-kit': 0.2.0 - '@humanfs/node': 0.16.5 + '@eslint/js': 9.14.0 + '@eslint/plugin-kit': 0.2.2 + '@humanfs/node': 0.16.6 '@humanwhocodes/module-importer': 1.0.1 - '@humanwhocodes/retry': 0.3.1 + '@humanwhocodes/retry': 0.4.1 '@types/estree': 1.0.6 '@types/json-schema': 7.0.15 ajv: 6.12.6 chalk: 4.1.2 - cross-spawn: 7.0.3 + cross-spawn: 7.0.5 debug: 4.3.7 escape-string-regexp: 4.0.0 - eslint-scope: 8.1.0 - eslint-visitor-keys: 4.1.0 - espree: 10.2.0 + eslint-scope: 8.2.0 + eslint-visitor-keys: 4.2.0 + espree: 10.3.0 esquery: 1.6.0 esutils: 2.0.3 fast-deep-equal: 3.1.3 @@ -2281,11 +2301,11 @@ snapshots: transitivePeerDependencies: - supports-color - espree@10.2.0: + espree@10.3.0: dependencies: - acorn: 8.12.1 - acorn-jsx: 5.3.2(acorn@8.12.1) - eslint-visitor-keys: 4.1.0 + acorn: 8.14.0 + acorn-jsx: 5.3.2(acorn@8.14.0) + eslint-visitor-keys: 4.2.0 esprima@4.0.1: {} @@ -2377,7 +2397,7 @@ snapshots: '@npmcli/package-json': 6.0.1 '@types/tough-cookie': 4.0.5 chalk-template: 1.1.0 - default-import: 2.0.1 + default-import: 2.0.4 dotenv: 16.4.5 ffbinaries: 1.1.6 floatplane: 4.5.2 @@ -2385,6 +2405,7 @@ snapshots: json5: 2.2.3 mime-types: 3.0.0 multi-progress-bars: 5.0.3 + postject: 1.0.0-alpha.6 process.argv: 0.6.1 prom-client: 15.1.3 prompts: 2.4.2 @@ -2404,12 +2425,12 @@ snapshots: floatplane@4.5.2: dependencies: cross-env: 7.0.3 - got: 14.4.3 + got: 14.4.4 tough-cookie: 4.1.4 foreground-child@3.3.0: dependencies: - cross-spawn: 7.0.3 + cross-spawn: 7.0.5 signal-exit: 4.1.0 forever-agent@0.6.1: {} @@ -2456,7 +2477,7 @@ snapshots: globals@14.0.0: {} - got@14.4.3: + got@14.4.4: dependencies: '@sindresorhus/is': 7.0.1 '@szmarczak/http-timer': 5.0.1 @@ -2771,6 +2792,10 @@ snapshots: picomatch@2.3.1: {} + postject@1.0.0-alpha.6: + dependencies: + commander: 9.5.0 + prelude-ls@1.2.1: {} prettier-linter-helpers@1.0.0: @@ -2965,7 +2990,7 @@ snapshots: synckit@0.9.2: dependencies: '@pkgr/core': 0.1.1 - tslib: 2.7.0 + tslib: 2.8.1 tdigest@0.1.2: dependencies: @@ -2997,11 +3022,11 @@ snapshots: dependencies: utf8-byte-length: 1.0.5 - ts-api-utils@1.3.0(typescript@5.7.0-dev.20241012): + ts-api-utils@1.4.0(typescript@5.7.0-dev.20241105): dependencies: - typescript: 5.7.0-dev.20241012 + typescript: 5.7.0-dev.20241105 - tslib@2.7.0: {} + tslib@2.8.1: {} tunnel-agent@0.6.0: dependencies: @@ -3017,7 +3042,7 @@ snapshots: typedarray@0.0.6: {} - typescript@5.7.0-dev.20241012: {} + typescript@5.7.0-dev.20241105: {} ufo@1.5.4: {} diff --git a/postject-sentinel.txt b/postject-sentinel.txt new file mode 100644 index 0000000..2577ed8 --- /dev/null +++ b/postject-sentinel.txt @@ -0,0 +1 @@ +NODE_SEA_FUSE_fce680ab2cc467b6e072b8b5df1996b2 diff --git a/sea-config.json b/sea-config.json index 84798c3..0509c87 100644 --- a/sea-config.json +++ b/sea-config.json @@ -3,7 +3,7 @@ "output": "dist/float.blob", "disableExperimentalSEAWarning": true, "useCodeCache": true, - "assets": { - "./version": "./dist/version" - } -} \ No newline at end of file + "assets": { + "./package.json": "./package.json" + } +} From 13a8d95d7378d5ffbfd4ed124899b14f7579dbfa Mon Sep 17 00:00:00 2001 From: ~noodlez1232 Date: Thu, 7 Nov 2024 10:37:36 -0800 Subject: [PATCH 05/10] Removed all the separate pathing and only have FFMPEG path in args This moves everything back into the db directory, and only allows the FFMPEG path to be changed. This also moves around some logic, and removes unnecessary blobs out of the distribution. --- sea-config.json | 5 +---- src/lib/Attachment.ts | 2 +- src/lib/Video.ts | 4 +++- src/lib/defaults.ts | 20 +------------------- src/lib/helpers/fetchFFMPEG.ts | 13 +++++++------ src/lib/helpers/index.ts | 19 +++++-------------- src/lib/types.ts | 5 +---- 7 files changed, 19 insertions(+), 49 deletions(-) diff --git a/sea-config.json b/sea-config.json index 0509c87..7677d8c 100644 --- a/sea-config.json +++ b/sea-config.json @@ -2,8 +2,5 @@ "main": "dist/float.cjs", "output": "dist/float.blob", "disableExperimentalSEAWarning": true, - "useCodeCache": true, - "assets": { - "./package.json": "./package.json" - } + "useCodeCache": true } diff --git a/src/lib/Attachment.ts b/src/lib/Attachment.ts index 6b3f0ae..efc23e7 100644 --- a/src/lib/Attachment.ts +++ b/src/lib/Attachment.ts @@ -31,7 +31,7 @@ enum Extensions { } export class Attachment implements AttachmentAttributes { - private static readonly AttachmentsDB: Record = db>(args.attachmentsPath); + private static readonly AttachmentsDB: Record = db>(`${args.dbPath}/attachments.json`); public static readonly Extensions = Extensions; public readonly attachmentId: string; diff --git a/src/lib/Video.ts b/src/lib/Video.ts index ac8a287..68b960e 100644 --- a/src/lib/Video.ts +++ b/src/lib/Video.ts @@ -24,6 +24,8 @@ import { updatePlex } from "./helpers/updatePlex.js"; import { ProgressHeadless } from "./logging/ProgressConsole.js"; import { ProgressBars } from "./logging/ProgressBars.js"; +import { ffmpegPath } from "./helpers/fetchFFMPEG.js"; + const exec = promisify(execCallback); const sleep = promisify(setTimeout); @@ -363,7 +365,7 @@ export class Video extends Attachment { await new Promise((resolve, reject) => execFile( - args.ffmpegPath, + ffmpegPath, [ "-i", this.partialPath, diff --git a/src/lib/defaults.ts b/src/lib/defaults.ts index 84ee5fe..da3a7e7 100644 --- a/src/lib/defaults.ts +++ b/src/lib/defaults.ts @@ -1,5 +1,4 @@ import { Resolutions, Channels, Settings, Args } from "./types.js"; -import { getBinaryFilename, detectPlatform } from "ffbinaries"; export const defaultResolutions: Resolutions = ["360", "720", "1080", "2160"]; export const defaultSubChannels: Record = { @@ -35,26 +34,9 @@ export const defaultArgs: Args = { plexUsername: "", plexPassword: "", sanityCheck: false, - workPath: "./db", + dbPath: "./db", ffmpegPath: "", - settingsPath: "", - cookiesPath: "", - attachmentsPath: "", }; -export function fixArgs(args: Args) { - if (args.ffmpegPath === "") { - args.ffmpegPath = `${args.workPath}/${getBinaryFilename("ffmpeg", detectPlatform() )}`; - } - if (args.settingsPath === "") { - args.settingsPath = `${args.workPath}/settings.json`; - } - if (args.cookiesPath === "") { - args.cookiesPath = `${args.workPath}/cookies.json`; - } - if (args.attachmentsPath === "") { - args.attachmentsPath = `${args.workPath}/attachments.json`; - } -} export const defaultSettings: Settings = { __SettingsWiki: "https://github.com/Inrixia/Floatplane-Downloader/blob/master/wiki/settings.md", diff --git a/src/lib/helpers/fetchFFMPEG.ts b/src/lib/helpers/fetchFFMPEG.ts index 9d1440b..c160658 100644 --- a/src/lib/helpers/fetchFFMPEG.ts +++ b/src/lib/helpers/fetchFFMPEG.ts @@ -1,18 +1,19 @@ import { downloadBinaries, detectPlatform, getBinaryFilename } from "ffbinaries"; import { args } from "./index.js"; import fs from "fs"; -import { dirname, basename } from "path"; +import { dirname } from "path"; + +export const ffmpegPath = args.ffmpegPath ?? `${args.dbPath}/${getBinaryFilename("ffmpeg", detectPlatform())}`; export const fetchFFMPEG = (): Promise => new Promise((resolve, reject) => { - let platform = detectPlatform(); - let path = args.ffmpegPath; - if (fs.existsSync(path) === false) { + const platform = detectPlatform(); + if (!fs.existsSync(ffmpegPath)) { process.stdout.write("> Ffmpeg binary missing! Downloading... "); downloadBinaries( - basename(path), + "ffmpeg", { - destination: dirname(path), + destination: dirname(ffmpegPath), platform, }, (err) => { diff --git a/src/lib/helpers/index.ts b/src/lib/helpers/index.ts index 3522d29..b409b65 100644 --- a/src/lib/helpers/index.ts +++ b/src/lib/helpers/index.ts @@ -1,5 +1,5 @@ -import { getEnv, rebuildTypes, recursiveUpdate } from "@inrixia/helpers/object"; -import { defaultArgs, defaultSettings, fixArgs } from "../defaults.js"; +import { getEnv, recursiveUpdate } from "@inrixia/helpers/object"; +import { defaultArgs, defaultSettings } from "../defaults.js"; import { Histogram } from "prom-client"; import db from "@inrixia/db"; @@ -8,8 +8,6 @@ import { defaultImport } from "default-import"; import _ARGV from "process.argv"; const ARGV = defaultImport(_ARGV); -import { readFileSync } from "fs"; - import "dotenv/config"; import json5 from "json5"; @@ -29,12 +27,11 @@ const argv = ARGV(process.argv.slice(2))({}); const env = getEnv(); export const args = defaultArgs; -recursiveUpdate(args, env, { setUndefined: false, setDefined: true }); +recursiveUpdate(args, env, { setUndefined: false, setDefined: true }); recursiveUpdate(args, argv, { setUndefined: false, setDefined: true }); -fixArgs(args); export const settings = defaultSettings; -let newSettings = db(args.settingsPath, { template: defaultSettings, pretty: true, forceCreate: true, updateOnExternalChanges: true }); +const newSettings = db(`${args.dbPath}/settings.json`, { template: defaultSettings, pretty: true, forceCreate: true, updateOnExternalChanges: true }); recursiveUpdate(settings, newSettings, { setUndefined: true, setDefined: true }); recursiveUpdate(settings, argv, { setUndefined: false, setDefined: true }); @@ -46,7 +43,7 @@ if (env.__FPDSettings !== undefined) { recursiveUpdate(settings, env, { setUndefined: false, setDefined: true }); -export const cookieJar = new CookieJar(new FileCookieStore(args.cookiesPath)); +export const cookieJar = new CookieJar(new FileCookieStore(`${args.dbPath}/cookies.json`)); export const fApi = new Floatplane( cookieJar, `Floatplane-Downloader/${DownloaderVersion} (Inrix, +https://github.com/Inrixia/Floatplane-Downloader), CFNetwork`, @@ -80,10 +77,6 @@ fApi.extend({ }, }); - - - - // eslint-disable-next-line no-control-regex const headlessStdoutRegex = /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g; // Override stdout if headless to not include formatting tags @@ -96,5 +89,3 @@ if (args.headless === true) { return originalStdoutWrite(...params); }) as typeof process.stdout.write; } - - diff --git a/src/lib/types.ts b/src/lib/types.ts index 0c3059d..4f000d9 100644 --- a/src/lib/types.ts +++ b/src/lib/types.ts @@ -33,11 +33,8 @@ export type Args = { plexUsername: string; plexPassword: string; sanityCheck: boolean; - workPath: string; - settingsPath: string; + dbPath: string; ffmpegPath: string; - cookiesPath: string; - attachmentsPath: string; }; export type PartialArgs = Partial; From dfc1c073186f9ba7c54c18a4a960e96e7f965f1d Mon Sep 17 00:00:00 2001 From: ~noodlez1232 Date: Thu, 7 Nov 2024 16:10:55 -0800 Subject: [PATCH 06/10] Revert special version checking logic --- package.json | 4 ++-- postject-sentinel.txt | 1 - sea-config.json | 5 ++++- src/lib/helpers/index.ts | 6 ++++-- 4 files changed, 10 insertions(+), 6 deletions(-) delete mode 100644 postject-sentinel.txt diff --git a/package.json b/package.json index ddd0a42..eaeaf68 100644 --- a/package.json +++ b/package.json @@ -16,8 +16,8 @@ "bundle": "pnpm run tsc && npx esbuild ./src/float.ts --bundle --platform=node --outfile=./dist/float.cjs", "build-windows-latest": "node make.js ./build/float-win.exe && pnpm run bundle && pnpm run makeBlob && pnpm run injectWin", "build-ubuntu-latest": "node make.js ./build/float-linux && pnpm run bundle && pnpm run makeBlob && pnpm run injectLinux", - "injectWin": "npx postject ./build/float-win.exe NODE_SEA_BLOB ./dist/float.blob --sentinel-fuse $(cat ./postject-sentinel.txt)", - "injectLinux": "npx postject ./build/float-linux NODE_SEA_BLOB ./dist/float.blob --sentinel-fuse $(cat ./postject-sentinel.txt)" + "injectWin": "npx postject ./build/float-win.exe NODE_SEA_BLOB ./dist/float.blob --sentinel-fuse NODE_SEA_FUSE_fce680ab2cc467b6e072b8b5df1996b2", + "injectLinux": "npx postject ./build/float-linux NODE_SEA_BLOB ./dist/float.blob --sentinel-fuse NODE_SEA_FUSE_fce680ab2cc467b6e072b8b5df1996b2" }, "dependencies": { "@ctrl/plex": "^3.4.0", diff --git a/postject-sentinel.txt b/postject-sentinel.txt deleted file mode 100644 index 2577ed8..0000000 --- a/postject-sentinel.txt +++ /dev/null @@ -1 +0,0 @@ -NODE_SEA_FUSE_fce680ab2cc467b6e072b8b5df1996b2 diff --git a/sea-config.json b/sea-config.json index 7677d8c..cdf64bf 100644 --- a/sea-config.json +++ b/sea-config.json @@ -2,5 +2,8 @@ "main": "dist/float.cjs", "output": "dist/float.blob", "disableExperimentalSEAWarning": true, - "useCodeCache": true + "useCodeCache": true, + "assets": { + "./version": "./dist/version" + } } diff --git a/src/lib/helpers/index.ts b/src/lib/helpers/index.ts index b409b65..374e392 100644 --- a/src/lib/helpers/index.ts +++ b/src/lib/helpers/index.ts @@ -8,13 +8,15 @@ import { defaultImport } from "default-import"; import _ARGV from "process.argv"; const ARGV = defaultImport(_ARGV); +import { readFileSync } from "fs"; + import "dotenv/config"; import json5 from "json5"; const { parse } = json5; -import pjson from "../../../package.json" with { type: "json" }; -export const DownloaderVersion = pjson.version; +import { isSea, getAsset } from "node:sea"; +export const DownloaderVersion = isSea() ? getAsset("./version", "utf-8") : JSON.parse(readFileSync("./package.json", "utf-8")).version; import type { PartialArgs, Settings } from "../types.js"; From e6da038cbcc6940aa144cc0dc178cbe2f960752e Mon Sep 17 00:00:00 2001 From: ~noodlez1232 Date: Fri, 8 Nov 2024 10:37:22 -0800 Subject: [PATCH 07/10] Fix typing for settings and args --- src/lib/helpers/index.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/lib/helpers/index.ts b/src/lib/helpers/index.ts index 374e392..aaf42ac 100644 --- a/src/lib/helpers/index.ts +++ b/src/lib/helpers/index.ts @@ -1,4 +1,4 @@ -import { getEnv, recursiveUpdate } from "@inrixia/helpers/object"; +import { getEnv, recursiveUpdate, rebuildTypes } from "@inrixia/helpers/object"; import { defaultArgs, defaultSettings } from "../defaults.js"; import { Histogram } from "prom-client"; import db from "@inrixia/db"; @@ -28,15 +28,16 @@ import { Floatplane } from "floatplane"; const argv = ARGV(process.argv.slice(2))({}); const env = getEnv(); -export const args = defaultArgs; +export const args = { ...defaultArgs }; recursiveUpdate(args, env, { setUndefined: false, setDefined: true }); recursiveUpdate(args, argv, { setUndefined: false, setDefined: true }); +rebuildTypes(args, defaultArgs); -export const settings = defaultSettings; +export const settings = { ...defaultSettings }; const newSettings = db(`${args.dbPath}/settings.json`, { template: defaultSettings, pretty: true, forceCreate: true, updateOnExternalChanges: true }); recursiveUpdate(settings, newSettings, { setUndefined: true, setDefined: true }); - recursiveUpdate(settings, argv, { setUndefined: false, setDefined: true }); +rebuildTypes(settings, defaultSettings); if (env.__FPDSettings !== undefined) { if (typeof env.__FPDSettings !== "string") throw new Error("The __FPDSettings environment variable cannot be parsed!"); From 8cf1068ea2eaf77b8ba99981a4882b0169df45c5 Mon Sep 17 00:00:00 2001 From: ~noodlez1232 Date: Fri, 8 Nov 2024 10:39:26 -0800 Subject: [PATCH 08/10] Add settings path argument --- src/lib/defaults.ts | 1 + src/lib/helpers/index.ts | 4 +++- src/lib/types.ts | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/lib/defaults.ts b/src/lib/defaults.ts index da3a7e7..9b30a35 100644 --- a/src/lib/defaults.ts +++ b/src/lib/defaults.ts @@ -36,6 +36,7 @@ export const defaultArgs: Args = { sanityCheck: false, dbPath: "./db", ffmpegPath: "", + settingsPath: "", }; export const defaultSettings: Settings = { diff --git a/src/lib/helpers/index.ts b/src/lib/helpers/index.ts index aaf42ac..50f69e3 100644 --- a/src/lib/helpers/index.ts +++ b/src/lib/helpers/index.ts @@ -33,8 +33,10 @@ recursiveUpdate(args, env, { setUndefined: false, setDefined: true }); recursiveUpdate(args, argv, { setUndefined: false, setDefined: true }); rebuildTypes(args, defaultArgs); +const settingsPath = args.settingsPath ?? `${args.dbPath}/settings.json`; + export const settings = { ...defaultSettings }; -const newSettings = db(`${args.dbPath}/settings.json`, { template: defaultSettings, pretty: true, forceCreate: true, updateOnExternalChanges: true }); +const newSettings = db(settingsPath, { template: defaultSettings, pretty: true, forceCreate: true, updateOnExternalChanges: true }); recursiveUpdate(settings, newSettings, { setUndefined: true, setDefined: true }); recursiveUpdate(settings, argv, { setUndefined: false, setDefined: true }); rebuildTypes(settings, defaultSettings); diff --git a/src/lib/types.ts b/src/lib/types.ts index 4f000d9..d79b826 100644 --- a/src/lib/types.ts +++ b/src/lib/types.ts @@ -35,6 +35,7 @@ export type Args = { sanityCheck: boolean; dbPath: string; ffmpegPath: string; + settingsPath: string; }; export type PartialArgs = Partial; From 473185c306d5d79d78f1a45a5207155a648ff67f Mon Sep 17 00:00:00 2001 From: ~noodlez1232 Date: Sat, 9 Nov 2024 17:40:39 -0800 Subject: [PATCH 09/10] Fix detection of missing arguments --- src/lib/helpers/fetchFFMPEG.ts | 2 +- src/lib/helpers/index.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/helpers/fetchFFMPEG.ts b/src/lib/helpers/fetchFFMPEG.ts index c160658..b89ce06 100644 --- a/src/lib/helpers/fetchFFMPEG.ts +++ b/src/lib/helpers/fetchFFMPEG.ts @@ -3,7 +3,7 @@ import { args } from "./index.js"; import fs from "fs"; import { dirname } from "path"; -export const ffmpegPath = args.ffmpegPath ?? `${args.dbPath}/${getBinaryFilename("ffmpeg", detectPlatform())}`; +export const ffmpegPath = args.ffmpegPath || `${args.dbPath}/${getBinaryFilename("ffmpeg", detectPlatform())}`; export const fetchFFMPEG = (): Promise => new Promise((resolve, reject) => { diff --git a/src/lib/helpers/index.ts b/src/lib/helpers/index.ts index 50f69e3..628ad71 100644 --- a/src/lib/helpers/index.ts +++ b/src/lib/helpers/index.ts @@ -33,7 +33,7 @@ recursiveUpdate(args, env, { setUndefined: false, setDefined: true }); recursiveUpdate(args, argv, { setUndefined: false, setDefined: true }); rebuildTypes(args, defaultArgs); -const settingsPath = args.settingsPath ?? `${args.dbPath}/settings.json`; +const settingsPath = args.settingsPath || `${args.dbPath}/settings.json`; export const settings = { ...defaultSettings }; const newSettings = db(settingsPath, { template: defaultSettings, pretty: true, forceCreate: true, updateOnExternalChanges: true }); From 90ea9a352262320ad0542b179ab68e47f4a9d1f3 Mon Sep 17 00:00:00 2001 From: ~noodlez1232 Date: Mon, 23 Dec 2024 18:13:35 -0800 Subject: [PATCH 10/10] Update pnpm lock --- pnpm-lock.yaml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index e0a4d8d..7a71440 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -53,9 +53,6 @@ importers: multi-progress-bars: specifier: ^5.0.3 version: 5.0.3 - postject: - specifier: 1.0.0-alpha.6 - version: 1.0.0-alpha.6 process.argv: specifier: ^0.6.1 version: 0.6.1 @@ -137,7 +134,7 @@ importers: version: 5.2.1(eslint-config-prettier@9.1.0(eslint@9.14.0))(eslint@9.14.0)(prettier@3.3.3) got: specifier: ^14.4.3 - version: 14.4.3 + version: 14.4.4 postject: specifier: 1.0.0-alpha.6 version: 1.0.0-alpha.6 @@ -2408,7 +2405,6 @@ snapshots: json5: 2.2.3 mime-types: 3.0.0 multi-progress-bars: 5.0.3 - postject: 1.0.0-alpha.6 process.argv: 0.6.1 prom-client: 15.1.3 prompts: 2.4.2