Skip to content

Commit

Permalink
work on video import
Browse files Browse the repository at this point in the history
  • Loading branch information
jbilcke-hf committed Jul 22, 2024
1 parent eca0313 commit 86259b4
Show file tree
Hide file tree
Showing 28 changed files with 1,380 additions and 724 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@
*.csv filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.excalidraw filter=lfs diff=lfs merge=lfs -text
*.wasm filter=lfs diff=lfs merge=lfs -text
6 changes: 4 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,12 @@ jobs:
run: npm install @playwright/test@${{ env.PLAYWRIGHT_VERSION }}
- name: Install Playwright Browsers
run: npx playwright install --with-deps ${{ inputs.browser }}
if: steps.playwright-cache.outputs.cache-hit != 'true'
# disabled for now as we have caching issues:
#_if: steps.playwright-cache.outputs.cache-hit != 'true'
- name: Install system dependencies for WebKit
# Some WebKit dependencies seem to lay outside the cache and will need to be installed separately
if: ${{ inputs.browser == 'webkit' && steps.playwright-cache.outputs.cache-hit == 'true' }}
# disabled for now as we have caching issues:
#_if: ${{ inputs.browser == 'webkit' && steps.playwright-cache.outputs.cache-hit == 'true' }}
run: npx playwright install-deps webkit
- name: Run build
run: npm run build:ci
Expand Down
57 changes: 51 additions & 6 deletions forge.config.js
Original file line number Diff line number Diff line change
@@ -1,32 +1,76 @@
// for some reason using forge.config.ts doesn't work,
//
// it says:
// Failed to load: /Users/jbilcke/Projects/clapper/forge.config.ts
// An unhandled rejection has occurred inside Forge:
// SyntaxError: Unexpected token 'export'
//
// so we cannot use this:
// import type { ForgeConfig } from '@electron-forge/shared-types';
// export const config: ForgeConfig = {
module.exports = {
packagerConfig: {
asar: false, // true,
icon: "./public/icon",
osxSign: {}
name: "Clapper",
asar: true,
icon: "./public/images/logos/CL.png",
osxSign: {},

// One or more files to be copied directly into the app's
// Contents/Resources directory for macOS target platforms
// and the resources directory for other target platforms.
// The resources directory can be referenced in the packaged
// app via the process.resourcesPath value.
extraResource: [
".next/standalone"
],
// ignore: ['^\\/public$', '^\\/node_modules$', '^\\/src$', '^\\/[.].+'],

// Walks the node_modules dependency tree to remove all of
// the packages specified in the devDependencies section of
// package.json from the outputted Electron app.
prune: true,

ignore: [
'^\\/.next$',
'^\\/src$',
'^\\/documentation$',
'^\\/test-results$',
'^\\/playwright-report$',
'^\\/.github$',
'^\\/public$',
'^\\/out$',
'^\\/tests$',
'^\\/Dockerfile$',
'^\\/package-lock.json$',
'^\\/.git$',
],
},
rebuildConfig: {},
makers: [
{
name: '@electron-forge/maker-squirrel',
config: {},
config: {
authors: "Clapper contributors"
}
},
{
name: '@electron-forge/maker-zip',
platforms: ['darwin'],
config: {},
},
{
name: '@electron-forge/maker-deb',
config: {
options: {
icon: './public/icon.png'
icon: './public/images/logos/CL.png'
}
},
},
{
name: '@electron-forge/maker-dmg',
config: {
options: {
icon: './public/icon.icns'
icon: './public/images/logos/CL.icns'
}
},
},
Expand All @@ -45,3 +89,4 @@ module.exports = {
*/
],
};

22 changes: 17 additions & 5 deletions main.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
const fs = require('fs')
const path = require('path')

// -----------------------------------------------------------
//
// attention: if you add dependencies here, you might have to edit
// forge.config.js, , the part about:
// '^\\/node_modules/(?!dotenv)$',
//
// if you have an idea to do that automatically, let me know
const dotenv = require('dotenv')
//
// -----------------------------------------------------------

dotenv.config()

Expand All @@ -20,12 +30,14 @@ try {

const { app, BrowserWindow, screen } = require('electron')

const currentDir = process.cwd()

const mainServerPath = path.join(currentDir, '.next/standalone/server.js')

// now we load the main server
require(mainServerPath)
try {
// used when the app is built with `npm run electron:make`
require(path.join(process.resourcesPath, 'standalone/server.js'))
} catch (err) {
// used when the app is started with `npm run electron:start`
require(path.join(process.cwd(), '.next/standalone/server.js'))
}

// TODO: load the proxy server (for AI providers that refuse browser-side clients)
// const proxyServerPath = path.join(currentDir, '.next/standalone/proxy-server.js')
Expand Down
Loading

0 comments on commit 86259b4

Please sign in to comment.