@nordicsemiconductor/pc-nrfconnect-shared 194.0.0 → 196.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.
Files changed (39) hide show
  1. package/Changelog.md +15 -0
  2. package/ipc/MetaFiles.ts +8 -6
  3. package/ipc/schema/packageJson.ts +3 -4
  4. package/ipc/schema/parseJson.ts +2 -2
  5. package/main/index.ts +2 -0
  6. package/package.json +1 -1
  7. package/scripts/nordic-publish.js +10 -10
  8. package/src/Device/DeviceSelector/DeviceList/DeviceList.tsx +66 -41
  9. package/src/Device/DeviceSelector/DeviceList/VirtualDevices.tsx +93 -0
  10. package/src/Device/DeviceSelector/DeviceList/device-list.scss +29 -24
  11. package/src/Device/DeviceSelector/DeviceSelector.tsx +54 -4
  12. package/src/Device/DeviceSelector/DisconnectDevice.tsx +20 -0
  13. package/src/Device/DeviceSelector/SelectedDevice.tsx +1 -13
  14. package/src/Device/DeviceSelector/SelectedVirtualDevice.tsx +40 -0
  15. package/src/Device/deviceSlice.ts +14 -0
  16. package/src/Link/ExternalLink.tsx +1 -1
  17. package/typings/generated/ipc/MetaFiles.d.ts +12 -4
  18. package/typings/generated/ipc/MetaFiles.d.ts.map +1 -1
  19. package/typings/generated/ipc/schema/packageJson.d.ts.map +1 -1
  20. package/typings/generated/ipc/schema/parseJson.d.ts +1 -1
  21. package/typings/generated/ipc/schema/parseJson.d.ts.map +1 -1
  22. package/typings/generated/main/index.d.ts +1 -1
  23. package/typings/generated/main/index.d.ts.map +1 -1
  24. package/typings/generated/src/Device/DeviceSelector/DeviceList/DeviceList.d.ts +2 -0
  25. package/typings/generated/src/Device/DeviceSelector/DeviceList/DeviceList.d.ts.map +1 -1
  26. package/typings/generated/src/Device/DeviceSelector/DeviceList/VirtualDevices.d.ts +14 -0
  27. package/typings/generated/src/Device/DeviceSelector/DeviceList/VirtualDevices.d.ts.map +1 -0
  28. package/typings/generated/src/Device/DeviceSelector/DeviceSelector.d.ts +4 -1
  29. package/typings/generated/src/Device/DeviceSelector/DeviceSelector.d.ts.map +1 -1
  30. package/typings/generated/src/Device/DeviceSelector/DisconnectDevice.d.ts +7 -0
  31. package/typings/generated/src/Device/DeviceSelector/DisconnectDevice.d.ts.map +1 -0
  32. package/typings/generated/src/Device/DeviceSelector/SelectedDevice.d.ts.map +1 -1
  33. package/typings/generated/src/Device/DeviceSelector/SelectedVirtualDevice.d.ts +9 -0
  34. package/typings/generated/src/Device/DeviceSelector/SelectedVirtualDevice.d.ts.map +1 -0
  35. package/typings/generated/src/Device/deviceSlice.d.ts +3 -1
  36. package/typings/generated/src/Device/deviceSlice.d.ts.map +1 -1
  37. package/typings/generated/src/Group/Group.d.ts +1 -1
  38. package/typings/generated/src/Link/ExternalLink.d.ts +2 -2
  39. package/typings/generated/src/Link/ExternalLink.d.ts.map +1 -1
