Skip to content

Commit

Permalink
Update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
nktpro committed May 20, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent b23f32b commit e02e3c0
Showing 26 changed files with 126 additions and 122 deletions.
3 changes: 3 additions & 0 deletions cli.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
#!/usr/bin/env bash
set -euo pipefail
shopt -s globstar

ENTRY_FILE="./src/helmet.ts"
MOD_FILE="./src/mod.ts"

code_quality() {
echo "Checking formatting..."
deno fmt --check ./src
echo "Checking..."
deno check ./src/**/*.ts
echo "Linting..."
deno lint ./src
echo "Running eslint..."
121 changes: 63 additions & 58 deletions deno.lock

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

12 changes: 6 additions & 6 deletions flake.lock

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

4 changes: 2 additions & 2 deletions src/actions/blacklist_instance.ts
Original file line number Diff line number Diff line change
@@ -6,12 +6,12 @@ import { bold, red } from "../deps/std_fmt_colors.ts";
import { importBundleModule } from "../libs/iac_utils.ts";

export default createCliAction(
Type.Object({
{
path: Type.String({
description: "Path to the instance module",
examples: ["./instances/prod.ts"],
}),
}),
},
async ({ path }) => {
const source = resolvePath(path);

45 changes: 21 additions & 24 deletions src/actions/compile.ts
Original file line number Diff line number Diff line change
@@ -268,28 +268,25 @@ export async function compile(
);
}

export default createCliAction(
Type.Object({
version: Type.String({
description: "Version to write to the generated Chart.yaml",
examples: ["1.0.0"],
}),
source: Type.String({
description: "Path to the instance module's source",
examples: ["./instances/prod.ts"],
}),
destination: Type.String({
description: "Destination path to generate the Helm chart to",
examples: ["/path/to/compiled-prod-chart"],
}),
export default createCliAction({
version: Type.String({
description: "Version to write to the generated Chart.yaml",
examples: ["1.0.0"],
}),
async ({ version, source, destination }) => {
await compile({
version,
source,
destination,
});

return ExitCode.Zero;
},
);
source: Type.String({
description: "Path to the instance module's source",
examples: ["./instances/prod.ts"],
}),
destination: Type.String({
description: "Destination path to generate the Helm chart to",
examples: ["/path/to/compiled-prod-chart"],
}),
}, async ({ version, source, destination }) => {
await compile({
version,
source,
destination,
});

return ExitCode.Zero;
});
4 changes: 2 additions & 2 deletions src/actions/ensure_instance_whitelisted.ts
Original file line number Diff line number Diff line change
@@ -7,12 +7,12 @@ import { importBundleModule } from "../libs/iac_utils.ts";
import { fetchCurrentWhitelist } from "./whitelist_instance.ts";

export default createCliAction(
Type.Object({
{
path: Type.String({
description: "Path to the instance module",
examples: ["./instances/prod.ts"],
}),
}),
},
async ({ path }) => {
const source = resolvePath(path);

8 changes: 4 additions & 4 deletions src/actions/install.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { captureExec, inheritExec, printErrLines, printOutLines } from "../deps/exec_utils.ts";
import { validate } from "../deps/validation_utils.ts";
import { type Static, Type } from "../deps/typebox.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";
@@ -118,7 +118,7 @@ async function helmInstall(
});
}

export const ParamsSchema = Type.Object({
export const ParamsSchema = {
name: Type.String({
description:
"Helm release base name. This will be used as the prefx of the different sub-releases (*-crds, *-namespaces and *-resources)",
@@ -164,7 +164,7 @@ export const ParamsSchema = Type.Object({
default: false,
examples: [false],
})),
});
};

export async function install(
{
@@ -178,7 +178,7 @@ export async function install(
createNamespace = false,
debug = false,
timeout,
}: Static<typeof ParamsSchema>,
}: Static<TObject<typeof ParamsSchema>>,
) {
const resolvedSource = resolvePath(source);

3 changes: 1 addition & 2 deletions src/actions/show_version.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { createCliAction, ExitCode } from "../deps/cli_utils.ts";
import { Type } from "../deps/typebox.ts";

export default createCliAction(
Type.Object({}),
{},
() => {
console.log(JSON.stringify(
{
4 changes: 2 additions & 2 deletions src/actions/typeify.ts
Original file line number Diff line number Diff line change
@@ -685,7 +685,7 @@ ${crdInterfaces}
}

export default createCliAction(
Type.Object({
{
charts: Type.String({
description: "Glob pattern to match directories of Helm charts, for which types will be generated",
examples: ["./charts/*"],
@@ -694,7 +694,7 @@ export default createCliAction(
description: "Path to the destination directory where types will be generated into",
examples: ["./types"],
}),
}),
},
async ({ charts, types }) => {
const resolvedTypesPath = resolvePath(types);

4 changes: 2 additions & 2 deletions src/actions/uninstall.ts
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@ import { inheritExec } from "../deps/exec_utils.ts";
import { Type } from "../deps/typebox.ts";

export default createCliAction(
Type.Object({
{
name: Type.String({
description: "Instance name to uninstall",
examples: ["iac-my-stack"],
@@ -12,7 +12,7 @@ export default createCliAction(
description: "The namespace where corresponding Helm releases of this instance were installed to",
examples: ["iac-my-stack"],
}),
}),
},
async ({ name, namespace }) => {
await inheritExec({
cmd: ["helm", "uninstall", "-n", namespace, `${name}-resources`],
4 changes: 2 additions & 2 deletions src/actions/update.ts
Original file line number Diff line number Diff line change
@@ -428,7 +428,7 @@ async function updateHelmRepoChart({
}

export default createCliAction(
Type.Object({
{
manifest: Type.String({
description: "Path to the manifest module",
examples: ["./manifest.ts"],
@@ -444,7 +444,7 @@ export default createCliAction(
only: Type.Optional(Type.String({
description: "Optional filter which partially matches the name of only a certain chart to update",
})),
}),
},
async ({ manifest, charts: chartsPath, types: typesPath, only }) => {
const resolvedManifest = resolvePath(manifest);
const resolvedChartsPath = resolvePath(chartsPath);
4 changes: 2 additions & 2 deletions src/actions/whitelist_instance.ts
Original file line number Diff line number Diff line change
@@ -71,12 +71,12 @@ export async function updateWhitelist(
}

export default createCliAction(
Type.Object({
{
path: Type.String({
description: "Path to the instance module",
examples: ["./instances/prod.ts"],
}),
}),
},
async ({ path }) => {
const source = resolvePath(path);

Loading

0 comments on commit e02e3c0

Please sign in to comment.