Skip to content

Commit

Permalink
Fix linux build (#4)
Browse files Browse the repository at this point in the history
* minor fixups to fields in package.json

* add missing `@types/*` packages

* update to latest yarn

* update yarn.lock to match updated yarn, remove redundant package-lock.json

* refactor all uses of `require` => `import`

* fix typo

* fix rpm/deb build for linux

* use better fix for rpm/deb build on linux

* add some build/yarn/vscode stuff to .gitignore

* add `yarn clean` and `yarn clean:slate` commands

* add basic README

* add lint:fix command to package.json
  • Loading branch information
telamonian authored Aug 29, 2024
1 parent 48de128 commit 0343541
Show file tree
Hide file tree
Showing 8 changed files with 7,430 additions and 14,446 deletions.
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ typings/

# TypeScript cache
*.tsbuildinfo
dist

# Optional npm cache directory
.npm
Expand All @@ -57,6 +58,9 @@ typings/
# Yarn Integrity file
.yarn-integrity

# Yarn cache files
.yarn

# dotenv environment variables file
.env
.env.test
Expand Down Expand Up @@ -95,6 +99,10 @@ out/
comfyui-prebuilt
comfyui

# vscode
*.code-workspace
.history
.vscode/*

assets/ComfyUI
assets/python
1 change: 1 addition & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
nodeLinker: node-modules
33 changes: 33 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# comfyui-electron

## Install

This project uses `yarn` as its package manager. If you do not already have a `yarn` binary available on your PATH, run:

```bash
# corepack is a set of utilities included with all recent distributions of node
corepack enable
```

This will install a usable `yarn` binary. Then, in the root directory of this repo (ie adjacent to the top-level package.json file), run:

```bash
yarn install
```

## Utility scripts

A number of utility scripts are defined under the "scripts" field of package.json. For example, to build the project, run:

```bash
yarn make
```

Then, to clean up the build artifacts you can run:

```bash
yarn clean

# clean:slate also removes node_modules
yarn clean:slate
```
17 changes: 13 additions & 4 deletions forge.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const config: ForgeConfig = {
debug:true,
hookFunction: (filePath) => {
if (!filePath.endsWith("ComfyUI.exe")) return; // For now just ignore any file that isnt the main exe will need to change when building with installers/auto updates / a compiled python servesr
require("child_process").execSync(`signtool.exe sign /sha1 ${process.env.DIGICERT_FINGERPRINT} /tr http://timestamp.digicert.com /td SHA256 /fd SHA256 ${filePath}`)
import("child_process").then(cp => cp.execSync(`signtool.exe sign /sha1 ${process.env.DIGICERT_FINGERPRINT} /tr http://timestamp.digicert.com /td SHA256 /fd SHA256 ${filePath}`));
},
}},
osxSign: {
Expand All @@ -28,7 +28,7 @@ const config: ForgeConfig = {
appleId: process.env.APPLE_ID,
appleIdPassword: process.env.APPLE_PASSWORD,
teamId: process.env.APPLE_TEAM_ID
}
},
},
rebuildConfig: {},
hooks: {
Expand All @@ -42,8 +42,17 @@ const config: ForgeConfig = {
},
makers: [
new MakerZIP({}, ['darwin', 'win32']),
new MakerRpm({}),
new MakerDeb({}),
// the forge build produces a "ComfyUI" bin, but the rpm/deb makers expect a "comfyui-electron" bin (matching the "name" in package.json). We override this below
new MakerRpm({
options: {
bin: "ComfyUI"
}
}),
new MakerDeb({
options: {
bin: "ComfyUI"
}
}),
],
plugins: [
new VitePlugin({
Expand Down
Loading

0 comments on commit 0343541

Please sign in to comment.