@helsenorge/library-build 36.1.0 → 37.0.2

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.
@@ -1,29 +1,33 @@
1
1
  {
2
2
  "compilerOptions": {
3
- "target": "ES2020",
3
+ "target": "ES2022",
4
4
  "useDefineForClassFields": true,
5
- "lib": ["ES2020", "DOM", "DOM.Iterable"],
5
+ "lib": ["ES2022", "DOM", "DOM.Iterable"],
6
6
  "module": "ESNext",
7
+ "types": ["vitest/globals", "@testing-library/jest-dom"],
7
8
  "skipLibCheck": true,
8
9
 
9
10
  /* Bundler mode */
10
- "moduleResolution": "node",
11
+ "moduleResolution": "bundler",
11
12
  "allowImportingTsExtensions": false,
12
- "resolveJsonModule": true,
13
- "isolatedModules": true,
13
+ "verbatimModuleSyntax": true,
14
+ "moduleDetection": "force",
14
15
  "noEmit": false,
15
16
  "jsx": "react-jsx",
17
+ "isolatedModules": true,
18
+ "resolveJsonModule": true,
16
19
 
17
20
  /* Linting */
18
21
  "strict": true,
19
22
  "noUnusedLocals": true,
20
23
  "noUnusedParameters": true,
24
+ //"erasableSyntaxOnly": false, // default true i vite, men fungerer ikke med enums fra EntitiesGenerator eller SonarQube
21
25
  "noFallthroughCasesInSwitch": true,
26
+ "noUncheckedSideEffectImports": true,
22
27
 
23
28
  /* library-build specific options */
24
29
  "declaration": true,
25
30
  "declarationMap": true,
26
- "esModuleInterop": true,
27
- "types": ["vitest/globals", "@testing-library/jest-dom"]
31
+ "esModuleInterop": true
28
32
  }
29
33
  }
@@ -1,9 +1,27 @@
1
1
  {
2
2
  "compilerOptions": {
3
- "composite": true,
4
- "skipLibCheck": true,
3
+ "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo",
4
+ "target": "ES2023",
5
+ "lib": ["ES2023"],
5
6
  "module": "ESNext",
7
+ "types": ["node"],
8
+ "skipLibCheck": true,
9
+
10
+ /* Bundler mode */
6
11
  "moduleResolution": "bundler",
7
- "allowSyntheticDefaultImports": true
8
- }
12
+ "allowImportingTsExtensions": true,
13
+ "verbatimModuleSyntax": true,
14
+ "moduleDetection": "force",
15
+ "noEmit": true,
16
+
17
+ /* Linting */
18
+ "strict": true,
19
+ "noUnusedLocals": true,
20
+ "noUnusedParameters": true,
21
+ //"erasableSyntaxOnly": false, // default true i vite, men fungerer ikke med enums fra EntitiesGenerator eller SonarQube
22
+ "noFallthroughCasesInSwitch": true,
23
+ "noUncheckedSideEffectImports": true,
24
+ "resolveJsonModule": true
25
+ },
26
+ "include": ["vite.config.ts"]
9
27
  }
