-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Convert repo from CommonJS to ES Modules (#491)
* Convert package from CommonJS to ES Modules Revert conversion of preload to esm - Fixes preload script loading issues - Electron has better support for CommonJS in preload scripts * Fix CommonJS files treated as ESM * Convert CommonJS scripts to ES modules * Fix type errors - missing node.js types * Remove unnecessary type assertions * Fix broken imports * Rename CommonJS build / test scripts to .cjs * Fix playwright using cjs require * Fix UV download script - ESM conversion error
- Loading branch information
1 parent
6b43d65
commit 524aeeb
Showing
21 changed files
with
76 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,7 @@ | |
"description": "The best modular GUI to run AI diffusion models.", | ||
"main": ".vite/build/main.js", | ||
"packageManager": "[email protected]", | ||
"type": "module", | ||
"config": { | ||
"frontendVersion": "1.5.14", | ||
"comfyVersion": "0.3.7", | ||
|
@@ -42,10 +43,10 @@ | |
"sign": "node debug/sign.js", | ||
"start": "node ./scripts/launchdev.js", | ||
"test:e2e": "npx playwright test", | ||
"test:unit": "jest --config jest.config.js", | ||
"test:unit": "jest --config jest.config.cjs", | ||
"test:update-snapshots": "npx playwright test --update-snapshots", | ||
"todesktop:afterPack": "./scripts/todesktop/afterPack.js", | ||
"todesktop:beforeInstall": "./scripts/todesktop/beforeInstall.js", | ||
"todesktop:afterPack": "./scripts/todesktop/afterPack.cjs", | ||
"todesktop:beforeInstall": "./scripts/todesktop/beforeInstall.cjs", | ||
"typescript": "yarn run tsc", | ||
"vite:compile": "vite build --config vite.main.config.ts && vite build --config vite.preload.config.ts", | ||
"vite:types": "vite build --config vite.types.config.ts && node scripts/prepareTypes.js", | ||
|
@@ -63,7 +64,7 @@ | |
"@types/adm-zip": "^0.5.5", | ||
"@types/electron-squirrel-startup": "^1.0.2", | ||
"@types/jest": "^29.5.14", | ||
"@types/node": "^22.5.0", | ||
"@types/node": "^22.10.2", | ||
"@types/tar": "6.1.13", | ||
"@types/wait-on": "^5.3.4", | ||
"@typescript-eslint/eslint-plugin": "^5.0.0", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
// Read the main package.json | ||
import { createRequire } from "module"; | ||
|
||
/** @type {import('../package.json')} */ | ||
const packageJson = createRequire(import.meta.url)("../package.json"); | ||
|
||
export default packageJson; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters