From 0d0a49bf1bbeee2d411aea28923f6a1aa9c350b7 Mon Sep 17 00:00:00 2001 From: Yohe-Am <56622350+Yohe-Am@users.noreply.github.com> Date: Fri, 29 Dec 2023 01:14:31 +0000 Subject: [PATCH] fix: address feedback --- deps/common.ts | 5 +---- ghjk.lock | 7 ++----- ghjk.ts | 7 ++++--- install.sh | 2 +- mod.ts | 6 ++---- modules/tasks/mod.ts | 2 +- modules/tasks/types.ts | 2 +- 7 files changed, 12 insertions(+), 19 deletions(-) diff --git a/deps/common.ts b/deps/common.ts index 22aa3b53..6947d171 100644 --- a/deps/common.ts +++ b/deps/common.ts @@ -2,10 +2,7 @@ //! FIXME: move files in this module to files called deps.ts //! and located close to their users -// export { z as zod } from "https://deno.land/x/zod@v3.22.4/mod.ts"; -export * as zcli from "https://deno.land/x/zcli@1.3.3/mod.ts"; -export * as zcli_json from "https://deno.land/x/zcli@1.3.3/zcli-json.ts"; -export { z as zod } from "https://deno.land/x/zcli@1.3.3/mod.ts"; +export { z as zod } from "https://deno.land/x/zod@v3.22.4/mod.ts"; export * as semver from "https://deno.land/std@0.205.0/semver/mod.ts"; export * as std_log from "https://deno.land/std@0.205.0/log/mod.ts"; export * as std_log_levels from "https://deno.land/std@0.205.0/log/levels.ts"; diff --git a/ghjk.lock b/ghjk.lock index d788162f..8befe310 100644 --- a/ghjk.lock +++ b/ghjk.lock @@ -665,9 +665,6 @@ } } ], - "vars": { - "STUFF": "hello" - }, "env": { "installs": [ { @@ -697,7 +694,7 @@ } } ], - "vars": { + "env": { "STUFF": "hello" }, "allowedPortDeps": {} @@ -1696,7 +1693,7 @@ } ], "allowedPortDeps": {}, - "vars": { + "env": { "STUFF": "hello" } } diff --git a/ghjk.ts b/ghjk.ts index 44a9fc58..b5d7b866 100644 --- a/ghjk.ts +++ b/ghjk.ts @@ -9,10 +9,11 @@ ghjk installs: [ protoc(), ], - vars: { STUFF: "hello" }, + env: { STUFF: "hello" }, async fn({ $ }) { - await $`echo $STUFF`; - await $`protoc --version`; + await $`echo $STUFFY; + protoc --version + `; }, }); diff --git a/install.sh b/install.sh index 7f4bb545..fefb5af3 100755 --- a/install.sh +++ b/install.sh @@ -2,7 +2,7 @@ set -e -u -GHJK_VERSION="${GHJK_VERISON:-v0.1.0-alpha}" +GHJK_VERSION="${GHJK_VERSIkON:-v0.1.0-alpha}" GHJK_INSTALLER_URL="${GHJK_INSTALLER_URL:-https://raw.github.com/metatypedev/ghjk/$GHJK_VERSION/install.ts}" GHJK_DIR="${GHJK_DIR:-$HOME/.local/share/ghjk}" DENO_VERSION="${DENO_VERSION:-v1.38.5}" diff --git a/mod.ts b/mod.ts index 1bb34dcf..2ed19a44 100644 --- a/mod.ts +++ b/mod.ts @@ -25,8 +25,6 @@ import * as std_modules from "./modules/std.ts"; // tasks import type { TaskEnv, TasksModuleConfig } from "./modules/tasks/types.ts"; import { dax } from "./deps/common.ts"; -// import { zcli } from "./deps/common.ts"; -// import { cliffy_cmd } from "./deps/cli.ts"; const portsConfig: PortsModuleConfigBase = { installs: [] }; @@ -48,7 +46,7 @@ const tasks = {} as Record< UserTask >; -// FIXME: use harden.js to deep freeze primoridials +// FIXME: ses.lockdown to freeze primoridials // freeze the object to prevent malicious tampering of the secureConfig export const ghjk = Object.freeze({ getConfig: Object.freeze(getConfig), @@ -70,7 +68,7 @@ function task(name: string, config: TaskConfig) { ...config, env: { installs: [], - vars: {}, + env: {}, allowedPortDeps: {}, ...config, }, diff --git a/modules/tasks/mod.ts b/modules/tasks/mod.ts index a2d1256c..7982aaca 100644 --- a/modules/tasks/mod.ts +++ b/modules/tasks/mod.ts @@ -139,7 +139,7 @@ export async function execTask( args, { ...installEnvs, - ...taskEnv.vars, + ...taskEnv.env, }, ); $.removeIfExists(taskEnvDir); diff --git a/modules/tasks/types.ts b/modules/tasks/types.ts index a9fc28e4..f46be3d2 100644 --- a/modules/tasks/types.ts +++ b/modules/tasks/types.ts @@ -9,7 +9,7 @@ const taskEnv = zod.object({ zod.string(), portsValidators.allowedPortDep, ), - vars: zod.record(zod.string(), zod.string()), + env: zod.record(zod.string(), zod.string()), }); const taskDef = zod.object({ env: taskEnv,