diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..563ba71 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +/node_modules +/build \ No newline at end of file diff --git a/analyze/analysis.mts b/analyze/analysis.ts similarity index 98% rename from analyze/analysis.mts rename to analyze/analysis.ts index 8da6702..515afab 100755 --- a/analyze/analysis.mts +++ b/analyze/analysis.ts @@ -1,6 +1,5 @@ #!/usr/bin/env zx - -/// +import "zx/globals" export interface AnalysisConfig { imageDir: string diff --git a/analyze/index.mts b/analyze/index.ts similarity index 84% rename from analyze/index.mts rename to analyze/index.ts index 5ad18d5..b173783 100755 --- a/analyze/index.mts +++ b/analyze/index.ts @@ -1,8 +1,8 @@ #!/usr/bin/env zx -/// -import { cacheDir, configDir, loadConfig } from "../utils.mts" -import { AnalysisConfig, analyzeImages, defaultConfig, ImageAnalysisData, runPreAnalysis } from "./analysis.mts" +import { cacheDir, configDir, loadConfig } from "../utils.ts" +import { AnalysisConfig, analyzeImages, defaultConfig, ImageAnalysisData, runPreAnalysis } from "./analysis.ts" +import "zx/globals" const pathToConfig = `${configDir}/analyze-config.json` diff --git a/apply/application.mts b/apply/application.ts similarity index 95% rename from apply/application.mts rename to apply/application.ts index 86e182b..c138654 100644 --- a/apply/application.mts +++ b/apply/application.ts @@ -1,8 +1,4 @@ -#!/usr/bin/env zx - -import { ImageAnalysisData } from "../analyze/analysis.mts" - -/// +import { ImageAnalysisData } from "../analyze/analysis.ts" export interface ApplicationConfig { latitude: number diff --git a/apply/index.mts b/apply/index.ts similarity index 90% rename from apply/index.mts rename to apply/index.ts index 6fc18f9..c78329a 100644 --- a/apply/index.mts +++ b/apply/index.ts @@ -1,10 +1,10 @@ #!/usr/bin/env zx -/// -import { ImageAnalysisData } from "../analyze/analysis.mts" -import { cacheDir, configDir, loadConfig, map, mapEaseInExpo, mapEaseOutExpo } from "../utils.mts" -import { ApplicationConfig, defaultConfig, findMatchingImages, getOpenMeteoData } from "./application.mts" -import * as SunCalc from "npm:suncalc" +import { ImageAnalysisData } from "../analyze/analysis.ts" +import { cacheDir, configDir, loadConfig, map, mapEaseInExpo, mapEaseOutExpo } from "../utils.ts" +import { ApplicationConfig, defaultConfig, findMatchingImages, getOpenMeteoData } from "./application.ts" +import * as SunCalc from "suncalc" +import "zx/globals" const pathToConfig = `${configDir}/apply-config.json` const pathToCache = `${cacheDir}/analysis.json` diff --git a/deno.json b/deno.json index 3a6e8a8..fd6fad3 100644 --- a/deno.json +++ b/deno.json @@ -1,12 +1,10 @@ { "tasks": { - "analyze": "zx analyze/index.mts", - "apply": "zx apply/index.mts" + "analyze": "zx analyze/index.ts", + "apply": "zx apply/index.ts" }, "imports": { - "@std/assert": "jsr:@std/assert@1", - "suncalc": "npm:suncalc@^2.0.0", - "zx": "npm:zx@^8.8.5" + "@std/assert": "jsr:@std/assert@1" }, "fmt": { "semiColons": false, "indentWidth": 4, "useTabs": true, "lineWidth": 120 } } diff --git a/deno.lock b/deno.lock index d467c64..0ea6dee 100644 --- a/deno.lock +++ b/deno.lock @@ -2,9 +2,8 @@ "version": "5", "specifiers": { "jsr:@std/assert@1": "1.0.19", - "jsr:@std/internal@^1.0.12": "1.0.12", - "npm:suncalc@2": "2.0.0", - "npm:zx@^8.8.5": "8.8.5" + "jsr:@std/internal@^1.0.12": "1.0.14", + "npm:suncalc@2": "2.0.0" }, "jsr": { "@std/assert@1.0.19": { @@ -13,24 +12,23 @@ "jsr:@std/internal" ] }, - "@std/internal@1.0.12": { - "integrity": "972a634fd5bc34b242024402972cd5143eac68d8dffaca5eaa4dba30ce17b027" + "@std/internal@1.0.14": { + "integrity": "291516b3d4c35024d6ffbc0a9df5bf4c64116e05b50012cf846710152d2ffdf7" } }, "npm": { "suncalc@2.0.0": { "integrity": "sha512-RcO28GOMXNnB+sr+c7/+zv5UPMa9wxIsUVGE3HddjQykqCVEC2rc4t4IjBB7qaa7K7dx5Cxp8UZwexyXrX8JkA==" - }, - "zx@8.8.5": { - "integrity": "sha512-SNgDF5L0gfN7FwVOdEFguY3orU5AkfFZm9B5YSHog/UDHv+lvmd82ZAsOenOkQixigwH2+yyH198AwNdKhj+RA==", - "bin": true } }, "workspace": { "dependencies": [ - "jsr:@std/assert@1", - "npm:suncalc@2", - "npm:zx@^8.8.5" - ] + "jsr:@std/assert@1" + ], + "packageJson": { + "dependencies": [ + "npm:suncalc@2" + ] + } } } diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..1bb31cc --- /dev/null +++ b/package-lock.json @@ -0,0 +1,30 @@ +{ + "name": "rainwall", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "dependencies": { + "suncalc": "^2.0.0", + "zx": "^8.8.5" + } + }, + "node_modules/suncalc": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/suncalc/-/suncalc-2.0.0.tgz", + "integrity": "sha512-RcO28GOMXNnB+sr+c7/+zv5UPMa9wxIsUVGE3HddjQykqCVEC2rc4t4IjBB7qaa7K7dx5Cxp8UZwexyXrX8JkA==" + }, + "node_modules/zx": { + "version": "8.8.5", + "resolved": "https://registry.npmjs.org/zx/-/zx-8.8.5.tgz", + "integrity": "sha512-SNgDF5L0gfN7FwVOdEFguY3orU5AkfFZm9B5YSHog/UDHv+lvmd82ZAsOenOkQixigwH2+yyH198AwNdKhj+RA==", + "license": "Apache-2.0", + "bin": { + "zx": "build/cli.js" + }, + "engines": { + "node": ">= 12.17.0" + } + } + } +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..5e2aca6 --- /dev/null +++ b/package.json @@ -0,0 +1,6 @@ +{ + "dependencies": { + "suncalc": "^2.0.0", + "zx": "^8.8.5" + } +} diff --git a/utils.mts b/utils.ts similarity index 99% rename from utils.mts rename to utils.ts index ef122df..ebf6b7a 100644 --- a/utils.mts +++ b/utils.ts @@ -1,3 +1,5 @@ +import "zx/globals" + export const configDir = process.env.XDG_CONFIG_HOME ? `${process.env.XDG_CONFIG_HOME}/rainwall` : `${os.homedir()}/.config/rainwall`