mirror of
https://github.com/balena-io/etcher.git
synced 2025-07-23 19:26:33 +00:00
patch: update husky configuration
This commit is contained in:
parent
d952d5129e
commit
4ee8055b20
4
.husky/pre-commit
Executable file
4
.husky/pre-commit
Executable file
@ -0,0 +1,4 @@
|
||||
#!/usr/bin/env sh
|
||||
. "$(dirname -- "$0")/_/husky.sh"
|
||||
|
||||
npm run lint-staged
|
@ -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;
|
||||
@ -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;
|
||||
@ -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>
|
||||
);
|
||||
@ -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,
|
||||
@ -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)}
|
||||
@ -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} />
|
||||
) : (
|
||||
@ -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',
|
||||
)
|
||||
}
|
||||
>
|
||||
@ -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>
|
||||
|
2
npm-shrinkwrap.json
generated
2
npm-shrinkwrap.json
generated
@ -44,7 +44,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",
|
||||
|
@ -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",
|
||||
@ -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": {
|
||||
@ -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",
|
||||
|
Loading…
x
Reference in New Issue
Block a user