From 219bee4cc1b505e1c1ecdb14b074521d70cc58df Mon Sep 17 00:00:00 2001 From: Angel Wang Date: Mon, 22 Jun 2026 20:34:10 -0600 Subject: [PATCH] refactor: restructure to use src directory --- deno.json | 8 ++++---- {analyze => src/analyze}/analysis.ts | 0 {analyze => src/analyze}/index.ts | 2 +- {apply => src/apply}/application.ts | 2 +- {apply => src/apply}/index.ts | 0 utils.ts => src/utils.ts | 0 6 files changed, 6 insertions(+), 6 deletions(-) rename {analyze => src/analyze}/analysis.ts (100%) rename {analyze => src/analyze}/index.ts (87%) rename {apply => src/apply}/application.ts (98%) rename {apply => src/apply}/index.ts (100%) rename utils.ts => src/utils.ts (100%) diff --git a/deno.json b/deno.json index e050cc5..bf25173 100644 --- a/deno.json +++ b/deno.json @@ -7,10 +7,10 @@ "./apply": "./apply/index.ts" }, "tasks": { - "compile-analyze": "deno compile --output build/rainwall-analyze -A analyze/index.ts", - "compile-apply": "deno compile --output build/rainwall-apply -A apply/index.ts", - "analyze": "deno -A analyze/index.ts", - "apply": "deno -A apply/index.ts" + "compile-analyze": "deno compile --output build/rainwall-analyze -A ./src/analyze/index.ts", + "compile-apply": "deno compile --output build/rainwall-apply -A ./src/apply/index.ts", + "analyze": "deno -A ./src/analyze/index.ts", + "apply": "deno -A ./src/apply/index.ts" }, "imports": { "@std/assert": "jsr:@std/assert@1", diff --git a/analyze/analysis.ts b/src/analyze/analysis.ts similarity index 100% rename from analyze/analysis.ts rename to src/analyze/analysis.ts diff --git a/analyze/index.ts b/src/analyze/index.ts similarity index 87% rename from analyze/index.ts rename to src/analyze/index.ts index d3cea90..a8da2b1 100755 --- a/analyze/index.ts +++ b/src/analyze/index.ts @@ -1,7 +1,7 @@ #!/usr/bin/env zx import { cacheDir, chalkDebug, configDir, loadConfig } from "../utils.ts" -import { AnalysisConfig, analyzeImages, defaultConfig, ImageAnalysisData, runPreAnalysis } from "./analysis.ts" +import { type AnalysisConfig, analyzeImages, defaultConfig, type ImageAnalysisData, runPreAnalysis } from "./analysis.ts" import "zx/globals" const pathToConfig = `${configDir}/analyze-config.json` diff --git a/apply/application.ts b/src/apply/application.ts similarity index 98% rename from apply/application.ts rename to src/apply/application.ts index e746f1e..bf3fa64 100644 --- a/apply/application.ts +++ b/src/apply/application.ts @@ -84,7 +84,7 @@ export function findMatchingImages( const matchingImages = [] - let targetDifference = 0.07 + let targetDifference = 0.05 while (matchingImages.length == 0) { for (const image of imagesData.files) { const targetAValue = image.oklch[1] * Math.cos(image.oklch[2]) diff --git a/apply/index.ts b/src/apply/index.ts similarity index 100% rename from apply/index.ts rename to src/apply/index.ts diff --git a/utils.ts b/src/utils.ts similarity index 100% rename from utils.ts rename to src/utils.ts -- 2.51.2