@nordicsemiconductor/pc-nrfconnect-shared 60.0.0-pre1 → 60.0.0-pre2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bootstrap.css +8951 -0
- package/dist/index.css +1451 -0
- package/dist/index.js +122119 -0
- package/{src/Logo/nordic-logo-blue-icon-only.png → dist/nordic-logo-blue-icon-only-H7BABN6D.png} +0 -0
- package/{src/Logo/nordic-logo-gray-icon-only.png → dist/nordic-logo-gray-icon-only-GATOTR3L.png} +0 -0
- package/package.json +12 -3
- package/typings/generated/src/Device/deviceInfo/deviceInfo.d.ts +1 -2
- package/.github/ISSUE_TEMPLATE/custom.md +0 -10
- package/.husky/pre-push +0 -3
- package/.renovaterc.json +0 -10
- package/Changelog.md +0 -2973
- package/azure-pipelines.yml +0 -34
- package/config/eslintrc.js +0 -190
- package/config/jest.config.js +0 -41
- package/config/prettier.config.js +0 -13
- package/config/tsconfig.json +0 -15
- package/fw/bootloader/graviton_bootloader_v1.0.1-[nRF5_SDK_15.0.1-1.alpha_f76d012].zip +0 -0
- package/jest.config.js +0 -7
- package/main/index.ts +0 -32
- package/mocks/deviceLibMock.ts +0 -21
- package/mocks/electronMock.ts +0 -15
- package/mocks/electronStoreMock.ts +0 -19
- package/mocks/emptyMock.ts +0 -7
- package/mocks/fileMock.ts +0 -13
- package/mocks/gaMock.ts +0 -9
- package/mocks/mockTests.test.ts +0 -15
- package/mocks/packageJsonMock.ts +0 -10
- package/mocks/remoteMock.ts +0 -17
- package/scripts/esbuild-bootstrap.js +0 -15
- package/scripts/esbuild-renderer.js +0 -131
- package/scripts/installHusky.ts +0 -17
- package/scripts/prepare-shared-release.ts +0 -122
- package/scripts/release-shared.test.ts +0 -132
- package/scripts/release-shared.ts +0 -207
- package/src/About/About.tsx +0 -25
- package/src/About/AboutButton.tsx +0 -28
- package/src/About/ApplicationCard.tsx +0 -83
- package/src/About/DeviceCard.tsx +0 -74
- package/src/About/DocumentationCard.tsx +0 -18
- package/src/About/DocumentationSection.tsx +0 -24
- package/src/About/Section.tsx +0 -21
- package/src/About/ShortcutButton.tsx +0 -41
- package/src/About/SupportCard.tsx +0 -97
- package/src/About/about.scss +0 -40
- package/src/About/documentationSlice.ts +0 -41
- package/src/About/section.scss +0 -15
- package/src/About/shortcutSlice.ts +0 -52
- package/src/Alert/Alert.module.scss +0 -29
- package/src/Alert/Alert.tsx +0 -37
- package/src/App/App.test.tsx +0 -47
- package/src/App/App.tsx +0 -227
- package/src/App/ConnectedToStore.tsx +0 -19
- package/src/App/VisibilityBar.tsx +0 -103
- package/src/App/app.scss +0 -83
- package/src/App/appLayout.ts +0 -95
- package/src/App/shared.scss +0 -49
- package/src/App/visibility-bar.scss +0 -55
- package/src/Button/Button.tsx +0 -66
- package/src/Button/button.module.scss +0 -154
- package/src/Card/Card.tsx +0 -26
- package/src/Card/card.module.scss +0 -28
- package/src/Device/BrokenDeviceDialog/BrokenDeviceDialog.tsx +0 -58
- package/src/Device/BrokenDeviceDialog/broken-device-dialog.scss +0 -18
- package/src/Device/BrokenDeviceDialog/brokenDeviceDialogSlice.tsx +0 -48
- package/src/Device/DeviceSelector/BasicDeviceInfo.tsx +0 -115
- package/src/Device/DeviceSelector/DeviceIcon.tsx +0 -27
- package/src/Device/DeviceSelector/DeviceList/AnimatedList.tsx +0 -62
- package/src/Device/DeviceSelector/DeviceList/BrokenDevice.tsx +0 -34
- package/src/Device/DeviceSelector/DeviceList/Device.tsx +0 -84
- package/src/Device/DeviceSelector/DeviceList/DeviceList.tsx +0 -113
- package/src/Device/DeviceSelector/DeviceList/EditDeviceButtons.tsx +0 -28
- package/src/Device/DeviceSelector/DeviceList/MoreDeviceInfo.tsx +0 -65
- package/src/Device/DeviceSelector/DeviceList/RenameDevice.tsx +0 -22
- package/src/Device/DeviceSelector/DeviceList/broken-device.scss +0 -32
- package/src/Device/DeviceSelector/DeviceList/device-list.scss +0 -64
- package/src/Device/DeviceSelector/DeviceList/device.scss +0 -28
- package/src/Device/DeviceSelector/DeviceList/edit-device-buttons.scss +0 -31
- package/src/Device/DeviceSelector/DeviceList/more-device-info.scss +0 -33
- package/src/Device/DeviceSelector/DeviceList/rename-device.scss +0 -13
- package/src/Device/DeviceSelector/DeviceSelector.test.tsx +0 -342
- package/src/Device/DeviceSelector/DeviceSelector.tsx +0 -173
- package/src/Device/DeviceSelector/Favorite.tsx +0 -49
- package/src/Device/DeviceSelector/SelectDevice.tsx +0 -36
- package/src/Device/DeviceSelector/SelectedDevice.tsx +0 -65
- package/src/Device/DeviceSelector/arrow-down.svg +0 -1
- package/src/Device/DeviceSelector/basic-device-info.scss +0 -62
- package/src/Device/DeviceSelector/device-icon.scss +0 -27
- package/src/Device/DeviceSelector/favorite.scss +0 -17
- package/src/Device/DeviceSelector/select-device.scss +0 -38
- package/src/Device/DeviceSelector/selected-device.scss +0 -57
- package/src/Device/DeviceSetup/DeviceSetupView.tsx +0 -102
- package/src/Device/deviceAutoSelectSlice.ts +0 -144
- package/src/Device/deviceInfo/deviceInfo.ts +0 -254
- package/src/Device/deviceInfo/nRF51-Series-logo.svg +0 -1
- package/src/Device/deviceInfo/nRF52-Series-logo.svg +0 -1
- package/src/Device/deviceInfo/nRF53-Series-logo.svg +0 -1
- package/src/Device/deviceInfo/nRF70-Series_no-background_RGB.svg +0 -36
- package/src/Device/deviceInfo/nRF91-Series-logo.svg +0 -1
- package/src/Device/deviceInfo/ppk-logo.svg +0 -1
- package/src/Device/deviceInfo/unknown-logo.svg +0 -30
- package/src/Device/deviceInfo/unknown-nordic-logo.svg +0 -25
- package/src/Device/deviceLibWrapper.test.ts +0 -97
- package/src/Device/deviceLibWrapper.ts +0 -133
- package/src/Device/deviceLister.test.ts +0 -89
- package/src/Device/deviceLister.ts +0 -396
- package/src/Device/deviceSetup.ts +0 -264
- package/src/Device/deviceSetupSlice.ts +0 -94
- package/src/Device/deviceSlice.ts +0 -248
- package/src/Device/dfu-cc.ts +0 -162
- package/src/Device/initPacket.ts +0 -402
- package/src/Device/jprogOperations.ts +0 -206
- package/src/Device/sdfuOperations.ts +0 -601
- package/src/Dialog/Dialog.test.tsx +0 -134
- package/src/Dialog/Dialog.tsx +0 -236
- package/src/Dialog/dialog.scss +0 -60
- package/src/Dropdown/Dropdown.module.scss +0 -83
- package/src/Dropdown/Dropdown.test.tsx +0 -62
- package/src/Dropdown/Dropdown.tsx +0 -106
- package/src/ErrorBoundary/ErrorBoundary.test.tsx +0 -105
- package/src/ErrorBoundary/ErrorBoundary.tsx +0 -186
- package/src/ErrorBoundary/bug.svg +0 -1
- package/src/ErrorBoundary/error-boundary.scss +0 -102
- package/src/ErrorDialog/ErrorDialog.test.tsx +0 -70
- package/src/ErrorDialog/ErrorDialog.tsx +0 -94
- package/src/ErrorDialog/error.scss +0 -14
- package/src/ErrorDialog/errorDialogSlice.test.ts +0 -64
- package/src/ErrorDialog/errorDialogSlice.ts +0 -80
- package/src/FactoryReset/FactoryResetButton.test.tsx +0 -46
- package/src/FactoryReset/FactoryResetButton.tsx +0 -81
- package/src/InlineInput/InlineInput.tsx +0 -170
- package/src/InlineInput/NumberInlineInput.tsx +0 -107
- package/src/InlineInput/inline-input.scss +0 -38
- package/src/InlineInput/number-inline-input.scss +0 -15
- package/src/Log/LogEntry.tsx +0 -62
- package/src/Log/LogViewer.tsx +0 -54
- package/src/Log/log-entry.scss +0 -30
- package/src/Log/log-viewer.scss +0 -24
- package/src/Log/logSlice.ts +0 -73
- package/src/Log/syncLogToStore.ts +0 -36
- package/src/Logo/Logo.tsx +0 -48
- package/src/Logo/logo.scss +0 -11
- package/src/Main/Main.tsx +0 -13
- package/src/Main/main.scss +0 -13
- package/src/MasonryLayout/MasonryLayout.tsx +0 -234
- package/src/MasonryLayout/masonryLayout.module.scss +0 -46
- package/src/NavBar/NavBar.tsx +0 -22
- package/src/NavBar/NavMenu.test.tsx +0 -41
- package/src/NavBar/NavMenu.tsx +0 -53
- package/src/NavBar/NavMenuItem.tsx +0 -41
- package/src/NavBar/nav-bar.scss +0 -26
- package/src/NavBar/nav-menu-item.scss +0 -34
- package/src/OpenApp/openApp.ts +0 -18
- package/src/Panes/FeedbackPane.tsx +0 -149
- package/src/PseudoButton/PseudoButton.tsx +0 -56
- package/src/PseudoButton/pseudo-button.scss +0 -11
- package/src/SerialPort/ConflictingSettingsDialog.tsx +0 -242
- package/src/SerialPort/SerialPort.test.ts +0 -54
- package/src/SerialPort/SerialPort.ts +0 -202
- package/src/Shortcuts/Shortcut-item.scss +0 -33
- package/src/Shortcuts/Shortcut-modal.scss +0 -20
- package/src/Shortcuts/ShortcutItem.tsx +0 -48
- package/src/Shortcuts/ShortcutModal.tsx +0 -67
- package/src/SidePanel/Group.tsx +0 -106
- package/src/SidePanel/SidePanel.tsx +0 -19
- package/src/SidePanel/group.scss +0 -42
- package/src/SidePanel/sidepanel.scss +0 -20
- package/src/Slider/Bar.tsx +0 -24
- package/src/Slider/Factor.test.ts +0 -48
- package/src/Slider/Handle.tsx +0 -121
- package/src/Slider/Slider.test.tsx +0 -25
- package/src/Slider/Slider.tsx +0 -91
- package/src/Slider/Ticks.tsx +0 -54
- package/src/Slider/__snapshots__/Slider.test.tsx.snap +0 -50
- package/src/Slider/bar.scss +0 -24
- package/src/Slider/factor.ts +0 -24
- package/src/Slider/handle.scss +0 -32
- package/src/Slider/percentage.ts +0 -67
- package/src/Slider/range.ts +0 -92
- package/src/Slider/slider.scss +0 -14
- package/src/Slider/ticks.scss +0 -28
- package/src/Slider/variables.scss +0 -16
- package/src/StartStopButton/StartStopButton.tsx +0 -60
- package/src/StartStopButton/play-circle.svg +0 -1
- package/src/StartStopButton/start-stop-button.scss +0 -47
- package/src/StartStopButton/stop-circle.svg +0 -1
- package/src/StateSelector/StateSelector.tsx +0 -64
- package/src/StateSelector/state-selector.scss +0 -38
- package/src/Stepper/Stepper.tsx +0 -139
- package/src/Stepper/stepper.scss +0 -127
- package/src/Toggle/Toggle.tsx +0 -120
- package/src/Toggle/toggle.scss +0 -109
- package/src/bootstrap.scss +0 -14
- package/src/index.ts +0 -146
- package/src/logging/appTransport.test.ts +0 -78
- package/src/logging/appTransport.ts +0 -41
- package/src/logging/describeError.test.ts +0 -38
- package/src/logging/describeError.ts +0 -56
- package/src/logging/index.ts +0 -103
- package/src/logging/logBuffer.test.ts +0 -41
- package/src/logging/logBuffer.ts +0 -24
- package/src/logging/sendInitialLogMessages.ts +0 -64
- package/src/store.ts +0 -60
- package/src/svg.d.ts +0 -15
- package/src/utils/AppTypes.ts +0 -60
- package/src/utils/appDirs.ts +0 -78
- package/src/utils/bleChannels.ts +0 -16
- package/src/utils/classNames.test.ts +0 -29
- package/src/utils/classNames.ts +0 -25
- package/src/utils/colors.scss +0 -46
- package/src/utils/colors.ts +0 -38
- package/src/utils/describeVersion.ts +0 -21
- package/src/utils/environment.ts +0 -6
- package/src/utils/logLibVersions.ts +0 -103
- package/src/utils/open.ts +0 -46
- package/src/utils/packageJson.ts +0 -60
- package/src/utils/persistentStore.ts +0 -144
- package/src/utils/systemReport.ts +0 -160
- package/src/utils/truncateMiddle.test.ts +0 -21
- package/src/utils/truncateMiddle.ts +0 -20
- package/src/utils/usageData.ts +0 -189
- package/src/utils/useHotKey.ts +0 -62
- package/src/utils/useStopwatch.test.tsx +0 -311
- package/src/utils/useStopwatch.ts +0 -140
- package/src/variables.scss +0 -820
- package/styles.scss +0 -88
- package/test/dispatchTo.ts +0 -23
- package/test/index.ts +0 -7
- package/test/jestResolver.js +0 -28
- package/test/setupTests.ts +0 -27
- package/test/testUtil.ts +0 -20
- package/test/testrenderer.tsx +0 -39
- /package/{src/Logo/nordic-logo-white-icon-only.png → dist/nordic-logo-white-icon-only-XIZBW537.png} +0 -0
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env ts-node
|
|
2
|
-
|
|
3
|
-
/*
|
|
4
|
-
* Copyright (c) 2023 Nordic Semiconductor ASA
|
|
5
|
-
*
|
|
6
|
-
* SPDX-License-Identifier: LicenseRef-Nordic-4-Clause
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
/*
|
|
10
|
-
A script to prepare a new version of shared.
|
|
11
|
-
|
|
12
|
-
Requirement for this script: Have [the GitHub CLI tool `gh`](https://cli.github.com)
|
|
13
|
-
installed and authenticate in it (run `gh auth login`).
|
|
14
|
-
|
|
15
|
-
Run
|
|
16
|
-
npm run prepare-shared-release
|
|
17
|
-
to update the version in `package.json` and the header of the latest entry
|
|
18
|
-
in `Changelog.md`.
|
|
19
|
-
*/
|
|
20
|
-
import { spawnSync } from 'node:child_process';
|
|
21
|
-
import { readFileSync, writeFileSync } from 'node:fs';
|
|
22
|
-
|
|
23
|
-
import { getNextReleaseNumber } from './release-shared';
|
|
24
|
-
|
|
25
|
-
const parseJson = <Result>(jsonString: string) =>
|
|
26
|
-
JSON.parse(jsonString) as Result;
|
|
27
|
-
|
|
28
|
-
const npmCommand = process.platform === 'win32' ? 'npm.cmd' : 'npm';
|
|
29
|
-
const npm = (...commands) =>
|
|
30
|
-
spawnSync(npmCommand, commands, {
|
|
31
|
-
stdio: ['inherit', 'pipe', 'inherit'],
|
|
32
|
-
encoding: 'utf-8',
|
|
33
|
-
}).stdout;
|
|
34
|
-
|
|
35
|
-
const updatePackageJson = (nextReleaseNumber: number) => {
|
|
36
|
-
const nextVersionString = `${nextReleaseNumber}.0.0`;
|
|
37
|
-
const currentVersion = parseJson<string>(npm('pkg', 'get', 'version'));
|
|
38
|
-
|
|
39
|
-
if (nextVersionString === currentVersion) {
|
|
40
|
-
console.log(
|
|
41
|
-
`- The version in \`package.json\` is already \`${currentVersion}\`, no need to change it.`
|
|
42
|
-
);
|
|
43
|
-
return false;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
npm('pkg', 'set', `version=${nextVersionString}`);
|
|
47
|
-
console.log(
|
|
48
|
-
`- Updated the version in \`package.json\` to \`${nextVersionString}\`.`
|
|
49
|
-
);
|
|
50
|
-
|
|
51
|
-
return true;
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
const withoutTime = (date: Date) => date.toISOString().split('T')[0];
|
|
55
|
-
|
|
56
|
-
const updateChangelog = (nextReleaseNumber: number) => {
|
|
57
|
-
const changelog = readFileSync('Changelog.md', { encoding: 'utf-8' });
|
|
58
|
-
|
|
59
|
-
const match = changelog.match(
|
|
60
|
-
/(?<beginning>.*?)^## (?<header>.*?)$(?<ending>.*)/ms
|
|
61
|
-
);
|
|
62
|
-
|
|
63
|
-
if (match?.groups == null) {
|
|
64
|
-
console.error(
|
|
65
|
-
'x Unable to correctly parse `Changelog.md`, to play it safe I am not changing it.'
|
|
66
|
-
);
|
|
67
|
-
return { updated: false, error: true };
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
const { beginning, header, ending } = match.groups;
|
|
71
|
-
|
|
72
|
-
const correctHeader = `${nextReleaseNumber} - ${withoutTime(new Date())}`;
|
|
73
|
-
if (header === correctHeader) {
|
|
74
|
-
console.log(
|
|
75
|
-
`- The latest entry in \`Changelog.md\` already has the header \`${header}\`, no need to change it.`
|
|
76
|
-
);
|
|
77
|
-
return { updated: false, error: false };
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
if (
|
|
81
|
-
header === 'Unreleased' ||
|
|
82
|
-
header === `${nextReleaseNumber} - Unreleased`
|
|
83
|
-
) {
|
|
84
|
-
writeFileSync(
|
|
85
|
-
'Changelog.md',
|
|
86
|
-
`${beginning}## ${correctHeader}${ending}`,
|
|
87
|
-
{ encoding: 'utf-8' }
|
|
88
|
-
);
|
|
89
|
-
console.log(
|
|
90
|
-
`- Updated the header of the latest entry in \`Changelog.md\` to \`${correctHeader}\`.`
|
|
91
|
-
);
|
|
92
|
-
|
|
93
|
-
return { updated: true, error: false };
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
console.error(
|
|
97
|
-
`x The latest entry in \`Changelog.md\` is not named \`Unreleased\` or \`${nextReleaseNumber} - Unreleased\`, to play it safe I am not changing it.`
|
|
98
|
-
);
|
|
99
|
-
|
|
100
|
-
return { updated: false, error: true };
|
|
101
|
-
};
|
|
102
|
-
|
|
103
|
-
const main = () => {
|
|
104
|
-
const nextReleaseNumber = getNextReleaseNumber();
|
|
105
|
-
|
|
106
|
-
const updatedPackageJson = updatePackageJson(nextReleaseNumber);
|
|
107
|
-
const { updated: updatedChangelog, error } =
|
|
108
|
-
updateChangelog(nextReleaseNumber);
|
|
109
|
-
|
|
110
|
-
if (!updatedPackageJson && !updatedChangelog) {
|
|
111
|
-
console.log('\nEverything already up-to-date.');
|
|
112
|
-
} else if (!error) {
|
|
113
|
-
console.log(
|
|
114
|
-
'\nUpdated everything needed. You still need to bring these changes into main.'
|
|
115
|
-
);
|
|
116
|
-
}
|
|
117
|
-
};
|
|
118
|
-
|
|
119
|
-
const runAsScript = require.main === module;
|
|
120
|
-
if (runAsScript) {
|
|
121
|
-
main();
|
|
122
|
-
}
|
|
@@ -1,132 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (c) 2023 Nordic Semiconductor ASA
|
|
3
|
-
*
|
|
4
|
-
* SPDX-License-Identifier: LicenseRef-Nordic-4-Clause
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
import {
|
|
8
|
-
changelogIsCorrect,
|
|
9
|
-
getLatestEntry,
|
|
10
|
-
getNextReleaseNumber,
|
|
11
|
-
latestEntryIsNotEmpty,
|
|
12
|
-
latestHeaderIsCorrect,
|
|
13
|
-
packageJsonIsCorrect,
|
|
14
|
-
} from './release-shared';
|
|
15
|
-
|
|
16
|
-
const noop = () => {};
|
|
17
|
-
|
|
18
|
-
test('determinding the next release number', () => {
|
|
19
|
-
expect(getNextReleaseNumber('v34', { log: noop })).toBe(35);
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
describe('checking package.json', () => {
|
|
23
|
-
test('no errors', () => {
|
|
24
|
-
expect(
|
|
25
|
-
packageJsonIsCorrect(34, {
|
|
26
|
-
fail: noop,
|
|
27
|
-
packageJson: '{"version": "34.0.0"}',
|
|
28
|
-
})
|
|
29
|
-
).toBe(true);
|
|
30
|
-
});
|
|
31
|
-
test('version is wrong', () => {
|
|
32
|
-
expect(
|
|
33
|
-
packageJsonIsCorrect(34, {
|
|
34
|
-
fail: noop,
|
|
35
|
-
packageJson: '{"version": "33.0.0"}',
|
|
36
|
-
})
|
|
37
|
-
).toBe(false);
|
|
38
|
-
});
|
|
39
|
-
test('format is wrong', () => {
|
|
40
|
-
expect(
|
|
41
|
-
packageJsonIsCorrect(34, {
|
|
42
|
-
fail: noop,
|
|
43
|
-
packageJson: '{"version": "34"}',
|
|
44
|
-
})
|
|
45
|
-
).toBe(false);
|
|
46
|
-
});
|
|
47
|
-
});
|
|
48
|
-
|
|
49
|
-
describe('checking Changelod.md', () => {
|
|
50
|
-
test('no errors', () => {
|
|
51
|
-
const correctChangelog = `# Changelog
|
|
52
|
-
|
|
53
|
-
All notable changes to this project will be documented in this file.
|
|
54
|
-
|
|
55
|
-
## 34 - 2022-03-10
|
|
56
|
-
|
|
57
|
-
### Changed
|
|
58
|
-
|
|
59
|
-
- Something`;
|
|
60
|
-
|
|
61
|
-
expect(
|
|
62
|
-
changelogIsCorrect(34, {
|
|
63
|
-
fail: noop,
|
|
64
|
-
now: new Date('2022-03-10T12:38:37.267Z'),
|
|
65
|
-
changelog: correctChangelog,
|
|
66
|
-
})
|
|
67
|
-
).toBe(true);
|
|
68
|
-
});
|
|
69
|
-
|
|
70
|
-
test('Unreleased entry', () => {
|
|
71
|
-
const outdatedChangelog = `# Changelog
|
|
72
|
-
|
|
73
|
-
All notable changes to this project will be documented in this file.
|
|
74
|
-
|
|
75
|
-
## 33 - 2022-02-01
|
|
76
|
-
|
|
77
|
-
### Changed
|
|
78
|
-
|
|
79
|
-
- Something`;
|
|
80
|
-
|
|
81
|
-
expect(
|
|
82
|
-
latestHeaderIsCorrect(34, {
|
|
83
|
-
fail: noop,
|
|
84
|
-
now: new Date('2022-03-10T12:38:37.267Z'),
|
|
85
|
-
changelog: outdatedChangelog,
|
|
86
|
-
})
|
|
87
|
-
).toBe(false);
|
|
88
|
-
});
|
|
89
|
-
|
|
90
|
-
test('Empty entry', () => {
|
|
91
|
-
const emptyLatestEntry = `# Changelog
|
|
92
|
-
|
|
93
|
-
All notable changes to this project will be documented in this file.
|
|
94
|
-
|
|
95
|
-
## 34 - 2022-03-10
|
|
96
|
-
|
|
97
|
-
## 33 - 2022-02-01`;
|
|
98
|
-
|
|
99
|
-
expect(
|
|
100
|
-
latestEntryIsNotEmpty({
|
|
101
|
-
fail: noop,
|
|
102
|
-
changelog: emptyLatestEntry,
|
|
103
|
-
})
|
|
104
|
-
).toBe(false);
|
|
105
|
-
});
|
|
106
|
-
});
|
|
107
|
-
|
|
108
|
-
describe('Parsing Changelog.md', () => {
|
|
109
|
-
const changelog = `# Changelog
|
|
110
|
-
|
|
111
|
-
All notable changes to this project will be documented in this file.
|
|
112
|
-
|
|
113
|
-
## 34 - 2023-04-20
|
|
114
|
-
|
|
115
|
-
### Changed
|
|
116
|
-
|
|
117
|
-
- Something
|
|
118
|
-
|
|
119
|
-
## 33 - 2023-04-19
|
|
120
|
-
|
|
121
|
-
### Added
|
|
122
|
-
|
|
123
|
-
- Something else
|
|
124
|
-
`;
|
|
125
|
-
|
|
126
|
-
test('Extracting the latest entry', () => {
|
|
127
|
-
expect(getLatestEntry(changelog)).toMatchObject({
|
|
128
|
-
header: '34 - 2023-04-20',
|
|
129
|
-
content: '### Changed\n\n- Something',
|
|
130
|
-
});
|
|
131
|
-
});
|
|
132
|
-
});
|
|
@@ -1,207 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env ts-node
|
|
2
|
-
|
|
3
|
-
/*
|
|
4
|
-
* Copyright (c) 2023 Nordic Semiconductor ASA
|
|
5
|
-
*
|
|
6
|
-
* SPDX-License-Identifier: LicenseRef-Nordic-4-Clause
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
/*
|
|
10
|
-
A script to release a new version of shared.
|
|
11
|
-
|
|
12
|
-
Requirement for this script: Have [the GitHub CLI tool `gh`](https://cli.github.com)
|
|
13
|
-
installed and authenticate in it (run `gh auth login`).
|
|
14
|
-
|
|
15
|
-
Run
|
|
16
|
-
npm run release-shared -- --dry-run
|
|
17
|
-
to check whether the script thinks you can release a new version of shared.
|
|
18
|
-
|
|
19
|
-
Run
|
|
20
|
-
npm run release-shared
|
|
21
|
-
to actually do the release.
|
|
22
|
-
|
|
23
|
-
This script checks the contents in the branch `origin/main`.
|
|
24
|
-
So if locally looks everything fine, please check `origin/main`.
|
|
25
|
-
*/
|
|
26
|
-
import { execSync, spawnSync } from 'node:child_process';
|
|
27
|
-
|
|
28
|
-
import { PackageJson } from '../src/utils/AppTypes';
|
|
29
|
-
|
|
30
|
-
const logError = (message: string) => {
|
|
31
|
-
console.error(message);
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
const parseJson = <Result>(jsonString: string) =>
|
|
35
|
-
JSON.parse(jsonString) as Result;
|
|
36
|
-
|
|
37
|
-
const git = (...commands) =>
|
|
38
|
-
spawnSync('git', commands, {
|
|
39
|
-
stdio: ['inherit', 'pipe', 'inherit'],
|
|
40
|
-
encoding: 'utf-8',
|
|
41
|
-
}).stdout;
|
|
42
|
-
|
|
43
|
-
const getLatestReleaseName = () =>
|
|
44
|
-
parseJson<{ tagName: string }>(
|
|
45
|
-
execSync(`gh release view --json tagName`, { encoding: 'utf-8' })
|
|
46
|
-
).tagName;
|
|
47
|
-
|
|
48
|
-
export const getNextReleaseNumber = (
|
|
49
|
-
latestReleaseName = getLatestReleaseName(),
|
|
50
|
-
{ log } = { log: console.log }
|
|
51
|
-
) => {
|
|
52
|
-
const latestReleaseNumber = Number(
|
|
53
|
-
/^v(?<versionNumber>\d+)$/.exec(latestReleaseName)?.groups
|
|
54
|
-
?.versionNumber
|
|
55
|
-
);
|
|
56
|
-
|
|
57
|
-
const nextReleaseNumber = latestReleaseNumber + 1;
|
|
58
|
-
|
|
59
|
-
log(
|
|
60
|
-
`The currently released version is ${latestReleaseNumber}, so the next one will be ${nextReleaseNumber}.\n`
|
|
61
|
-
);
|
|
62
|
-
|
|
63
|
-
return nextReleaseNumber;
|
|
64
|
-
};
|
|
65
|
-
|
|
66
|
-
const equality = <T>(
|
|
67
|
-
expected: T,
|
|
68
|
-
actual: T,
|
|
69
|
-
errorMessage: string,
|
|
70
|
-
fail: typeof logError
|
|
71
|
-
) => {
|
|
72
|
-
if (expected !== actual) {
|
|
73
|
-
fail(
|
|
74
|
-
`${errorMessage}:\n Expected: ${expected}\n Actual: ${actual}\n`
|
|
75
|
-
);
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
return expected === actual;
|
|
79
|
-
};
|
|
80
|
-
|
|
81
|
-
const getLatestPackageJson = () => git('show', 'origin/main:package.json');
|
|
82
|
-
|
|
83
|
-
export const packageJsonIsCorrect = (
|
|
84
|
-
expectedVersionNumber: number,
|
|
85
|
-
{ fail, packageJson } = {
|
|
86
|
-
fail: logError,
|
|
87
|
-
packageJson: getLatestPackageJson(),
|
|
88
|
-
}
|
|
89
|
-
) => {
|
|
90
|
-
const expectedVersionString = `${expectedVersionNumber}.0.0`;
|
|
91
|
-
const actualVersionString = parseJson<PackageJson>(packageJson).version;
|
|
92
|
-
|
|
93
|
-
return equality(
|
|
94
|
-
expectedVersionString,
|
|
95
|
-
actualVersionString,
|
|
96
|
-
'Version number in `package.json` is not as expected',
|
|
97
|
-
fail
|
|
98
|
-
);
|
|
99
|
-
};
|
|
100
|
-
|
|
101
|
-
const getLatestChangelog = () => git('show', 'origin/main:Changelog.md');
|
|
102
|
-
|
|
103
|
-
export const getLatestEntry = (changelog: string) => {
|
|
104
|
-
const latestEntry = changelog.split('\n## ')[1];
|
|
105
|
-
|
|
106
|
-
const header = latestEntry.split('\n')[0];
|
|
107
|
-
const content = latestEntry.replace(/[^\n]*/, '').trim();
|
|
108
|
-
|
|
109
|
-
return { header, content };
|
|
110
|
-
};
|
|
111
|
-
|
|
112
|
-
export const latestEntryIsNotEmpty = ({
|
|
113
|
-
fail,
|
|
114
|
-
changelog,
|
|
115
|
-
}: {
|
|
116
|
-
fail: (message: string) => void;
|
|
117
|
-
changelog: string;
|
|
118
|
-
}) => {
|
|
119
|
-
const correct = getLatestEntry(changelog).content.length > 0;
|
|
120
|
-
|
|
121
|
-
if (!correct) {
|
|
122
|
-
fail('Latest entry in `Changelog.md` does not contain anything.');
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
return correct;
|
|
126
|
-
};
|
|
127
|
-
|
|
128
|
-
const withoutTime = (date: Date) => date.toISOString().split('T')[0];
|
|
129
|
-
|
|
130
|
-
export const latestHeaderIsCorrect = (
|
|
131
|
-
expectedVersionNumber: number,
|
|
132
|
-
{ fail, now, changelog } = {
|
|
133
|
-
fail: logError,
|
|
134
|
-
now: new Date(),
|
|
135
|
-
changelog: getLatestChangelog(),
|
|
136
|
-
}
|
|
137
|
-
) => {
|
|
138
|
-
const expectedHeaderline = `${expectedVersionNumber} - ${withoutTime(now)}`;
|
|
139
|
-
const actualHeaderline = getLatestEntry(changelog).header;
|
|
140
|
-
|
|
141
|
-
return equality(
|
|
142
|
-
expectedHeaderline,
|
|
143
|
-
actualHeaderline,
|
|
144
|
-
'Latest entry in `Changelog.md` is not as expected',
|
|
145
|
-
fail
|
|
146
|
-
);
|
|
147
|
-
};
|
|
148
|
-
|
|
149
|
-
export const changelogIsCorrect = (
|
|
150
|
-
expectedVersionNumber: number,
|
|
151
|
-
{ fail, now, changelog } = {
|
|
152
|
-
fail: logError,
|
|
153
|
-
now: new Date(),
|
|
154
|
-
changelog: getLatestChangelog(),
|
|
155
|
-
}
|
|
156
|
-
) =>
|
|
157
|
-
latestEntryIsNotEmpty({ fail, changelog }) &&
|
|
158
|
-
latestHeaderIsCorrect(expectedVersionNumber, { fail, now, changelog });
|
|
159
|
-
|
|
160
|
-
const doRelease = (nextReleaseNumber: number) => {
|
|
161
|
-
const nextReleaseName = `v${nextReleaseNumber}`;
|
|
162
|
-
const latestChangelogEntry = getLatestEntry(getLatestChangelog()).content;
|
|
163
|
-
|
|
164
|
-
const dryRun = process.argv.includes('--dry-run');
|
|
165
|
-
if (dryRun) {
|
|
166
|
-
console.log(
|
|
167
|
-
`Would create a release ${nextReleaseName} now, with this description:\n${latestChangelogEntry}`
|
|
168
|
-
);
|
|
169
|
-
} else {
|
|
170
|
-
console.log(`Creating release ${nextReleaseName} now:`);
|
|
171
|
-
const result = spawnSync(
|
|
172
|
-
'gh',
|
|
173
|
-
[
|
|
174
|
-
'release',
|
|
175
|
-
'create',
|
|
176
|
-
nextReleaseName,
|
|
177
|
-
'--title',
|
|
178
|
-
nextReleaseName,
|
|
179
|
-
'--notes',
|
|
180
|
-
latestChangelogEntry,
|
|
181
|
-
],
|
|
182
|
-
{
|
|
183
|
-
stdio: 'inherit',
|
|
184
|
-
encoding: 'utf-8',
|
|
185
|
-
}
|
|
186
|
-
);
|
|
187
|
-
process.exitCode = result.status ?? 1;
|
|
188
|
-
}
|
|
189
|
-
};
|
|
190
|
-
|
|
191
|
-
const main = () => {
|
|
192
|
-
console.log(git('fetch'));
|
|
193
|
-
const nextReleaseNumber = getNextReleaseNumber();
|
|
194
|
-
|
|
195
|
-
const noErrors =
|
|
196
|
-
packageJsonIsCorrect(nextReleaseNumber) &&
|
|
197
|
-
changelogIsCorrect(nextReleaseNumber);
|
|
198
|
-
|
|
199
|
-
if (noErrors) {
|
|
200
|
-
doRelease(nextReleaseNumber);
|
|
201
|
-
}
|
|
202
|
-
};
|
|
203
|
-
|
|
204
|
-
const runAsScript = require.main === module;
|
|
205
|
-
if (runAsScript) {
|
|
206
|
-
main();
|
|
207
|
-
}
|
package/src/About/About.tsx
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (c) 2015 Nordic Semiconductor ASA
|
|
3
|
-
*
|
|
4
|
-
* SPDX-License-Identifier: LicenseRef-Nordic-4-Clause
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
import React from 'react';
|
|
8
|
-
|
|
9
|
-
import ApplicationCard from './ApplicationCard';
|
|
10
|
-
import DeviceCard from './DeviceCard';
|
|
11
|
-
import DocumentationCard from './DocumentationCard';
|
|
12
|
-
import SupportCard from './SupportCard';
|
|
13
|
-
|
|
14
|
-
import './about.scss';
|
|
15
|
-
|
|
16
|
-
export default () => (
|
|
17
|
-
<div className="about">
|
|
18
|
-
<div className="about-inner">
|
|
19
|
-
<ApplicationCard />
|
|
20
|
-
<DeviceCard />
|
|
21
|
-
<DocumentationCard />
|
|
22
|
-
<SupportCard />
|
|
23
|
-
</div>
|
|
24
|
-
</div>
|
|
25
|
-
);
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (c) 2015 Nordic Semiconductor ASA
|
|
3
|
-
*
|
|
4
|
-
* SPDX-License-Identifier: LicenseRef-Nordic-4-Clause
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
import React, { FC } from 'react';
|
|
8
|
-
|
|
9
|
-
import Button from '../Button/Button';
|
|
10
|
-
import { openUrl } from '../utils/open';
|
|
11
|
-
|
|
12
|
-
interface Props {
|
|
13
|
-
onClick?: () => void;
|
|
14
|
-
url?: string;
|
|
15
|
-
label: string;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
const AboutButton: FC<Props> = ({ url, label, onClick }) => (
|
|
19
|
-
<Button
|
|
20
|
-
disabled={!url && !onClick}
|
|
21
|
-
onClick={onClick || (() => openUrl(url as string))}
|
|
22
|
-
variant="secondary"
|
|
23
|
-
>
|
|
24
|
-
{label}
|
|
25
|
-
</Button>
|
|
26
|
-
);
|
|
27
|
-
|
|
28
|
-
export default AboutButton;
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (c) 2015 Nordic Semiconductor ASA
|
|
3
|
-
*
|
|
4
|
-
* SPDX-License-Identifier: LicenseRef-Nordic-4-Clause
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
import React, { useEffect, useState } from 'react';
|
|
8
|
-
import { ipcRenderer } from 'electron';
|
|
9
|
-
|
|
10
|
-
import Card from '../Card/Card';
|
|
11
|
-
import FactoryResetButton from '../FactoryReset/FactoryResetButton';
|
|
12
|
-
import AboutButton from './AboutButton';
|
|
13
|
-
import Section from './Section';
|
|
14
|
-
import ShortcutButton from './ShortcutButton';
|
|
15
|
-
|
|
16
|
-
interface AppDetails {
|
|
17
|
-
coreVersion: string;
|
|
18
|
-
corePath: string;
|
|
19
|
-
homeDir: string;
|
|
20
|
-
tmpDir: string;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
interface LauncerApp {
|
|
24
|
-
name?: string;
|
|
25
|
-
displayName?: string;
|
|
26
|
-
description?: string;
|
|
27
|
-
homepage?: string;
|
|
28
|
-
currentVersion?: string;
|
|
29
|
-
latestVersion?: string;
|
|
30
|
-
engineVersion?: string;
|
|
31
|
-
path?: string;
|
|
32
|
-
iconPath?: string;
|
|
33
|
-
shortcutIconPath?: string;
|
|
34
|
-
isOfficial?: string;
|
|
35
|
-
sharedVersion?: string;
|
|
36
|
-
source?: string;
|
|
37
|
-
url?: string;
|
|
38
|
-
releaseNote?: string;
|
|
39
|
-
upgradeAvailable?: string;
|
|
40
|
-
repositoryUrl?: string;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
type DetailsFromLauncher = AppDetails & LauncerApp;
|
|
44
|
-
|
|
45
|
-
export default () => {
|
|
46
|
-
const [appInfo, setAppInfo] = useState<DetailsFromLauncher>();
|
|
47
|
-
|
|
48
|
-
useEffect(() => {
|
|
49
|
-
ipcRenderer.once('app-details', (_, details: DetailsFromLauncher) => {
|
|
50
|
-
setAppInfo(details);
|
|
51
|
-
});
|
|
52
|
-
ipcRenderer.send('get-app-details');
|
|
53
|
-
}, [setAppInfo]);
|
|
54
|
-
|
|
55
|
-
if (appInfo == null) return null;
|
|
56
|
-
|
|
57
|
-
return (
|
|
58
|
-
<Card title="Application">
|
|
59
|
-
<Section title="Title">{appInfo.displayName}</Section>
|
|
60
|
-
<Section title="Purpose">{appInfo.description}</Section>
|
|
61
|
-
<Section title="Version">{appInfo.currentVersion}</Section>
|
|
62
|
-
<Section title="Source">{appInfo.source || 'local'}</Section>
|
|
63
|
-
<Section title="Supported engines">
|
|
64
|
-
nRF Connect {appInfo.engineVersion}
|
|
65
|
-
</Section>
|
|
66
|
-
<Section title="Current engine">
|
|
67
|
-
nRF Connect {appInfo.coreVersion}
|
|
68
|
-
</Section>
|
|
69
|
-
<Section>
|
|
70
|
-
<AboutButton
|
|
71
|
-
url={appInfo.repositoryUrl}
|
|
72
|
-
label="Get source code"
|
|
73
|
-
/>
|
|
74
|
-
</Section>
|
|
75
|
-
<Section>
|
|
76
|
-
<FactoryResetButton label="Restore defaults..." />
|
|
77
|
-
</Section>
|
|
78
|
-
<Section>
|
|
79
|
-
<ShortcutButton label="Show shortcuts" />
|
|
80
|
-
</Section>
|
|
81
|
-
</Card>
|
|
82
|
-
);
|
|
83
|
-
};
|
package/src/About/DeviceCard.tsx
DELETED
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (c) 2015 Nordic Semiconductor ASA
|
|
3
|
-
*
|
|
4
|
-
* SPDX-License-Identifier: LicenseRef-Nordic-4-Clause
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
import React from 'react';
|
|
8
|
-
import { useSelector } from 'react-redux';
|
|
9
|
-
|
|
10
|
-
import Card from '../Card/Card';
|
|
11
|
-
import {
|
|
12
|
-
buyOnlineUrl,
|
|
13
|
-
deviceInfo,
|
|
14
|
-
productPageUrl,
|
|
15
|
-
} from '../Device/deviceInfo/deviceInfo';
|
|
16
|
-
import { selectedDevice } from '../Device/deviceSlice';
|
|
17
|
-
import AboutButton from './AboutButton';
|
|
18
|
-
import Section from './Section';
|
|
19
|
-
|
|
20
|
-
const memorySize = (memoryInBytes: number) => {
|
|
21
|
-
if (memoryInBytes == null) {
|
|
22
|
-
return 'Unknown';
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
return `${memoryInBytes / 1024}KiB`;
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
export default () => {
|
|
29
|
-
const device = useSelector(selectedDevice);
|
|
30
|
-
|
|
31
|
-
if (device == null) {
|
|
32
|
-
return (
|
|
33
|
-
<Card title="Device">
|
|
34
|
-
<Section title="No device selected" />
|
|
35
|
-
</Card>
|
|
36
|
-
);
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
const pca = device.boardVersion;
|
|
40
|
-
const { name, cores } = deviceInfo(device);
|
|
41
|
-
|
|
42
|
-
return (
|
|
43
|
-
<Card title="Device">
|
|
44
|
-
<Section title="Name">{name || 'Unknown'}</Section>
|
|
45
|
-
<Section title="ID">{device.serialNumber}</Section>
|
|
46
|
-
<Section title="PCA">{pca || 'Unknown'}</Section>
|
|
47
|
-
<Section title="Cores">{cores || 'Unknown'}</Section>
|
|
48
|
-
|
|
49
|
-
{device.hwInfo && (
|
|
50
|
-
<>
|
|
51
|
-
<Section title="RAM">
|
|
52
|
-
{memorySize(device.hwInfo.ramSize)}
|
|
53
|
-
</Section>
|
|
54
|
-
<Section title="Flash">
|
|
55
|
-
{memorySize(device.hwInfo.romSize)}
|
|
56
|
-
</Section>
|
|
57
|
-
</>
|
|
58
|
-
)}
|
|
59
|
-
|
|
60
|
-
<Section>
|
|
61
|
-
<AboutButton
|
|
62
|
-
url={buyOnlineUrl(device)}
|
|
63
|
-
label="Find distributor"
|
|
64
|
-
/>
|
|
65
|
-
</Section>
|
|
66
|
-
<Section>
|
|
67
|
-
<AboutButton
|
|
68
|
-
url={productPageUrl(device)}
|
|
69
|
-
label="Go to product page"
|
|
70
|
-
/>
|
|
71
|
-
</Section>
|
|
72
|
-
</Card>
|
|
73
|
-
);
|
|
74
|
-
};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (c) 2021 Nordic Semiconductor ASA
|
|
3
|
-
*
|
|
4
|
-
* SPDX-License-Identifier: LicenseRef-Nordic-4-Clause
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
import React from 'react';
|
|
8
|
-
import { useSelector } from 'react-redux';
|
|
9
|
-
|
|
10
|
-
import Card from '../Card/Card';
|
|
11
|
-
import { documentationSections } from './documentationSlice';
|
|
12
|
-
|
|
13
|
-
export default () => {
|
|
14
|
-
const sections = useSelector(documentationSections);
|
|
15
|
-
if (sections.length === 0) return null;
|
|
16
|
-
|
|
17
|
-
return <Card title="Documentation">{sections}</Card>;
|
|
18
|
-
};
|