@barbapapazes/video-toolkit 0.10.0 → 0.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/cli.mjs +1 -1
  2. package/package.json +1 -1
package/dist/cli.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import{basename as e,dirname as t,extname as n,isAbsolute as r,join as i,resolve as a}from"node:path";import o from"node:process";import{intro as s,isCancel as c,log as l,outro as u,select as d,spinner as f,text as p}from"@clack/prompts";import{cac as m}from"cac";import{homedir as h}from"node:os";import{loadConfig as g}from"c12";import{copyFileSync as _,createReadStream as ee,existsSync as v,mkdirSync as y,readFileSync as b,readdirSync as x,statSync as S,unlinkSync as C,writeFileSync as w}from"node:fs";import{format as T,parse as E}from"date-fns";import{Buffer as D}from"node:buffer";import{ofetch as O}from"ofetch";import k from"sharp";import{execSync as A}from"node:child_process";import te from"openai";var j=`0.10.0`;const M={openaiApiKey:``,language:`fr`,model:`whisper-1`,templatesDir:i(h(),`.config`,`video-toolkit`,`templates`)};async function N(){let{config:e}=await g({name:`video-toolkit`,defaults:M,globalRc:!0});return{openaiApiKey:e.openaiApiKey||``,language:e.language||`fr`,model:e.model||`whisper-1`,templatesDir:e.templatesDir}}function P(t){let r=a(t),o=e(r,n(r)),s=a(r,`..`),c=i(s,`${o}_audio.mp3`),l=i(s,`${o}.srt`),u=i(s,`thumbnails`);v(u)||y(u,{recursive:!0});let d=[`first`,`25`,`50`,`75`,`last`];return{videoPath:r,audioPath:c,srtPath:l,thumbnailTempPaths:d.map(e=>i(u,`${o}_thumbnail_${e}_temp.png`)),thumbnailPaths:d.map(e=>i(u,`${o}_thumbnail_${e}.png`))}}function F(e){return r(e)?e:a(o.cwd(),e)}function I(e){let t=F(e);if(!v(t))return[];try{return x(t,{withFileTypes:!0}).filter(e=>e.isFile()&&n(e.name).toLowerCase()===`.svg`).map(e=>e.name.replace(/\.svg$/i,``))}catch{return[]}}function L(e,t){return i(F(t),`${e}.svg`)}function R(){let e=i(h(),`.config`,`video-toolkit`,`fonts`);return v(e)||y(e,{recursive:!0}),e}function z(){let e=R(),n=t(e),r=i(n,`fonts.conf`);v(r)||w(r,`<?xml version="1.0"?>
2
+ import{basename as e,dirname as t,extname as n,isAbsolute as r,join as i,resolve as a}from"node:path";import o from"node:process";import{intro as s,isCancel as c,log as l,outro as u,select as d,spinner as f,text as p}from"@clack/prompts";import{cac as m}from"cac";import{homedir as h}from"node:os";import{loadConfig as g}from"c12";import{copyFileSync as _,createReadStream as ee,existsSync as v,mkdirSync as y,readFileSync as b,readdirSync as x,statSync as S,unlinkSync as C,writeFileSync as w}from"node:fs";import{format as T,parse as E}from"date-fns";import{Buffer as D}from"node:buffer";import{ofetch as O}from"ofetch";import k from"sharp";import{execSync as A}from"node:child_process";import te from"openai";var j=`0.11.0`;const M={openaiApiKey:``,language:`fr`,model:`whisper-1`,templatesDir:i(h(),`.config`,`video-toolkit`,`templates`)};async function N(){let{config:e}=await g({name:`video-toolkit`,defaults:M,globalRc:!0});return{openaiApiKey:e.openaiApiKey||``,language:e.language||`fr`,model:e.model||`whisper-1`,templatesDir:e.templatesDir}}function P(t){let r=a(t),o=e(r,n(r)),s=a(r,`..`),c=i(s,`${o}_audio.mp3`),l=i(s,`${o}.srt`),u=i(s,`thumbnails`);v(u)||y(u,{recursive:!0});let d=[`first`,`25`,`50`,`75`,`last`];return{videoPath:r,audioPath:c,srtPath:l,thumbnailTempPaths:d.map(e=>i(u,`${o}_thumbnail_${e}_temp.png`)),thumbnailPaths:d.map(e=>i(u,`${o}_thumbnail_${e}.png`))}}function F(e){return r(e)?e:a(o.cwd(),e)}function I(e){let t=F(e);if(!v(t))return[];try{return x(t,{withFileTypes:!0}).filter(e=>e.isFile()&&n(e.name).toLowerCase()===`.svg`).map(e=>e.name.replace(/\.svg$/i,``))}catch{return[]}}function L(e,t){return i(F(t),`${e}.svg`)}function R(){let e=i(h(),`.config`,`video-toolkit`,`fonts`);return v(e)||y(e,{recursive:!0}),e}function z(){let e=R(),n=t(e),r=i(n,`fonts.conf`);v(r)||w(r,`<?xml version="1.0"?>
3
3
  <!DOCTYPE fontconfig SYSTEM "fonts.dtd">
4
4
  <fontconfig>
5
5
  <dir>${e}</dir>
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@barbapapazes/video-toolkit",
3
3
  "type": "module",
4
- "version": "0.10.0",
4
+ "version": "0.11.0",
5
5
  "author": "Estéban Soubiran <esteban@soubiran.dev>",
6
6
  "license": "MIT",
7
7
  "funding": "https://github.com/sponsors/Barbapapazes",