Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changeset/pretty-buckets-return.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@hypermod/fetcher': patch
'@hypermod/cli': patch
---

Fixes logic to locate configs when bundled in deeply nested directories
16 changes: 12 additions & 4 deletions packages/cli/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,19 @@ import { getConfigPrompt, getMultiConfigPrompt } from './prompt';

const ExperimentalModuleLoader = () => ({
install: async (packageName: string) =>
await installPackage(packageName, { cwd: __dirname }),
await installPackage(packageName, {
cwd: __dirname,
packageManager: 'npm',
additionalArgs: ['--force'],
}),
require: (packageName: string) => require(packageName),
getInfo: (packageName: string) => ({
location: require.resolve(packageName),
}),
getInfo: (packageName: string) => {
const entryPath = require.resolve(packageName);
return {
location: entryPath.split(packageName)[0] + packageName,
entryPath: entryPath,
};
},
});

export default async function main(
Expand Down
2 changes: 1 addition & 1 deletion packages/fetcher/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ export async function fetchRemotePackage(
if (configExport.transforms || configExport.presets) {
return {
filePath: info.location,
config: resolveConfigExport(pkg),
config: configExport,
};
}
} catch (e) {
Expand Down