package/Changelog.md CHANGED
@@ -7,6 +7,21 @@ This project does _not_ adhere to
7
7
  [Semantic Versioning](https://semver.org/spec/v2.0.0.html) but contrary to it
8
8
  every new version is a new major version.
9
9
 
10
+ ## 196.0.0 - 2025-01-13
11
+
12
+ ### Changed
13
+
14
+ - `ExternalLink`: The `label` prop now defaults to the value of `href`.
15
+
16
+ ## 195.0.0 - 2025-01-09
17
+
18
+ ### Added
19
+
20
+ - `virtualDevices` parameter to `DeviceSelector`.
21
+ - `onVirtualDeviceSelected` and `onVirtualDeviceDeselected` parameters to
22
+ `DeviceSelector`.
23
+ - Exported zod schemas for `source.json` and `withdrawn.json` files.
24
+
10
25
  ## 194.0.0 - 2024-12-17
11
26
 
12
27
  ### Fixed
package/ipc/MetaFiles.ts CHANGED
@@ -8,12 +8,14 @@ import { z } from 'zod';
8
8
 
9
9
  export type UrlString = string;
10
10
 
11
- export interface SourceJson {
12
- name: string;
13
- apps: UrlString[];
14
- }
15
-
16
- export type WithdrawnJson = UrlString[];
11
+ export const sourceJsonSchema = z.object({
12
+ name: z.string(),
13
+ apps: z.array(z.string().url()),
14
+ });
15
+ export type SourceJson = z.infer<typeof sourceJsonSchema>;
16
+
17
+ export const withdrawnJsonSchema = z.array(z.string().url());
18
+ export type WithdrawnJson = z.infer<typeof withdrawnJsonSchema>;
17
19
 
18
20
  export type AppVersions = {
19
21
  [version: string]: AppVersion;
@@ -19,8 +19,7 @@ const packageJson = z.object({
19
19
 
20
20
  export type PackageJson = z.infer<typeof packageJson>;
21
21
 
22
- export const parsePackageJson =
23
- parseWithPrettifiedErrorMessage<PackageJson>(packageJson);
22
+ export const parsePackageJson = parseWithPrettifiedErrorMessage(packageJson);
24
23
 
25
24
  // Apps have more required fields in their package.json
26
25
 
@@ -57,7 +56,7 @@ const packageJsonApp = packageJson.extend({
57
56
  export type PackageJsonApp = z.infer<typeof packageJsonApp>;
58
57
 
59
58
  export const parsePackageJsonApp =
60
- parseWithPrettifiedErrorMessage<PackageJsonApp>(packageJsonApp);
59
+ parseWithPrettifiedErrorMessage(packageJsonApp);
61
60
 
62
61
  // In the launcher we want to handle that the whole nrfConnectForDesktop may be missing
63
62
  // and the html in it can also be undefined, so there we need to use this legacy variant
@@ -71,4 +70,4 @@ const packageJsonLegacyApp = packageJsonApp.extend({
71
70
  export type PackageJsonLegacyApp = z.infer<typeof packageJsonLegacyApp>;
72
71
 
73
72
  export const parsePackageJsonLegacyApp =
74
- parseWithPrettifiedErrorMessage<PackageJsonLegacyApp>(packageJsonLegacyApp);
73
+ parseWithPrettifiedErrorMessage(packageJsonLegacyApp);
@@ -8,12 +8,12 @@ import { z } from 'zod';
8
8
  import { fromZodError } from 'zod-validation-error';
9
9
 
10
10
  export const parseWithPrettifiedErrorMessage =
11
- <Out, T extends z.ZodType<Out> = z.ZodTypeAny>(schema: T) =>
11
+ <T extends z.ZodTypeAny>(schema: T) =>
12
12
  (content: string) => {
13
13
  const result = schema.safeParse(JSON.parse(content));
14
14
 
15
15
  if (result.success) {
16
- return result;
16
+ return result as z.SafeParseSuccess<z.infer<T>>;
17
17
  }
18
18
 
19
19
  return {
package/main/index.ts CHANGED
@@ -34,6 +34,8 @@ export const serialPort = {
34
34
  };
35
35
 
36
36
  export {
37
+ sourceJsonSchema,
38
+ withdrawnJsonSchema,
37
39
  type AppInfo,
38
40
  type NrfutilModuleName,
39
41
  type NrfutilModules,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nordicsemiconductor/pc-nrfconnect-shared",
3
- "version": "194.0.0",
3
+ "version": "196.0.0",
4
4
  "description": "Shared commodities for developing pc-nrfconnect-* packages",
5
5
  "repository": {
6
6
  "type": "git",