@@ -10,14 +10,11 @@ import { installPackage } from '@antfu/install-pkg';
10
10
import * as core from '@hypermod/core' ;
11
11
import { fetchConfigAtPath } from '@hypermod/fetcher' ;
12
12
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' ;
21
18
22
19
const ExperimentalModuleLoader = ( ) => {
23
20
const getInfo = ( packageName : string ) => {
@@ -37,7 +34,6 @@ const ExperimentalModuleLoader = () => {
37
34
} ;
38
35
39
36
const install = async ( packageName : string ) => {
40
- const __dirname = path . dirname ( new URL ( import . meta. url ) . pathname ) ;
41
37
await installPackage ( packageName , {
42
38
cwd : __dirname ,
43
39
packageManager : 'npm' ,
@@ -80,11 +76,7 @@ export default async function main(
80
76
}
81
77
82
78
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' ) ,
88
80
} ;
89
81
90
82
// If a registry is provided in the CLI flags, use it for the pluginManagers configuration.
@@ -164,33 +156,21 @@ export default async function main(
164
156
*/
165
157
const configFilePath = await findUp ( [
166
158
'hypermod.config.js' ,
167
- 'hypermod.config.cjs' ,
168
- 'hypermod.config.mjs' ,
169
159
'hypermod.config.ts' ,
170
160
'hypermod.config.tsx' ,
171
161
'src/hypermod.config.js' ,
172
- 'src/hypermod.config.cjs' ,
173
- 'src/hypermod.config.mjs' ,
174
162
'src/hypermod.config.ts' ,
175
163
'src/hypermod.config.tsx' ,
176
164
'codemods/hypermod.config.js' ,
177
- 'codemods/hypermod.config.cjs' ,
178
- 'codemods/hypermod.config.mjs' ,
179
165
'codemods/hypermod.config.ts' ,
180
166
'codemods/hypermod.config.tsx' ,
181
167
'codeshift.config.js' ,
182
- 'codeshift.config.cjs' ,
183
- 'codeshift.config.mjs' ,
184
168
'codeshift.config.ts' ,
185
169
'codeshift.config.tsx' ,
186
170
'src/codeshift.config.js' ,
187
- 'src/codeshift.config.cjs' ,
188
- 'src/codeshift.config.mjs' ,
189
171
'src/codeshift.config.ts' ,
190
172
'src/codeshift.config.tsx' ,
191
173
'codemods/codeshift.config.js' ,
192
- 'codemods/codeshift.config.cjs' ,
193
- 'codemods/codeshift.config.mjs' ,
194
174
'codemods/codeshift.config.ts' ,
195
175
'codemods/codeshift.config.tsx' ,
196
176
] ) ;
0 commit comments