Skip to content
This repository has been archived by the owner on Nov 19, 2024. It is now read-only.

Commit

Permalink
Merge pull request #57 from robdimarco-render/robdimarco-render/SVC-1…
Browse files Browse the repository at this point in the history
…626-fix-build-issue

Fix dependency and resulting build issue
  • Loading branch information
robdimarco-render authored May 15, 2023
2 parents 7dc06e4 + 9468738 commit c0de4b6
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 117 deletions.
2 changes: 1 addition & 1 deletion buildpack/crud.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { pathExists } from "../util/paths.ts";
import { DOCKERFILE_TEMPLATE } from "./templates/dockerfile_template.ts";
import { RenderBuildpackFile } from "./types.ts";

const BUILDPACKS_VALIDATOR = ajv.compile<RenderBuildpackFile>(RenderBuildpackFile);
const BUILDPACKS_VALIDATOR = ajv.compile(RenderBuildpackFile);

export async function initDockerfile(dir: string, force: boolean) {
const f = `${dir}/Dockerfile.render`;
Expand Down
2 changes: 1 addition & 1 deletion commands/services/tail.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export const servicesTailCommand =
throw err;
}

const logEntryValidator = ajv.compile<LogTailEntry>(LogTailEntry);
const logEntryValidator = ajv.compile(LogTailEntry);


setInterval(() => {
Expand Down
4 changes: 2 additions & 2 deletions config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,9 @@ async function buildRuntimeProfile(
}

export function validateRegion(s: string): Region {
if (!ajv.validate<Region>(Region, s)) {
if (!ajv.validate(Region, s)) {
throw new Error(`Invalid region '${s}'. Valid regions: ${ALL_REGIONS.join(' ')}`);
}

return s;
return s as Region;
}
2 changes: 1 addition & 1 deletion config/types/enums.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export type Region = Static<typeof Region>;
export const ALL_REGIONS = Region.anyOf.map(i => i.const);

export function assertValidRegion(s: string): asserts s is Region {
if (!ajv.validate<Region>(Region, s)) {
if (!ajv.validate(Region, s)) {
throw new Error(`Region '${s}' is not one of: ${ALL_REGIONS.join(' ')}`);
}
}
124 changes: 17 additions & 107 deletions deps-lock.json

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions deps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ export {
sortBy
} from "https://raw.githubusercontent.com/lodash/lodash/4.17.21-es/lodash.js";

export { Type, type Static } from "https://deno.land/x/typebox@0.24.27/src/typebox.ts";
export * as Typebox from "https://deno.land/x/typebox@0.24.27/src/typebox.ts";
export { Type, type Static } from "https://deno.land/x/typebox@0.28.10/src/typebox.ts";
export * as Typebox from "https://deno.land/x/typebox@0.28.10/src/typebox.ts";

export { default as Ajv, type ErrorObject as AjvErrorObject } from "https://esm.sh/v86/[email protected]";
export { default as Ajv } from "https://esm.sh/v86/[email protected]";
export { default as AjvFormats } from "https://esm.sh/v86/[email protected]";

export * as Cliffy from "https://deno.land/x/[email protected]/mod.ts";
Expand Down
2 changes: 1 addition & 1 deletion errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export class ValidationFailed extends RenderCLIError {
super(
`Error validating object of type ${schema.title ?? schema.$id ?? 'unknown'}: ` +
"\n\n" +
(errors ?? []).map(error => ajv.errorsText([error])).join("\n")
(errors ?? []).map((error:any) => ajv.errorsText([error])).join("\n")
);
}
}
2 changes: 1 addition & 1 deletion util/ajv.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export function logAjvErrors(logger: Log.Logger, errors: typeof ajv.errors) {
}

export function assertType<T extends Typebox.TSchema>(schema: T, content: unknown): asserts content is Typebox.Static<T> {
const isValid = ajv.validate<T>(schema, content);
const isValid = ajv.validate(schema, content);
if (!isValid) {
throw new ValidationFailed(schema, ajv.errors);
}
Expand Down

0 comments on commit c0de4b6

Please sign in to comment.