Skip to content

Commit

Permalink
Merge pull request #19 from Tech-Nest-Ventures/17-app-doesnt-automati…
Browse files Browse the repository at this point in the history
…cally-update-with-new-data-for-new-day

fix: have frontend rerender on app focus
  • Loading branch information
timeowilliams authored Oct 27, 2024
2 parents 0890fd8 + b131d2d commit 9da141d
Show file tree
Hide file tree
Showing 34 changed files with 1,759 additions and 618 deletions.
39 changes: 27 additions & 12 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,21 +1,36 @@
module.exports = {
plugins: ['solid'],
root: true,
env: {
browser: true,
es6: true,
node: true
},
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint', 'solid', 'import'],
extends: [
'eslint:recommended',
'plugin:solid/typescript',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'plugin:import/recommended',
'plugin:import/typescript',
'@electron-toolkit/eslint-config-ts/recommended',
'@electron-toolkit/eslint-config-prettier'
],
rules: {
'@typescript-eslint/explicit-function-return-type': [
'error',
{
allowExpressions: true, // Allow return types to be inferred for expressions
allowTypedFunctionExpressions: true, // Allow typed function expressions
allowMethods: true // Allow methods in classes to omit return types
overrides: [
{
// For Solid.js-specific settings
files: ['*.tsx'],
extends: ['plugin:solid/typescript'],
rules: {
// Add or override rules specific to Solid.js or TypeScript JSX files here
}
],
// Disable the no-unused-vars rule or allow specific patterns like unused state variables
'no-unused-vars': ['warn', { varsIgnorePattern: '^_' }]
}
],
settings: {
'import/resolver': {
typescript: {
project: './tsconfig.json'
}
}
}
}
16 changes: 0 additions & 16 deletions .eslintrc.json

This file was deleted.

71 changes: 33 additions & 38 deletions forge.config.ts
Original file line number Diff line number Diff line change
@@ -1,29 +1,24 @@
import type { ForgeConfig } from '@electron-forge/shared-types';
import { MakerSquirrel } from '@electron-forge/maker-squirrel';
import { MakerZIP } from '@electron-forge/maker-zip';
import { MakerDeb } from '@electron-forge/maker-deb';
import { MakerRpm } from '@electron-forge/maker-rpm';
import { VitePlugin } from '@electron-forge/plugin-vite';
import { FusesPlugin } from '@electron-forge/plugin-fuses';
import { FuseV1Options, FuseVersion } from '@electron/fuses';
import { MakerDMG } from '@electron-forge/maker-dmg';
import { MakerPKG } from '@electron-forge/maker-pkg';
import type { ForgeConfig } from '@electron-forge/shared-types'
import { MakerSquirrel } from '@electron-forge/maker-squirrel'
import { MakerZIP } from '@electron-forge/maker-zip'
import { MakerDeb } from '@electron-forge/maker-deb'
import { MakerRpm } from '@electron-forge/maker-rpm'
import { VitePlugin } from '@electron-forge/plugin-vite'
import { FusesPlugin } from '@electron-forge/plugin-fuses'
import { FuseV1Options, FuseVersion } from '@electron/fuses'
import { MakerDMG } from '@electron-forge/maker-dmg'
import { MakerPKG } from '@electron-forge/maker-pkg'

const config: ForgeConfig = {
packagerConfig: {
asar: true,
asar: true,
name: 'Deep Focus',
icon: './resources/icon.icns',
osxSign: {
identity: 'Developer ID Application: Timeo Williams (3Y4F3KTSJA)',
type: 'distribution',
provisioningProfile: '/Users/timeo/deepFocus/deepWork/distribution.provisionprofile',
provisioningProfile: '/Users/timeo/deepFocus/deepWork/distribution.provisionprofile'
},
// osxNotarize: {
// appleId: 'timwillie73@gmail.com',
// appleIdPassword: 'mjaz-xgdj-wqgj-bqiy',
// teamId: '3Y4F3KTSJA',
// },
appBundleId: 'com.electron.deepfocus',
extraResource: [
'resources/.env',
Expand All @@ -32,8 +27,8 @@ const config: ForgeConfig = {
'resources/icon_green.png',
'resources/icon_red.png',
'resources/icon_yellow.png',
'resources/icon_blue.png',
],
'resources/icon_blue.png'
]
},
rebuildConfig: {},
makers: [
Expand All @@ -42,33 +37,33 @@ const config: ForgeConfig = {
new MakerRpm({}),
new MakerDeb({}),
new MakerDMG({
appPath: './out/Deep Focus-darwin-arm64/Deep Focus.app',
appPath: './out/Deep Focus-darwin-arm64/Deep Focus.app',
name: 'Deep Focus',
icon: './resources/icon.icns',
format: 'ULFO',
overwrite: true,
contents: (opts) => [
{ x: 130, y: 220, type: 'file', path: opts.appPath },
{ x: 410, y: 220, type: 'link', path: '/Applications' },
],
{ x: 410, y: 220, type: 'link', path: '/Applications' }
]
}),
new MakerPKG({
name: 'Deep Focus',
identity: 'Developer ID Installer: Timeo Williams (3Y4F3KTSJA)',
}),
identity: 'Developer ID Installer: Timeo Williams (3Y4F3KTSJA)'
})
],
plugins: [
new VitePlugin({
build: [
{
entry: 'src/main.ts',
config: 'vite.main.config.ts',
target: 'main',
entry: 'src/main.ts',
config: 'vite.main.config.ts',
target: 'main'
},
{
entry: 'src/preload.ts',
config: 'vite.preload.config.ts',
target: 'preload',
entry: 'src/preload.ts',
config: 'vite.preload.config.ts',
target: 'preload'
},
{
entry: 'src/worker.ts',
Expand All @@ -79,9 +74,9 @@ const config: ForgeConfig = {
renderer: [
{
name: 'main_window',
config: 'vite.renderer.config.mts', // Path to Vite config for renderer process
},
],
config: 'vite.renderer.config.mts' // Path to Vite config for renderer process
}
]
}),
new FusesPlugin({
version: FuseVersion.V1,
Expand All @@ -90,9 +85,9 @@ const config: ForgeConfig = {
[FuseV1Options.EnableNodeOptionsEnvironmentVariable]: false,
[FuseV1Options.EnableNodeCliInspectArguments]: false,
[FuseV1Options.EnableEmbeddedAsarIntegrityValidation]: true,
[FuseV1Options.OnlyLoadAppFromAsar]: true,
}),
],
};
[FuseV1Options.OnlyLoadAppFromAsar]: true
})
]
}

export default config;
export default config
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
style-src 'self' 'unsafe-inline' https://fonts.googleapis.com;
font-src 'self' https://fonts.gstatic.com;
connect-src 'self' https://backend-production-5eec.up.railway.app http://localhost:5000;
img-src 'self' data: https://www.google.com https://*.google.com https://*.gstatic.com;
img-src 'self' data: https://www.google.com https://*.google.com https://*.gstatic.com https://cdn-icons-png.freepik.com;
"
/>
<link
Expand Down
Loading

0 comments on commit 9da141d

Please sign in to comment.