@@ -3,7 +3,6 @@ import path from 'node:path';
33import { pathToFileURL } from 'node:url' ;
44import fs from 'node:fs' ;
55import debug from 'debug' ;
6- import { updatePackageJSON } from './index.js' ;
76import { afterEach , beforeEach , describe , expect , test } from 'vitest' ;
87import os from 'node:os' ;
98
@@ -204,43 +203,6 @@ export function testForgeTemplate({
204203 ] . join ( '\n' ) ,
205204 ) ;
206205
207- // TODO decide if we want to keep this or remove it in favor of manually
208- // updating any files that need to change when moving a project to ESM.
209- // Non-TypeScript templates are left untouched since they'd also need
210- // `forge.config.js` to be converted to ESM.
211- if ( moduleFormat === 'es' && templateName . endsWith ( '-typescript' ) ) {
212- let mainProcessEntrypointContent = await fs . promises . readFile (
213- mainProcessEntrypoint ,
214- { encoding : 'utf-8' } ,
215- ) ;
216-
217- const importElectronSquirrelStartup = `import started from 'electron-squirrel-startup';` ;
218-
219- await fs . promises . writeFile (
220- mainProcessEntrypoint ,
221- mainProcessEntrypointContent
222- . replaceAll ( / p r e l o a d \. c ? j s / g, 'preload.js' )
223- . replaceAll ( '__dirname' , 'import.meta.dirname' )
224- . replace (
225- importElectronSquirrelStartup ,
226- [
227- '\n' ,
228- `import { createRequire } from 'node:module';` ,
229- `const require = createRequire(import.meta.url);` ,
230- `const started = require('electron-squirrel-startup')` ,
231- ] . join ( '\n' ) ,
232- ) ,
233- ) ;
234-
235- await updatePackageJSON ( tmpDir , async ( packageJSON ) => {
236- packageJSON . type = 'module' ;
237-
238- ( packageJSON . main as string ) . replace ( / \. c ? j s / , '.js' ) ;
239-
240- return packageJSON ;
241- } ) ;
242- }
243-
244206 const electronForgeStartOutput = await spawn (
245207 packageManager ,
246208 [ 'run' , 'start' ] ,
0 commit comments