Skip to content

Commit

Permalink
Merge pull request #569 from Dygmalab/newFocusArch
Browse files Browse the repository at this point in the history
Bazecor 1.4.0
  • Loading branch information
alexpargon authored Feb 21, 2024
2 parents 537c59e + 772902f commit 0772fbc
Show file tree
Hide file tree
Showing 343 changed files with 26,863 additions and 11,221 deletions.
6 changes: 6 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,12 @@ module.exports = {
"react/require-default-props": "off",
"react/function-component-definition": "off",
"import/prefer-default-export": "off",
"react/jsx-no-useless-fragment": "off",
"no-restricted-syntax": "off",
"@typescript-eslint/lines-between-class-members": "off",
"max-classes-per-file": ["warn", 2],
"prefer-regex-literals": "off",
"no-control-regex": "off",
},
ignorePatterns: ["/*", "!/src"], // we only care about linting src folder
};
2 changes: 2 additions & 0 deletions .github/workflows/staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@ name: Staging
on:
push:
branches:
- "*"
- "development"
pull_request:
branches:
- "*"
- "development"

permissions:
Expand Down
7 changes: 7 additions & 0 deletions .vscode/ltex.dictionary.en-GB.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Bazecor
colormap
Dygma
keymap
superkeys
Underglow
underglow
2 changes: 2 additions & 0 deletions .vscode/ltex.hiddenFalsePositives.en-GB.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
{"rule":"MAC_OS","sentence":"^\\QBazecor is supported on all three major operating systems, we test our releases on Windows 10, MacOS, and Ubuntu LTS.\\E$"}
{"rule":"WHITESPACE_RULE","sentence":"^\\QWindows \\E(?:Dummy|Ina|Jimmy-)[0-9]+\\Q\nmacOS \\E(?:Dummy|Ina|Jimmy-)[0-9]+\\Q\nmacOS x64 \\E(?:Dummy|Ina|Jimmy-)[0-9]+\\Q\nmacOS arm64 \\E(?:Dummy|Ina|Jimmy-)[0-9]+\\Q\nLinux \\E(?:Dummy|Ina|Jimmy-)[0-9]+$"}
28 changes: 26 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,34 @@
"[javascriptreact]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[json]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.quickSuggestions": {
"strings": true
},
"editor.suggest.insertMode": "replace"
},
"[jsonc]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.quickSuggestions": {
"strings": true
},
"editor.suggest.insertMode": "replace"
},
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[typescriptreact]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
}
}
},
"cSpell.language": "en-GB",
"cSpell.words": [
"Bazecor",
"configurator",
"Dygma",
"dygmalab",
"EEPROM",
"libudev"
],
"ltex.language": "en-GB"
}
17 changes: 17 additions & 0 deletions components.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"$schema": "https://ui.shadcn.com/schema.json",
"style": "default",
"rsc": false,
"tsx": true,
"tailwind": {
"config": "tailwind.config.js",
"css": "src/renderer/theme/styles.css",
"baseColor": "slate",
"cssVariables": false,
"prefix": ""
},
"aliases": {
"components": "@Renderer/components",
"utils": "@Renderer/utils"
}
}
12 changes: 6 additions & 6 deletions forge.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ const packagerConfig: ForgePackagerOptions = {
appCopyright: "Copyright © 2018, 2023 DygmaLab SL; distributed under the GPLv3",
};

