Skip to content

Commit cb79b60

Browse files
Merge pull request #1067 from NordicSemiconductor/update_big_dependencies
Update big dependencies
2 parents c67fbcc + 4f13178 commit cb79b60

File tree

143 files changed

+3386
-2923
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

143 files changed

+3386
-2923
lines changed

Changelog.md

Lines changed: 1669 additions & 1674 deletions
Large diffs are not rendered by default.

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
This project provides shared commodities for developing nRF Connect for Desktop
44
apps and their launcher:
55

6-
- React components
7-
- Build scripts
8-
- Configurations
9-
- Test facilities
6+
- React components
7+
- Build scripts
8+
- Configurations
9+
- Test facilities
1010

1111
## Developing a new feature or fixing an error
1212

@@ -21,10 +21,10 @@ change as a new version right ahead, add a new section with the heading
2121

2222
To release, two files must be up-to-date:
2323

24-
- `package.json` contain the correct version number (one more than the last
25-
release).
26-
- `Changelog.md` must contain an entry, with that version number and today's
27-
date.
24+
- `package.json` contain the correct version number (one more than the last
25+
release).
26+
- `Changelog.md` must contain an entry, with that version number and today's
27+
date.
2828

2929
By running `npm run prepare-shared-release` you update the version in
3030
`package.json` and in `Changelog.md` a potential `## Unreleased` heading is

config/colors.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ paletteColorsKeys.forEach(color => {
3737
});
3838

3939
const colors = Object.entries(flattenedColors).filter(
40-
([key]) => !paletteColorsKeys.find(c => key.startsWith(c))
40+
([key]) => !paletteColorsKeys.find(c => key.startsWith(c)),
4141
);
4242

