Skip to content

Commit

Permalink
Use deno config imports for dependency management
Browse files Browse the repository at this point in the history
  • Loading branch information
nktpro committed Jul 23, 2024
1 parent d45e23a commit c2f9c9e
Show file tree
Hide file tree
Showing 33 changed files with 171 additions and 163 deletions.
12 changes: 11 additions & 1 deletion deno.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@wok/helmet",
"version": "dev",
"version": "0.0.0",
"exports": {
".": "./src/mod.ts",
"./deps/typebox": "./src/deps/typebox.ts"
Expand All @@ -26,5 +26,15 @@
"rules": {
"exclude": ["no-slow-types"]
}
},
"imports": {
"@std/fmt": "jsr:@std/fmt@0.225.6",
"@std/fs": "jsr:@std/fs@0.229.3",
"@std/io": "jsr:@std/io@0.224.3",
"@std/path": "jsr:@std/path@1.0.1",
"@std/semver": "jsr:@std/semver@0.224.3",
"@std/yaml": "jsr:@std/yaml@0.224.3",
"@wok/case": "jsr:@wok/case@1.0.1",
"@wok/utils": "jsr:@wok/utils@1.3.3"
}
}
118 changes: 65 additions & 53 deletions deno.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions examples/namespaces.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { createK8sNamespace } from "../src/deps/k8s_utils.ts";
import { defineBundle } from "../src/libs/iac_utils.ts";
import { createK8sNamespace, defineBundle } from "../src/mod.ts";

export default defineBundle({
releaseId: "examples-namespaces",
Expand Down
14 changes: 7 additions & 7 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 13 additions & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
name = "${name}-src";
filter = with pkgs.lib; (path: /* type */_:
hasInfix "/src" path ||
hasSuffix "/deno.json" path ||
hasSuffix "/deno.lock" path
);
};
Expand All @@ -57,7 +58,18 @@
inherit name deno deno-cache src;
inherit (hotPotPkgs) deno-app-build;
appSrcPath = "./src/helmet.ts";
denoRunFlags = "-A --no-lock";
denoRunFlags = ''"''${DENO_RUN_FLAGS[@]}"'';
preExec = ''
DENO_RUN_FLAGS=("-A")
if [ ! -f deno.lock ]; then
DENO_RUN_FLAGS+=("--no-lock")
fi
if [ -f deno.json ]; then
DENO_RUN_FLAGS+=("--config=deno.json")
elif [ -f deno.jsonc ]; then
DENO_RUN_FLAGS+=("--config=deno.jsonc")
fi
'';
};
denoJson = builtins.fromJSON (builtins.readFile ./deno.json);
in
Expand Down
8 changes: 4 additions & 4 deletions src/actions/blacklist_instance.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Type } from "../deps/typebox.ts";
import { createCliAction, ExitCode } from "../deps/cli_utils.ts";
import { Type } from "@wok/utils/typebox";
import { createCliAction, ExitCode } from "@wok/utils/cli";
import { fetchCurrentWhitelist, updateWhitelist } from "./whitelist_instance.ts";
import { resolvePath } from "../deps/std_path.ts";
import { bold, red } from "../deps/std_fmt_colors.ts";
import { resolve as resolvePath } from "@std/path";
import { bold, red } from "@std/fmt/colors";
import { importBundleModule } from "../libs/iac_utils.ts";

