@nordicsemiconductor/pc-nrfconnect-shared 81.0.0 → 82.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 CHANGED
@@ -7,7 +7,13 @@ 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
- ## 81 - Unreleased
10
+ ## 82 - 09.08.2023
11
+
12
+ ### Fixed
13
+
14
+ - Jest tests were broken due to missing config changes.
15
+
16
+ ## 81 - 09.08.2023
11
17
 
12
18
  ### Changed
13
19
 
@@ -23,9 +23,6 @@ module.exports = (disabledMocks = []) => ({
23
23
  : {
24
24
  packageJson$: `${mockDir}/packageJsonMock.ts`,
25
25
  }),
26
- ...(disabledMocks.includes('react-ga')
27
- ? {}
28
- : { '^react-ga$': `${mockDir}/gaMock.ts` }),
29
26
  ...(disabledMocks.includes('serialport')
30
27
  ? {}
31
28
  : { serialport: `${mockDir}/emptyMock.ts` }),
@@ -33,7 +30,9 @@ module.exports = (disabledMocks = []) => ({
33
30
  transform: {
34
31
  '^.+\\.[jt]sx?$': '@swc/jest',
35
32
  },
36
- transformIgnorePatterns: ['node_modules/(?!(pc-nrfconnect-shared)/)'],
33
+ transformIgnorePatterns: [
34
+ 'node_modules/(?!(@nordicsemiconductor/pc-nrfconnect-shared)/)',
35
+ ],
37
36
  setupFilesAfterEnv: [`${__dirname}/../test/setupTests.ts`],
38
37
  snapshotSerializers: ['enzyme-to-json/serializer'],
39
38
  resolver: `${__dirname}/../test/jestResolver.js`,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nordicsemiconductor/pc-nrfconnect-shared",
3
- "version": "81.0.0",
3
+ "version": "82.0.0",
4
4
  "description": "Shared commodities for developing pc-nrfconnect-* packages",
5
5
  "repository": {
6
6
  "type": "git",
@@ -27,9 +27,10 @@
27
27
  "./test",
28
28
  "./typings",
29
29
  "./styles.scss",
30
- "LICENSE",
31
- "Changelog.md",
32
- "README.md"
30
+ "./tsconfig.json",
31
+ "./LICENSE",
32
+ "./Changelog.md",
33
+ "./README.md"
33
34
  ],
34
35
  "main": "src",
35
36
  "scripts": {
@@ -42,7 +43,8 @@
42
43
  "generate-types": "tsc --emitDeclarationOnly --declaration --declarationMap --outDir ./typings/generated --rootDir .",
43
44
  "prepare": "ts-node scripts/installHusky.ts",
44
45
  "release-shared": "ts-node scripts/release-shared.ts",
45
- "prepare-shared-release": "ts-node scripts/prepare-shared-release.ts"
46
+ "prepare-shared-release": "ts-node scripts/prepare-shared-release.ts",
47
+ "postinstall": "node scripts/postinstall.js"
46
48
  },
47
49
  "peerDependencies": {
48
50
  "@nordicsemiconductor/nrf-device-lib-js": "*"
@@ -0,0 +1,42 @@
1
+ #!/usr/bin/env node
2
+
3
+ /*
4
+ * Copyright (c) 2015 Nordic Semiconductor ASA
5
+ *
6
+ * SPDX-License-Identifier: LicenseRef-Nordic-4-Clause
7
+ */
8
+
9
+ const { execSync } = require('child_process');
10
+ const { existsSync } = require('fs');
11
+ const { resolve } = require('path');
12
+ const { build } = require('./esbuild-renderer');
13
+
14
+ const scripts = [
15
+ 'nordic-publish',
16
+ 'check-app-properties',
17
+ 'check-for-typescript',
18
+ 'nrfconnect-license',
19
+ ];
20
+
21
+ scripts.forEach(script => {
22
+ // compile scripts if they don't exist
23
+ if (!existsSync(`scripts/${script}.js`)) {
24
+ const command = `npx esbuild scripts/${script}.ts --bundle --outfile=scripts/${script}.js --platform=node --log-level=warning --minify`;
25
+ execSync(command, { encoding: 'utf-8' });
26
+ }
27
+ });
28
+
29
+ if (!existsSync(`dist/bootstrap.css`)) {
30
+ build({
31
+ logLevel: 'warning',
32
+ entryPoints: ['./src/bootstrap.scss'],
33
+ outfile: 'dist/bootstrap.css',
34
+ sourcemap: false,
35
+ });
36
+ }
37
+
38
+ const root = resolve(__dirname, '..');
39
+ process.chdir(root);
40
+
41
+ // Generate types
42
+ execSync('npm run generate-types', { encoding: 'utf-8' });
package/tsconfig.json ADDED
@@ -0,0 +1,9 @@
1
+ {
2
+ "extends": "./config/tsconfig.json",
3
+ "include": [
4
+ "./main/**/*.ts",
5
+ "./src/**/*.ts",
6
+ "./src/**/*.tsx",
7
+ "./typings/*.d.ts"
8
+ ]
9
+ }
package/mocks/gaMock.ts DELETED
@@ -1,9 +0,0 @@
1
- /*
2
- * Copyright (c) 2021 Nordic Semiconductor ASA
3
- *
4
- * SPDX-License-Identifier: LicenseRef-Nordic-4-Clause
5
- */
6
-
7
- export default jest.fn(() => ({
8
- initialize: jest.fn(),
9
- }));
@@ -1,20 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- /*
4
- * Copyright (c) 2015 Nordic Semiconductor ASA
5
- *
6
- * SPDX-License-Identifier: LicenseRef-Nordic-4-Clause
7
- */
8
-
9
- const scripts = [
10
- 'nordic-publish',
11
- 'check-app-properties',
12
- 'check-for-typescript',
13
- 'nrfconnect-license',
14
- ];
15
- const { execSync } = require('child_process');
16
-
17
- scripts.forEach(script => {
18
- const command = `npx esbuild scripts/${script}.ts --bundle --outfile=scripts/${script}.js --platform=node --log-level=warning --minify`;
19
- execSync(command);
20
- });
@@ -1,15 +0,0 @@
1
- #!/usr/bin/env node
2
- /*
3
- * Copyright (c) 2015 Nordic Semiconductor ASA
4
- *
5
- * SPDX-License-Identifier: LicenseRef-Nordic-4-Clause
6
- */
7
-
8
- const { build } = require('./esbuild-renderer');
9
-
10
- build({
11
- logLevel: 'warning',
12
- entryPoints: ['./src/bootstrap.scss'],
13
- outfile: 'dist/bootstrap.css',
14
- sourcemap: false,
15
- });