-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Ignore shims script (hard forked) * Format scripts * Remove redundant code * [Refactor] Remove ternary statement * Add ESM top-level await * Add TS types, clean up * Ignore ESLint warnings in scripts * Remove redundant code * Lint tests * Remove stylistic ESLint rule !array.length is acceptable here. * Ignore ESLint errors on yaml parsing No easy solution here; this is already in the wild. Needs proper reimplementation at some point. * nit * [Refactor] if-else => switch * [Refactor] Remove redundant code * Remove unnecessary use of static class * Annotate remaining low-priority ESLint items * Lint configs * Lint playwright config * nit
- Loading branch information
1 parent
146a588
commit a179d5c
Showing
33 changed files
with
345 additions
and
305 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,5 +3,5 @@ out | |
dist | ||
assets | ||
.vite | ||
scripts | ||
scripts/shims | ||
.env_* |
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 |
---|---|---|
@@ -1,49 +1,50 @@ | ||
import axios from 'axios' | ||
import extract from 'extract-zip' | ||
import fs from 'node:fs/promises' | ||
import path from 'node:path' | ||
import axios from 'axios'; | ||
import extract from 'extract-zip'; | ||
import fs from 'node:fs/promises'; | ||
import path from 'node:path'; | ||
|
||
import packageJson from './getPackage.js' | ||
import packageJson from './getPackage.js'; | ||
|
||
// Example "v1.3.34" | ||
const version = process.argv[2] || packageJson.config.frontendVersion; | ||
if (!version) { | ||
console.error('No version specified'); | ||
process.exit(1); | ||
console.error('No version specified'); | ||
process.exit(1); | ||
} | ||
|
||
const url = `https://github.com/Comfy-Org/ComfyUI_frontend/releases/download/v${version}/dist.zip`; | ||
const downloadPath = 'temp_frontend.zip'; | ||
const extractPath = 'assets/ComfyUI/web_custom_versions/desktop_app'; | ||
|
||
async function downloadAndExtractFrontend() { | ||
try { | ||
// Create directories if they don't exist | ||
await fs.mkdir(extractPath, { recursive: true }); | ||
|
||
// Download the file | ||
console.log('Downloading frontend...'); | ||
const response = await axios({ | ||
method: 'GET', | ||
url: url, | ||
responseType: 'arraybuffer' | ||
}); | ||
|
||
// Save to temporary file | ||
await fs.writeFile(downloadPath, response.data); | ||
|
||
// Extract the zip file | ||
console.log('Extracting frontend...'); | ||
await extract(downloadPath, { dir: path.resolve(extractPath) }); | ||
|
||
// Clean up temporary file | ||
await fs.unlink(downloadPath); | ||
|
||
console.log('Frontend downloaded and extracted successfully!'); | ||
} catch (error) { | ||
console.error('Error downloading frontend:', error.message); | ||
process.exit(1); | ||
} | ||
try { | ||
// Create directories if they don't exist | ||
await fs.mkdir(extractPath, { recursive: true }); | ||
|
||
// Download the file | ||
console.log('Downloading frontend...'); | ||
const response = await axios({ | ||
method: 'GET', | ||
url: url, | ||
responseType: 'arraybuffer', | ||
}); | ||
|
||
// Save to temporary file | ||
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument | ||
await fs.writeFile(downloadPath, response.data); | ||
|
||
// Extract the zip file | ||
console.log('Extracting frontend...'); | ||
await extract(downloadPath, { dir: path.resolve(extractPath) }); | ||
|
||
// Clean up temporary file | ||
await fs.unlink(downloadPath); | ||
|
||
console.log('Frontend downloaded and extracted successfully!'); | ||
} catch (error) { | ||
console.error('Error downloading frontend:', error.message); | ||
process.exit(1); | ||
} | ||
} | ||
|
||
await downloadAndExtractFrontend(); |
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 |
---|---|---|
@@ -1,7 +1,8 @@ | ||
// Read the main package.json | ||
import { createRequire } from "node:module"; | ||
import { createRequire } from 'node:module'; | ||
|
||
/** @type {import('../package.json')} */ | ||
const packageJson = createRequire(import.meta.url)("../package.json"); | ||
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment | ||
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
Oops, something went wrong.