if (process.env.NODE_ENV !== "development") {
if (process.env["NODE_ENV"] !== "development") {
packagerConfig.osxNotarize = {
tool: "notarytool",
appleId: process.env.APPLE_ID || "",
appleIdPassword: process.env.APPLE_ID_PASSWORD || "",
teamId: process.env.APPLE_TEAM_ID || "",
appleId: process.env["APPLE_ID"] || "",
appleIdPassword: process.env["APPLE_ID_PASSWORD"] || "",
teamId: process.env["APPLE_TEAM_ID"] || "",
};
packagerConfig.osxSign = {
optionsForFile: () => ({
Expand Down Expand Up @@ -79,7 +79,7 @@ const config: ForgeConfig = {
}),
],
hooks: {
packageAfterPrune: async (forgeConfig, buildPath, electronVersion, platform, arch) => {
packageAfterPrune: async (_forgeConfig, buildPath, _electronVersion, platform, _arch) => {
/**
* Serialport, usb and uiohook-napi are problematic libraries to run in Electron.
* When Electron app is been built, these libraries are not included properly in the final executable.
Expand All @@ -95,7 +95,7 @@ const config: ForgeConfig = {
};

fs.writeFileSync(path.resolve(buildPath, "package.json"), JSON.stringify(packageJson));
const npmInstall = spawnSync("npm", ["install", "--omit=dev"], {
spawnSync("npm", ["install", "--omit=dev"], {
cwd: buildPath,
stdio: "inherit",
shell: true,
Expand Down
39 changes: 34 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "Bazecor",
"productName": "Bazecor",
"version": "1.3.11",
"version": "1.4.0-rc.1",
"description": "Bazecor desktop app",
"private": true,
"repository": {
Expand All @@ -10,6 +10,7 @@
},
"main": ".webpack/main",
"scripts": {
"coverage": "vitest run --coverage",
"clean": "rm -rf dist && rm -rf out && rm -rf node_modules",
"start": "cross-env NODE_ENV=development electron-forge start",
"make-dev": "cross-env NODE_ENV=development electron-forge make",
Expand All @@ -21,8 +22,12 @@
"make-mac-arm": "electron-forge make --platform=darwin --arch=arm64",
"make-lin": "electron-forge make --platform=linux",
"lint": "eslint --ext .ts,.tsx,.js,.jsx .",
"typeCheck": "tsc --noEmit --skipLibCheck && eslint",
"prettier": "prettier --write \"./**/*.{js,json,css,scss,md}\"",
"test": "vitest run src",
"t": "vitest",
"tc": "vitest --coverage",
"test": "vitest",
"test:type": "tsc && tsc -p tsconfig.strict.json",
"e2e": "yarn playwright test",
"commit": "cz -s",
"prepare": "husky install"
Expand Down Expand Up @@ -69,12 +74,17 @@
"@semantic-release/npm": "^10.0.4",
"@semantic-release/release-notes-generator": "^11.0.3",
"@types/react": "^18.2.8",
"@types/react-beautiful-dnd": "^13.1.5",
"@types/react-dom": "^18.2.4",
"@types/styled-components": "^5.1.26",
"@typescript-eslint/eslint-plugin": "^5.0.0",
"@typescript-eslint/parser": "^5.0.0",
"@vercel/webpack-asset-relocator-loader": "1.7.3",
"babel-loader": "^9.1.2",
"@vitest/coverage-v8": "^1.2.2",
"@xpd/tailwind-3dtransforms": "^1.0.3",
"assertron": "^11.5.0",
"autoprefixer": "^10.4.16",
"babel-loader": "9.1.2",
"copy-webpack-plugin": "^11.0.0",
"cross-env": "^7.0.3",
"css-loader": "^6.0.0",
Expand All @@ -91,39 +101,56 @@
"eslint-import-resolver-typescript": "^3.5.5",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-jsx-a11y": "^6.7.1",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-prettier": "^5.0.0",
"eslint-plugin-react": "^7.32.2",
"eslint-plugin-react-hooks": "^4.6.0",
"fork-ts-checker-webpack-plugin": "^7.2.13",
"glob": "^10.2.7",
"html-webpack-plugin": "^5.5.1",
"husky": "^8.0.3",
"node-loader": "^2.0.0",
"postcss": "^8.4.32",
"postcss-loader": "^7.3.4",
"prettier": "^3.1.1",
"semantic-release": "^21.0.5",
"style-loader": "^3.0.0",
"tailwindcss": "^3.4.0",
"ts-loader": "^9.2.2",
"ts-node": "^10.0.0",
"typescript": "~4.5.4",
"vite": "^4.5.2",
"vitest": "^0.32.2",
"vitest": "^1.2.2",
"webpack-cli": "^5.1.3"
},
"dependencies": {
"@appigram/react-rangeslider": "2.2.10",
"@headlessui/react": "^1.7.17",
"@octokit/core": "^4.2.1",
"@radix-ui/react-accordion": "^1.1.2",
"@radix-ui/react-checkbox": "^1.0.4",
"@radix-ui/react-dialog": "^1.0.5",
"@radix-ui/react-label": "^2.0.2",
"@radix-ui/react-switch": "^1.0.3",
"@radix-ui/react-tabs": "^1.0.4",
"@serialport/parser-delimiter": "^10.0.0",
"@types/react-color": "^3.0.11",
"@types/react-rangeslider": "^2.2.4",
"@types/w3c-web-hid": "^1.0.3",
"@xstate/react": "^3.2.2",
"async": "^3.2.4",
"axios": "^1.6.0",
"bootstrap-css-only": "^4.4.1",
"class-variance-authority": "^0.7.0",
"clsx": "^2.1.0",
"core-js": "^3.30.2",
"drivelist": "^11.1.0",
"easy-crc": "^1.1.0",
"electron-squirrel-startup": "^1.0.0",
"electron-store": "^8.1.0",
"electron-window-state": "^5.0.3",
"framer-motion": "^10.16.16",
"lucide-react": "^0.307.0",
"moment": "^2.30.1",
"prop-types": "^15.8.1",
"react": "^18.2.0",
"react-beautiful-dnd": "^13.1.1",
Expand All @@ -140,6 +167,8 @@
"serialport": "^10.0.0",
"styled-components": "5.3.11",
"sudo-prompt": "^9.2.1",
"tailwind-merge": "^2.2.0",
"tailwindcss-animate": "^1.0.7",
"uiohook-napi": "^1.5.2",
"update-electron-app": "^2.0.1",
"usb": "^2.9.0",
Expand Down
15 changes: 15 additions & 0 deletions postcss.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// export default {
// plugins: {
// "tailwindcss/nesting": {},
// tailwindcss: {},
// autoprefixer: {},
// },
// };

module.exports = {
plugins: {
"tailwindcss/nesting": {},
tailwindcss: {},
autoprefixer: {},
},
};
1 change: 1 addition & 0 deletions src/api/ConnectedDevice.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export type ConnectedDevice = unknown;
7 changes: 7 additions & 0 deletions src/api/ConnectedDeviceComms.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export type ConnnectedDeviceCommsHandler = (dataReceived: string) => void;
export type ErrorHandler = (err: Error) => void;

export interface ConnectedDeviceComms {
sendData: (data: string, receiverHandler: ConnnectedDeviceCommsHandler, errorHandler: ErrorHandler) => Promise<void>;
sendRawData: (data: string, receiverHandler: ConnnectedDeviceCommsHandler, errorHandler: ErrorHandler) => Promise<void>;
}
9 changes: 9 additions & 0 deletions src/api/DeviceManager.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { ConnectedDevice } from "./ConnectedDevice";

export interface DeviceManager {
find: () => Promise<ConnectedDevice[]>;
open: (index: number) => Promise<ConnectedDevice>;
close: (index: number) => void;
isDeviceAccessible: (index: number) => boolean;
isDeviceSupported: (index: number) => boolean;
}
Loading

0 comments on commit 0772fbc

Please sign in to comment.