@nordicsemiconductor/pc-nrfconnect-shared 219.0.0 → 221.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 (62) hide show
  1. package/Changelog.md +24 -0
  2. package/README.md +28 -0
  3. package/config/tailwind.config.js +5 -1
  4. package/config/tsconfig.json +0 -2
  5. package/dist/bootstrap.css +1 -1
  6. package/package.json +11 -12
  7. package/release_notes.md +10 -0
  8. package/scripts/check-app-properties.ts +4 -10
  9. package/scripts/check-for-typescript.ts +1 -1
  10. package/scripts/create-source.ts +1 -1
  11. package/scripts/esbuild.ts +1 -1
  12. package/scripts/get-release-numbers.ts +25 -0
  13. package/scripts/installHusky.ts +1 -1
  14. package/scripts/is-releasable.ts +68 -0
  15. package/scripts/latest-changelog-entry.test.ts +80 -0
  16. package/scripts/latest-changelog-entry.ts +25 -0
  17. package/scripts/nordic-publish.js +20 -19
  18. package/scripts/nordic-publish.ts +1 -1
  19. package/scripts/nrfconnect-license.ts +1 -1
  20. package/scripts/postinstall.ts +1 -1
  21. package/scripts/prepare-shared-release.ts +10 -8
  22. package/src/Dropdown/Dropdown.tsx +15 -4
  23. package/src/Group/Group.tsx +29 -3
  24. package/src/InlineInput/InlineInput.tsx +3 -0
  25. package/src/InlineInput/NumberInlineInput.tsx +23 -0
  26. package/src/index.ts +2 -0
  27. package/src/utils/persistentStore.ts +17 -0
  28. package/typings/generated/scripts/check-app-properties.d.ts +1 -1
  29. package/typings/generated/scripts/check-app-properties.d.ts.map +1 -1
  30. package/typings/generated/scripts/check-for-typescript.d.ts +1 -1
  31. package/typings/generated/scripts/create-source.d.ts +1 -1
  32. package/typings/generated/scripts/esbuild.d.ts +1 -1
  33. package/typings/generated/scripts/get-release-numbers.d.ts +6 -0
  34. package/typings/generated/scripts/get-release-numbers.d.ts.map +1 -0
  35. package/typings/generated/scripts/installHusky.d.ts +1 -1
  36. package/typings/generated/scripts/is-releasable.d.ts +3 -0
  37. package/typings/generated/scripts/is-releasable.d.ts.map +1 -0
  38. package/typings/generated/scripts/latest-changelog-entry.d.ts +6 -0
  39. package/typings/generated/scripts/latest-changelog-entry.d.ts.map +1 -0
  40. package/typings/generated/scripts/latest-changelog-entry.test.d.ts +2 -0
  41. package/typings/generated/scripts/latest-changelog-entry.test.d.ts.map +1 -0
  42. package/typings/generated/scripts/nordic-publish.d.ts +1 -1
  43. package/typings/generated/scripts/nrfconnect-license.d.ts +1 -1
  44. package/typings/generated/scripts/postinstall.d.ts +1 -1
  45. package/typings/generated/scripts/prepare-shared-release.d.ts +1 -1
  46. package/typings/generated/src/Dropdown/Dropdown.d.ts +2 -1
  47. package/typings/generated/src/Dropdown/Dropdown.d.ts.map +1 -1
  48. package/typings/generated/src/Group/Group.d.ts +3 -1
  49. package/typings/generated/src/Group/Group.d.ts.map +1 -1
  50. package/typings/generated/src/InlineInput/InlineInput.d.ts +1 -0
  51. package/typings/generated/src/InlineInput/InlineInput.d.ts.map +1 -1
  52. package/typings/generated/src/InlineInput/NumberInlineInput.d.ts.map +1 -1
  53. package/typings/generated/src/index.d.ts +1 -1
  54. package/typings/generated/src/index.d.ts.map +1 -1
  55. package/typings/generated/src/utils/persistentStore.d.ts +3 -0
  56. package/typings/generated/src/utils/persistentStore.d.ts.map +1 -1
  57. package/scripts/release-shared.test.ts +0 -132
  58. package/scripts/release-shared.ts +0 -213
  59. package/typings/generated/scripts/release-shared.d.ts +0 -30
  60. package/typings/generated/scripts/release-shared.d.ts.map +0 -1
  61. package/typings/generated/scripts/release-shared.test.d.ts +0 -2
  62. package/typings/generated/scripts/release-shared.test.d.ts.map +0 -1
