@helsenorge/library-build 35.1.1 → 36.0.1

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,37 +1,33 @@
1
1
  #! /usr/bin/env node
2
- /* eslint-disable no-console */
2
+ import { spawnSync } from 'node:child_process';
3
3
  import { createRequire } from 'node:module';
4
+ import yargs from 'yargs';
5
+ import { hideBin } from 'yargs/helpers';
4
6
  const require = createRequire(import.meta.url);
5
- const sync = require('cross-spawn').sync;
6
- const args = process.argv.slice(2);
7
- const scriptIndex = args.findIndex(x => x === 'build' || x === 'copy');
8
- const script = scriptIndex === -1 ? args[0] : args[scriptIndex];
9
- const nodeArgs = scriptIndex > 0 ? args.slice(0, scriptIndex) : [];
10
- switch (script) {
11
- case 'build':
12
- case 'copy': {
13
- const result = sync('node', nodeArgs.concat(require.resolve('./' + script)).concat(args.slice(scriptIndex + 1)), {
7
+ const args = hideBin(process.argv);
8
+ yargs(args)
9
+ .command({
10
+ command: 'build',
11
+ handler: () => {
12
+ const result = spawnSync('node', [require.resolve('./build'), ...args.slice(1)], {
14
13
  stdio: 'inherit',
15
14
  });
16
- if (result.signal) {
17
- if (result.signal === 'SIGKILL') {
18
- console.log('The build failed because the process exited too early. ' +
19
- 'This probably means the system ran out of memory or someone called ' +
20
- '`kill -9` on the process.');
21
- }
22
- else if (result.signal === 'SIGTERM') {
23
- console.log('The build failed because the process exited too early. ' +
24
- 'Someone might have called `kill` or `killall`, or the system could ' +
25
- 'be shutting down.');
26
- }
27
- process.exit(1);
15
+ if (result.status) {
16
+ process.exit(result.status);
28
17
  }
29
- if (result.status)
18
+ },
19
+ })
20
+ .command({
21
+ command: 'copy',
22
+ handler: () => {
23
+ const result = spawnSync('node', [require.resolve('./copy'), ...args.slice(1)], {
24
+ stdio: 'inherit',
25
+ });
26
+ if (result.status) {
30
27
  process.exit(result.status);
31
- break;
32
- }
33
- default:
34
- console.log('Unknown script "' + script + '".');
35
- console.log('Perhaps you need to update @helsenorge/library-build?');
36
- break;
37
- }
28
+ }
29
+ },
30
+ })
31
+ .demandCommand()
32
+ .help()
33
+ .parse();
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@helsenorge/library-build",
3
3
  "author": "Norsk helsenett SF",
4
- "version": "35.1.1",
4
+ "version": "36.0.1",
5
5
  "type": "module",
6
6
  "sideEffects": false,
7
7
  "repository": {
@@ -17,29 +17,27 @@
17
17
  "react-dom": "^18.0.0"
18
18
  },
19
19
  "dependencies": {
20
- "@helsenorge/eslint-config": "^35.1.1",
21
- "@testing-library/jest-dom": "^6.6.3",
20
+ "@helsenorge/eslint-config": "^36.0.1",
21
+ "@helsenorge/typed-scss-modules": "^9.0.4",
22
+ "@testing-library/jest-dom": "^6.8.0",
22
23
  "@testing-library/react": "^16.3.0",
23
24
  "@testing-library/user-event": "^14.6.1",
24
25
  "@types/copyfiles": "^2.4.4",
25
- "@types/react": "^18.3.18",
26
- "@types/react-dom": "^18.3.5",
27
- "@vitejs/plugin-react": "^4.4.1",
28
- "@vitest/coverage-v8": "^3.1.2",
26
+ "@types/react": "^18.3.24",
27
+ "@types/react-dom": "^18.3.7",
28
+ "@vitejs/plugin-react": "^4.7.0",
29
+ "@vitest/coverage-v8": "^3.2.4",
29
30
  "copyfiles": "^2.4.1",
30
- "cross-spawn": "^7.0.6",
31
- "esbuild": "~0.25.3",
31
+ "esbuild": "~0.25.9",
32
32
  "jsdom": "^26.1.0",
33
33
  "rimraf": "^6.0.1",
34
- "sass": "^1.87.0",
35
- "sass-embedded": "^1.87.0",
36
- "typed-scss-modules": "^8.1.1",
37
- "typescript": "~5.8.3",
38
- "vite": "^6.3.3",
34
+ "sass": "^1.91.0",
35
+ "sass-embedded": "^1.91.0",
36
+ "typescript": "~5.9.2",
37
+ "vite": "^6.3.5",
39
38
  "vite-tsconfig-paths": "^5.1.4",
40
- "vitest": "^3.1.2",
41
- "whatwg-fetch": "^3.6.20",
42
- "yargs": "^17.7.2"
39
+ "vitest": "^3.2.4",
40
+ "yargs": "^18.0.0"
43
41
  },
44
42
  "publishConfig": {
45
43
  "access": "public"
@@ -1,5 +1,4 @@
1
1
  import '@testing-library/jest-dom/vitest';
2
- import 'whatwg-fetch';
3
2
  declare global {
4
3
  interface Window {
5
4
  HN: Record<string, unknown>;
@@ -1 +1 @@
1
- {"version":3,"file":"setupTests.vite.d.ts","sourceRoot":"","sources":["../src/setupTests.vite.ts"],"names":[],"mappings":"AACA,OAAO,kCAAkC,CAAC;AAC1C,OAAO,cAAc,CAAC;AAEtB,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":"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,6 +1,5 @@
1
1
  import { vi } from 'vitest';
2
2
  import '@testing-library/jest-dom/vitest';
3
- import 'whatwg-fetch';
4
3
  window.HN = {
5
4
  Page: {},
6
5
  Rest: {},