Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(gate): ensure all deps are defined in import_map.json #768

Merged
merged 2 commits into from
Jun 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 32 additions & 3 deletions typegate/deno.lock

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

3 changes: 3 additions & 0 deletions typegate/import_map.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
"sentry": "npm:@sentry/[email protected]",
"dataloader": "npm:[email protected]",
"chance": "npm:[email protected]",
"validator": "npm:[email protected]",
"lodash": "npm:[email protected]",
"pg": "npm:[email protected]",
"swc": "https://deno.land/x/[email protected]/mod.ts",
"swc/types": "https://esm.sh/@swc/[email protected]/types.d.ts?pin=v131",
"zod": "https://deno.land/x/[email protected]/mod.ts",
Expand Down
19 changes: 11 additions & 8 deletions typegate/src/engine/typecheck/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

import { StringFormat } from "../../typegraph/types.ts";
import * as uuid from "std/uuid/mod.ts";
import validator from "npm:validator";
import lodash from "npm:lodash";
import validator from "validator";
import lodash from "lodash";

export type ErrorEntry = [path: string, message: string];

Expand Down Expand Up @@ -32,12 +32,15 @@ const formatValidators: Record<StringFormat, FormatValidator> = {
email: validator.isEmail,
// TODO validatorjs does not have a URI validator, so this is stricter than expected
uri: (value: string) => {
return validator.isDataURI(value) || validator.isURL(value, {
require_protocol: true,
require_valid_protocol: false,
require_host: true,
require_tld: false,
});
return (
validator.isDataURI(value) ||
validator.isURL(value, {
require_protocol: true,
require_valid_protocol: false,
require_host: true,
require_tld: false,
})
);
},
// TODO
hostname: validator.isFQDN,
Expand Down
2 changes: 1 addition & 1 deletion typegate/tests/utils/database.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
// SPDX-License-Identifier: Elastic-2.0

import pg from "npm:pg";
import pg from "pg";
import { removeMigrations } from "test-utils/migrations.ts";

export async function dropSchema(schema: string) {
Expand Down
Loading