Skip to content

Commit

Permalink
refactor: rename new implementation (drop .zod) pt 2
Browse files Browse the repository at this point in the history
  • Loading branch information
andykais committed Jan 9, 2025
1 parent 0bce29f commit 8fddb8b
Show file tree
Hide file tree
Showing 24 changed files with 67 additions and 67 deletions.
2 changes: 1 addition & 1 deletion ffmpeg-templates.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as flags from '@std/flags'
import ffmpeg_templates from './lib/cli.zod.ts'
import ffmpeg_templates from './lib/cli.ts'


const VERSION = 'v0.2.0'
Expand Down
4 changes: 2 additions & 2 deletions lib/bindings/ffmpeg.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import {readlines} from '../util.ts'
import { InputError, CommandError } from '../errors.ts'
import { parse_duration } from '../parsers/duration.zod.ts'
import { parse_duration } from '../parsers/duration.ts'
import type { Context } from '../context.ts'
import type { Timestamp } from '../template_input.zod.ts'
import type { Timestamp } from '../template_input.ts'

type OnReadLine = (line: string) => void
async function exec(cmd: string[]) {
Expand Down
8 changes: 4 additions & 4 deletions lib/builder/clip_base.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { parse_unit } from '../parsers/unit.ts'
import type * as parsed from '../parsers/template.zod.ts'
import type { TimelineClip } from '../timeline.zod.ts'
import type { ComputedGeometry } from '../geometry.zod.ts'
import type { ClipInfo } from '../probe.zod.ts'
import type * as parsed from '../parsers/template.ts'
import type { TimelineClip } from '../timeline.ts'
import type { ComputedGeometry } from '../geometry.ts'
import type { ClipInfo } from '../probe.ts'

import { type ClipBuilderData } from './ffmpeg_base.ts'

Expand Down
6 changes: 3 additions & 3 deletions lib/builder/clip_sample.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { TimelineClip } from '../timeline.zod.ts'
import type { ClipInfo } from '../probe.zod.ts'
import type * as parsed from '../parsers/template.zod.ts'
import type { TimelineClip } from '../timeline.ts'
import type { ClipInfo } from '../probe.ts'
import type * as parsed from '../parsers/template.ts'
import { ClipBuilderBase } from './clip_base.ts'


Expand Down
10 changes: 5 additions & 5 deletions lib/builder/ffmpeg_base.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import * as errors from '../errors.ts'
import { Context } from '../context.ts'
import { relative_path } from '../util.ts'
import type * as inputs from '../template_input.zod.ts'
import type * as parsed from '../parsers/template.zod.ts'
import type { TimelineClip } from '../timeline.zod.ts'
import type { ComputedGeometry } from '../geometry.zod.ts'
import type { ClipInfo } from '../probe.zod.ts'
import type * as inputs from '../template_input.ts'
import type * as parsed from '../parsers/template.ts'
import type { TimelineClip } from '../timeline.ts'
import type { ComputedGeometry } from '../geometry.ts'
import type { ClipInfo } from '../probe.ts'

import { ClipBuilderBase } from './clip_base.ts'

Expand Down
8 changes: 4 additions & 4 deletions lib/builder/ffmpeg_sample.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import * as path from '@std/path'
import { parse_duration } from '../parsers/duration.zod.ts'
import { parse_duration } from '../parsers/duration.ts'
import { Context } from '../context.ts'
import { relative_path } from '../util.ts'
import type * as inputs from '../template_input.zod.ts'
import type * as parsed from '../parsers/template.zod.ts'
import type { ClipInfo } from '../probe.zod.ts'
import type * as inputs from '../template_input.ts'
import type * as parsed from '../parsers/template.ts'
import type { ClipInfo } from '../probe.ts'

import { FfmpegBuilderBase } from './ffmpeg_base.ts'
import { ClipBuilderBase } from './clip_base.ts'
Expand Down
4 changes: 2 additions & 2 deletions lib/builder/ffmpeg_video.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as path from '@std/path'
import { relative_path } from '../util.ts'
import type * as parsed from '../parsers/template.zod.ts'
import type { ClipInfo } from '../probe.zod.ts'
import type * as parsed from '../parsers/template.ts'
import type { ClipInfo } from '../probe.ts'

import { FfmpegBuilderBase, type ClipBuilderData } from './ffmpeg_base.ts'
import { ClipBuilderBase } from './clip_base.ts'
Expand Down
4 changes: 2 additions & 2 deletions lib/canvas/font.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import * as path from '@std/path'
import * as skia_canvas from '@gfx/canvas'
// @deno-types="@types/culori"
import * as culori from 'culori'
import { compute_size } from '../geometry.zod.ts'
import { compute_size } from '../geometry.ts'
import type { Context } from '../context.ts'
import type { TextClipParsed, MediaClipParsed } from '../parsers/template.zod.ts'
import type { TextClipParsed, MediaClipParsed } from '../parsers/template.ts'

// first in the list gets highest priority
const PRIORITIED_FONT_FAMILIES = [
Expand Down
6 changes: 3 additions & 3 deletions lib/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ import {open} from '@opensrc/deno-open'
// import { open } from 'https://deno.land/x/[email protected]/index.ts'
// // import open from 'npm:open'
import * as errors from './errors.ts'
import { parse_template } from './parsers/template.zod.ts'
import { render_video, render_sample_frame } from './mod.zod.ts'
import { parse_template } from './parsers/template.ts'
import { render_video, render_sample_frame } from './mod.ts'
import { Logger } from './logger.ts'
import { InstanceContext } from './context.ts'
import type * as inputs from './template_input.zod.ts'
import type * as inputs from './template_input.ts'
import type { ContextOptions } from './context.ts'


Expand Down
8 changes: 4 additions & 4 deletions lib/context.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import * as path from '@std/path'
import * as errors from './errors.ts'
import { Logger } from './logger.ts'
import { ClipInfoMap } from './probe.zod.ts'
import { ClipInfoMap } from './probe.ts'
import { AbstractClipMap } from './util.ts'
import { PreviewServer } from './preview/server.ts'
import type { LogLevel } from './logger.ts'
import type * as inputs from './template_input.zod.ts'
import type { TemplateParsed, MediaClipParsed } from './parsers/template.zod.ts'
import type { Keypoints } from './timeline.zod.ts'
import type * as inputs from './template_input.ts'
import type { TemplateParsed, MediaClipParsed } from './parsers/template.ts'
import type { Keypoints } from './timeline.ts'

interface ContextOptions {
output_folder: string
Expand Down
4 changes: 2 additions & 2 deletions lib/geometry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import { InputError } from './errors.ts'
import { parse_unit } from './parsers/unit.ts'
import { AbstractClipMap } from './util.ts'
import type { Context } from './context.ts'
import type { DetailedSizeUnit } from './template_input.zod.ts'
import type { TemplateParsed, MediaClipParsed, LayoutParsed, SizeParsed } from './parsers/template.zod.ts'
import type { DetailedSizeUnit } from './template_input.ts'
import type { TemplateParsed, MediaClipParsed, LayoutParsed, SizeParsed } from './parsers/template.ts'

interface ComputedGeometry {
x: number
Expand Down
2 changes: 1 addition & 1 deletion lib/logger.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { fmt_human_readable_duration } from './parsers/duration.zod.ts'
import { fmt_human_readable_duration } from './parsers/duration.ts'

type LogLevel = 'error' | 'warn' | 'info'

Expand Down
26 changes: 13 additions & 13 deletions lib/mod.ts
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
import * as path from '@std/path'
import * as errors from './errors.ts'
import { parse_unit } from './parsers/unit.ts'
import { parse_template } from './parsers/template.zod.ts'
import { parse_template } from './parsers/template.ts'
import { parse_percentage } from './parsers/unit.ts'
import { parse_duration, fmt_human_readable_duration } from './parsers/duration.zod.ts'
import { parse_duration, fmt_human_readable_duration } from './parsers/duration.ts'
import { InstanceContext, Context } from './context.ts'
import { compute_geometry, compute_size, compute_rotated_size } from './geometry.zod.ts'
import { compute_zoompans } from './zoompan.zod.ts'
import { compute_timeline } from './timeline.zod.ts'
import { create_text_image } from './canvas/font.zod.ts'
import { compute_geometry, compute_size, compute_rotated_size } from './geometry.ts'
import { compute_zoompans } from './zoompan.ts'
import { compute_timeline } from './timeline.ts'
import { create_text_image } from './canvas/font.ts'
import { relative_path } from './util.ts'
import type * as inputs from './template_input.zod.ts'
import type * as parsed from './parsers/template.zod.ts'
import type { TimelineClip } from './timeline.zod.ts'
import type { ComputedGeometry } from './geometry.zod.ts'
import type { ClipInfo } from './probe.zod.ts'
import type * as inputs from './template_input.ts'
import type * as parsed from './parsers/template.ts'
import type { TimelineClip } from './timeline.ts'
import type { ComputedGeometry } from './geometry.ts'
import type { ClipInfo } from './probe.ts'
import type { ContextOptions } from './context.ts'
import { ffmpeg } from './bindings/ffmpeg.zod.ts'
import { ffmpeg } from './bindings/ffmpeg.ts'

import { FfmpegBuilderBase, type ClipBuilderData } from './builder/ffmpeg_base.ts'
import { ClipBuilderBase } from './builder/clip_base.ts'
Expand Down Expand Up @@ -150,5 +150,5 @@ async function render_image(template: inputs.Template, options: ContextOptions,

export { render_video, render_sample_frame, render_image }
export type Template = inputs.Template
export type { TemplateParsed } from './parsers/template.zod.ts'
export type { TemplateParsed } from './parsers/template.ts'
export type { RenderData } from './builder/ffmpeg_base.ts'
2 changes: 1 addition & 1 deletion lib/parsers/duration.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { InputError } from '../errors.ts'
import type * as inputs from '../template_input.zod.ts'
import type * as inputs from '../template_input.ts'
import type { Context } from '../context.ts'

type Seconds = number
Expand Down
2 changes: 1 addition & 1 deletion lib/parsers/ffmpeg_output.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { compute_rotated_size } from '../geometry.zod.ts'
import { compute_rotated_size } from '../geometry.ts'


function parse_aspect_ratio(aspect_ratio: string, rotation?: number) {
Expand Down
2 changes: 1 addition & 1 deletion lib/parsers/template.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as path from '@std/path'
import { z } from 'zod'
import * as t from '../template_input.zod.ts'
import * as t from '../template_input.ts'
import * as errors from '../errors.ts'
import { parse_unit } from './unit.ts'
import * as tsafe from 'npm:[email protected]'
Expand Down
2 changes: 1 addition & 1 deletion lib/parsers/unit.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { DetailedSizeUnit } from '../template_input.zod.ts'
import type { DetailedSizeUnit } from '../template_input.ts'
import { InputError } from '../errors.ts'

class UnitError extends InputError {}
Expand Down
8 changes: 4 additions & 4 deletions lib/probe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ import {readlines} from './util.ts'
import { ProbeError, CommandError } from './errors.ts'
import { AbstractClipMap } from './util.ts'
import { parse_aspect_ratio, parse_ffmpeg_packet } from './parsers/ffmpeg_output.ts'
import { compute_rotated_size } from './geometry.zod.ts'
import { compute_rotated_size } from './geometry.ts'
import type { InstanceContext } from './context.ts'
import type * as template from './template_input.zod.ts'
import type { MediaClipParsed } from './parsers/template.zod.ts'
import type { Seconds } from './parsers/duration.zod.ts'
import type * as template from './template_input.ts'
import type { MediaClipParsed } from './parsers/template.ts'
import type { Seconds } from './parsers/duration.ts'

const CLIP_INFO_FILENAME = 'probe_info.json'

Expand Down
6 changes: 3 additions & 3 deletions lib/timeline.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import * as errors from './errors.ts'
import { parse_unit } from './parsers/unit.ts'
import { parse_duration } from './parsers/duration.zod.ts'
import type * as inputs from './template_input.zod.ts'
import type * as parsed from './parsers/template.zod.ts'
import { parse_duration } from './parsers/duration.ts'
import type * as inputs from './template_input.ts'
import type * as parsed from './parsers/template.ts'
import type { Context } from './context.ts'


Expand Down
2 changes: 1 addition & 1 deletion lib/util.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {TextLineStream} from '@std/streams'
import * as path from '@std/path'
import { InputError } from './errors.ts'
import type * as template_input from './template_input.zod.ts'
import type * as template_input from './template_input.ts'


abstract class AbstractClipMap<T> extends Map<template_input.ClipID, T> {
Expand Down
8 changes: 4 additions & 4 deletions lib/zoompan.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { InputError } from './errors.ts'
import { parse_unit, parse_percentage } from './parsers/unit.ts'
import { parse_duration } from './parsers/duration.zod.ts'
import { parse_duration } from './parsers/duration.ts'
import { AbstractClipMap } from './util.ts'
import type { ClipID } from './template_input.zod.ts'
import type { ClipInfoMap } from './probe.zod.ts'
import type { ClipGeometryMap } from './geometry.zod.ts'
import type { ClipID } from './template_input.ts'
import type { ClipInfoMap } from './probe.ts'
import type { ClipGeometryMap } from './geometry.ts'
import type {Context} from './context.ts'

type ComputedZoompan = {
Expand Down
4 changes: 2 additions & 2 deletions test/cli.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as path from '@std/path'
import * as fs from '@std/fs'
import ffmpeg_templates from '../lib/cli.zod.ts'
import { render_sample_frame, type Template, type TemplateParsed, type RenderData } from '../lib/mod.zod.ts'
import ffmpeg_templates from '../lib/cli.ts'
import { render_sample_frame, type Template, type TemplateParsed, type RenderData } from '../lib/mod.ts'
import { test, type TestContext } from './tools/test.ts'


Expand Down
2 changes: 1 addition & 1 deletion test/font.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { render_image, render_video } from '../lib/mod.zod.ts'
import { render_image, render_video } from '../lib/mod.ts'
import { path } from './tools/deps.ts'
import { test } from './tools/test.ts'

Expand Down
4 changes: 2 additions & 2 deletions test/mod.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import ffmpeg_templates from '../lib/cli.zod.ts'
import { render_image, render_video } from '../lib/mod.zod.ts'
import ffmpeg_templates from '../lib/cli.ts'
import { render_image, render_video } from '../lib/mod.ts'
import * as path from '@std/path'
import { test } from './tools/test.ts'

Expand Down

0 comments on commit 8fddb8b

Please sign in to comment.