4343
module.exports = {

config/eslintrc.js

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,10 @@ module.exports = {
1717
extends: [
1818
'eslint:recommended',
1919
'airbnb',
20-
'plugin:@typescript-eslint/recommended',
20+
'plugin:@typescript-eslint/strict',
2121
'plugin:import/recommended',
2222
'plugin:import/typescript',
23+
'plugin:jsonc/recommended-with-jsonc',
2324
'prettier',
2425
],
2526
ignorePatterns: [
@@ -35,9 +36,7 @@ module.exports = {
3536
'error',
3637
{ 'ts-expect-error': 'allow-with-description' },
3738
],
38-
'@typescript-eslint/no-empty-function': 'off',
3939
'@typescript-eslint/no-shadow': 'error',
40-
'@typescript-eslint/no-var-requires': 'off',
4140
'import/default': 'error',
4241
'import/extensions': 'off',
4342
'import/named': 'error',
@@ -64,10 +63,11 @@ module.exports = {
6463
plugins: [
6564
'preset-lint-markdown-style-guide',
6665
'frontmatter',
67-
['lint-no-duplicate-headings', false],
68-
['lint-list-item-indent', false],
6966
['lint-emphasis-marker', false],
67+
['lint-list-item-content-indent', false],
68+
['lint-list-item-indent', false],
7069
['lint-list-item-spacing', false],
70+
['lint-no-duplicate-headings', false],
7171
['lint-no-literal-urls', false],
7272
],
7373
},
@@ -125,6 +125,10 @@ module.exports = {
125125
},
126126
],
127127
'valid-jsdoc': ['error', { prefer: { return: 'returns' } }],
128+
'no-empty-function': [
129+
'error',
130+
{ allow: ['arrowFunctions', 'constructors'] },
131+
],
128132
},
129133
overrides: [
130134
{
@@ -158,10 +162,17 @@ module.exports = {
158162
},
159163
{
160164
files: ['*.json'],
165+
parser: 'jsonc-eslint-parser',
161166
rules: {
162167
'no-template-curly-in-string': 'off',
163168
},
164169
},
170+
{
171+
files: ['*.js'],
172+
rules: {
173+
'@typescript-eslint/no-require-imports': 'off',
174+
},
175+
},
165176
{
166177
files: [
167178
'**/__tests__/**/*.[jt]s?(x)',

config/jest.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ module.exports = (disabledMocks = []) => ({
1818
'^electron-store$': `${mockDir}/electronStoreMock.ts`,
1919
'@electron/remote': `${mockDir}/remoteMock.ts`,
2020
'react-markdown': require.resolve(
21-
'react-markdown/react-markdown.min.js'
21+
'react-markdown/react-markdown.min.js',
2222
),
2323
...(disabledMocks.includes('packageJson')
2424
? {}

ipc/MetaFiles.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export interface AppInfo {
4949
export const semver = z.string().regex(
5050
// From https://semver.org
5151
/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/,
52-
'Is not a valid string for a semantic version'
52+
'Is not a valid string for a semantic version',
5353
);
5454

5555
const nrfutilModuleName = z.string();
@@ -60,7 +60,7 @@ export type NrfutilModuleVersion = z.infer<typeof nrfutilModuleVersion>;
6060

6161
export const nrfModules = z.record(
6262
nrfutilModuleName,
63-
z.tuple([nrfutilModuleVersion])
63+
z.tuple([nrfutilModuleVersion]),
6464
);
6565

6666
export type NrfutilModules = z.infer<typeof nrfModules>;

ipc/README.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,28 +16,28 @@ launcher will react in the way the apps expect it.
1616

1717
There are a few conventions we follow with the code here in `ipc/`:
1818

19-
- In each file there are pairs of functions: One to send a message over an IPC
20-
channel (e.g. `openApp`) and another to register a handler for the messages
21-
on that same channel (e.g. `registerOpenApp`).
19+
- In each file there are pairs of functions: One to send a message over an IPC
20+
channel (e.g. `openApp`) and another to register a handler for the messages on
21+
that same channel (e.g. `registerOpenApp`).
2222

2323
Usually these two functions utilize a shared signature which is defined in a
2424
type above them. Usually the functions are defined by invoking functions
2525
from `infrastructure/mainToRenderer.ts` or
2626
`infrastructure/rendererToMain.ts` which also use that type.
2727

28-
- The functions mentioned before are then exported in objects with the names
29-
`inMain`, `forRenderer`, `inRenderer`, and `forMain` to signify how the
30-
functions are supposed to be used. E.g. the mentioned `openApp` is in
31-
`inMain` because it is called by code in the renderer processes to invoke
32-
code in the main process to open an window. `registerOpenApp` is in
33-
`forRenderer` because the handler is registered so that code in the renderer
34-
processes can invoke it.
28+
- The functions mentioned before are then exported in objects with the names
29+
`inMain`, `forRenderer`, `inRenderer`, and `forMain` to signify how the
30+
functions are supposed to be used. E.g. the mentioned `openApp` is in `inMain`
31+
because it is called by code in the renderer processes to invoke code in the
32+
main process to open an window. `registerOpenApp` is in `forRenderer` because
33+
the handler is registered so that code in the renderer processes can invoke
34+
it.
3535

3636
So, `inMain` and `forRenderer` are used when sending messages from the
3737
renderer processes to the main process. `inRenderer` and `forMain` are used,
3838
when sending messages from the main process to the renderer processes.
3939

40-
- The code here in `ipc/` must neither reference any code in `src/` (which is
41-
for code of the renderer processes) nor in `main/` (which is for code in the
42-
main process). Only the other way around code in those two folders can
43-
reference code in `ipc/`.
40+
- The code here in `ipc/` must neither reference any code in `src/` (which is
41+
for code of the renderer processes) nor in `main/` (which is for code in the
42+
main process). Only the other way around code in those two folders can
43+
reference code in `ipc/`.

ipc/appDetails.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ type GetAppDetails = () => AppDetailsFromLauncher;
3030
const getAppDetails = invoke<GetAppDetails>(channel.request);
3131

3232
const registerGetAppDetails = (
33-
onGetAppDetails: (webContents: WebContents) => AppDetailsFromLauncher
33+
onGetAppDetails: (webContents: WebContents) => AppDetailsFromLauncher,
3434
) => {
3535
handleWithSender<GetAppDetails>(channel.request)(onGetAppDetails);
3636

ipc/apps.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -119,23 +119,23 @@ export type GetDownloadableAppsResult = {
119119
type GetDownloadableApps = () => GetDownloadableAppsResult;
120120

121121
const getDownloadableApps = invoke<GetDownloadableApps>(
122-
channel.getDownloadableApps
122+
channel.getDownloadableApps,
123123
);
124124
const registerGetDownloadableApps = handle<GetDownloadableApps>(
125-
channel.getDownloadableApps
125+
channel.getDownloadableApps,
126126
);
127127

128128
// installDownloadableApp
129129
type InstallDownloadableApp = (
130130
app: DownloadableApp,
131-
version?: string
131+
version?: string,
132132
) => DownloadableApp;
133133

134134
const installDownloadableApp = invoke<InstallDownloadableApp>(
135-
channel.installDownloadableApp
135+
channel.installDownloadableApp,
136136
);
137137
const registerInstallDownloadableApp = handle<InstallDownloadableApp>(
138-
channel.installDownloadableApp
138+
channel.installDownloadableApp,
139139
);
140140

141141
export const forRenderer = {

ipc/infrastructure/mainToRenderer.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export const on =
2525
<T extends (...args: never[]) => void>(channel: string) =>
2626
(handler: T) =>
2727
ipcRenderer.on(channel, (_event, ...args: unknown[]) =>
28-
handler(...(args as Parameters<T>))
28+
handler(...(args as Parameters<T>)),
2929
);
3030

3131
// Broadcast with a subchannel
@@ -44,10 +44,10 @@ export const broadcast =
4444
export const onBroadcasted =
4545
<T extends (...args: never[]) => void>(
4646
channel: string,
47-
subChannel: string
47+
subChannel: string,
4848
) =>
4949
(handler: T) =>
5050
ipcRenderer.on(
5151
`${channel}_${subChannel}`,
52-
(_event, ...args: unknown[]) => handler(...(args as Parameters<T>))
52+
(_event, ...args: unknown[]) => handler(...(args as Parameters<T>)),
5353
);

0 commit comments

Comments
 (0)