diff --git a/.eslintrc.json b/.eslintrc.json
new file mode 100644
index 0000000..2d7aa60
--- /dev/null
+++ b/.eslintrc.json
@@ -0,0 +1,16 @@
+{
+ "env": {
+ "browser": true,
+ "es6": true,
+ "node": true
+ },
+ "extends": [
+ "eslint:recommended",
+ "plugin:@typescript-eslint/eslint-recommended",
+ "plugin:@typescript-eslint/recommended",
+ "plugin:import/recommended",
+ "plugin:import/electron",
+ "plugin:import/typescript"
+ ],
+ "parser": "@typescript-eslint/parser"
+}
diff --git a/.gitignore b/.gitignore
index e68362a..8296128 100644
--- a/.gitignore
+++ b/.gitignore
@@ -82,16 +82,11 @@ typings/
# DynamoDB Local files
.dynamodb/
-# Vite
-.vite/
-
# Webpack
.webpack/
+# Vite
+.vite/
+
# Electron-Forge
out/
-ugrc-api-client*
-
-# Sentry
-sentry.properties
-.electron-symbols
diff --git a/.prettierrc b/.prettierrc
new file mode 100644
index 0000000..e31a15e
--- /dev/null
+++ b/.prettierrc
@@ -0,0 +1,9 @@
+{
+ "plugins": [
+ "prettier-plugin-organize-imports",
+ "prettier-plugin-packagejson",
+ "prettier-plugin-tailwindcss"
+ ],
+ "printWidth": 120,
+ "singleQuote": true
+}
diff --git a/CHANGELOG.md b/CHANGELOG.md
index d3f517e..2434ae8 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -2,38 +2,34 @@
## [1.7.8](https://github.com/agrc/api-client/compare/v1.7.7...v1.7.8) (2024-10-17)
-
### Bug Fixes
-* fiddle with dependencies to fix windows ([#282](https://github.com/agrc/api-client/issues/282)) ([902cdd8](https://github.com/agrc/api-client/commit/902cdd83032c4e62f5a3a512e6ac457f0eee7e58))
+- fiddle with dependencies to fix windows ([#282](https://github.com/agrc/api-client/issues/282)) ([902cdd8](https://github.com/agrc/api-client/commit/902cdd83032c4e62f5a3a512e6ac457f0eee7e58))
## [1.7.8-0](https://github.com/agrc/api-client/compare/v1.7.7...v1.7.8-0) (2024-10-17)
-
### Dependencies
-* downgrade to 7.4.0 ([0e4b89e](https://github.com/agrc/api-client/commit/0e4b89ebc05f0ff210459f690685fae2b92f18ca)), closes [#280](https://github.com/agrc/api-client/issues/280)
-* update [@babel](https://github.com/babel) ([6b95c90](https://github.com/agrc/api-client/commit/6b95c903954938e803b5632884f3a16b30fe4fcf))
-* update [@sentry](https://github.com/sentry) ([0bd6766](https://github.com/agrc/api-client/commit/0bd6766f6a2c755ed4bb76e2c892084c8a119f96))
-* update dropzone ([6877630](https://github.com/agrc/api-client/commit/6877630e0dac6a6b616fb80fd9ffae8b6cf635cb))
-* update electron ([5990fa6](https://github.com/agrc/api-client/commit/5990fa6db6bff4612b3b7268e127bd1a13ab17fb))
-* update error boundary ([4b6f9cb](https://github.com/agrc/api-client/commit/4b6f9cba29125d09b50934804f35be90cb778bbb))
-* update eslint ([ab9884a](https://github.com/agrc/api-client/commit/ab9884a9f258e2282b4851097dc78a7d5d055475))
-* update headless ([9fde993](https://github.com/agrc/api-client/commit/9fde9937a24a630b9fba18802746518badf83630))
-* update plugins ([7e40a34](https://github.com/agrc/api-client/commit/7e40a3465bc1d7fc65df782c2df7759cb406c16e))
-* update tailwind ([8df5060](https://github.com/agrc/api-client/commit/8df50606ef7a12e6496feb583755316e4a702e44))
-* update vite ([511bfae](https://github.com/agrc/api-client/commit/511bfaee0c325ec2059c5943afb35fc07d9a77f4))
+- downgrade to 7.4.0 ([0e4b89e](https://github.com/agrc/api-client/commit/0e4b89ebc05f0ff210459f690685fae2b92f18ca)), closes [#280](https://github.com/agrc/api-client/issues/280)
+- update [@babel](https://github.com/babel) ([6b95c90](https://github.com/agrc/api-client/commit/6b95c903954938e803b5632884f3a16b30fe4fcf))
+- update [@sentry](https://github.com/sentry) ([0bd6766](https://github.com/agrc/api-client/commit/0bd6766f6a2c755ed4bb76e2c892084c8a119f96))
+- update dropzone ([6877630](https://github.com/agrc/api-client/commit/6877630e0dac6a6b616fb80fd9ffae8b6cf635cb))
+- update electron ([5990fa6](https://github.com/agrc/api-client/commit/5990fa6db6bff4612b3b7268e127bd1a13ab17fb))
+- update error boundary ([4b6f9cb](https://github.com/agrc/api-client/commit/4b6f9cba29125d09b50934804f35be90cb778bbb))
+- update eslint ([ab9884a](https://github.com/agrc/api-client/commit/ab9884a9f258e2282b4851097dc78a7d5d055475))
+- update headless ([9fde993](https://github.com/agrc/api-client/commit/9fde9937a24a630b9fba18802746518badf83630))
+- update plugins ([7e40a34](https://github.com/agrc/api-client/commit/7e40a3465bc1d7fc65df782c2df7759cb406c16e))
+- update tailwind ([8df5060](https://github.com/agrc/api-client/commit/8df50606ef7a12e6496feb583755316e4a702e44))
+- update vite ([511bfae](https://github.com/agrc/api-client/commit/511bfaee0c325ec2059c5943afb35fc07d9a77f4))
## [1.7.7](https://github.com/agrc/api-client/compare/v1.7.6...v1.7.7) (2024-10-02)
-
### Bug Fixes
-* update permissions to publish release assets ([6e70f68](https://github.com/agrc/api-client/commit/6e70f689d4f085f627e427e263dcb393de3a4b39))
+- update permissions to publish release assets ([6e70f68](https://github.com/agrc/api-client/commit/6e70f689d4f085f627e427e263dcb393de3a4b39))
## [1.7.6](https://github.com/agrc/api-client/compare/v1.7.5...v1.7.6) (2024-10-01)
-
### Dependencies
-* update packages ([9b42bfc](https://github.com/agrc/api-client/commit/9b42bfc3f5701c8af0be42eb1e3d52e9fa0707d4))
+- update packages ([9b42bfc](https://github.com/agrc/api-client/commit/9b42bfc3f5701c8af0be42eb1e3d52e9fa0707d4))
diff --git a/forge.config.cjs b/forge.config.cjs
deleted file mode 100644
index b04bcfb..0000000
--- a/forge.config.cjs
+++ /dev/null
@@ -1,165 +0,0 @@
-const { FusesPlugin } = require('@electron-forge/plugin-fuses');
-const {
- utils: { fromBuildIdentifier },
-} = require('@electron-forge/core');
-const { FuseV1Options, FuseVersion } = require('@electron/fuses');
-const packageJson = require('./package.json');
-const path = require('node:path');
-const dotenv = require('dotenv');
-
-if (process.env.NODE_ENV !== 'production') {
- // skip loading any local env files in production
- dotenv.config();
-}
-
-const { version } = packageJson;
-
-const assets = path.resolve(__dirname, 'src', 'assets');
-
-module.exports = {
- buildIdentifier: process.env.VITE_IS_BETA === 'true' ? 'beta' : 'prod',
- packagerConfig: {
- name: fromBuildIdentifier({
- beta: 'UGRC API Client Beta',
- prod: 'UGRC API Client',
- }),
- executableName: 'ugrc-api-client',
- asar: true,
- icon: path.resolve(assets, 'logo.icns'),
- appBundleId: fromBuildIdentifier({
- beta: 'com.beta.electron.ugrc-api-client',
- prod: 'com.electron.ugrc-api-client',
- }),
- appCategoryType: 'public.app-category.developer-tools',
- win32metadata: {
- CompanyName: 'UGRC',
- OriginalFilename: 'UGRC API Client',
- },
- osxSign: {
- identity: process.env.APPLE_IDENTITY,
- hardenedRuntime: true,
- 'gatekeeper-assess': false,
- entitlements: 'build/entitlements.plist',
- 'entitlements-inherit': 'build/entitlements.plist',
- },
- osxNotarize: {
- tool: 'notarytool',
- appBundleId: fromBuildIdentifier({
- beta: 'com.beta.electron.ugrc-api-client',
- prod: 'com.electron.ugrc-api-client',
- }),
- appleId: process.env.APPLE_USER_ID,
- appleIdPassword: process.env.APPLE_PASSWORD,
- teamId: process.env.APPLE_TEAM_ID,
- },
- },
- rebuildConfig: {},
- makers: [
- {
- name: '@electron-forge/maker-squirrel',
- platforms: ['win32'],
- arch: 'all',
- config: {
- name: 'ugrc-api-client',
- authors: 'UGRC Developers',
- exe: 'ugrc-api-client.exe',
- iconUrl:
- 'https://raw.githubusercontent.com/agrc/api-client/dac3554721f3ef6341910e5eee5c5395820ec8f1/src/assets/logo.ico',
- loadingGif: './src/assets/loading.gif',
- noMsi: true,
- setupExe: `ugrc-api-client-${version}-win32-setup.exe`,
- setupIcon: path.resolve(assets, 'logo.ico'),
- certificateFile: './build/cert/windows.p12',
- certificatePassword: process.env.WINDOWS_CERTIFICATE_PASSWORD,
- },
- },
- {
- name: '@electron-forge/maker-zip',
- },
- {
- name: '@electron-forge/maker-dmg',
- config: {
- title: '${productName} ${version}',
- window: {
- size: {
- width: 400,
- height: 274,
- },
- },
- background: './src/assets/dmg-background.png',
- icon: './src/assets/logo.icns',
- contents: (options) => {
- return [
- {
- x: 75,
- y: 140,
- type: 'file',
- path: options.appPath,
- },
- {
- x: 300,
- y: 140,
- type: 'link',
- path: '/Applications',
- },
- ];
- },
- },
- },
- ],
- publishers: [
- {
- name: '@electron-forge/publisher-github',
- config: {
- repository: {
- owner: 'agrc',
- name: 'api-client',
- },
- draft: true,
- prerelease: fromBuildIdentifier({
- beta: true,
- prod: false,
- }),
- },
- },
- ],
- plugins: [
- {
- name: '@electron-forge/plugin-vite',
- config: {
- devContentSecurityPolicy:
- "default-src 'self' 'unsafe-inline' data:; script-src 'self' 'unsafe-eval' 'unsafe-inline' data:; connect-src 'self' 'unsafe-inline' *.ingest.sentry.io data:;",
- // `build` can specify multiple entry builds, which can be Main process, Preload scripts, Worker process, etc.
- // If you are familiar with Vite configuration, it will look really familiar.
- build: [
- {
- // `entry` is just an alias for `build.lib.entry` in the corresponding file of `config`.
- entry: 'src/main.js',
- config: 'vite.main.config.js',
- },
- {
- entry: 'src/preload.js',
- config: 'vite.preload.config.js',
- },
- ],
- renderer: [
- {
- name: 'main_window',
- config: 'vite.renderer.config.js',
- },
- ],
- },
- },
- // Fuses are used to enable/disable various Electron functionality
- // at package time, before code signing the application
- new FusesPlugin({
- version: FuseVersion.V1,
- [FuseV1Options.RunAsNode]: false,
- [FuseV1Options.EnableCookieEncryption]: true,
- [FuseV1Options.EnableNodeOptionsEnvironmentVariable]: false,
- [FuseV1Options.EnableNodeCliInspectArguments]: false,
- [FuseV1Options.EnableEmbeddedAsarIntegrityValidation]: true,
- [FuseV1Options.OnlyLoadAppFromAsar]: true,
- }),
- ],
-};
diff --git a/forge.config.ts b/forge.config.ts
new file mode 100644
index 0000000..4327119
--- /dev/null
+++ b/forge.config.ts
@@ -0,0 +1,161 @@
+import { utils } from '@electron-forge/core';
+import { MakerDMG } from '@electron-forge/maker-dmg';
+import { MakerSquirrel } from '@electron-forge/maker-squirrel';
+import { MakerZIP } from '@electron-forge/maker-zip';
+import { FusesPlugin } from '@electron-forge/plugin-fuses';
+import { VitePlugin } from '@electron-forge/plugin-vite';
+import { PublisherGithub } from '@electron-forge/publisher-github';
+import type { ForgeConfig } from '@electron-forge/shared-types';
+import { FuseV1Options, FuseVersion } from '@electron/fuses';
+import dotenv from 'dotenv';
+import path from 'path';
+import packageJson from './package.json';
+
+if (process.env.NODE_ENV !== 'production') {
+ // skip loading any local env files in production
+ dotenv.config();
+}
+
+const fromBuildIdentifier = utils.fromBuildIdentifier;
+
+const { version } = packageJson;
+const assets = path.resolve(__dirname, 'src', 'assets');
+
+const config: ForgeConfig = {
+ buildIdentifier: process.env.VITE_IS_BETA === 'true' ? 'beta' : 'prod',
+ packagerConfig: {
+ // @ts-expect-error expect string
+ name: fromBuildIdentifier({
+ beta: 'UGRC API Client Beta',
+ prod: 'UGRC API Client',
+ }),
+ executableName: 'ugrc-api-client',
+ asar: true,
+ icon: path.resolve(assets, 'logo.icns'),
+ // @ts-expect-error expect string
+ appBundleId: fromBuildIdentifier({
+ beta: 'com.beta.electron.ugrc-api-client',
+ prod: 'com.electron.ugrc-api-client',
+ }),
+ appCategoryType: 'public.app-category.developer-tools',
+ win32metadata: {
+ CompanyName: 'UGRC',
+ OriginalFilename: 'UGRC API Client',
+ },
+ osxSign:
+ process.env.NODE_ENV !== 'production'
+ ? {}
+ : {
+ identity: process.env.APPLE_IDENTITY,
+ // hardenedRuntime: true,
+ // 'gatekeeper-assess': false,
+
+ // entitlements: 'build/entitlements.plist',
+ // 'entitlements-inherit': 'build/entitlements.plist',
+ },
+ osxNotarize: {
+ appleId: process.env.APPLE_USER_ID,
+ appleIdPassword: process.env.APPLE_PASSWORD,
+ teamId: process.env.APPLE_TEAM_ID,
+ },
+ },
+ rebuildConfig: {},
+ makers: [
+ new MakerSquirrel({
+ name: 'ugrc-api-client',
+ authors: 'UGRC Developers',
+ exe: 'ugrc-api-client.exe',
+ iconUrl:
+ 'https://raw.githubusercontent.com/agrc/api-client/dac3554721f3ef6341910e5eee5c5395820ec8f1/src/assets/logo.ico',
+ loadingGif: './src/assets/loading.gif',
+ noMsi: true,
+ setupExe: `ugrc-api-client-${version}-win32-setup.exe`,
+ setupIcon: path.resolve(assets, 'logo.ico'),
+ certificateFile: './build/cert/windows.p12',
+ certificatePassword: process.env.WINDOWS_CERTIFICATE_PASSWORD,
+ }),
+ new MakerZIP({}, ['darwin']),
+ // @ts-expect-error expect missing appPath
+ new MakerDMG({
+ title: '${productName} ${version}',
+ additionalDMGOptions: {
+ window: {
+ size: {
+ width: 400,
+ height: 274,
+ },
+ },
+ },
+ background: './src/assets/dmg-background.png',
+ icon: './src/assets/logo.icns',
+ // appPath: '',
+ contents: (options) => {
+ return [
+ {
+ x: 75,
+ y: 140,
+ type: 'file',
+ path: options.appPath,
+ },
+ {
+ x: 300,
+ y: 140,
+ type: 'link',
+ path: '/Applications',
+ },
+ ];
+ },
+ }),
+ ],
+ publishers: [
+ new PublisherGithub({
+ repository: {
+ owner: 'agrc',
+ name: 'api-client',
+ },
+ draft: true,
+ prerelease: !!fromBuildIdentifier({
+ beta: true,
+ prod: false,
+ }),
+ }),
+ ],
+ plugins: [
+ new VitePlugin({
+ // `build` can specify multiple entry builds, which can be Main process, Preload scripts, Worker process, etc.
+ // If you are familiar with Vite configuration, it will look really familiar.
+ build: [
+ {
+ // `entry` is just an alias for `build.lib.entry` in the corresponding file of `config`.
+ entry: 'src/main.ts',
+ config: 'vite.main.config.ts',
+ target: 'main',
+ },
+ {
+ entry: 'src/preload.ts',
+ config: 'vite.preload.config.ts',
+ target: 'preload',
+ },
+ ],
+ renderer: [
+ {
+ name: 'main_window',
+ config: 'vite.renderer.config.ts',
+ },
+ ],
+ }),
+ // Fuses are used to enable/disable various Electron functionality
+ // at package time, before code signing the application
+ new FusesPlugin({
+ version: FuseVersion.V1,
+ [FuseV1Options.RunAsNode]: false,
+ [FuseV1Options.EnableCookieEncryption]: true,
+ [FuseV1Options.EnableNodeOptionsEnvironmentVariable]: false,
+ [FuseV1Options.EnableNodeCliInspectArguments]: false,
+ [FuseV1Options.EnableEmbeddedAsarIntegrityValidation]: true,
+ [FuseV1Options.OnlyLoadAppFromAsar]: true,
+ }),
+ ],
+};
+
+export default config;
diff --git a/forge.env.d.ts b/forge.env.d.ts
new file mode 100644
index 0000000..9700e0a
--- /dev/null
+++ b/forge.env.d.ts
@@ -0,0 +1 @@
+///