@nordicsemiconductor/pc-nrfconnect-shared 89.0.0 → 91.0.0
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/Changelog.md +54 -0
- package/config/jest.config.js +0 -1
- package/config/tsconfig.json +1 -1
- package/coverage/cobertura-coverage.xml +2166 -1086
- package/ipc/MetaFiles.ts +26 -8
- package/nrfutil/device/__mocks__/device.ts +43 -0
- package/nrfutil/device/batch.ts +219 -0
- package/nrfutil/device/batchTypes.ts +133 -0
- package/nrfutil/device/common.ts +274 -0
- package/nrfutil/device/device.ts +62 -0
- package/nrfutil/device/erase.ts +26 -0
- package/nrfutil/device/eraseBatch.ts +28 -0
- package/nrfutil/device/firmwareRead.ts +34 -0
- package/nrfutil/device/firmwareReadBatch.ts +42 -0
- package/nrfutil/device/getCoreInfo.ts +44 -0
- package/nrfutil/device/getCoreInfoBatch.ts +29 -0
- package/nrfutil/device/getFwInfo.ts +69 -0
- package/nrfutil/device/getFwInfoBatch.ts +29 -0
- package/nrfutil/device/getProtectionStatus.ts +46 -0
- package/nrfutil/device/getProtectionStatusBatch.ts +32 -0
- package/nrfutil/device/list.ts +81 -0
- package/nrfutil/device/program.ts +186 -0
- package/nrfutil/device/programBatch.ts +69 -0
- package/nrfutil/device/recover.ts +26 -0
- package/nrfutil/device/recoverBatch.ts +28 -0
- package/nrfutil/device/reset.ts +41 -0
- package/nrfutil/device/resetBatch.ts +30 -0
- package/nrfutil/device/setMcuState.ts +27 -0
- package/nrfutil/device/setProtectionStatus.ts +27 -0
- package/nrfutil/index.ts +25 -0
- package/nrfutil/moduleVersion.ts +57 -0
- package/nrfutil/nrfutilLogger.ts +15 -0
- package/nrfutil/sandbox.ts +504 -0
- package/nrfutil/sandboxTypes.ts +178 -0
- package/package.json +1 -4
- package/scripts/check-app-properties.ts +49 -22
- package/scripts/esbuild-renderer.js +0 -1
- package/scripts/nordic-publish.js +6 -6
- package/scripts/nordic-publish.ts +11 -2
- package/src/About/SupportCard.tsx +6 -9
- package/src/App/App.test.tsx +4 -0
- package/src/App/App.tsx +13 -2
- package/src/Device/DeviceSelector/DeviceList/MoreDeviceInfo.tsx +1 -1
- package/src/Device/DeviceSelector/DeviceSelector.test.tsx +39 -31
- package/src/Device/DeviceSelector/DeviceSelector.tsx +3 -12
- package/src/Device/deviceInfo/deviceInfo.ts +2 -3
- package/src/Device/deviceLister.test.ts +1 -2
- package/src/Device/deviceLister.ts +169 -215
- package/src/Device/deviceSlice.ts +2 -16
- package/src/Device/jprogOperations.ts +21 -69
- package/src/Device/sdfuOperations.ts +77 -93
- package/src/ErrorBoundary/ErrorBoundary.tsx +1 -1
- package/src/Log/LogViewer.tsx +0 -4
- package/src/Log/logSlice.ts +4 -7
- package/src/index.ts +0 -1
- package/src/logging/sendInitialLogMessages.ts +7 -8
- package/src/utils/appDirs.ts +6 -11
- package/src/utils/logLibVersions.ts +12 -14
- package/src/utils/packageJson.ts +11 -1
- package/src/utils/systemReport.ts +11 -17
- package/src/utils/usageData.ts +14 -9
- package/tsconfig.json +1 -0
- package/typings/generated/ipc/MetaFiles.d.ts +21 -8
- package/typings/generated/ipc/MetaFiles.d.ts.map +1 -1
- package/typings/generated/nrfutil/device/__mocks__/device.d.ts +23 -0
- package/typings/generated/nrfutil/device/__mocks__/device.d.ts.map +1 -0
- package/typings/generated/nrfutil/device/batch.d.ts +26 -0
- package/typings/generated/nrfutil/device/batch.d.ts.map +1 -0
- package/typings/generated/nrfutil/device/batchTypes.d.ts +78 -0
- package/typings/generated/nrfutil/device/batchTypes.d.ts.map +1 -0
- package/typings/generated/nrfutil/device/common.d.ts +125 -0
- package/typings/generated/nrfutil/device/common.d.ts.map +1 -0
- package/typings/generated/nrfutil/device/device.d.ts +30 -0
- package/typings/generated/nrfutil/device/device.d.ts.map +1 -0
- package/typings/generated/nrfutil/device/erase.d.ts +5 -0
- package/typings/generated/nrfutil/device/erase.d.ts.map +1 -0
- package/typings/generated/nrfutil/device/eraseBatch.d.ts +7 -0
- package/typings/generated/nrfutil/device/eraseBatch.d.ts.map +1 -0
- package/typings/generated/nrfutil/device/firmwareRead.d.ts +10 -0
- package/typings/generated/nrfutil/device/firmwareRead.d.ts.map +1 -0
- package/typings/generated/nrfutil/device/firmwareReadBatch.d.ts +9 -0
- package/typings/generated/nrfutil/device/firmwareReadBatch.d.ts.map +1 -0
- package/typings/generated/nrfutil/device/getCoreInfo.d.ts +22 -0
- package/typings/generated/nrfutil/device/getCoreInfo.d.ts.map +1 -0
- package/typings/generated/nrfutil/device/getCoreInfoBatch.d.ts +8 -0
- package/typings/generated/nrfutil/device/getCoreInfoBatch.d.ts.map +1 -0
- package/typings/generated/nrfutil/device/getFwInfo.d.ts +31 -0
- package/typings/generated/nrfutil/device/getFwInfo.d.ts.map +1 -0
- package/typings/generated/nrfutil/device/getFwInfoBatch.d.ts +8 -0
- package/typings/generated/nrfutil/device/getFwInfoBatch.d.ts.map +1 -0
- package/typings/generated/nrfutil/device/getProtectionStatus.d.ts +13 -0
- package/typings/generated/nrfutil/device/getProtectionStatus.d.ts.map +1 -0
- package/typings/generated/nrfutil/device/getProtectionStatusBatch.d.ts +8 -0
- package/typings/generated/nrfutil/device/getProtectionStatusBatch.d.ts.map +1 -0
- package/typings/generated/nrfutil/device/list.d.ts +19 -0
- package/typings/generated/nrfutil/device/list.d.ts.map +1 -0
- package/typings/generated/nrfutil/device/program.d.ts +27 -0
- package/typings/generated/nrfutil/device/program.d.ts.map +1 -0
- package/typings/generated/nrfutil/device/programBatch.d.ts +9 -0
- package/typings/generated/nrfutil/device/programBatch.d.ts.map +1 -0
- package/typings/generated/nrfutil/device/recover.d.ts +5 -0
- package/typings/generated/nrfutil/device/recover.d.ts.map +1 -0
- package/typings/generated/nrfutil/device/recoverBatch.d.ts +7 -0
- package/typings/generated/nrfutil/device/recoverBatch.d.ts.map +1 -0
- package/typings/generated/nrfutil/device/reset.d.ts +5 -0
- package/typings/generated/nrfutil/device/reset.d.ts.map +1 -0
- package/typings/generated/nrfutil/device/resetBatch.d.ts +8 -0
- package/typings/generated/nrfutil/device/resetBatch.d.ts.map +1 -0
- package/typings/generated/nrfutil/device/setMcuState.d.ts +6 -0
- package/typings/generated/nrfutil/device/setMcuState.d.ts.map +1 -0
- package/typings/generated/nrfutil/device/setProtectionStatus.d.ts +5 -0
- package/typings/generated/nrfutil/device/setProtectionStatus.d.ts.map +1 -0
- package/typings/generated/nrfutil/index.d.ts +11 -0
- package/typings/generated/nrfutil/index.d.ts.map +1 -0
- package/typings/generated/nrfutil/moduleVersion.d.ts +6 -0
- package/typings/generated/nrfutil/moduleVersion.d.ts.map +1 -0
- package/typings/generated/nrfutil/nrfutilLogger.d.ts +4 -0
- package/typings/generated/nrfutil/nrfutilLogger.d.ts.map +1 -0
- package/typings/generated/nrfutil/sandbox.d.ts +36 -0
- package/typings/generated/nrfutil/sandbox.d.ts.map +1 -0
- package/typings/generated/nrfutil/sandboxTypes.d.ts +135 -0
- package/typings/generated/nrfutil/sandboxTypes.d.ts.map +1 -0
- package/typings/generated/src/About/SupportCard.d.ts.map +1 -1
- package/typings/generated/src/App/App.d.ts.map +1 -1
- package/typings/generated/src/Device/DeviceSelector/DeviceSelector.d.ts +2 -6
- package/typings/generated/src/Device/DeviceSelector/DeviceSelector.d.ts.map +1 -1
- package/typings/generated/src/Device/deviceInfo/deviceInfo.d.ts +2 -2
- package/typings/generated/src/Device/deviceInfo/deviceInfo.d.ts.map +1 -1
- package/typings/generated/src/Device/deviceLister.d.ts +11 -16
- package/typings/generated/src/Device/deviceLister.d.ts.map +1 -1
- package/typings/generated/src/Device/deviceLister.test.d.ts.map +1 -1
- package/typings/generated/src/Device/deviceSlice.d.ts +3 -3
- package/typings/generated/src/Device/deviceSlice.d.ts.map +1 -1
- package/typings/generated/src/Device/jprogOperations.d.ts.map +1 -1
- package/typings/generated/src/Device/sdfuOperations.d.ts.map +1 -1
- package/typings/generated/src/ErrorBoundary/ErrorBoundary.d.ts +1 -1
- package/typings/generated/src/ErrorBoundary/ErrorBoundary.d.ts.map +1 -1
- package/typings/generated/src/Log/LogViewer.d.ts.map +1 -1
- package/typings/generated/src/Log/logSlice.d.ts +2 -3
- package/typings/generated/src/Log/logSlice.d.ts.map +1 -1
- package/typings/generated/src/index.d.ts +0 -1
- package/typings/generated/src/index.d.ts.map +1 -1
- package/typings/generated/src/logging/sendInitialLogMessages.d.ts.map +1 -1
- package/typings/generated/src/utils/appDirs.d.ts +4 -4
- package/typings/generated/src/utils/appDirs.d.ts.map +1 -1
- package/typings/generated/src/utils/logLibVersions.d.ts.map +1 -1
- package/typings/generated/src/utils/packageJson.d.ts.map +1 -1
- package/typings/generated/src/utils/systemReport.d.ts +1 -1
- package/typings/generated/src/utils/systemReport.d.ts.map +1 -1
- package/typings/generated/src/utils/usageData.d.ts +2 -0
- package/typings/generated/src/utils/usageData.d.ts.map +1 -1
- package/mocks/deviceLibMock.ts +0 -21
- package/src/Device/deviceLibWrapper.test.ts +0 -97
- package/src/Device/deviceLibWrapper.ts +0 -132
- package/src/utils/describeVersion.ts +0 -21
- package/typings/generated/src/Device/deviceLibWrapper.d.ts +0 -9
- package/typings/generated/src/Device/deviceLibWrapper.d.ts.map +0 -1
- package/typings/generated/src/Device/deviceLibWrapper.test.d.ts +0 -2
- package/typings/generated/src/Device/deviceLibWrapper.test.d.ts.map +0 -1
- package/typings/generated/src/utils/describeVersion.d.ts +0 -4
- package/typings/generated/src/utils/describeVersion.d.ts.map +0 -1
|
@@ -80,6 +80,51 @@ const checkMandatoryProperties = (packageJson: PackageJson) => {
|
|
|
80
80
|
);
|
|
81
81
|
};
|
|
82
82
|
|
|
83
|
+
const checkNrfutilProperties = (packageJson: PackageJson) => {
|
|
84
|
+
const nrfutilModules = packageJson.nrfConnectForDesktop?.nrfutil;
|
|
85
|
+
if (nrfutilModules != null) {
|
|
86
|
+
Object.entries(nrfutilModules).forEach(
|
|
87
|
+
([moduleName, moduleVersions]) => {
|
|
88
|
+
if (
|
|
89
|
+
!Array.isArray(moduleVersions) ||
|
|
90
|
+
moduleVersions.length === 0
|
|
91
|
+
) {
|
|
92
|
+
fail(
|
|
93
|
+
`For each module in \`nrfConnectForDesktop.nrfutil\` in package.json at least one version must be specified, but for \`${moduleName}\` none was specified.`
|
|
94
|
+
);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
);
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
const checkRepoUrl = (packageJson: PackageJson) => {
|
|
102
|
+
if (!existsSync('./.git')) {
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
const realGitUrl = execSync('git remote get-url origin', {
|
|
107
|
+
encoding: 'utf-8',
|
|
108
|
+
}).trimEnd();
|
|
109
|
+
const declaredGitUrl = packageJson.repository?.url;
|
|
110
|
+
|
|
111
|
+
const withoutPostfix = (gitUrl?: string) => gitUrl?.replace(/\.git$/, '');
|
|
112
|
+
|
|
113
|
+
const withoutProtocol = (gitUrl?: string) =>
|
|
114
|
+
gitUrl
|
|
115
|
+
?.replace(/^git@github\.com:/, 'github.com/')
|
|
116
|
+
.replace(/^https:\/\//, '');
|
|
117
|
+
|
|
118
|
+
const stripped = (gitUrl?: string) =>
|
|
119
|
+
withoutProtocol(withoutPostfix(gitUrl));
|
|
120
|
+
|
|
121
|
+
if (stripped(realGitUrl) !== stripped(declaredGitUrl)) {
|
|
122
|
+
fail(
|
|
123
|
+
`package.json says the repository is located at \`${declaredGitUrl}\` but \`git remote get-url origin\` says it is at \`${realGitUrl}\`.`
|
|
124
|
+
);
|
|
125
|
+
}
|
|
126
|
+
};
|
|
127
|
+
|
|
83
128
|
const checkOptionalProperties = (packageJson: PackageJson) => {
|
|
84
129
|
if (propertyIsMissing(packageJson)('homepage')) {
|
|
85
130
|
warn('Please provide a property `homepage` in package.json.');
|
|
@@ -89,32 +134,14 @@ const checkOptionalProperties = (packageJson: PackageJson) => {
|
|
|
89
134
|
warn(
|
|
90
135
|
'Please provide a property `nrfConnectForDesktop.html` in package.json'
|
|
91
136
|
);
|
|
137
|
+
} else {
|
|
138
|
+
checkNrfutilProperties(packageJson);
|
|
92
139
|
}
|
|
93
140
|
|
|
94
141
|
if (propertyIsMissing(packageJson)('repository.url')) {
|
|
95
142
|
warn('Please provide a property `repository.url` in package.json.');
|
|
96
|
-
} else
|
|
97
|
-
|
|
98
|
-
encoding: 'utf-8',
|
|
99
|
-
}).trimEnd();
|
|
100
|
-
const declaredGitUrl = packageJson.repository?.url;
|
|
101
|
-
|
|
102
|
-
const withoutPostfix = (gitUrl?: string) =>
|
|
103
|
-
gitUrl?.replace(/\.git$/, '');
|
|
104
|
-
|
|
105
|
-
const withoutProtocol = (gitUrl?: string) =>
|
|
106
|
-
gitUrl
|
|
107
|
-
?.replace(/^git@github\.com:/, 'github.com/')
|
|
108
|
-
.replace(/^https:\/\//, '');
|
|
109
|
-
|
|
110
|
-
const stripped = (gitUrl?: string) =>
|
|
111
|
-
withoutProtocol(withoutPostfix(gitUrl));
|
|
112
|
-
|
|
113
|
-
if (stripped(realGitUrl) !== stripped(declaredGitUrl)) {
|
|
114
|
-
fail(
|
|
115
|
-
`package.json says the repository is located at \`${declaredGitUrl}\` but \`git remote get-url origin\` says it is at \`${realGitUrl}\`.`
|
|
116
|
-
);
|
|
117
|
-
}
|
|
143
|
+
} else {
|
|
144
|
+
checkRepoUrl(packageJson);
|
|
118
145
|
}
|
|
119
146
|
};
|
|
120
147
|
|