From 37073b42becec4eb72455bd75afe51085a9feadd Mon Sep 17 00:00:00 2001 From: garronej Date: Sat, 25 Feb 2023 19:19:46 +0100 Subject: [PATCH] Avoir introducing breaking changes for CSS only setup --- package.json | 2 +- src/lib/KcApp.tsx | 5 +-- src/lib/KcProps.ts | 2 +- src/lib/Template.tsx | 2 +- .../KcContextBase.ts | 0 .../getKcContext.ts | 0 .../getKcContextFromWindow.ts | 0 src/lib/{kcContext => getKcContext}/index.ts | 0 .../kcContextMocks/index.ts | 0 .../kcContextMocks/kcContextMocks.ts | 0 src/lib/i18n/i18n.tsx | 2 +- src/lib/index.ts | 2 +- src/lib/pages/Error.tsx | 2 +- src/lib/pages/IdpReviewUserProfile.tsx | 2 +- src/lib/pages/Info.tsx | 2 +- src/lib/pages/Login.tsx | 2 +- src/lib/pages/LoginConfigTotp.tsx | 2 +- src/lib/pages/LoginIdpLinkConfirm.tsx | 2 +- src/lib/pages/LoginIdpLinkEmail.tsx | 2 +- src/lib/pages/LoginOtp.tsx | 2 +- src/lib/pages/LoginPageExpired.tsx | 2 +- src/lib/pages/LoginPassword.tsx | 2 +- src/lib/pages/LoginResetPassword.tsx | 2 +- src/lib/pages/LoginUpdatePassword.tsx | 2 +- src/lib/pages/LoginUpdateProfile.tsx | 2 +- src/lib/pages/LoginUsername.tsx | 2 +- src/lib/pages/LoginVerifyEmail.tsx | 2 +- src/lib/pages/LogoutConfirm.tsx | 2 +- src/lib/pages/Register.tsx | 2 +- src/lib/pages/RegisterUserProfile.tsx | 2 +- src/lib/pages/Template.tsx | 2 +- src/lib/pages/Terms.tsx | 2 +- src/lib/pages/UpdateUserProfile.tsx | 2 +- src/lib/pages/WebauthnAuthenticate.tsx | 2 +- src/lib/pages/shared/UserProfileCommons.tsx | 2 +- src/lib/tools/SetOptional.ts | 1 + src/lib/useFormValidationSlice.tsx | 2 +- src/scripts/link-in-app.ts | 31 ++++++------------- 38 files changed, 42 insertions(+), 53 deletions(-) rename src/lib/{kcContext => getKcContext}/KcContextBase.ts (100%) rename src/lib/{kcContext => getKcContext}/getKcContext.ts (100%) rename src/lib/{kcContext => getKcContext}/getKcContextFromWindow.ts (100%) rename src/lib/{kcContext => getKcContext}/index.ts (100%) rename src/lib/{kcContext => getKcContext}/kcContextMocks/index.ts (100%) rename src/lib/{kcContext => getKcContext}/kcContextMocks/kcContextMocks.ts (100%) create mode 100644 src/lib/tools/SetOptional.ts diff --git a/package.json b/package.json index 6abd30ad..a48ad243 100644 --- a/package.json +++ b/package.json @@ -18,8 +18,8 @@ "_format": "prettier '**/*.{ts,tsx,json,md}'", "format": "yarn _format --write", "format:check": "yarn _format --list-different", - "link-in-app": "ts-node --skipProject src/scripts/link-in-app.ts", "generate-messages": "ts-node --skipProject src/scripts/generate-i18n-messages.ts", + "link-in-app": "ts-node --skipProject src/scripts/link-in-app.ts", "link-in-starter": "yarn link-in-app keycloakify-advanced-starter", "tsc-watch": "tsc -p src/bin -w & tsc -p src/lib -w " }, diff --git a/src/lib/KcApp.tsx b/src/lib/KcApp.tsx index 8efcdd24..fd4b7bf3 100644 --- a/src/lib/KcApp.tsx +++ b/src/lib/KcApp.tsx @@ -1,9 +1,10 @@ import React, { lazy, Suspense } from "react"; import { __unsafe_useI18n as useI18n } from "./i18n"; import DefaultTemplate from "./pages/Template"; -import type { KcContextBase } from "./kcContext/KcContextBase"; +import type { KcContextBase } from "./getKcContext/KcContextBase"; import type { PageProps } from "./KcProps"; import type { I18nBase } from "./i18n"; +import type { SetOptional } from "./tools/SetOptional"; const Login = lazy(() => import("./pages/Login")); const Register = lazy(() => import("./pages/Register")); @@ -27,7 +28,7 @@ const LogoutConfirm = lazy(() => import("./pages/LogoutConfirm")); const UpdateUserProfile = lazy(() => import("./pages/UpdateUserProfile")); const IdpReviewUserProfile = lazy(() => import("./pages/IdpReviewUserProfile")); -export default function KcApp(props_: PageProps) { +export default function KcApp(props_: SetOptional, "Template">) { const { kcContext, i18n: userProvidedI18n, Template = DefaultTemplate, ...kcProps } = props_; const i18n = (function useClosure() { diff --git a/src/lib/KcProps.ts b/src/lib/KcProps.ts index 6e089fa4..9b73d04c 100644 --- a/src/lib/KcProps.ts +++ b/src/lib/KcProps.ts @@ -1,6 +1,6 @@ import { allPropertiesValuesToUndefined } from "./tools/allPropertiesValuesToUndefined"; import { assert } from "tsafe/assert"; -import type { KcContextBase } from "./kcContext"; +import type { KcContextBase } from "./getKcContext"; import type { ReactNode } from "react"; import { I18nBase } from "./i18n"; diff --git a/src/lib/Template.tsx b/src/lib/Template.tsx index af23a347..8dfea143 100644 --- a/src/lib/Template.tsx +++ b/src/lib/Template.tsx @@ -6,7 +6,7 @@ import { headInsert } from "./tools/headInsert"; import { pathJoin } from "../bin/tools/pathJoin"; import { clsx } from "./tools/clsx"; import type { TemplateProps } from "./KcProps"; -import type { KcContextBase } from "./kcContext/KcContextBase"; +import type { KcContextBase } from "./getKcContext/KcContextBase"; import type { I18nBase } from "./i18n"; export default function Template(props: TemplateProps) { diff --git a/src/lib/kcContext/KcContextBase.ts b/src/lib/getKcContext/KcContextBase.ts similarity index 100% rename from src/lib/kcContext/KcContextBase.ts rename to src/lib/getKcContext/KcContextBase.ts diff --git a/src/lib/kcContext/getKcContext.ts b/src/lib/getKcContext/getKcContext.ts similarity index 100% rename from src/lib/kcContext/getKcContext.ts rename to src/lib/getKcContext/getKcContext.ts diff --git a/src/lib/kcContext/getKcContextFromWindow.ts b/src/lib/getKcContext/getKcContextFromWindow.ts similarity index 100% rename from src/lib/kcContext/getKcContextFromWindow.ts rename to src/lib/getKcContext/getKcContextFromWindow.ts diff --git a/src/lib/kcContext/index.ts b/src/lib/getKcContext/index.ts similarity index 100% rename from src/lib/kcContext/index.ts rename to src/lib/getKcContext/index.ts diff --git a/src/lib/kcContext/kcContextMocks/index.ts b/src/lib/getKcContext/kcContextMocks/index.ts similarity index 100% rename from src/lib/kcContext/kcContextMocks/index.ts rename to src/lib/getKcContext/kcContextMocks/index.ts diff --git a/src/lib/kcContext/kcContextMocks/kcContextMocks.ts b/src/lib/getKcContext/kcContextMocks/kcContextMocks.ts similarity index 100% rename from src/lib/kcContext/kcContextMocks/kcContextMocks.ts rename to src/lib/getKcContext/kcContextMocks/kcContextMocks.ts diff --git a/src/lib/i18n/i18n.tsx b/src/lib/i18n/i18n.tsx index 785aa6d6..37204902 100644 --- a/src/lib/i18n/i18n.tsx +++ b/src/lib/i18n/i18n.tsx @@ -3,7 +3,7 @@ import "minimal-polyfills/Object.fromEntries"; import React, { useEffect, useState, useRef } from "react"; import type baseMessages from "./generated_messages/18.0.1/login/en"; import { assert } from "tsafe/assert"; -import type { KcContextBase } from "../kcContext/KcContextBase"; +import type { KcContextBase } from "../getKcContext/KcContextBase"; import { Markdown } from "../tools/Markdown"; export const fallbackLanguageTag = "en"; diff --git a/src/lib/index.ts b/src/lib/index.ts index d7c23eee..ff83dac6 100644 --- a/src/lib/index.ts +++ b/src/lib/index.ts @@ -1,4 +1,4 @@ -export * from "./kcContext"; +export * from "./getKcContext"; export * from "./i18n"; diff --git a/src/lib/pages/Error.tsx b/src/lib/pages/Error.tsx index c2e703e1..b13cd4a4 100644 --- a/src/lib/pages/Error.tsx +++ b/src/lib/pages/Error.tsx @@ -1,5 +1,5 @@ import React from "react"; -import type { KcContextBase } from "../kcContext"; +import type { KcContextBase } from "../getKcContext"; import type { PageProps } from "../KcProps"; import type { I18nBase } from "../i18n"; diff --git a/src/lib/pages/IdpReviewUserProfile.tsx b/src/lib/pages/IdpReviewUserProfile.tsx index 95e58e50..e7d455c2 100644 --- a/src/lib/pages/IdpReviewUserProfile.tsx +++ b/src/lib/pages/IdpReviewUserProfile.tsx @@ -1,7 +1,7 @@ import React, { useState } from "react"; import { clsx } from "../tools/clsx"; import { UserProfileFormFields } from "./shared/UserProfileCommons"; -import type { KcContextBase } from "../kcContext"; +import type { KcContextBase } from "../getKcContext"; import type { PageProps } from "../KcProps"; import type { I18nBase } from "../i18n"; diff --git a/src/lib/pages/Info.tsx b/src/lib/pages/Info.tsx index 873ad239..a863e54c 100644 --- a/src/lib/pages/Info.tsx +++ b/src/lib/pages/Info.tsx @@ -1,6 +1,6 @@ import React from "react"; import { assert } from "../tools/assert"; -import type { KcContextBase } from "../kcContext"; +import type { KcContextBase } from "../getKcContext"; import type { PageProps } from "../KcProps"; import type { I18nBase } from "../i18n"; diff --git a/src/lib/pages/Login.tsx b/src/lib/pages/Login.tsx index f48bfef2..d09c91d1 100644 --- a/src/lib/pages/Login.tsx +++ b/src/lib/pages/Login.tsx @@ -2,7 +2,7 @@ import React, { useState } from "react"; import { clsx } from "../tools/clsx"; import { useConstCallback } from "../tools/useConstCallback"; import type { FormEventHandler } from "react"; -import type { KcContextBase } from "../kcContext"; +import type { KcContextBase } from "../getKcContext"; import type { PageProps } from "../KcProps"; import type { I18nBase } from "../i18n"; diff --git a/src/lib/pages/LoginConfigTotp.tsx b/src/lib/pages/LoginConfigTotp.tsx index 1c1767b8..297c115f 100644 --- a/src/lib/pages/LoginConfigTotp.tsx +++ b/src/lib/pages/LoginConfigTotp.tsx @@ -1,6 +1,6 @@ import React from "react"; import { clsx } from "../tools/clsx"; -import type { KcContextBase } from "../kcContext"; +import type { KcContextBase } from "../getKcContext"; import type { PageProps } from "../KcProps"; import type { I18nBase } from "../i18n"; diff --git a/src/lib/pages/LoginIdpLinkConfirm.tsx b/src/lib/pages/LoginIdpLinkConfirm.tsx index c62e529f..999092f9 100644 --- a/src/lib/pages/LoginIdpLinkConfirm.tsx +++ b/src/lib/pages/LoginIdpLinkConfirm.tsx @@ -1,6 +1,6 @@ import React from "react"; import { clsx } from "../tools/clsx"; -import type { KcContextBase } from "../kcContext"; +import type { KcContextBase } from "../getKcContext"; import type { PageProps } from "../KcProps"; import type { I18nBase } from "../i18n"; diff --git a/src/lib/pages/LoginIdpLinkEmail.tsx b/src/lib/pages/LoginIdpLinkEmail.tsx index 017a7294..9bf0fc7a 100644 --- a/src/lib/pages/LoginIdpLinkEmail.tsx +++ b/src/lib/pages/LoginIdpLinkEmail.tsx @@ -1,5 +1,5 @@ import React from "react"; -import type { KcContextBase } from "../kcContext"; +import type { KcContextBase } from "../getKcContext"; import type { PageProps } from "../KcProps"; import type { I18nBase } from "../i18n"; diff --git a/src/lib/pages/LoginOtp.tsx b/src/lib/pages/LoginOtp.tsx index 8bb766c2..50c041f5 100644 --- a/src/lib/pages/LoginOtp.tsx +++ b/src/lib/pages/LoginOtp.tsx @@ -2,7 +2,7 @@ import React, { useEffect } from "react"; import { headInsert } from "../tools/headInsert"; import { pathJoin } from "../../bin/tools/pathJoin"; import { clsx } from "../tools/clsx"; -import type { KcContextBase } from "../kcContext"; +import type { KcContextBase } from "../getKcContext"; import type { PageProps } from "../KcProps"; import type { I18nBase } from "../i18n"; diff --git a/src/lib/pages/LoginPageExpired.tsx b/src/lib/pages/LoginPageExpired.tsx index 38717c46..479e4566 100644 --- a/src/lib/pages/LoginPageExpired.tsx +++ b/src/lib/pages/LoginPageExpired.tsx @@ -1,5 +1,5 @@ import React from "react"; -import type { KcContextBase } from "../kcContext"; +import type { KcContextBase } from "../getKcContext"; import type { PageProps } from "../KcProps"; import type { I18nBase } from "../i18n"; diff --git a/src/lib/pages/LoginPassword.tsx b/src/lib/pages/LoginPassword.tsx index 2e5bd331..90a27e7d 100644 --- a/src/lib/pages/LoginPassword.tsx +++ b/src/lib/pages/LoginPassword.tsx @@ -2,7 +2,7 @@ import React, { useState } from "react"; import { clsx } from "../tools/clsx"; import { useConstCallback } from "../tools/useConstCallback"; import type { FormEventHandler } from "react"; -import type { KcContextBase } from "../kcContext"; +import type { KcContextBase } from "../getKcContext"; import type { PageProps } from "../KcProps"; import type { I18nBase } from "../i18n"; diff --git a/src/lib/pages/LoginResetPassword.tsx b/src/lib/pages/LoginResetPassword.tsx index 870e832f..5b0e23f4 100644 --- a/src/lib/pages/LoginResetPassword.tsx +++ b/src/lib/pages/LoginResetPassword.tsx @@ -1,6 +1,6 @@ import React from "react"; import { clsx } from "../tools/clsx"; -import type { KcContextBase } from "../kcContext"; +import type { KcContextBase } from "../getKcContext"; import type { PageProps } from "../KcProps"; import type { I18nBase } from "../i18n"; diff --git a/src/lib/pages/LoginUpdatePassword.tsx b/src/lib/pages/LoginUpdatePassword.tsx index d68ebc27..e183a854 100644 --- a/src/lib/pages/LoginUpdatePassword.tsx +++ b/src/lib/pages/LoginUpdatePassword.tsx @@ -1,6 +1,6 @@ import React from "react"; import { clsx } from "../tools/clsx"; -import type { KcContextBase } from "../kcContext"; +import type { KcContextBase } from "../getKcContext"; import type { PageProps } from "../KcProps"; import type { I18nBase } from "../i18n"; diff --git a/src/lib/pages/LoginUpdateProfile.tsx b/src/lib/pages/LoginUpdateProfile.tsx index 50ba53cd..3c985006 100644 --- a/src/lib/pages/LoginUpdateProfile.tsx +++ b/src/lib/pages/LoginUpdateProfile.tsx @@ -1,6 +1,6 @@ import React from "react"; import { clsx } from "../tools/clsx"; -import type { KcContextBase } from "../kcContext"; +import type { KcContextBase } from "../getKcContext"; import type { PageProps } from "../KcProps"; import type { I18nBase } from "../i18n"; diff --git a/src/lib/pages/LoginUsername.tsx b/src/lib/pages/LoginUsername.tsx index e9961dac..614a918b 100644 --- a/src/lib/pages/LoginUsername.tsx +++ b/src/lib/pages/LoginUsername.tsx @@ -2,7 +2,7 @@ import React, { useState } from "react"; import { clsx } from "../tools/clsx"; import { useConstCallback } from "../tools/useConstCallback"; import type { FormEventHandler } from "react"; -import type { KcContextBase } from "../kcContext"; +import type { KcContextBase } from "../getKcContext"; import type { PageProps } from "../KcProps"; import type { I18nBase } from "../i18n"; diff --git a/src/lib/pages/LoginVerifyEmail.tsx b/src/lib/pages/LoginVerifyEmail.tsx index 0bacdc9e..97c7e065 100644 --- a/src/lib/pages/LoginVerifyEmail.tsx +++ b/src/lib/pages/LoginVerifyEmail.tsx @@ -1,5 +1,5 @@ import React from "react"; -import type { KcContextBase } from "../kcContext"; +import type { KcContextBase } from "../getKcContext"; import type { PageProps } from "../KcProps"; import type { I18nBase } from "../i18n"; diff --git a/src/lib/pages/LogoutConfirm.tsx b/src/lib/pages/LogoutConfirm.tsx index 4fc4103c..a3e33e0d 100644 --- a/src/lib/pages/LogoutConfirm.tsx +++ b/src/lib/pages/LogoutConfirm.tsx @@ -1,6 +1,6 @@ import React from "react"; import { clsx } from "../tools/clsx"; -import type { KcContextBase } from "../kcContext"; +import type { KcContextBase } from "../getKcContext"; import type { PageProps } from "../KcProps"; import type { I18nBase } from "../i18n"; diff --git a/src/lib/pages/Register.tsx b/src/lib/pages/Register.tsx index 75bca9ff..5ffcb581 100644 --- a/src/lib/pages/Register.tsx +++ b/src/lib/pages/Register.tsx @@ -1,6 +1,6 @@ import React from "react"; import { clsx } from "../tools/clsx"; -import type { KcContextBase } from "../kcContext"; +import type { KcContextBase } from "../getKcContext"; import type { PageProps } from "../KcProps"; import type { I18nBase } from "../i18n"; diff --git a/src/lib/pages/RegisterUserProfile.tsx b/src/lib/pages/RegisterUserProfile.tsx index e1b12144..6b72d474 100644 --- a/src/lib/pages/RegisterUserProfile.tsx +++ b/src/lib/pages/RegisterUserProfile.tsx @@ -1,7 +1,7 @@ import React, { useState } from "react"; import { clsx } from "../tools/clsx"; import { UserProfileFormFields } from "./shared/UserProfileCommons"; -import type { KcContextBase } from "../kcContext"; +import type { KcContextBase } from "../getKcContext"; import type { PageProps } from "../KcProps"; import type { I18nBase } from "../i18n"; diff --git a/src/lib/pages/Template.tsx b/src/lib/pages/Template.tsx index 39f72f1e..4469a88b 100644 --- a/src/lib/pages/Template.tsx +++ b/src/lib/pages/Template.tsx @@ -1,5 +1,5 @@ import React, { useReducer, useEffect } from "react"; -import type { KcContextBase } from "../kcContext"; +import type { KcContextBase } from "../getKcContext"; import { assert } from "../tools/assert"; import { useCallbackFactory } from "../tools/useCallbackFactory"; import { headInsert } from "../tools/headInsert"; diff --git a/src/lib/pages/Terms.tsx b/src/lib/pages/Terms.tsx index 755864c2..9a749915 100644 --- a/src/lib/pages/Terms.tsx +++ b/src/lib/pages/Terms.tsx @@ -9,7 +9,7 @@ import { useConst } from "../tools/useConst"; import { useConstCallback } from "../tools/useConstCallback"; import { Markdown } from "../tools/Markdown"; import type { Extends } from "tsafe"; -import type { KcContextBase } from "../kcContext"; +import type { KcContextBase } from "../getKcContext"; import type { PageProps } from "../KcProps"; import type { I18nBase } from "../i18n"; diff --git a/src/lib/pages/UpdateUserProfile.tsx b/src/lib/pages/UpdateUserProfile.tsx index a14fab56..d87496d3 100644 --- a/src/lib/pages/UpdateUserProfile.tsx +++ b/src/lib/pages/UpdateUserProfile.tsx @@ -1,7 +1,7 @@ import React, { useState } from "react"; import { clsx } from "../tools/clsx"; import { UserProfileFormFields } from "./shared/UserProfileCommons"; -import type { KcContextBase } from "../kcContext"; +import type { KcContextBase } from "../getKcContext"; import type { PageProps } from "../KcProps"; import type { I18nBase } from "../i18n"; diff --git a/src/lib/pages/WebauthnAuthenticate.tsx b/src/lib/pages/WebauthnAuthenticate.tsx index baed08e6..544f0d1a 100644 --- a/src/lib/pages/WebauthnAuthenticate.tsx +++ b/src/lib/pages/WebauthnAuthenticate.tsx @@ -3,7 +3,7 @@ import { clsx } from "../tools/clsx"; import type { MessageKeyBase } from "../i18n"; import { base64url } from "rfc4648"; import { useConstCallback } from "../tools/useConstCallback"; -import type { KcContextBase } from "../kcContext"; +import type { KcContextBase } from "../getKcContext"; import type { PageProps } from "../KcProps"; import type { I18nBase } from "../i18n"; diff --git a/src/lib/pages/shared/UserProfileCommons.tsx b/src/lib/pages/shared/UserProfileCommons.tsx index 1825d1b7..b29fcf15 100644 --- a/src/lib/pages/shared/UserProfileCommons.tsx +++ b/src/lib/pages/shared/UserProfileCommons.tsx @@ -1,6 +1,6 @@ import React, { useEffect, Fragment } from "react"; import type { KcProps } from "../../KcProps"; -import type { Attribute } from "../../kcContext/KcContextBase"; +import type { Attribute } from "../../getKcContext/KcContextBase"; import { clsx } from "../../tools/clsx"; import type { ReactComponent } from "../../tools/ReactComponent"; import { useCallbackFactory } from "../../tools/useCallbackFactory"; diff --git a/src/lib/tools/SetOptional.ts b/src/lib/tools/SetOptional.ts new file mode 100644 index 00000000..d202b335 --- /dev/null +++ b/src/lib/tools/SetOptional.ts @@ -0,0 +1 @@ +export type SetOptional, K extends keyof T> = Omit & Partial>; diff --git a/src/lib/useFormValidationSlice.tsx b/src/lib/useFormValidationSlice.tsx index aa5cd123..9104410b 100644 --- a/src/lib/useFormValidationSlice.tsx +++ b/src/lib/useFormValidationSlice.tsx @@ -1,6 +1,6 @@ import "./tools/Array.prototype.every"; import React, { useMemo, useReducer, Fragment } from "react"; -import type { KcContextBase, Validators, Attribute } from "./kcContext/KcContextBase"; +import type { KcContextBase, Validators, Attribute } from "./getKcContext/KcContextBase"; import type { I18nBase, MessageKeyBase } from "./i18n"; import { useConstCallback } from "./tools/useConstCallback"; import { id } from "tsafe/id"; diff --git a/src/scripts/link-in-app.ts b/src/scripts/link-in-app.ts index e370bcbd..5944a39b 100644 --- a/src/scripts/link-in-app.ts +++ b/src/scripts/link-in-app.ts @@ -54,37 +54,24 @@ const commonThirdPartyDeps = (() => { ]; })(); -const { yarnLinkFolderPath, yarnGlobalFolderPath } = (() => { - const yarnGlobalDirPath = pathJoin(rootDirPath, ".yarn_home"); +const yarnGlobalDirPath = pathJoin(rootDirPath, ".yarn_home"); - return { - "yarnLinkFolderPath": pathJoin(yarnGlobalDirPath, "link"), - "yarnGlobalFolderPath": pathJoin(yarnGlobalDirPath, "global") - }; -})(); - -[yarnLinkFolderPath, yarnGlobalFolderPath].forEach(path => { - fs.rmSync(path, { "recursive": true, "force": true }); - fs.mkdirSync(path, { "recursive": true }); -}); +fs.rmSync(yarnGlobalDirPath, { "recursive": true, "force": true }); +fs.mkdirSync(yarnGlobalDirPath); const execYarnLink = (params: { targetModuleName?: string; cwd: string }) => { const { targetModuleName, cwd } = params; - const cmd = [ - "yarn", - "link", - ...(targetModuleName !== undefined ? [targetModuleName] : []), - "--link-folder", - yarnLinkFolderPath, - "--global-folder", - yarnGlobalFolderPath - ].join(" "); + const cmd = ["yarn", "link", ...(targetModuleName !== undefined ? [targetModuleName] : ["--no-bin-links"])].join(" "); console.log(`$ cd ${pathRelative(rootDirPath, cwd) || "."} && ${cmd}`); execSync(cmd, { - cwd + cwd, + "env": { + ...process.env, + "HOME": yarnGlobalDirPath + } }); };