From 05d1f586b1b0d592fb570591a46df4b65d77839f Mon Sep 17 00:00:00 2001 From: Max Hauser Date: Wed, 12 Jun 2024 21:31:36 +0200 Subject: [PATCH] [fix]: Determine the correct package name for GitHub dependencies (#2801) * prepare changelog for beta * allow to install github urls too * add to docs * fix the validation log * trim output from npm view * fix linter * listInstalledNodeModules now returns correct name also for GitHub dependencies --- CHANGELOG.md | 2 +- packages/adapter/src/lib/adapter/utils.ts | 13 +++++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 749db8eaae..61d5ddaf30 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ ## __WORK IN PROGRESS__ --> -## 6.0.2 (2024-06-11) - Kiera +## __WORK IN PROGRESS__ - Kiera **Breaking changes** * Support for Node.js 16 is dropped! diff --git a/packages/adapter/src/lib/adapter/utils.ts b/packages/adapter/src/lib/adapter/utils.ts index 1ac35b9839..ea99417a5d 100644 --- a/packages/adapter/src/lib/adapter/utils.ts +++ b/packages/adapter/src/lib/adapter/utils.ts @@ -10,6 +10,10 @@ import { import { SUPPORTED_FEATURES, type SupportedFeature } from '@/lib/adapter/constants.js'; import path from 'node:path'; import fs from 'fs-extra'; +import { createRequire } from 'node:module'; + +// eslint-disable-next-line unicorn/prefer-module +const require = createRequire(import.meta.url || 'file://' + __filename); interface EncryptArrayOptions { /** The objects whose values should be en/decrypted */ @@ -114,14 +118,15 @@ export async function listInstalledNodeModules(namespace: string): Promise