mirror of
https://github.com/robonen/tools.git
synced 2026-03-20 02:44:45 +00:00
Merge branch 'master' into platform
# Conflicts: # package.json # packages/renovate/package.json # packages/stdlib/package.json # packages/tsconfig/package.json # pnpm-lock.yaml
This commit is contained in:
2
apps/vhs/.gitignore
vendored
Normal file
2
apps/vhs/.gitignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
bin/**
|
||||
!bin/.gitkeep
|
||||
1
apps/vhs/README.md
Normal file
1
apps/vhs/README.md
Normal file
@@ -0,0 +1 @@
|
||||
# @robonen/vhs
|
||||
0
apps/vhs/bin/.gitkeep
Normal file
0
apps/vhs/bin/.gitkeep
Normal file
5
apps/vhs/jsr.json
Normal file
5
apps/vhs/jsr.json
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"name": "@robonen/vhs",
|
||||
"version": "0.0.0",
|
||||
"exports": "./src/index.ts"
|
||||
}
|
||||
26
apps/vhs/package.json
Normal file
26
apps/vhs/package.json
Normal file
@@ -0,0 +1,26 @@
|
||||
{
|
||||
"name": "@robonen/vhs",
|
||||
"private": true,
|
||||
"version": "0.0.1",
|
||||
"license": "UNLICENSED",
|
||||
"description": "",
|
||||
"keywords": [],
|
||||
"author": "Robonen Andrew <robonenandrew@gmail.com>",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/robonen/tools.git",
|
||||
"directory": "./apps/vhs"
|
||||
},
|
||||
"packageManager": "pnpm@9.11.0",
|
||||
"engines": {
|
||||
"bun": ">=1.1.27"
|
||||
},
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"start": "bun run src/index.ts"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@robonen/tsconfig": "workspace:*",
|
||||
"@types/bun": "^1.1.10"
|
||||
}
|
||||
}
|
||||
36
apps/vhs/src/index.ts
Normal file
36
apps/vhs/src/index.ts
Normal file
@@ -0,0 +1,36 @@
|
||||
import { version } from '../package.json';
|
||||
import { resolve } from 'path';
|
||||
import { $, Glob } from 'bun';
|
||||
|
||||
async function ffmpegMergeAndTranscodeAvi(files: Set<string>) {
|
||||
const ffmpeg = resolve('bin/ffmpeg');
|
||||
const output = resolve('output.mp4');
|
||||
const input = Array.from(files).toSorted((a, b) => a.localeCompare(b)).join('|');
|
||||
|
||||
const shell = $`${ffmpeg} -i "concat:${input}" -stats -c:v libx264 -crf 23 -preset veryfast -c:a aac ${output}`;
|
||||
|
||||
for await (const line of shell.lines()) {
|
||||
console.log(line);
|
||||
}
|
||||
}
|
||||
|
||||
const path = Bun.argv[2];
|
||||
|
||||
if (!path) {
|
||||
console.error('Please provide a path to a file or directory');
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
console.info(`Welcome to VHS v${version} 📼`);
|
||||
console.info(`Scanning ${path}...`);
|
||||
|
||||
const glob = new Glob(resolve(path));
|
||||
const files = new Set<string>();
|
||||
|
||||
for await (const file of glob.scan({ followSymlinks: false })) {
|
||||
files.add(file);
|
||||
}
|
||||
|
||||
console.info(`Found ${files.size} files`);
|
||||
|
||||
console.info(await ffmpegMergeAndTranscodeAvi(files));
|
||||
3
apps/vhs/tsconfig.json
Normal file
3
apps/vhs/tsconfig.json
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"extends": "@robonen/tsconfig/tsconfig.json"
|
||||
}
|
||||
8
cli.ts
8
cli.ts
@@ -3,10 +3,10 @@ import { defineCommand, runMain } from 'citty';
|
||||
import { resolve } from 'pathe';
|
||||
import { splitByCase } from 'scule';
|
||||
|
||||
const PACKAGE_MANAGER = 'pnpm@9.1.0';
|
||||
const NODE_VERSION = '>=20.12.2';
|
||||
const VITE_VERSION = '^5.2.11';
|
||||
const VITE_DTS_VERSION = '^3.9.1';
|
||||
const PACKAGE_MANAGER = 'pnpm@9.11.0';
|
||||
const NODE_VERSION = '>=20.17.0';
|
||||
const VITE_VERSION = '^5.4.8';
|
||||
const VITE_DTS_VERSION = '^4.2.2';
|
||||
const PATHE_VERSION = '^1.1.2'
|
||||
const DEFAULT_DIR = 'packages';
|
||||
|
||||
|
||||
16
package.json
16
package.json
@@ -15,24 +15,24 @@
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/robonen/tools.git"
|
||||
},
|
||||
"packageManager": "pnpm@9.4.0",
|
||||
"packageManager": "pnpm@9.11.0",
|
||||
"engines": {
|
||||
"node": ">=20.13.1"
|
||||
"node": ">=20.17.0"
|
||||
},
|
||||
"type": "module",
|
||||
"devDependencies": {
|
||||
"@types/node": "^20.14.8",
|
||||
"@types/node": "^20.16.10",
|
||||
"citty": "^0.1.6",
|
||||
"jiti": "^1.21.6",
|
||||
"jiti": "^2.0.0",
|
||||
"pathe": "^1.1.2",
|
||||
"scule": "^1.3.0",
|
||||
"vitepress": "^1.2.3"
|
||||
"vitepress": "^1.3.4"
|
||||
},
|
||||
"scripts": {
|
||||
"all:test": "pnpm -r test",
|
||||
"create": "jiti ./cli.ts",
|
||||
"docs:dev": "vitepress dev docs",
|
||||
"docs:build": "vitepress build docs",
|
||||
"docs:preview": "vitepress preview docs"
|
||||
"docs:dev": "vitepress dev .",
|
||||
"docs:build": "vitepress build .",
|
||||
"docs:preview": "vitepress preview ."
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,9 +16,9 @@
|
||||
"url": "git+https://github.com/robonen/tools.git",
|
||||
"directory": "packages/renovate"
|
||||
},
|
||||
"packageManager": "pnpm@9.4.0",
|
||||
"packageManager": "pnpm@9.11.0",
|
||||
"engines": {
|
||||
"node": ">=20.13.1"
|
||||
"node": ">=20.17.0"
|
||||
},
|
||||
"files": [
|
||||
"default.json"
|
||||
@@ -27,6 +27,6 @@
|
||||
"test": "renovate-config-validator ./default.json"
|
||||
},
|
||||
"devDependencies": {
|
||||
"renovate": "^37.415.0"
|
||||
"renovate": "^38.100.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,9 +18,9 @@
|
||||
"url": "git+https://github.com/robonen/tools.git",
|
||||
"directory": "packages/stdlib"
|
||||
},
|
||||
"packageManager": "pnpm@9.4.0",
|
||||
"packageManager": "pnpm@9.11.0",
|
||||
"engines": {
|
||||
"node": ">=20.13.1"
|
||||
"node": ">=20.17.0"
|
||||
},
|
||||
"type": "module",
|
||||
"files": [
|
||||
@@ -43,9 +43,9 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@robonen/tsconfig": "workspace:*",
|
||||
"@vitest/coverage-v8": "^1.6.0",
|
||||
"@vitest/coverage-v8": "^2.1.1",
|
||||
"pathe": "^1.1.2",
|
||||
"unbuild": "^2.0.0",
|
||||
"vitest": "^1.6.0"
|
||||
"vitest": "^2.1.1"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,9 +16,9 @@
|
||||
"url": "git+https://github.com/robonen/tools.git",
|
||||
"directory": "packages/tsconfig"
|
||||
},
|
||||
"packageManager": "pnpm@9.4.0",
|
||||
"packageManager": "pnpm@9.11.0",
|
||||
"engines": {
|
||||
"node": ">=20.13.1"
|
||||
"node": ">=20.17.0"
|
||||
},
|
||||
"files": [
|
||||
"**tsconfig.json"
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
"display": "Base TypeScript Configuration",
|
||||
"compilerOptions": {
|
||||
/* Basic Options */
|
||||
"module": "Preserve",
|
||||
"module": "ESNext",
|
||||
"noEmit": true,
|
||||
"lib": ["ESNext"],
|
||||
"moduleResolution": "Bundler",
|
||||
|
||||
5015
pnpm-lock.yaml
generated
5015
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user