package/Changelog.md CHANGED
@@ -7,6 +7,30 @@ 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
+ ## 221.0.0 - 2025-07-21
11
+
12
+ ### Added
13
+
14
+ - Custom tailwind font-size `text-2xs` (0.625rem/10px).
15
+ - Narrower Dropdown variant.
16
+ - Automatic character limit derivation for number input components based on
17
+ their range constraints.
18
+
19
+ ### Fixed
20
+
21
+ - Running build scripts failed on Windows.
22
+
23
+ ## 220.0.0 - 2025-07-16
24
+
25
+ ### Added
26
+
27
+ - Option to persist the Group collapse state.
28
+
29
+ ### Changed
30
+
31
+ - Use `tsx` instead of `ts-node`.
32
+ - Switched releasing shared from Azure to GitHub Actions.
33
+
10
34
  ## 219.0.0 - 2025-07-10
11
35
 
12
36
  ### 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.
@@ -16,7 +16,11 @@ module.exports = {
16
16
  ],
17
17
  theme: {
18
18
  colors,
19
- extend: {},
19
+ extend: {
20
+ fontSize: {
21
+ '2xs': '0.625rem', // 10px
22
+ },
23
+ },
20
24
  },
21
25
  corePlugins: {
22
26
  preflight: false,
@@ -1,6 +1,4 @@
1
1
  {
2
- "ts-node": { "swc": true },
3
-
4
2
  "compilerOptions": {
5
3
  "target": "es2021",
6
4
  "moduleResolution": "node",
@@ -1,6 +1,6 @@
1
1
  @charset "UTF-8";
2
2
 
3
- /* stylePlugin:/home/vsts/work/1/s/src/bootstrap.scss */
3
+ /* stylePlugin:/home/runner/work/pc-nrfconnect-shared/pc-nrfconnect-shared/src/bootstrap.scss */
4
4
  :root {
5
5
  --blue: #007bff;
6
6
  --indigo: #3f51b5;
package/package.json CHANGED
@@ -1,18 +1,18 @@
1
1
  {
2
2
  "name": "@nordicsemiconductor/pc-nrfconnect-shared",
3
- "version": "219.0.0",
3
+ "version": "221.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": "./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"
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": "ts-node scripts/nrfconnect-license.ts check",
23
+ "check:license": "tsx scripts/nrfconnect-license.ts check",
24
24
  "generate-types": "tsc --emitDeclarationOnly --declaration --declarationMap --outDir ./typings/generated --rootDir .",
25
- "prepare": "ts-node scripts/installHusky.ts",
26
- "release-shared": "ts-node scripts/release-shared.ts",
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": "ts-node scripts/postinstall.ts"
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
- "ts-node": "10.9.1",
119
+ "tsx": "^4.20.3",
121
120
  "typescript": "4.9.5",
122
121
  "util": "0.12.5",
123
122
  "uuid": "8.3.2",
@@ -0,0 +1,10 @@
1
+ ### Added
2
+
3
+ - Custom tailwind font-size `text-2xs` (0.625rem/10px).
4
+ - Narrower Dropdown variant.
5
+ - Automatic character limit derivation for number input components based on
6
+ their range constraints.
7
+
8
+ ### Fixed
9
+
10
+ - Running build scripts failed on Windows.
@@ -1,4 +1,4 @@
1
- #!/usr/bin/env ts-node
1
+ #!/usr/bin/env 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 changelog = readFileSync('./Changelog.md', 'utf8');
152
- if (!changelog.match(changelogEntryRegexp(packageJson.version))) {
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
 
@@ -1,4 +1,4 @@
1
- #!/usr/bin/env ts-node
1
+ #!/usr/bin/env tsx
2
2
 
3
3
  /*
4
4
  * Copyright (c) 2015 Nordic Semiconductor ASA
@@ -1,4 +1,4 @@
1
- #!/usr/bin/env ts-node
1
+ #!/usr/bin/env tsx
2
2
 
3
3
  /*
4
4
  * Copyright (c) 2025 Nordic Semiconductor ASA
@@ -1,4 +1,4 @@
1
- #!/usr/bin/env ts-node
1
+ #!/usr/bin/env tsx
2
2
  /*
3
3
  * Copyright (c) 2015 Nordic Semiconductor ASA
4
4
  *
@@ -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
+ };
@@ -1,4 +1,4 @@
1
- #!/usr/bin/env ts-node
1
+ #!/usr/bin/env tsx
2
2
 
3
3
  /*
4
4
  * Copyright (c) 2022 Nordic Semiconductor ASA
@@ -0,0 +1,68 @@
1
+ #!/usr/bin/env 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 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
+ }