@nordicsemiconductor/pc-nrfconnect-shared 245.0.0 → 247.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 +12 -0
- package/dist/scripts/nordic-publish.js +11 -11
- package/dist/typings/scripts/check-app-properties.d.ts +1 -0
- package/dist/typings/scripts/check-app-properties.d.ts.map +1 -1
- package/dist/typings/scripts/check-app-properties.test.d.ts +2 -0
- package/dist/typings/scripts/check-app-properties.test.d.ts.map +1 -0
- package/package.json +1 -1
- package/release_notes.md +1 -34
- package/scripts/check-app-properties.test.ts +60 -0
- package/scripts/check-app-properties.ts +13 -11
- package/src/Card/Card.tsx +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"check-app-properties.d.ts","sourceRoot":"","sources":["../../../scripts/check-app-properties.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"check-app-properties.d.ts","sourceRoot":"","sources":["../../../scripts/check-app-properties.ts"],"names":[],"mappings":";AAmEA,eAAO,MAAM,YAAY,GAAI,MAAM,MAAM,EAAE,MAAM,MAAM,YAUtD,CAAC;AAuGF,QAAA,MAAM,SAAS,GAAI,oCAEhB;IACC,6BAA6B,EAAE,OAAO,CAAC;CAC1C,SAKA,CAAC;AAOF,eAAe,SAAS,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"check-app-properties.test.d.ts","sourceRoot":"","sources":["../../../scripts/check-app-properties.test.ts"],"names":[],"mappings":""}
|
package/package.json
CHANGED
package/release_notes.md
CHANGED
|
@@ -1,36 +1,3 @@
|
|
|
1
|
-
### Added
|
|
2
|
-
|
|
3
|
-
- Added proto-slot components `Card.Header`, `Card.Header.Title`, `Card.Body`.
|
|
4
|
-
- Added support for `className` and `ref` on `Card` and its proto-slot
|
|
5
|
-
components.
|
|
6
|
-
- Added support for `cardTitleClassName` and `cardSubtitleClassName` on
|
|
7
|
-
`Card.Header.Title`
|
|
8
|
-
- nRF54LS05 to the list of the known devices.
|
|
9
|
-
|
|
10
1
|
### Changed
|
|
11
2
|
|
|
12
|
-
-
|
|
13
|
-
height with usual spacing units instead of screen sizes.
|
|
14
|
-
- Refactored `Card` component to remove dependency on bootstrap and to allow for
|
|
15
|
-
more flexibility.
|
|
16
|
-
|
|
17
|
-
### Steps to upgrade when using this package
|
|
18
|
-
|
|
19
|
-
#### Migrating the `Card` component
|
|
20
|
-
|
|
21
|
-
The `title` and `titleButton` are no longer available on `Card`, and the overall
|
|
22
|
-
structure of `Card` changed. Follow this format:
|
|
23
|
-
|
|
24
|
-
```tsx
|
|
25
|
-
import { Card } from '@nordicsemiconductor/pc-nrfconnect-shared';
|
|
26
|
-
|
|
27
|
-
<Card>
|
|
28
|
-
<Card.Header className="tw-flex tw-flex-row tw-justify-between">
|
|
29
|
-
<Card.Header.Title cardTitle="your title here" />
|
|
30
|
-
{ /* your button here */ }
|
|
31
|
-
</Card.Header>
|
|
32
|
-
<Card.Body>
|
|
33
|
-
{ /* your card content here */ }
|
|
34
|
-
</Card.Body>
|
|
35
|
-
</Card>
|
|
36
|
-
```
|
|
3
|
+
- In the repo URL check, ignore the hostname for ssh git URLs.
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2026 Nordic Semiconductor ASA
|
|
3
|
+
*
|
|
4
|
+
* SPDX-License-Identifier: LicenseRef-Nordic-4-Clause
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import { sameRepoURLs } from './check-app-properties';
|
|
8
|
+
|
|
9
|
+
describe('sameRepoURLs', () => {
|
|
10
|
+
it('accepts equal URLs', () => {
|
|
11
|
+
expect(
|
|
12
|
+
sameRepoURLs(
|
|
13
|
+
'https://github.com/nordicsemi/pc-nrfconnect-ppk',
|
|
14
|
+
'https://github.com/nordicsemi/pc-nrfconnect-ppk',
|
|
15
|
+
),
|
|
16
|
+
).toBe(true);
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
it('rejects different URLs', () => {
|
|
20
|
+
expect(
|
|
21
|
+
sameRepoURLs(
|
|
22
|
+
'https://github.com/nordicsemi/pc-nrfconnect-ppk',
|
|
23
|
+
'https://github.com/nordicsemi/pc-nrfconnect-shared',
|
|
24
|
+
),
|
|
25
|
+
).toBe(false);
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
it('ignores a .git postfix on either URL', () => {
|
|
29
|
+
expect(
|
|
30
|
+
sameRepoURLs(
|
|
31
|
+
'https://github.com/nordicsemi/pc-nrfconnect-ppk.git',
|
|
32
|
+
'https://github.com/nordicsemi/pc-nrfconnect-ppk',
|
|
33
|
+
),
|
|
34
|
+
).toBe(true);
|
|
35
|
+
expect(
|
|
36
|
+
sameRepoURLs(
|
|
37
|
+
'https://github.com/nordicsemi/pc-nrfconnect-ppk',
|
|
38
|
+
'https://github.com/nordicsemi/pc-nrfconnect-ppk.git',
|
|
39
|
+
),
|
|
40
|
+
).toBe(true);
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
it('treats the protocol https and git as the same', () => {
|
|
44
|
+
expect(
|
|
45
|
+
sameRepoURLs(
|
|
46
|
+
'https://github.com/nordicsemi/pc-nrfconnect-ppk',
|
|
47
|
+
'git@github.com:nordicsemi/pc-nrfconnect-ppk.git',
|
|
48
|
+
),
|
|
49
|
+
).toBe(true);
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
it('ignores the host name for the git protocol', () => {
|
|
53
|
+
expect(
|
|
54
|
+
sameRepoURLs(
|
|
55
|
+
'https://github.com/nordicsemi/pc-nrfconnect-ppk',
|
|
56
|
+
'git@nordic-git:nordicsemi/pc-nrfconnect-ppk.git',
|
|
57
|
+
),
|
|
58
|
+
).toBe(true);
|
|
59
|
+
});
|
|
60
|
+
});
|
|
@@ -65,6 +65,18 @@ const mustContainOneOf = (
|
|
|
65
65
|
}
|
|
66
66
|
};
|
|
67
67
|
|
|
68
|
+
export const sameRepoURLs = (url1: string, url2: string) => {
|
|
69
|
+
const withoutPostfix = (gitUrl: string) => gitUrl.replace(/\.git$/, '');
|
|
70
|
+
|
|
71
|
+
const withoutProtocol = (gitUrl: string) =>
|
|
72
|
+
gitUrl.replace(/^git@[^:]+:/, 'github.com/').replace(/^https:\/\//, '');
|
|
73
|
+
|
|
74
|
+
const stripped = (gitUrl: string) =>
|
|
75
|
+
withoutProtocol(withoutPostfix(gitUrl));
|
|
76
|
+
|
|
77
|
+
return stripped(url1) === stripped(url2);
|
|
78
|
+
};
|
|
79
|
+
|
|
68
80
|
const checkRepoUrl = (packageJson: PackageJsonApp) => {
|
|
69
81
|
if (!existsSync('./.git')) {
|
|
70
82
|
return;
|
|
@@ -75,17 +87,7 @@ const checkRepoUrl = (packageJson: PackageJsonApp) => {
|
|
|
75
87
|
}).trimEnd();
|
|
76
88
|
const declaredGitUrl = packageJson.repository?.url;
|
|
77
89
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
const withoutProtocol = (gitUrl?: string) =>
|
|
81
|
-
gitUrl
|
|
82
|
-
?.replace(/^git@github\.com:/, 'github.com/')
|
|
83
|
-
.replace(/^https:\/\//, '');
|
|
84
|
-
|
|
85
|
-
const stripped = (gitUrl?: string) =>
|
|
86
|
-
withoutProtocol(withoutPostfix(gitUrl));
|
|
87
|
-
|
|
88
|
-
if (stripped(realGitUrl) !== stripped(declaredGitUrl)) {
|
|
90
|
+
if (declaredGitUrl == null || !sameRepoURLs(realGitUrl, declaredGitUrl)) {
|
|
89
91
|
fail(
|
|
90
92
|
`package.json says the repository is located at \`${declaredGitUrl}\` but \`git remote get-url origin\` says it is at \`${realGitUrl}\`.`,
|
|
91
93
|
);
|
package/src/Card/Card.tsx
CHANGED
|
@@ -60,7 +60,7 @@ interface CardHeaderComponent extends React.FC<CardHeaderProps> {
|
|
|
60
60
|
const CardHeader: CardHeaderComponent = ({ children, className, ...attrs }) => (
|
|
61
61
|
<header
|
|
62
62
|
className={classNames(
|
|
63
|
-
`tw-border-b tw-border-solid tw-border-b-black tw-border-opacity-10 tw-
|
|
63
|
+
`tw-border-b tw-border-solid tw-border-b-black tw-border-opacity-10 tw-pb-3 tw-pt-5`,
|
|
64
64
|
className,
|
|
65
65
|
)}
|
|
66
66
|
{...attrs}
|
|
@@ -98,7 +98,7 @@ interface CardComponent extends React.FC<CardProps> {
|
|
|
98
98
|
const Card: CardComponent = ({ children, className, ...attrs }) => (
|
|
99
99
|
<article
|
|
100
100
|
className={classNames(
|
|
101
|
-
`tw-preflight tw-relative tw-flex tw-flex-col tw-gap-
|
|
101
|
+
`tw-preflight tw-relative tw-flex tw-flex-col tw-gap-3.5 tw-break-words tw-border tw-border-solid tw-border-black tw-border-opacity-10 tw-bg-white tw-px-4 tw-pb-4`,
|
|
102
102
|
className,
|
|
103
103
|
)}
|
|
104
104
|
{...attrs}
|