export default createCliAction(
Expand Down
10 changes: 5 additions & 5 deletions src/actions/compile.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { stringifyYamlRelaxed } from "../libs/yaml_utils.ts";
import type { HelmetChartInstance } from "../libs/types.ts";
import { joinPath, resolvePath } from "../deps/std_path.ts";
import { createCliAction, ExitCode } from "../deps/cli_utils.ts";
import { Type } from "../deps/typebox.ts";
import { cyan } from "../deps/std_fmt_colors.ts";
import { join as joinPath, resolve as resolvePath } from "@std/path";
import { createCliAction, ExitCode } from "@wok/utils/cli";
import { Type } from "@wok/utils/typebox";
import { cyan } from "@std/fmt/colors";
import { importBundleModule } from "../libs/iac_utils.ts";
import { K8sKind } from "../deps/k8s_utils.ts";
import { K8sKind } from "@wok/utils/k8s";

async function generateChildChart(
{ crdsPath, resourcesPath, namespacesPath, instance }: {
Expand Down
10 changes: 5 additions & 5 deletions src/actions/ensure_instance_whitelisted.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { createCliAction, ExitCode } from "../deps/cli_utils.ts";
import { captureExec } from "../deps/exec_utils.ts";
import { bold, cyan, red } from "../deps/std_fmt_colors.ts";
import { resolvePath } from "../deps/std_path.ts";
import { Type } from "../deps/typebox.ts";
import { createCliAction, ExitCode } from "@wok/utils/cli";
import { captureExec } from "@wok/utils/exec";
import { bold, cyan, red } from "@std/fmt/colors";
import { resolve as resolvePath } from "@std/path";
import { Type } from "@wok/utils/typebox";
import { importBundleModule } from "../libs/iac_utils.ts";
import { fetchCurrentWhitelist } from "./whitelist_instance.ts";

Expand Down
16 changes: 8 additions & 8 deletions src/actions/install.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { captureExec, inheritExec, printErrLines, printOutLines } from "../deps/exec_utils.ts";
import { validate } from "../deps/validation_utils.ts";
import { type Static, type TObject, Type } from "../deps/typebox.ts";
import { joinPath, resolvePath } from "../deps/std_path.ts";
import { expandGlobSync } from "../deps/std_fs.ts";
import { createCliAction, ExitCode } from "../deps/cli_utils.ts";
import { cyan, gray } from "../deps/std_fmt_colors.ts";
import { readerFromStreamReader, readLines } from "../deps/std_io.ts";
import { captureExec, inheritExec, printErrLines, printOutLines } from "@wok/utils/exec";
import { validate } from "@wok/utils/validation";
import { type Static, type TObject, Type } from "@wok/utils/typebox";
import { join as joinPath, resolve as resolvePath } from "@std/path";
import { expandGlobSync } from "@std/fs";
import { createCliAction, ExitCode } from "@wok/utils/cli";
import { cyan, gray } from "@std/fmt/colors";
import { readerFromStreamReader, readLines } from "@std/io";
import { HelmLsResultSchema } from "../libs/iac_utils.ts";

async function helmInstall(
Expand Down
2 changes: 1 addition & 1 deletion src/actions/show_version.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { createCliAction, ExitCode } from "../deps/cli_utils.ts";
import { createCliAction, ExitCode } from "@wok/utils/cli";

export default createCliAction(
{},
Expand Down
18 changes: 9 additions & 9 deletions src/actions/typeify.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import { deepMerge } from "../libs/patch_utils.ts";

import { checkAndImport, type ImportDef, readChartCrds, type TypeifyPatch } from "../libs/iac_utils.ts";
import { basename, joinPath, resolvePath } from "../deps/std_path.ts";
import { expandGlobSync, fsExists } from "../deps/std_fs.ts";
import { parseYaml } from "../deps/std_yaml.ts";
import { pascalCase } from "../deps/case.ts";
import { captureExec, inheritExec, printErrLines } from "../deps/exec_utils.ts";
import { K8sCrdApiVersionV1beta1 } from "../deps/k8s_utils.ts";
import { createCliAction, ExitCode } from "../deps/cli_utils.ts";
import { Type } from "../deps/typebox.ts";
import { cyan, gray } from "../deps/std_fmt_colors.ts";
import { basename, join as joinPath, resolve as resolvePath } from "@std/path";
import { exists as fsExists, expandGlobSync } from "@std/fs";
import { parse as parseYaml } from "@std/yaml";
import { pascalCase } from "@wok/case";
import { captureExec, inheritExec, printErrLines } from "@wok/utils/exec";
import { K8sCrdApiVersionV1beta1 } from "@wok/utils/k8s";
import { createCliAction, ExitCode } from "@wok/utils/cli";
import { Type } from "@wok/utils/typebox";
import { cyan, gray } from "@std/fmt/colors";

export type ClassifiedType =
| "array"
Expand Down
6 changes: 3 additions & 3 deletions src/actions/uninstall.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { createCliAction, ExitCode } from "../deps/cli_utils.ts";
import { inheritExec } from "../deps/exec_utils.ts";
import { Type } from "../deps/typebox.ts";
import { createCliAction, ExitCode } from "@wok/utils/cli";
import { inheritExec } from "@wok/utils/exec";
import { Type } from "@wok/utils/typebox";

export default createCliAction(
{
Expand Down
Loading

0 comments on commit c2f9c9e

Please sign in to comment.