From 32225ccd8f82080b313fe87a4c1e99a776938ce1 Mon Sep 17 00:00:00 2001 From: Albert G <516972+alber70g@users.noreply.github.com> Date: Tue, 24 Sep 2024 16:29:25 +0200 Subject: [PATCH 1/2] fix: packageJsonStruct to allow `repository.directory` When releasing a package from a monorepo the `repository.directory` is used to identify which package is been released. This is used for the Github build provenance. --- packages/snaps-utils/src/types.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/snaps-utils/src/types.ts b/packages/snaps-utils/src/types.ts index aa2bf85cf3..15d797835e 100644 --- a/packages/snaps-utils/src/types.ts +++ b/packages/snaps-utils/src/types.ts @@ -42,7 +42,7 @@ export const NpmSnapPackageJsonStruct = type({ name: NameStruct, main: optional(size(string(), 1, Infinity)), repository: optional( - object({ + type({ type: size(string(), 1, Infinity), url: size(string(), 1, Infinity), }), From 3dddab993f86aa36d63d6c3c82b1b8bac4198929 Mon Sep 17 00:00:00 2001 From: Albert G <516972+alber70g@users.noreply.github.com> Date: Wed, 25 Sep 2024 14:23:12 +0200 Subject: [PATCH 2/2] Update validation to allow `repository.directory` in metamask manifest --- packages/snaps-utils/src/manifest/validation.ts | 2 +- packages/snaps-utils/src/types.ts | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/snaps-utils/src/manifest/validation.ts b/packages/snaps-utils/src/manifest/validation.ts index 3f8deef7ab..6ed252ae52 100644 --- a/packages/snaps-utils/src/manifest/validation.ts +++ b/packages/snaps-utils/src/manifest/validation.ts @@ -268,7 +268,7 @@ export const SnapManifestStruct = object({ description: size(string(), 1, 280), proposedName: size(string(), 1, 214), repository: optional( - object({ + type({ type: size(string(), 1, Infinity), url: size(string(), 1, Infinity), }), diff --git a/packages/snaps-utils/src/types.ts b/packages/snaps-utils/src/types.ts index 15d797835e..abbba8b2e6 100644 --- a/packages/snaps-utils/src/types.ts +++ b/packages/snaps-utils/src/types.ts @@ -1,7 +1,6 @@ import { instance, is, - object, optional, pattern, refine,