Skip to content

Commit

Permalink
fix: address feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
Yohe-Am committed Dec 29, 2023
1 parent e3e0eca commit 0d0a49b
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 19 deletions.
5 changes: 1 addition & 4 deletions deps/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]/mod.ts";
export * as zcli from "https://deno.land/x/[email protected]/mod.ts";
export * as zcli_json from "https://deno.land/x/[email protected]/zcli-json.ts";
export { z as zod } from "https://deno.land/x/[email protected]/mod.ts";
export { z as zod } from "https://deno.land/x/[email protected]/mod.ts";
export * as semver from "https://deno.land/[email protected]/semver/mod.ts";
export * as std_log from "https://deno.land/[email protected]/log/mod.ts";
export * as std_log_levels from "https://deno.land/[email protected]/log/levels.ts";
Expand Down
7 changes: 2 additions & 5 deletions ghjk.lock
Original file line number Diff line number Diff line change
Expand Up @@ -665,9 +665,6 @@
}
}
],
"vars": {
"STUFF": "hello"
},
"env": {
"installs": [
{
Expand Down Expand Up @@ -697,7 +694,7 @@
}
}
],
"vars": {
"env": {
"STUFF": "hello"
},
"allowedPortDeps": {}
Expand Down Expand Up @@ -1696,7 +1693,7 @@
}
],
"allowedPortDeps": {},
"vars": {
"env": {
"STUFF": "hello"
}
}
Expand Down
7 changes: 4 additions & 3 deletions ghjk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
`;
},
});

Expand Down
2 changes: 1 addition & 1 deletion install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down
6 changes: 2 additions & 4 deletions mod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: [] };

Expand All @@ -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),
Expand All @@ -70,7 +68,7 @@ function task(name: string, config: TaskConfig) {
...config,
env: {
installs: [],
vars: {},
env: {},
allowedPortDeps: {},
...config,
},
Expand Down
2 changes: 1 addition & 1 deletion modules/tasks/mod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ export async function execTask(
args,
{
...installEnvs,
...taskEnv.vars,
...taskEnv.env,
},
);
$.removeIfExists(taskEnvDir);
Expand Down
2 changes: 1 addition & 1 deletion modules/tasks/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 0d0a49b

Please sign in to comment.