- Updated .gitignore to include the new skills directory. - Modified forge.config.ts to stage skills as an app resource. - Added new script stage-skills.mjs for staging agent skills. - Enhanced skills installation logic in skills-install.ts to support symlinking skills and added a healing function for broken links. - Updated main.ts to call the new healing function on app launch. - Adjusted onboarding page to streamline skills installation feedback and removed unnecessary checks for Node.js availability.
70 lines
2.4 KiB
TypeScript
70 lines
2.4 KiB
TypeScript
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
import type { ForgeConfig } from '@electron-forge/shared-types';
|
|
import { MakerDMG } from '@electron-forge/maker-dmg';
|
|
import { MakerZIP } from '@electron-forge/maker-zip';
|
|
import { PublisherGithub } from '@electron-forge/publisher-github';
|
|
import { readFileSync } from 'node:fs';
|
|
import { join } from 'node:path';
|
|
|
|
const { version } = JSON.parse(readFileSync(join(__dirname, '..', '..', 'package.json'), 'utf8'));
|
|
|
|
const config: ForgeConfig = {
|
|
packagerConfig: {
|
|
name: 'Diffusion Studio',
|
|
appBundleId: 'studio.diffusion.editor',
|
|
appCategoryType: 'public.app-category.video',
|
|
appVersion: version,
|
|
icon: './assets/icon',
|
|
protocols: [{ name: 'Diffusion Studio', schemes: ['diffusion'] }],
|
|
prune: false,
|
|
ignore: (path) =>
|
|
path !== '' &&
|
|
path !== '/package.json' &&
|
|
path !== '/dist' &&
|
|
!path.startsWith('/dist/') &&
|
|
path !== '/web' &&
|
|
!path.startsWith('/web/'),
|
|
// Staged by scripts/stage-{cli,docs,skills}.mjs; end up at
|
|
// Contents/Resources/{cli,docs,skills}.
|
|
extraResource: ['./cli', './docs', './skills'],
|
|
osxSign: process.env.SKIP_SIGN ? undefined : {},
|
|
osxNotarize:
|
|
process.env.APPLE_ID && process.env.APPLE_PASSWORD && process.env.APPLE_TEAM_ID
|
|
? {
|
|
appleId: process.env.APPLE_ID,
|
|
appleIdPassword: process.env.APPLE_PASSWORD,
|
|
teamId: process.env.APPLE_TEAM_ID,
|
|
}
|
|
: undefined,
|
|
},
|
|
makers: [
|
|
new MakerZIP({}, ['darwin']),
|
|
new MakerDMG({
|
|
name: `Diffusion-Studio-${process.arch}`,
|
|
icon: './assets/icon.icns',
|
|
// Dark, on-brand window; @2x sibling is picked up automatically for retina.
|
|
background: './assets/dmg-background.png',
|
|
iconSize: 120,
|
|
additionalDMGOptions: {
|
|
'background-color': '#1c1c1c',
|
|
window: { size: { width: 658, height: 498 } },
|
|
},
|
|
contents: (opts) => [
|
|
{ x: 188, y: 217, type: 'file', path: opts.appPath },
|
|
{ x: 470, y: 217, type: 'link', path: '/Applications' },
|
|
],
|
|
}),
|
|
],
|
|
publishers: [
|
|
new PublisherGithub({
|
|
repository: { owner: 'diffusionstudio', name: 'editor' },
|
|
draft: true,
|
|
}),
|
|
],
|
|
};
|
|
|
|
export default config;
|