Skip to content
This repository has been archived by the owner on Jan 6, 2025. It is now read-only.

Commit

Permalink
fmt: Prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
binarybaron committed Jun 12, 2024
1 parent bd7cc9a commit 819fa63
Show file tree
Hide file tree
Showing 49 changed files with 300 additions and 297 deletions.
6 changes: 3 additions & 3 deletions .erb/configs/webpack.config.renderer.dev.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ if (process.env.NODE_ENV === 'production') {
const port = process.env.PORT || 1212;
const manifest = path.resolve(webpackPaths.dllPath, 'renderer.json');
const requiredByDLLConfig = module.parent?.filename.includes(
'webpack.config.renderer.dev.dll'
'webpack.config.renderer.dev.dll',
);

/**
Expand All @@ -31,8 +31,8 @@ if (
) {
console.log(
chalk.black.bgYellow.bold(
'The DLL files are missing. Sit back while we build them for you with "npm run build-dll"'
)
'The DLL files are missing. Sit back while we build them for you with "npm run build-dll"',
),
);
execSync('npm run postinstall');
}
Expand Down
8 changes: 4 additions & 4 deletions .erb/scripts/check-build-exists.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ const rendererPath = path.join(webpackPaths.distRendererPath, 'renderer.js');
if (!fs.existsSync(mainPath)) {
throw new Error(
chalk.whiteBright.bgRed.bold(
'The main process is not built yet. Build it by running "npm run build:main"'
)
'The main process is not built yet. Build it by running "npm run build:main"',
),
);
}

if (!fs.existsSync(rendererPath)) {
throw new Error(
chalk.whiteBright.bgRed.bold(
'The renderer process is not built yet. Build it by running "npm run build:renderer"'
)
'The renderer process is not built yet. Build it by running "npm run build:renderer"',
),
);
}
12 changes: 6 additions & 6 deletions .erb/scripts/check-native-dep.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,34 +16,34 @@ if (dependencies) {
// because of a devDependency then that is okay. Warn when it is installed
// because of a dependency
const { dependencies: dependenciesObject } = JSON.parse(
execSync(`npm ls ${nativeDeps.join(' ')} --json`).toString()
execSync(`npm ls ${nativeDeps.join(' ')} --json`).toString(),
);
const rootDependencies = Object.keys(dependenciesObject);
const filteredRootDependencies = rootDependencies.filter((rootDependency) =>
dependenciesKeys.includes(rootDependency)
dependenciesKeys.includes(rootDependency),
);
if (filteredRootDependencies.length > 0) {
const plural = filteredRootDependencies.length > 1;
console.log(`
${chalk.whiteBright.bgYellow.bold(
'Webpack does not work with native dependencies.'
'Webpack does not work with native dependencies.',
)}
${chalk.bold(filteredRootDependencies.join(', '))} ${
plural ? 'are native dependencies' : 'is a native dependency'
} and should be installed inside of the "./release/app" folder.
First, uninstall the packages from "./package.json":
${chalk.whiteBright.bgGreen.bold('npm uninstall your-package')}
${chalk.bold(
'Then, instead of installing the package to the root "./package.json":'
'Then, instead of installing the package to the root "./package.json":',
)}
${chalk.whiteBright.bgRed.bold('npm install your-package')}
${chalk.bold('Install the package to "./release/app/package.json"')}
${chalk.whiteBright.bgGreen.bold(
'cd ./release/app && npm install your-package'
'cd ./release/app && npm install your-package',
)}
Read more about native dependencies at:
${chalk.bold(
'https://electron-react-boilerplate.js.org/docs/adding-dependencies/#module-structure'
'https://electron-react-boilerplate.js.org/docs/adding-dependencies/#module-structure',
)}
`);
process.exit(1);
Expand Down
4 changes: 2 additions & 2 deletions .erb/scripts/check-node-env.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ export default function checkNodeEnv(expectedEnv) {
if (process.env.NODE_ENV !== expectedEnv) {
console.log(
chalk.whiteBright.bgRed.bold(
`"process.env.NODE_ENV" must be "${expectedEnv}" to use this webpack config`
)
`"process.env.NODE_ENV" must be "${expectedEnv}" to use this webpack config`,
),
);
process.exit(2);
}
Expand Down
4 changes: 2 additions & 2 deletions .erb/scripts/check-port-in-use.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ detectPort(port, (err, availablePort) => {
if (port !== String(availablePort)) {
throw new Error(
chalk.whiteBright.bgRed.bold(
`Port "${port}" on "localhost" is already in use. Please use another port. ex: PORT=4343 npm start`
)
`Port "${port}" on "localhost" is already in use. Please use another port. ex: PORT=4343 npm start`,
),
);
} else {
process.exit(0);
Expand Down
9 changes: 6 additions & 3 deletions .erb/scripts/download-swap-binaries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ async function makeFileExecutable(binary: Binary) {
await chmod(
fullPath,
// eslint-disable-next-line no-bitwise
mode | constants.S_IXUSR | constants.S_IXGRP | constants.S_IXOTH
mode | constants.S_IXUSR | constants.S_IXGRP | constants.S_IXOTH,
);
}

Expand Down Expand Up @@ -50,7 +50,10 @@ Promise.all(

// Append the prefix to the binary filename
const newFilename = `${CLI_FILE_NAME_VERSION_PREFIX}${binary.filename}`;
await move(join(binary.dest, binary.filename), join(binary.dest, newFilename));
await move(
join(binary.dest, binary.filename),
join(binary.dest, newFilename),
);
binary.filename = newFilename;

// Chmod binary in the directory to make them executable
Expand All @@ -60,7 +63,7 @@ Promise.all(
});

console.log(`Downloaded and extracted ${binary.url} to ${binary.dest}`);
})
}),
)
.then(() => {
console.log(`Successfully downloaded ${binaries.length} swap binaries!`);
Expand Down
6 changes: 3 additions & 3 deletions .erb/scripts/download-tor-binaries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ async function makeFileExecutable(binary: Binary) {
await chmod(
fullPath,
// eslint-disable-next-line no-bitwise
mode | constants.S_IXUSR | constants.S_IXGRP | constants.S_IXOTH
mode | constants.S_IXUSR | constants.S_IXGRP | constants.S_IXOTH,
);
}

Expand Down Expand Up @@ -56,7 +56,7 @@ emptyDir(torBuildDir, (error) => {
dirPath: binary[0],
fileName: binary[1],
});
})
}),
);
} else {
console.log('Tor binaries download failed!');
Expand All @@ -66,7 +66,7 @@ emptyDir(torBuildDir, (error) => {

ls.on('spawn', () => {
console.log(
`Downloading precompiled tor binaries from ${TOR_BINARIES_GIT_URL}`
`Downloading precompiled tor binaries from ${TOR_BINARIES_GIT_URL}`,
);
});
});
2 changes: 1 addition & 1 deletion .erb/scripts/notarize.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ exports.default = async function notarizeMacos(context) {

if (!('APPLE_ID' in process.env && 'APPLE_ID_PASS' in process.env)) {
console.warn(
'Skipping notarizing step. APPLE_ID and APPLE_ID_PASS env variables must be set'
'Skipping notarizing step. APPLE_ID and APPLE_ID_PASS env variables must be set',
);
return;
}
Expand Down
8 changes: 4 additions & 4 deletions src/__tests__/store/listSellersSlice.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ describe('testnet', () => {
expect(
reducer(
initialState,
setRegistryProviders([exampleMainnetProvider, exampleTestnetProvider])
)
setRegistryProviders([exampleMainnetProvider, exampleTestnetProvider]),
),
).toMatchObject({
registry: {
providers: [exampleTestnetProvider],
Expand All @@ -81,8 +81,8 @@ describe('mainnet', () => {
expect(
reducer(
initialState,
setRegistryProviders([exampleMainnetProvider, exampleTestnetProvider])
)
setRegistryProviders([exampleMainnetProvider, exampleTestnetProvider]),
),
).toMatchObject({
registry: {
providers: [exampleMainnetProvider],
Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/store/swapSlice.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const mPublishedBtcRefundTxLog: CliLog = require('../mock_cli_logs/cli_log_publi

function testChainedReducer(
initialState: SwapSlice,
states: [AnyAction, unknown][]
states: [AnyAction, unknown][],
) {
let state = initialState;

Expand Down
Loading

0 comments on commit 819fa63

Please sign in to comment.