@@ -1,28 +1,30 @@
1
1
  {
2
2
  "compilerOptions": {
3
- "target": "ES2020",
3
+ "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
4
+ "target": "ES2022",
4
5
  "useDefineForClassFields": true,
5
- "lib": ["ES2020", "DOM", "DOM.Iterable"],
6
+ "lib": ["ES2022", "DOM", "DOM.Iterable"],
6
7
  "module": "ESNext",
8
+ "types": ["vite/client", "vitest/globals", "@testing-library/jest-dom"],
7
9
  "skipLibCheck": true,
8
10
 
9
11
  /* Bundler mode */
10
12
  "moduleResolution": "bundler",
11
13
  "allowImportingTsExtensions": true,
12
- "resolveJsonModule": true,
13
- "isolatedModules": true,
14
+ "verbatimModuleSyntax": true,
14
15
  "moduleDetection": "force",
15
16
  "noEmit": true,
16
17
  "jsx": "react-jsx",
18
+ "isolatedModules": true,
19
+ "resolveJsonModule": true,
17
20
 
18
21
  /* Linting */
19
22
  "strict": true,
20
23
  "noUnusedLocals": true,
21
24
  "noUnusedParameters": true,
25
+ //"erasableSyntaxOnly": false, // default true i vite, men fungerer ikke med enums fra EntitiesGenerator eller SonarQube
22
26
  "noFallthroughCasesInSwitch": true,
23
- "noUncheckedSideEffectImports": true,
24
-
25
- /* https://vitest.dev/config/#globals */
26
- "types": ["vitest/globals", "@testing-library/jest-dom"]
27
- }
27
+ "noUncheckedSideEffectImports": true
28
+ },
29
+ "include": ["src"]
28
30
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@helsenorge/library-build",
3
3
  "author": "Norsk helsenett SF",
4
- "version": "36.1.0",
4
+ "version": "37.0.2",
5
5
  "type": "module",
6
6
  "sideEffects": false,
7
7
  "repository": {
@@ -13,28 +13,29 @@
13
13
  },
14
14
  "license": "MIT",
15
15
  "peerDependencies": {
16
- "react": "^18.0.0",
17
- "react-dom": "^18.0.0"
16
+ "react": "^18.0.0 || ^19.0.0",
17
+ "react-dom": "^18.0.0 || ^19.0.0"
18
18
  },
