Skip to content

Commit 57ab8d8

Browse files
committed
fix: use ES-Module memoizee fork
medikoo/memoizee#143
1 parent 57e4019 commit 57ab8d8

22 files changed

+15
-160
lines changed

dist/legacy/gcc_matcher.json

-17
This file was deleted.

dist/legacy/llvm_matcher.json

-17
This file was deleted.

dist/legacy/msvc_matcher.json

-18
This file was deleted.

dist/legacy/python_matcher.json

-18
This file was deleted.

dist/modern/assets/actions_python-mhNRejTS.mjs

-2
This file was deleted.

dist/modern/assets/hdi-CLiriP2M.mjs

-2
This file was deleted.

dist/modern/assets/hdi-CLiriP2M.mjs.map

-1
This file was deleted.

dist/modern/assets/proxy-agent-CtreyBpw.mjs

-2
This file was deleted.

dist/modern/assets/proxy-agent-CtreyBpw.mjs.map

-1
This file was deleted.

dist/modern/gcc_matcher.json

-17
This file was deleted.

dist/modern/llvm_matcher.json

-17
This file was deleted.

dist/modern/msvc_matcher.json

-18
This file was deleted.

dist/modern/python_matcher.json

-18
This file was deleted.

package.json

+3
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,9 @@
208208
"pnpm": {
209209
"patchedDependencies": {
210210
"@actions/[email protected]": "patches/@[email protected]"
211+
},
212+
"overrides": {
213+
"memoizee": "https://github.com/aminya/memoizee#77c8b19"
211214
}
212215
}
213216
}

packages/envosman/src/rc-file.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ async function sourceRCInRc_(options: RcOptions) {
3838
/**
3939
* handles adding conditions to source rc file from .bashrc and .profile
4040
*/
41-
export const sourceRCInRc = memoize(sourceRCInRc_, { promise: true })
41+
export const sourceRCInRc = await memoize(sourceRCInRc_, { promise: true })
4242

4343
async function addRCHeader(options: RcOptions) {
4444
// a variable that prevents source rc from being called from .bashrc and .profile

packages/setup-apt/src/init-apt.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@ export async function initApt(apt: string) {
2525
}
2626

2727
/** Install gnupg and certificates (usually missing from docker containers) (memoized) */
28-
export const initAptMemoized = memoize(initApt, { promise: true })
28+
export const initAptMemoized = await memoize(initApt, { promise: true })

packages/setup-apt/src/update.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,4 @@ export function updateAptRepos(apt: string = getApt()) {
2424
* Update the apt repositories (memoized)
2525
* @param apt The apt command to use (optional)
2626
*/
27-
export const updateAptReposMemoized = memoize(updateAptRepos)
27+
export const updateAptReposMemoized = await memoize(updateAptRepos)

src/llvm/llvm.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ async function setupLLVMWithoutActivation_raw(version: string, setupDir: string,
3838

3939
return installationInfo
4040
}
41-
const setupLLVMWithoutActivation = memoize(setupLLVMWithoutActivation_raw, { promise: true })
41+
const setupLLVMWithoutActivation = await memoize(setupLLVMWithoutActivation_raw, { promise: true })
4242

4343
/**
4444
* Setup clang-format
@@ -84,7 +84,7 @@ async function llvmBinaryDeps_raw(majorVersion: number) {
8484
}
8585
}
8686
}
87-
const llvmBinaryDeps = memoize(llvmBinaryDeps_raw, { promise: true })
87+
const llvmBinaryDeps = await memoize(llvmBinaryDeps_raw, { promise: true })
8888

8989
async function setupLLVMDeps_raw(arch: string) {
9090
if (process.platform === "linux") {
@@ -93,7 +93,7 @@ async function setupLLVMDeps_raw(arch: string) {
9393
await setupGcc(getVersion("gcc", undefined, await ubuntuVersion()), "", arch, 40)
9494
}
9595
}
96-
const setupLLVMDeps = memoize(setupLLVMDeps_raw, { promise: true })
96+
const setupLLVMDeps = await memoize(setupLLVMDeps_raw, { promise: true })
9797

9898
export async function activateLLVM(directory: string) {
9999
const ld = process.env.LD_LIBRARY_PATH ?? ""

src/python/python.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -317,4 +317,4 @@ async function addPythonBaseExecPrefix_raw(python: string) {
317317
*
318318
* The answer is cached for subsequent calls
319319
*/
320-
export const addPythonBaseExecPrefix = memoize(addPythonBaseExecPrefix_raw, { promise: true })
320+
export const addPythonBaseExecPrefix = await memoize(addPythonBaseExecPrefix_raw, { promise: true })

src/utils/env/macos_version.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ function macosVersion_raw() {
1414
const { version } = macosRelease()
1515
return version.split(".").map((v) => Number.parseInt(v, 10))
1616
}
17-
export const macosVersion = memoize(macosVersion_raw)
17+
export const macosVersion = await memoize(macosVersion_raw)

src/utils/env/ubuntu_version.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ async function ubuntuVersion_raw(): Promise<number[] | null> {
3434
}
3535

3636
/** Detect Ubuntu version */
37-
export const ubuntuVersion = memoize(ubuntuVersion_raw, { promise: true })
37+
export const ubuntuVersion = await memoize(ubuntuVersion_raw, { promise: true })
3838

3939
/** Detect Ubuntu version using os.version() for Ubuntu based distros */
4040
function detectUsingOsVersion() {

src/utils/setup/setupPipPack.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ async function getPipxHome_raw() {
129129
await mkdirp(join(pipxHome, "venv"))
130130
return pipxHome
131131
}
132-
const getPipxHome = memoize(getPipxHome_raw, { promise: true })
132+
const getPipxHome = await memoize(getPipxHome_raw, { promise: true })
133133

134134
async function getPipxBinDir_raw() {
135135
if (process.env.PIPX_BIN_DIR !== undefined) {
@@ -141,7 +141,7 @@ async function getPipxBinDir_raw() {
141141
await mkdirp(pipxBinDir)
142142
return pipxBinDir
143143
}
144-
const getPipxBinDir = memoize(getPipxBinDir_raw, { promise: true })
144+
const getPipxBinDir = await memoize(getPipxBinDir_raw, { promise: true })
145145

146146
async function getPython_raw(): Promise<string> {
147147
const pythonBin = (await setupPython(getVersion("python", undefined, await ubuntuVersion()), "", process.arch)).bin
@@ -150,7 +150,7 @@ async function getPython_raw(): Promise<string> {
150150
}
151151
return pythonBin
152152
}
153-
const getPython = memoize(getPython_raw, { promise: true })
153+
const getPython = await memoize(getPython_raw, { promise: true })
154154

155155
async function pipHasPackage(python: string, name: string) {
156156
const result = await execa(python, ["-m", "pip", "-qq", "index", "versions", name], {

0 commit comments

Comments
 (0)