From 590de7a67b4d13889b43dcfb63d7d6d91ff1ab3b Mon Sep 17 00:00:00 2001 From: Joseph Garrone Date: Sat, 5 Oct 2024 21:22:00 +0200 Subject: [PATCH] Fix missing exports --- package.json | 2 +- src/bin/shared/buildContext.ts | 4 ++-- src/bin/tools/fetchProxyOptions.ts | 14 ++++++++------ 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/package.json b/package.json index bebb3ed3..9a799b8f 100644 --- a/package.json +++ b/package.json @@ -43,7 +43,7 @@ "dist/bin/*.node", "dist/bin/shared/constants.js", "dist/bin/shared/customHandler.js", - "dist/bin/shared/*.d.ts", + "dist/bin/*.d.ts", "dist/bin/shared/*.js.map", "!dist/vite-plugin/", "dist/vite-plugin/index.js", diff --git a/src/bin/shared/buildContext.ts b/src/bin/shared/buildContext.ts index fa658097..26c746b8 100644 --- a/src/bin/shared/buildContext.ts +++ b/src/bin/shared/buildContext.ts @@ -23,7 +23,7 @@ import { objectEntries } from "tsafe/objectEntries"; import { type ThemeType } from "./constants"; import { id } from "tsafe/id"; import chalk from "chalk"; -import { getProxyFetchOptions, type ProxyFetchOptions } from "../tools/fetchProxyOptions"; +import { getProxyFetchOptions, type FetchOptionsLike } from "../tools/fetchProxyOptions"; import { is } from "tsafe/is"; export type BuildContext = { @@ -42,7 +42,7 @@ export type BuildContext = { * In this case the urlPathname will be "/my-app/" */ urlPathname: string | undefined; assetsDirPath: string; - fetchOptions: ProxyFetchOptions; + fetchOptions: FetchOptionsLike; kcContextExclusionsFtlCode: string | undefined; environmentVariables: { name: string; default: string }[]; themeSrcDirPath: string; diff --git a/src/bin/tools/fetchProxyOptions.ts b/src/bin/tools/fetchProxyOptions.ts index e6f8f497..c607feb9 100644 --- a/src/bin/tools/fetchProxyOptions.ts +++ b/src/bin/tools/fetchProxyOptions.ts @@ -1,16 +1,18 @@ -import { type FetchOptions } from "make-fetch-happen"; import * as child_process from "child_process"; import * as fs from "fs"; import { exclude } from "tsafe/exclude"; -export type ProxyFetchOptions = Pick< - FetchOptions, - "proxy" | "noProxy" | "strictSSL" | "cert" | "ca" ->; +export type FetchOptionsLike = { + proxy: string | undefined; + noProxy: string | string[]; + strictSSL: boolean; + cert: string | string[] | undefined; + ca: string[] | undefined; +}; export function getProxyFetchOptions(params: { npmConfigGetCwd: string; -}): ProxyFetchOptions { +}): FetchOptionsLike { const { npmConfigGetCwd } = params; const cfg = (() => {