19
19
  "dependencies": {
20
- "@helsenorge/eslint-config": "^36.1.0",
21
- "@helsenorge/typed-scss-modules": "^9.0.4",
22
- "@testing-library/jest-dom": "^6.8.0",
20
+ "@helsenorge/eslint-config": "^37.0.2",
21
+ "@helsenorge/typed-scss-modules": "^9.0.7",
22
+ "@testing-library/jest-dom": "^6.9.1",
23
23
  "@testing-library/react": "^16.3.0",
24
24
  "@testing-library/user-event": "^14.6.1",
25
25
  "@types/copyfiles": "^2.4.4",
26
- "@types/react": "^18.3.24",
27
- "@types/react-dom": "^18.3.7",
28
- "@vitejs/plugin-react": "^4.7.0",
26
+ "@types/react": "^19.2.6",
27
+ "@types/react-dom": "^19.2.3",
28
+ "@vitejs/plugin-react": "^5.1.1",
29
29
  "@vitest/coverage-v8": "^3.2.4",
30
30
  "copyfiles": "^2.4.1",
31
- "esbuild": "~0.25.9",
31
+ "esbuild": "~0.27.0",
32
32
  "jsdom": "^26.1.0",
33
- "rimraf": "^6.0.1",
34
- "sass": "^1.91.0",
35
- "sass-embedded": "^1.91.0",
36
- "typescript": "~5.9.2",
37
- "vite": "^6.3.5",
33
+ "node-fetch": "^3.3.2",
34
+ "rimraf": "^6.1.2",
35
+ "sass": "^1.94.2",
36
+ "sass-embedded": "^1.93.3",
37
+ "typescript": "~5.9.3",
38
+ "vite": "^7.2.4",
38
39
  "vite-tsconfig-paths": "^5.1.4",
39
40
  "vitest": "^3.2.4",
40
41
  "yargs": "^18.0.0"
@@ -1 +1 @@
1
- {"version":3,"file":"setupTests.vite.d.ts","sourceRoot":"","sources":["../src/setupTests.vite.ts"],"names":[],"mappings":"AACA,OAAO,kCAAkC,CAAC;AAE1C,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,EAAE,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KAC7B;CACF"}
1
+ {"version":3,"file":"setupTests.vite.d.ts","sourceRoot":"","sources":["../src/setupTests.vite.ts"],"names":[],"mappings":"AAEA,OAAO,kCAAkC,CAAC;AAe1C,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,EAAE,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KAC7B;CACF"}
@@ -1,5 +1,17 @@
1
+ import fetchPolyfill, { Request as RequestPolyfill } from 'node-fetch';
1
2
  import { vi } from 'vitest';
2
3
  import '@testing-library/jest-dom/vitest';
4
+ // @todo: Fjern etter oppdatering til vitest 4, fjern da også dependency til node-fetch
5
+ // https://github.com/reduxjs/redux-toolkit/issues/4966#issuecomment-3115230061
6
+ Object.defineProperty(global, 'fetch', {
7
+ // MSW will overwrite this to intercept requests
8
+ writable: true,
9
+ value: fetchPolyfill,
10
+ });
11
+ Object.defineProperty(global, 'Request', {
12
+ writable: false,
13
+ value: RequestPolyfill,
14
+ });
3
15
  window.HN = {
4
16
  Page: {},
5
17
  Rest: {},
@@ -7,8 +19,9 @@ window.HN = {
7
19
  Commands: {},
8
20
  PortalCommands: {},
9
21
  };
10
- const MatchMediaMock = vi.fn(() => ({
11
- matches: true,
22
+ const MatchMediaMock = vi.fn((query) => ({
23
+ // @todo Her burde vi finne ut i hvilke tilfeller den skal være true, og bare sette den til true i de tilfellene
24
+ matches: query !== '(prefers-reduced-motion)',
12
25
  addListener: vi.fn(),
13
26
  addEventListener: vi.fn(),
14
27
  removeEventListener: vi.fn(),
package/vite.config.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { UserConfigFnPromise } from 'vite';
1
+ import { type UserConfigFnPromise } from 'vite';
2
2
  export declare const getConfig: UserConfigFnPromise;
3
3
  declare const _default: UserConfigFnPromise;
4
4
  export default _default;
@@ -1 +1 @@
1
- {"version":3,"file":"vite.config.d.ts","sourceRoot":"","sources":["../src/vite.config.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAgB,MAAM,MAAM,CAAC;AAGzD,eAAO,MAAM,SAAS,EAAE,mBAIvB,CAAC;;AAEF,wBAAyD"}
1
+ {"version":3,"file":"vite.config.d.ts","sourceRoot":"","sources":["../src/vite.config.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,mBAAmB,EAAgB,MAAM,MAAM,CAAC;AAG9D,eAAO,MAAM,SAAS,EAAE,mBAIvB,CAAC;;AAEF,wBAAyD"}
@@ -1,4 +1,4 @@
1
- import { UserConfigFn } from 'vitest/config';
1
+ import { type UserConfigFn } from 'vitest/config';
2
2
  export declare const getConfig: UserConfigFn;
3
3
  declare const _default: import("vitest/config").UserConfigExport;
4
4
  export default _default;
@@ -1 +1 @@
1
- {"version":3,"file":"vitest.config.d.ts","sourceRoot":"","sources":["../src/vitest.config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAwC,MAAM,eAAe,CAAC;AAEnF,eAAO,MAAM,SAAS,EAAE,YAkCvB,CAAC;;AAEF,wBAAmD"}
1
+ {"version":3,"file":"vitest.config.d.ts","sourceRoot":"","sources":["../src/vitest.config.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,YAAY,EAAwC,MAAM,eAAe,CAAC;AAExF,eAAO,MAAM,SAAS,EAAE,YAmCvB,CAAC;;AAEF,wBAAmD"}
package/vitest.config.js CHANGED
@@ -1,6 +1,9 @@
1
+ import react from '@vitejs/plugin-react';
2
+ import tsconfigPaths from 'vite-tsconfig-paths';
1
3
  import { coverageConfigDefaults, defineConfig } from 'vitest/config';
2
4
  export const getConfig = () => {
3
5
  return {
6
+ plugins: [react(), tsconfigPaths()],
4
7
  test: {
5
8
  include: ['src/**/__tests__/**/*.[jt]s?(x)', 'src/**/?(*.)+(spec|test).[jt]s?(x)'],
6
9
  globals: true,