Skip to content

Commit

Permalink
patch: update husky configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
aethernet committed Oct 19, 2023
1 parent d952d51 commit 4ee8055
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 30 deletions.
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npm run lint-staged
52 changes: 26 additions & 26 deletions lib/gui/app/components/settings/settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,18 @@
* limitations under the License.
*/

import GithubSvg from "@fortawesome/fontawesome-free/svgs/brands/github.svg";
import * as _ from "lodash";
import * as React from "react";
import { Box, Checkbox, Flex, Txt } from "rendition";
import GithubSvg from '@fortawesome/fontawesome-free/svgs/brands/github.svg';
import * as _ from 'lodash';
import * as React from 'react';
import { Box, Checkbox, Flex, Txt } from 'rendition';

import { version, packageType } from "../../../../../package.json";
import * as settings from "../../models/settings";
import * as analytics from "../../modules/analytics";
import { open as openExternal } from "../../os/open-external/services/open-external";
import { Modal } from "../../styled-components";
import * as i18next from "i18next";
import { etcherProInfo } from "../../utils/etcher-pro-specific";
import { version, packageType } from '../../../../../package.json';
import * as settings from '../../models/settings';
import * as analytics from '../../modules/analytics';
import { open as openExternal } from '../../os/open-external/services/open-external';
import { Modal } from '../../styled-components';
import * as i18next from 'i18next';
import { etcherProInfo } from '../../utils/etcher-pro-specific';

interface Setting {
name: string;
Expand All @@ -35,18 +35,18 @@ interface Setting {
async function getSettingsList(): Promise<Setting[]> {
const list: Setting[] = [
{
name: "errorReporting",
label: i18next.t("settings.errorReporting"),
name: 'errorReporting',
label: i18next.t('settings.errorReporting'),
},
{
name: "autoBlockmapping",
label: i18next.t("settings.trimExtPartitions"),
name: 'autoBlockmapping',
label: i18next.t('settings.trimExtPartitions'),
},
];
if (["appimage", "nsis", "dmg"].includes(packageType)) {
if (['appimage', 'nsis', 'dmg'].includes(packageType)) {
list.push({
name: "updatesEnabled",
label: i18next.t("settings.autoUpdate"),
name: 'updatesEnabled',
label: i18next.t('settings.autoUpdate'),
});
}
return list;
Expand All @@ -62,7 +62,7 @@ const InfoBox = (props: any) => (
<Box fontSize={14}>
<Txt>{props.label}</Txt>
<Txt code copy={props.value}>
{props.value}{" "}
{props.value}{' '}
</Txt>
</Box>
);
Expand All @@ -89,7 +89,7 @@ export function SettingsModal({ toggleModal }: SettingsModalProps) {

const toggleSetting = async (setting: string) => {
const value = currentSettings[setting];
analytics.logEvent("Toggle setting", { setting, value });
analytics.logEvent('Toggle setting', { setting, value });
await settings.set(setting, !value);
setCurrentSettings({
...currentSettings,
Expand All @@ -101,7 +101,7 @@ export function SettingsModal({ toggleModal }: SettingsModalProps) {
<Modal
titleElement={
<Txt fontSize={24} mb={24}>
{i18next.t("settings.settings")}
{i18next.t('settings.settings')}
</Txt>
}
done={() => toggleModal(false)}
Expand All @@ -122,7 +122,7 @@ export function SettingsModal({ toggleModal }: SettingsModalProps) {
})}
{EPInfo !== undefined && (
<Flex flexDirection="column">
<Txt fontSize={24}>{i18next.t("settings.systemInformation")}</Txt>
<Txt fontSize={24}>{i18next.t('settings.systemInformation')}</Txt>
{EPInfo.get_serial() === undefined ? (
<InfoBox label="UUID" value={EPInfo.uuid} />
) : (
Expand All @@ -135,13 +135,13 @@ export function SettingsModal({ toggleModal }: SettingsModalProps) {
alignItems="center"
color="#00aeef"
style={{
width: "fit-content",
cursor: "pointer",
width: 'fit-content',
cursor: 'pointer',
fontSize: 14,
}}
onClick={() =>
openExternal(
"https://github.com/balena-io/etcher/blob/master/CHANGELOG.md"
'https://github.com/balena-io/etcher/blob/master/CHANGELOG.md',
)
}
>
Expand All @@ -150,7 +150,7 @@ export function SettingsModal({ toggleModal }: SettingsModalProps) {
fill="currentColor"
style={{ marginRight: 8 }}
/>
<Txt style={{ borderBottom: "1px solid #00aeef" }}>{version}</Txt>
<Txt style={{ borderBottom: '1px solid #00aeef' }}>{version}</Txt>
</Flex>
</Flex>
</Modal>
Expand Down
2 changes: 1 addition & 1 deletion npm-shrinkwrap.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"lint-css": "prettier --write lib/**/*.css",
"lint-ts": "balena-lint --fix --typescript typings lib tests scripts/clean-shrinkwrap.ts webpack.config.ts",
"lint": "npm run lint-ts && npm run lint-css",
"lint-staged": "lint-staged",
"sanity-checks": "bash scripts/ci/ensure-all-file-extensions-in-gitattributes.sh",
"start": "./node_modules/.bin/electron .",
"test-gui": "electron-mocha --recursive --reporter spec --window-config tests/gui/window-config.json --require ts-node/register/transpile-only --require-main tests/gui/allow-renderer-process-reuse.ts --full-trace --no-sandbox --renderer tests/gui/**/*.ts",
Expand All @@ -32,11 +33,12 @@
"test-windows": "npm run lint && npm run test-gui && npm run test-shared && npm run sanity-checks",
"test": "echo npm run test-{linux,windows,macos}",
"watch": "webpack serve --no-optimization-minimize --config ./webpack.dev.config.ts",
"webpack": "webpack"
"webpack": "webpack",
"prepare": "husky install"
},
"husky": {
"hooks": {
"pre-commit": "lint-staged"
"pre-commit": "npm run lint-staged"
}
},
"lint-staged": {
Expand Down Expand Up @@ -85,7 +87,7 @@
"esbuild-loader": "4.0.2",
"etcher-sdk": "8.7.2",
"file-loader": "6.2.0",
"husky": "8.0.3",
"husky": "^8.0.3",
"i18next": "23.6.0",
"immutable": "4.3.4",
"lint-staged": "15.0.1",
Expand Down

0 comments on commit 4ee8055

Please sign in to comment.