@nordicsemiconductor/pc-nrfconnect-shared 218.0.0 → 220.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 +17 -0
- package/README.md +28 -0
- package/config/tsconfig.json +0 -2
- package/dist/bootstrap.css +1 -1
- package/nrfutil/sandbox.ts +2 -2
- package/package.json +11 -12
- package/release_notes.md +8 -0
- package/scripts/check-app-properties.ts +4 -10
- package/scripts/check-for-typescript.ts +1 -1
- package/scripts/create-source.ts +1 -1
- package/scripts/esbuild.ts +1 -1
- package/scripts/get-release-numbers.ts +25 -0
- package/scripts/installHusky.ts +1 -1
- package/scripts/is-releasable.ts +68 -0
- package/scripts/latest-changelog-entry.test.ts +80 -0
- package/scripts/latest-changelog-entry.ts +25 -0
- package/scripts/nordic-publish.js +20 -19
- package/scripts/nordic-publish.ts +1 -1
- package/scripts/nrfconnect-license.ts +1 -1
- package/scripts/postinstall.ts +1 -1
- package/scripts/prepare-shared-release.ts +10 -8
- package/src/Group/Group.tsx +28 -2
- package/src/index.ts +2 -0
- package/src/utils/persistentStore.ts +17 -0
- package/typings/generated/nrfutil/sandbox.d.ts.map +1 -1
- package/typings/generated/scripts/check-app-properties.d.ts +1 -1
- package/typings/generated/scripts/check-app-properties.d.ts.map +1 -1
- package/typings/generated/scripts/check-for-typescript.d.ts +1 -1
- package/typings/generated/scripts/create-source.d.ts +1 -1
- package/typings/generated/scripts/esbuild.d.ts +1 -1
- package/typings/generated/scripts/get-release-numbers.d.ts +6 -0
- package/typings/generated/scripts/get-release-numbers.d.ts.map +1 -0
- package/typings/generated/scripts/installHusky.d.ts +1 -1
- package/typings/generated/scripts/is-releasable.d.ts +3 -0
- package/typings/generated/scripts/is-releasable.d.ts.map +1 -0
- package/typings/generated/scripts/latest-changelog-entry.d.ts +6 -0
- package/typings/generated/scripts/latest-changelog-entry.d.ts.map +1 -0
- package/typings/generated/scripts/latest-changelog-entry.test.d.ts +2 -0
- package/typings/generated/scripts/latest-changelog-entry.test.d.ts.map +1 -0
- package/typings/generated/scripts/nordic-publish.d.ts +1 -1
- package/typings/generated/scripts/nrfconnect-license.d.ts +1 -1
- package/typings/generated/scripts/postinstall.d.ts +1 -1
- package/typings/generated/scripts/prepare-shared-release.d.ts +1 -1
- package/typings/generated/src/Group/Group.d.ts +3 -1
- package/typings/generated/src/Group/Group.d.ts.map +1 -1
- package/typings/generated/src/index.d.ts +1 -1
- package/typings/generated/src/index.d.ts.map +1 -1
- package/typings/generated/src/utils/persistentStore.d.ts +3 -0
- package/typings/generated/src/utils/persistentStore.d.ts.map +1 -1
- package/scripts/release-shared.test.ts +0 -132
- package/scripts/release-shared.ts +0 -213
- package/typings/generated/scripts/release-shared.d.ts +0 -30
- package/typings/generated/scripts/release-shared.d.ts.map +0 -1
- package/typings/generated/scripts/release-shared.test.d.ts +0 -2
- package/typings/generated/scripts/release-shared.test.d.ts.map +0 -1
package/Changelog.md
CHANGED
|
@@ -7,6 +7,23 @@ 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
|
+
## 220.0.0 - 2025-07-16
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- Option to persist the Group collapse state.
|
|
15
|
+
|
|
16
|
+
### Changed
|
|
17
|
+
|
|
18
|
+
- Use `tsx` instead of `ts-node`.
|
|
19
|
+
- Switched releasing shared from Azure to GitHub Actions.
|
|
20
|
+
|
|
21
|
+
## 219.0.0 - 2025-07-10
|
|
22
|
+
|
|
23
|
+
### Fixed
|
|
24
|
+
|
|
25
|
+
- Error when verbose logging was turned on.
|
|
26
|
+
|
|
10
27
|
## 218.0.0 - 2025-07-08
|
|
11
28
|
|
|
12
29
|
### Fixed
|
package/README.md
CHANGED
|
@@ -9,3 +9,31 @@ apps and their launcher:
|
|
|
9
9
|
- Build scripts
|
|
10
10
|
- Configurations
|
|
11
11
|
- Test facilities
|
|
12
|
+
|
|
13
|
+
## Releasing
|
|
14
|
+
|
|
15
|
+
This project uses GitHub Actions for automated releases. To release a new
|
|
16
|
+
version:
|
|
17
|
+
|
|
18
|
+
### Prepare the release
|
|
19
|
+
|
|
20
|
+
- Update the version in `package.json`.
|
|
21
|
+
- Add a changelog entry in `Changelog.md` with the format:
|
|
22
|
+
`## X.0.0 - YYYY-MM-DD`.
|
|
23
|
+
- Commit and push your changes
|
|
24
|
+
|
|
25
|
+
### Create the release
|
|
26
|
+
|
|
27
|
+
- Go to the the
|
|
28
|
+
[Release shared](https://github.com/NordicSemiconductor/pc-nrfconnect-shared/actions/workflows/release-shared.yml)
|
|
29
|
+
action.
|
|
30
|
+
- Click "Run workflow".
|
|
31
|
+
- Optionally select a ref to release, but usually this should be `main` and
|
|
32
|
+
can be left empty.
|
|
33
|
+
|
|
34
|
+
The workflow will:
|
|
35
|
+
|
|
36
|
+
- Check if a release is possible.
|
|
37
|
+
- Build and test the package.
|
|
38
|
+
- Create a GitHub release.
|
|
39
|
+
- Publish to npm.
|
package/config/tsconfig.json
CHANGED
package/dist/bootstrap.css
CHANGED
package/nrfutil/sandbox.ts
CHANGED
|
@@ -140,9 +140,9 @@ export class NrfutilSandbox {
|
|
|
140
140
|
public isSandboxInstalled = () =>
|
|
141
141
|
this.executableExists() && this.commandReportsCorrectVersion();
|
|
142
142
|
|
|
143
|
-
private log(message: LogMessage, pid: number | undefined) {
|
|
143
|
+
private log = (message: LogMessage, pid: number | undefined) => {
|
|
144
144
|
this.onLoggingHandlers.forEach(onLogging => onLogging(message, pid));
|
|
145
|
-
}
|
|
145
|
+
};
|
|
146
146
|
|
|
147
147
|
private executableExists() {
|
|
148
148
|
return fs.existsSync(
|
package/package.json
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nordicsemiconductor/pc-nrfconnect-shared",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "220.0.0",
|
|
4
4
|
"description": "Shared commodities for developing pc-nrfconnect-* packages",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
|
-
"url": "https://github.com/NordicSemiconductor/pc-nrfconnect-shared.git"
|
|
7
|
+
"url": "git+https://github.com/NordicSemiconductor/pc-nrfconnect-shared.git"
|
|
8
8
|
},
|
|
9
9
|
"author": "Nordic Semiconductor ASA",
|
|
10
10
|
"license": "ISC",
|
|
11
11
|
"bin": {
|
|
12
|
-
"check-for-typescript": "
|
|
13
|
-
"check-app-properties": "
|
|
14
|
-
"nrfconnect-license": "
|
|
15
|
-
"run-esbuild": "
|
|
12
|
+
"check-for-typescript": "scripts/check-for-typescript.ts",
|
|
13
|
+
"check-app-properties": "scripts/check-app-properties.ts",
|
|
14
|
+
"nrfconnect-license": "scripts/nrfconnect-license.ts",
|
|
15
|
+
"run-esbuild": "scripts/esbuild.ts"
|
|
16
16
|
},
|
|
17
17
|
"main": "src",
|
|
18
18
|
"scripts": {
|
|
@@ -20,13 +20,12 @@
|
|
|
20
20
|
"check": "run-p --silent --continue-on-error --print-label check:*",
|
|
21
21
|
"check:lint": "eslint --color .",
|
|
22
22
|
"check:types": "tsc --noEmit",
|
|
23
|
-
"check:license": "
|
|
23
|
+
"check:license": "tsx scripts/nrfconnect-license.ts check",
|
|
24
24
|
"generate-types": "tsc --emitDeclarationOnly --declaration --declarationMap --outDir ./typings/generated --rootDir .",
|
|
25
|
-
"prepare": "
|
|
26
|
-
"
|
|
27
|
-
"prepare-shared-release": "ts-node scripts/prepare-shared-release.ts",
|
|
25
|
+
"prepare": "tsx scripts/installHusky.ts",
|
|
26
|
+
"prepare-shared-release": "tsx scripts/prepare-shared-release.ts",
|
|
28
27
|
"clean": "rimraf dist typings/generated scripts/nordic-publish.js",
|
|
29
|
-
"postinstall": "
|
|
28
|
+
"postinstall": "tsx scripts/postinstall.ts"
|
|
30
29
|
},
|
|
31
30
|
"dependencies": {
|
|
32
31
|
"@electron/remote": "^2.1.2",
|
|
@@ -117,7 +116,7 @@
|
|
|
117
116
|
"systeminformation": "^5.25.11",
|
|
118
117
|
"tailwindcss": "3.3.2",
|
|
119
118
|
"tree-kill-promise": "^3.0.14",
|
|
120
|
-
"
|
|
119
|
+
"tsx": "^4.20.3",
|
|
121
120
|
"typescript": "4.9.5",
|
|
122
121
|
"util": "0.12.5",
|
|
123
122
|
"uuid": "8.3.2",
|
package/release_notes.md
ADDED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#!/usr/bin/env
|
|
1
|
+
#!/usr/bin/env -S npx tsx
|
|
2
2
|
|
|
3
3
|
/*
|
|
4
4
|
* Copyright (c) 2022 Nordic Semiconductor ASA
|
|
@@ -11,6 +11,7 @@ import { existsSync, readdirSync, readFileSync } from 'fs';
|
|
|
11
11
|
import property from 'lodash/property';
|
|
12
12
|
|
|
13
13
|
import { PackageJsonApp, parsePackageJsonApp } from '../ipc/schema/packageJson';
|
|
14
|
+
import { getLatestEntry } from './latest-changelog-entry';
|
|
14
15
|
|
|
15
16
|
const format = (strings: string[]) =>
|
|
16
17
|
strings.map(string => `\`${string}\``).join(', ');
|
|
@@ -132,9 +133,6 @@ const readAndCheckPackageJson = () => {
|
|
|
132
133
|
return packageJson;
|
|
133
134
|
};
|
|
134
135
|
|
|
135
|
-
const changelogEntryRegexp = (version?: string) =>
|
|
136
|
-
new RegExp(`^## ${version}`, 'mi');
|
|
137
|
-
|
|
138
136
|
const checkChangelog = (
|
|
139
137
|
packageJson: PackageJsonApp,
|
|
140
138
|
checkChangelogHasCurrentEntry: boolean
|
|
@@ -148,16 +146,12 @@ const checkChangelog = (
|
|
|
148
146
|
fail('package.json must specify a `version`.');
|
|
149
147
|
}
|
|
150
148
|
|
|
151
|
-
const
|
|
152
|
-
if (!
|
|
149
|
+
const latestChangelogEntry = getLatestEntry();
|
|
150
|
+
if (!latestChangelogEntry.header.includes(packageJson.version)) {
|
|
153
151
|
fail(
|
|
154
152
|
`Found no entry for the current version packageJson.version ${packageJson.version} in \`Changelog.md\`.`
|
|
155
153
|
);
|
|
156
154
|
}
|
|
157
|
-
|
|
158
|
-
if (changelog.match(changelogEntryRegexp('unreleased'))) {
|
|
159
|
-
fail('There must not be an entry `unreleased` in `Changelog.md`.');
|
|
160
|
-
}
|
|
161
155
|
}
|
|
162
156
|
};
|
|
163
157
|
|
package/scripts/create-source.ts
CHANGED
package/scripts/esbuild.ts
CHANGED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2025 Nordic Semiconductor ASA
|
|
3
|
+
*
|
|
4
|
+
* SPDX-License-Identifier: LicenseRef-Nordic-4-Clause
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import { execSync } from 'node:child_process';
|
|
8
|
+
|
|
9
|
+
const getLatestReleaseName = () => {
|
|
10
|
+
const latestReleaseJson = execSync(`gh release view --json tagName`, {
|
|
11
|
+
encoding: 'utf-8',
|
|
12
|
+
});
|
|
13
|
+
const latestRelease = JSON.parse(latestReleaseJson) as { tagName: string };
|
|
14
|
+
|
|
15
|
+
return latestRelease.tagName;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export default (latestReleaseName = getLatestReleaseName()) => {
|
|
19
|
+
const latest = Number(
|
|
20
|
+
/^v(?<versionNumber>\d+)$/.exec(latestReleaseName)?.groups
|
|
21
|
+
?.versionNumber
|
|
22
|
+
);
|
|
23
|
+
|
|
24
|
+
return { latest, next: latest + 1 };
|
|
25
|
+
};
|
package/scripts/installHusky.ts
CHANGED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
#!/usr/bin/env -S npx tsx
|
|
2
|
+
|
|
3
|
+
/*
|
|
4
|
+
* Copyright (c) 2025 Nordic Semiconductor ASA
|
|
5
|
+
*
|
|
6
|
+
* SPDX-License-Identifier: LicenseRef-Nordic-4-Clause
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
/*
|
|
10
|
+
A script to check if the current state of the repository is releasable.
|
|
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
|
+
|
|
16
|
+
import packageJson from '../package.json';
|
|
17
|
+
import getReleaseNumbers from './get-release-numbers';
|
|
18
|
+
import { getLatestEntry } from './latest-changelog-entry';
|
|
19
|
+
|
|
20
|
+
const fail = (message: string) => {
|
|
21
|
+
console.log(`::error::${message}`);
|
|
22
|
+
process.exit(1);
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
const assertPackageJsonIsCorrect = (expectedVersionNumber: number) => {
|
|
26
|
+
if (packageJson.version !== `${expectedVersionNumber}.0.0`) {
|
|
27
|
+
fail(
|
|
28
|
+
`Version number in package.json must be '${expectedVersionNumber}.0.0' but is '${packageJson.version}'`
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
const assertLatestEntryIsNotEmpty = () => {
|
|
34
|
+
if (getLatestEntry().content.length === 0) {
|
|
35
|
+
fail('Latest entry in `Changelog.md` does not contain anything.');
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
const today = () => new Date().toISOString().split('T')[0];
|
|
40
|
+
|
|
41
|
+
const assertLatestHeaderIsCorrect = (expectedVersionNumber: number) => {
|
|
42
|
+
const expectedHeaderline = `${expectedVersionNumber}.0.0 - ${today()}`;
|
|
43
|
+
const actualHeaderline = getLatestEntry().header;
|
|
44
|
+
|
|
45
|
+
if (expectedHeaderline !== actualHeaderline) {
|
|
46
|
+
fail(
|
|
47
|
+
`Latest entry in Changelog.md is not as expected:\n Expected: ${expectedHeaderline}\n Actual: ${actualHeaderline}`
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
const assertChangelogIsCorrect = (expectedVersionNumber: number) => {
|
|
53
|
+
assertLatestEntryIsNotEmpty();
|
|
54
|
+
assertLatestHeaderIsCorrect(expectedVersionNumber);
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
const main = () => {
|
|
58
|
+
const releaseNumbers = getReleaseNumbers();
|
|
59
|
+
|
|
60
|
+
assertPackageJsonIsCorrect(releaseNumbers.next);
|
|
61
|
+
assertChangelogIsCorrect(releaseNumbers.next);
|
|
62
|
+
|
|
63
|
+
console.log(
|
|
64
|
+
`The currently released version is ${releaseNumbers.latest}, so the next one will be ${releaseNumbers.next}.\n`
|
|
65
|
+
);
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
main();
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2025 Nordic Semiconductor ASA
|
|
3
|
+
*
|
|
4
|
+
* SPDX-License-Identifier: LicenseRef-Nordic-4-Clause
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import { getLatestEntry } from './latest-changelog-entry';
|
|
8
|
+
|
|
9
|
+
describe('getLatestEntry', () => {
|
|
10
|
+
it('should extract the latest changelog entry correctly', () => {
|
|
11
|
+
const changelog = `# Changelog
|
|
12
|
+
|
|
13
|
+
All notable changes to this project will be documented in this file.
|
|
14
|
+
|
|
15
|
+
## 34.0.0 - 2022-03-10
|
|
16
|
+
|
|
17
|
+
### Changed
|
|
18
|
+
|
|
19
|
+
- Something
|
|
20
|
+
|
|
21
|
+
## 33.0.0 - 2022-02-01
|
|
22
|
+
|
|
23
|
+
### Added
|
|
24
|
+
- Basic stuff`;
|
|
25
|
+
|
|
26
|
+
const result = getLatestEntry(changelog);
|
|
27
|
+
|
|
28
|
+
expect(result.header).toBe('34.0.0 - 2022-03-10');
|
|
29
|
+
expect(result.content).toBe('### Changed\n\n- Something');
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
it('should handle changelog with only one entry', () => {
|
|
33
|
+
const changelog = `# Changelog
|
|
34
|
+
|
|
35
|
+
All notable changes to this project will be documented in this file.
|
|
36
|
+
|
|
37
|
+
## 33.0.0 - 2022-02-01
|
|
38
|
+
|
|
39
|
+
### Added
|
|
40
|
+
|
|
41
|
+
- Something else`;
|
|
42
|
+
|
|
43
|
+
const result = getLatestEntry(changelog);
|
|
44
|
+
|
|
45
|
+
expect(result.header).toBe('33.0.0 - 2022-02-01');
|
|
46
|
+
expect(result.content).toBe('### Added\n\n- Something else');
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
it('should handle changelog with empty content', () => {
|
|
50
|
+
const changelog = `# Changelog
|
|
51
|
+
|
|
52
|
+
All notable changes to this project will be documented in this file.
|
|
53
|
+
|
|
54
|
+
## 34.0.0 - 2022-03-10
|
|
55
|
+
|
|
56
|
+
## 33.0.0 - 2022-02-01
|
|
57
|
+
|
|
58
|
+
### Added
|
|
59
|
+
|
|
60
|
+
- Something else`;
|
|
61
|
+
|
|
62
|
+
const result = getLatestEntry(changelog);
|
|
63
|
+
|
|
64
|
+
expect(result.header).toBe('34.0.0 - 2022-03-10');
|
|
65
|
+
expect(result.content).toBe('');
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
it('should handle changelog with nothing before the first entry', () => {
|
|
69
|
+
const changelog = `## 33.0.0 - 2022-02-01
|
|
70
|
+
|
|
71
|
+
### Added
|
|
72
|
+
|
|
73
|
+
- Something else`;
|
|
74
|
+
|
|
75
|
+
const result = getLatestEntry(changelog);
|
|
76
|
+
|
|
77
|
+
expect(result.header).toBe('33.0.0 - 2022-02-01');
|
|
78
|
+
expect(result.content).toBe('### Added\n\n- Something else');
|
|
79
|
+
});
|
|
80
|
+
});
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
#!/usr/bin/env -S npx tsx
|
|
2
|
+
|
|
3
|
+
/*
|
|
4
|
+
* Copyright (c) 2025 Nordic Semiconductor ASA
|
|
5
|
+
*
|
|
6
|
+
* SPDX-License-Identifier: LicenseRef-Nordic-4-Clause
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import { readFileSync } from 'node:fs';
|
|
10
|
+
|
|
11
|
+
const readChangelog = () => readFileSync('Changelog.md', 'utf-8');
|
|
12
|
+
|
|
13
|
+
export const getLatestEntry = (changelog = readChangelog()) => {
|
|
14
|
+
const latestEntry = changelog.split(/(?:^|\n)## /)[1];
|
|
15
|
+
|
|
16
|
+
const header = latestEntry.split('\n')[0];
|
|
17
|
+
const content = latestEntry.replace(/[^\n]*/, '').trim();
|
|
18
|
+
|
|
19
|
+
return { header, content };
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
const runAsScript = require.main === module;
|
|
23
|
+
if (runAsScript) {
|
|
24
|
+
console.log(getLatestEntry().content);
|
|
25
|
+
}
|