From 5069ab8ce705b6095da2b5eb6fc8938f0db54cca Mon Sep 17 00:00:00 2001 From: uinstinct <61635505+uinstinct@users.noreply.github.com> Date: Fri, 12 Sep 2025 18:50:48 +0530 Subject: [PATCH] feat: support tilde when resolving uses block --- packages/config-yaml/src/interfaces/slugs.ts | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/packages/config-yaml/src/interfaces/slugs.ts b/packages/config-yaml/src/interfaces/slugs.ts index 2215468d2..18b168577 100644 --- a/packages/config-yaml/src/interfaces/slugs.ts +++ b/packages/config-yaml/src/interfaces/slugs.ts @@ -1,3 +1,5 @@ +import os from "node:os"; + export interface PackageSlug { ownerSlug: string; packageSlug: string; @@ -61,13 +63,18 @@ export function decodePackageIdentifier(identifier: string): PackageIdentifier { fileUri: identifier.substring(7), }; } - // Otherwise, it's a slug - else { + // support ~ by replacing with home directory + else if (identifier.startsWith("~")) { return { - uriType: "slug", - fullSlug: decodeFullSlug(identifier), + uriType: "file", + fileUri: identifier.replace("~", os.homedir()), }; } + // Otherwise, it's a slug + return { + uriType: "slug", + fullSlug: decodeFullSlug(identifier), + }; } export enum VirtualTags {