Skip to content

Commit 4b63101

Browse files
committed
Update dependencies
1 parent 2e26a41 commit 4b63101

File tree

6 files changed

+29
-32
lines changed

6 files changed

+29
-32
lines changed

cli.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ ENTRY_FILE="./src/cli.ts"
66
MOD_FILE="./src/mod.ts"
77

88
update_deps() {
9-
deno run -A jsr:@wok/deup@2.0.0 update "$@"
9+
deno run -A jsr:@wok/deup@2.1.0 update "$@"
1010
"$0" update_lock
1111
}
1212

deno.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
"@std/streams": "jsr:@std/streams@^1.0.8",
3737
"@std/yaml": "jsr:@std/yaml@^1.0.5",
3838
"@wok/case": "jsr:@wok/case@^1.0.2",
39-
"@wok/schema": "jsr:@wok/schema@^2.0.2",
40-
"@wok/utils": "jsr:@wok/utils@^4.0.2"
39+
"@wok/schema": "jsr:@wok/schema@^2.1.0",
40+
"@wok/utils": "jsr:@wok/utils@^4.1.0"
4141
}
4242
}

deno.lock

Lines changed: 12 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/actions/install.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { createCliAction, ExitCode } from "@wok/utils/cli";
55
import { cyan, gray } from "@std/fmt/colors";
66
import { HelmLsResultSchema } from "../libs/iac_utils.ts";
77
import { TextLineStream } from "@std/streams/text-line-stream";
8-
import { Bool, Obj, Opt, Str, typedParse } from "../deps/schema.ts";
8+
import { Bool, Obj, Opt, Str, validate } from "../deps/schema.ts";
99

1010
async function helmInstall(
1111
{
@@ -38,7 +38,7 @@ async function helmInstall(
3838
})).out,
3939
);
4040

41-
const helmLsResult = typedParse(HelmLsResultSchema, helmLsResultRaw);
41+
const helmLsResult = validate(HelmLsResultSchema, helmLsResultRaw);
4242

4343
if (!helmLsResult.isSuccess) {
4444
throw new Error('Failed validating result of "helm ls" command');

src/actions/update.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import {
2525
import { typeifyChart } from "./typeify.ts";
2626
import { bold, gray, green, red } from "@std/fmt/colors";
2727
import { checkAndImport } from "../mod.ts";
28-
import { Opt, Str, typedParse } from "../deps/schema.ts";
28+
import { Opt, Str, validate } from "../deps/schema.ts";
2929

3030
interface ChartUpdateFailure {
3131
isSuccess: false;
@@ -48,7 +48,7 @@ async function getCurrentChartMetadata(
4848
const currentChartMetaRaw = parseYaml(
4949
await Deno.readTextFile(joinPath(chartPath, "Chart.yaml")),
5050
);
51-
const currentChartMetaResult = typedParse(
51+
const currentChartMetaResult = validate(
5252
ChartMetadataSchema,
5353
currentChartMetaRaw,
5454
);
@@ -318,7 +318,7 @@ async function updateHelmRepoChart({
318318
const remoteRepoIndexRaw = parseYaml(
319319
await fetchRemoteRepoIndexYaml(remoteRepoUrl),
320320
);
321-
const remoteRepoIndexResult = typedParse(
321+
const remoteRepoIndexResult = validate(
322322
ChartRepoIndexSchema,
323323
remoteRepoIndexRaw,
324324
);

src/libs/iac_utils.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import { memoize } from "@wok/utils/memoize";
1616
import { parseMultiDocumentsYaml, stringifyYamlRelaxed } from "./yaml_utils.ts";
1717
import { gray } from "@std/fmt/colors";
1818
import { toFileUrl } from "@std/path/to-file-url";
19-
import { Arr, createTypedParser, Obj, type ParseResult, Str, typedParse, type TypedSchema } from "../deps/schema.ts";
19+
import { Arr, createValidator, Obj, Str, type TypedSchema, validate, type ValidationResult } from "../deps/schema.ts";
2020

2121
export interface ImportDef {
2222
props: string[];
@@ -38,7 +38,7 @@ export function createTypeifyPatch(
3838
export async function decryptAndValidateSecrets<T>(
3939
schema: TypedSchema<T, unknown>,
4040
encryptedSecretsPath: string,
41-
): Promise<ParseResult<T>> {
41+
): Promise<ValidationResult<T>> {
4242
const raw = await (async () => {
4343
try {
4444
return (await captureExec({
@@ -54,7 +54,7 @@ export async function decryptAndValidateSecrets<T>(
5454

5555
const decrypted = parseYaml(raw);
5656

57-
return typedParse(schema, decrypted);
57+
return validate(schema, decrypted);
5858
}
5959

6060
export function createK8sSecretsDecryptor<T>(
@@ -83,7 +83,7 @@ export function createK8sSecretsDecryptor<T>(
8383
});
8484
}
8585

86-
const validateChartMeta = createTypedParser(ChartMetadataSchema);
86+
const validateChartMeta = createValidator(ChartMetadataSchema);
8787

8888
export async function readChartMeta(chartPath: string): Promise<ChartMetadata> {
8989
const chartMetaPath = joinPath(
@@ -104,7 +104,7 @@ export async function readChartMeta(chartPath: string): Promise<ChartMetadata> {
104104
return chartMetaResult.value;
105105
}
106106

107-
const validateCrds = createTypedParser(Arr(K8sCrdSchema));
107+
const validateCrds = createValidator(Arr(K8sCrdSchema));
108108

109109
export async function collectCrdFiles(chartPath: string): Promise<string[]> {
110110
const crdsPath = joinPath(chartPath, "crds");
@@ -160,7 +160,7 @@ export async function readChartCrds(chartPath: string): Promise<K8sCrd[]> {
160160
);
161161
}
162162

163-
const validateK8sResource = createTypedParser(K8sResourceSchema);
163+
const validateK8sResource = createValidator(K8sResourceSchema);
164164

165165
const memoizedAllApiVersions = memoize(async () => {
166166
const apiVersionsFromEnv = Deno.env.get("HELMET_KUBECTL_API_VERSIONS");
@@ -239,14 +239,14 @@ const memoizedKubeVersion = memoize(async () => {
239239
const json = JSON.parse(out);
240240

241241
if (useServerVersion) {
242-
const validation = typedParse(KubectlServerVersionCmdOutputSchema, json);
242+
const validation = validate(KubectlServerVersionCmdOutputSchema, json);
243243
if (!validation.isSuccess) {
244244
throw new Error(`Got invalid output for command: ${cmd.join(" ")}`);
245245
}
246246
return validation.value.serverVersion.gitVersion;
247247
}
248248

249-
const validation = typedParse(KubectlClientVersionCmdOutputSchema, json);
249+
const validation = validate(KubectlClientVersionCmdOutputSchema, json);
250250
if (!validation.isSuccess) {
251251
throw new Error(`Got invalid output for command: ${cmd.join(" ")}`);
252252
}
@@ -335,7 +335,7 @@ ${JSON.stringify(docResult.errors, null, 2)}
335335
return transformedDocs;
336336
}
337337

338-
const validateK8sCrd = createTypedParser(K8sCrdSchema);
338+
const validateK8sCrd = createValidator(K8sCrdSchema);
339339

340340
export const HelmLsResultSchema = Arr(Obj({
341341
name: Str(),

0 commit comments

Comments
 (0)