@@ -10,14 +10,11 @@ import { installPackage } from '@antfu/install-pkg';
1010import * as core from '@hypermod/core' ;
1111import { fetchConfigAtPath } from '@hypermod/fetcher' ;
1212
13- import { InvalidUserInputError } from './errors.js' ;
14- import { fetchPackages } from './utils/fetch-package.js' ;
15- import { mergeConfigs } from './utils/merge-configs.js' ;
16- import {
17- fetchConfigsForWorkspaces ,
18- getPackageJson ,
19- } from './utils/file-system.js' ;
20- import { getConfigPrompt , getMultiConfigPrompt } from './prompt.js' ;
13+ import { InvalidUserInputError } from './errors' ;
14+ import { fetchPackages } from './utils/fetch-package' ;
15+ import { mergeConfigs } from './utils/merge-configs' ;
16+ import { fetchConfigsForWorkspaces , getPackageJson } from './utils/file-system' ;
17+ import { getConfigPrompt , getMultiConfigPrompt } from './prompt' ;
2118
2219const ExperimentalModuleLoader = ( ) => {
2320 const getInfo = ( packageName : string ) => {
@@ -37,7 +34,6 @@ const ExperimentalModuleLoader = () => {
3734 } ;
3835
3936 const install = async ( packageName : string ) => {
40- const __dirname = path . dirname ( new URL ( import . meta. url ) . pathname ) ;
4137 await installPackage ( packageName , {
4238 cwd : __dirname ,
4339 packageManager : 'npm' ,
@@ -80,11 +76,7 @@ export default async function main(
8076 }
8177
8278 const pluginManagerConfig : Partial < PluginManagerOptions > = {
83- pluginsPath : path . join (
84- path . dirname ( new URL ( import . meta. url ) . pathname ) ,
85- '..' ,
86- 'node_modules' ,
87- ) ,
79+ pluginsPath : path . join ( __dirname , '..' , 'node_modules' ) ,
8880 } ;
8981
9082 // If a registry is provided in the CLI flags, use it for the pluginManagers configuration.
@@ -164,33 +156,21 @@ export default async function main(
164156 */
165157 const configFilePath = await findUp ( [
166158 'hypermod.config.js' ,
167- 'hypermod.config.cjs' ,
168- 'hypermod.config.mjs' ,
169159 'hypermod.config.ts' ,
170160 'hypermod.config.tsx' ,
171161 'src/hypermod.config.js' ,
172- 'src/hypermod.config.cjs' ,
173- 'src/hypermod.config.mjs' ,
174162 'src/hypermod.config.ts' ,
175163 'src/hypermod.config.tsx' ,
176164 'codemods/hypermod.config.js' ,
177- 'codemods/hypermod.config.cjs' ,
178- 'codemods/hypermod.config.mjs' ,
179165 'codemods/hypermod.config.ts' ,
180166 'codemods/hypermod.config.tsx' ,
181167 'codeshift.config.js' ,
182- 'codeshift.config.cjs' ,
183- 'codeshift.config.mjs' ,
184168 'codeshift.config.ts' ,
185169 'codeshift.config.tsx' ,
186170 'src/codeshift.config.js' ,
187- 'src/codeshift.config.cjs' ,
188- 'src/codeshift.config.mjs' ,
189171 'src/codeshift.config.ts' ,
190172 'src/codeshift.config.tsx' ,
191173 'codemods/codeshift.config.js' ,
192- 'codemods/codeshift.config.cjs' ,
193- 'codemods/codeshift.config.mjs' ,
194174 'codemods/codeshift.config.ts' ,
195175 'codemods/codeshift.config.tsx' ,
196176 ] ) ;
0 commit comments