@helsenorge/library-build 34.1.2 → 35.1.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.
@@ -0,0 +1,9 @@
1
+ {
2
+ "compilerOptions": {
3
+ "composite": true,
4
+ "skipLibCheck": true,
5
+ "module": "ESNext",
6
+ "moduleResolution": "bundler",
7
+ "allowSyntheticDefaultImports": true
8
+ }
9
+ }
@@ -0,0 +1,28 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2020",
4
+ "useDefineForClassFields": true,
5
+ "lib": ["ES2020", "DOM", "DOM.Iterable"],
6
+ "module": "ESNext",
7
+ "skipLibCheck": true,
8
+
9
+ /* Bundler mode */
10
+ "moduleResolution": "bundler",
11
+ "allowImportingTsExtensions": true,
12
+ "resolveJsonModule": true,
13
+ "isolatedModules": true,
14
+ "moduleDetection": "force",
15
+ "noEmit": true,
16
+ "jsx": "react-jsx",
17
+
18
+ /* Linting */
19
+ "strict": true,
20
+ "noUnusedLocals": true,
21
+ "noUnusedParameters": true,
22
+ "noFallthroughCasesInSwitch": true,
23
+ "noUncheckedSideEffectImports": true,
24
+
25
+ /* https://vitest.dev/config/#globals */
26
+ "types": ["vitest/globals", "@testing-library/jest-dom"]
27
+ }
28
+ }
@@ -4,11 +4,10 @@ import { createRequire } from 'node:module';
4
4
  const require = createRequire(import.meta.url);
5
5
  const sync = require('cross-spawn').sync;
6
6
  const args = process.argv.slice(2);
7
- const scriptIndex = args.findIndex(x => x === 'start' || x === 'build' || x === 'copy');
7
+ const scriptIndex = args.findIndex(x => x === 'build' || x === 'copy');
8
8
  const script = scriptIndex === -1 ? args[0] : args[scriptIndex];
9
9
  const nodeArgs = scriptIndex > 0 ? args.slice(0, scriptIndex) : [];
10
10
  switch (script) {
11
- case 'start':
12
11
  case 'build':
13
12
  case 'copy': {
14
13
  const result = sync('node', nodeArgs.concat(require.resolve('./' + script)).concat(args.slice(scriptIndex + 1)), {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@helsenorge/library-build",
3
3
  "author": "Norsk helsenett SF",
4
- "version": "34.1.2",
4
+ "version": "35.1.1",
5
5
  "type": "module",
6
6
  "sideEffects": false,
7
7
  "repository": {
@@ -17,25 +17,27 @@
17
17
  "react-dom": "^18.0.0"
18
18
  },
19
19
  "dependencies": {
20
- "@helsenorge/eslint-config": "^34.1.2",
20
+ "@helsenorge/eslint-config": "^35.1.1",
21
21
  "@testing-library/jest-dom": "^6.6.3",
22
- "@testing-library/react": "^16.2.0",
23
- "@testing-library/user-event": "^14.6.0",
22
+ "@testing-library/react": "^16.3.0",
23
+ "@testing-library/user-event": "^14.6.1",
24
24
  "@types/copyfiles": "^2.4.4",
25
25
  "@types/react": "^18.3.18",
26
26
  "@types/react-dom": "^18.3.5",
27
- "@vitest/coverage-v8": "^2.1.8",
27
+ "@vitejs/plugin-react": "^4.4.1",
28
+ "@vitest/coverage-v8": "^3.1.2",
28
29
  "copyfiles": "^2.4.1",
29
30
  "cross-spawn": "^7.0.6",
30
- "esbuild": "~0.21.5",
31
- "esbuild-sass-plugin": "^3.3.1",
32
- "jsdom": "^25.0.1",
33
- "postcss": "^8.5.1",
34
- "postcss-modules": "^6.0.1",
31
+ "esbuild": "~0.25.3",
32
+ "jsdom": "^26.1.0",
35
33
  "rimraf": "^6.0.1",
34
+ "sass": "^1.87.0",
35
+ "sass-embedded": "^1.87.0",
36
36
  "typed-scss-modules": "^8.1.1",
37
- "typescript": "~5.7.2",
38
- "vitest": "^2.1.8",
37
+ "typescript": "~5.8.3",
38
+ "vite": "^6.3.3",
39
+ "vite-tsconfig-paths": "^5.1.4",
40
+ "vitest": "^3.1.2",
39
41
  "whatwg-fetch": "^3.6.20",
40
42
  "yargs": "^17.7.2"
41
43
  },
@@ -0,0 +1,5 @@
1
+ import { UserConfigFnPromise } from 'vite';
2
+ export declare const getConfig: UserConfigFnPromise;
3
+ declare const _default: UserConfigFnPromise;
4
+ export default _default;
5
+ //# sourceMappingURL=vite.config.d.ts.map
@@ -0,0 +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"}
package/vite.config.js ADDED
@@ -0,0 +1,9 @@
1
+ import react from '@vitejs/plugin-react';
2
+ import { defineConfig } from 'vite';
3
+ import tsconfigPaths from 'vite-tsconfig-paths';
4
+ export const getConfig = async () => {
5
+ return {
6
+ plugins: [react(), tsconfigPaths()],
7
+ };
8
+ };
9
+ export default defineConfig(async (env) => getConfig(env));
package/index.html DELETED
@@ -1,36 +0,0 @@
1
- <!doctype html>
2
- <html lang="no">
3
- <head>
4
- <meta charset="UTF-8" />
5
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
- <meta http-equiv="X-UA-Compatible" content="ie=edge" />
7
- <title>Helsenorge</title>
8
- <!-- IMPORT TEMPLATE FOR WEBCOMP-->
9
-
10
- <template id="hn-webcomp-header-footer-template">
11
- <link href="https://static-hn-mas-01.int-hn.nhn.no/core/static/css/helsenorge/helsenorge.css" rel="stylesheet" />
12
- <link
13
- type="text/css"
14
- rel="stylesheet"
15
- href="https://static-hn-mas-01.int-hn.nhn.no/header-footer/static/css/header-footer/header-footer.css"
16
- />
17
- </template>
18
-
19
- <!-- ADDING RESET CSS -->
20
- <link href="https://static-hn-mas-01.int-hn.nhn.no/core/static/css/helsenorge/helsenorge.css" rel="stylesheet" />
21
-
22
- <link type="text/css" rel="stylesheet" href="index.css" />
23
- </head>
24
-
25
- <body id="helsenorge">
26
- <hn-webcomp-header></hn-webcomp-header>
27
- <div id="main-content-wrapper"></div>
28
-
29
- <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/react/18.3.1/umd/react.development.js"></script>
30
- <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/react-dom/18.3.1/umd/react-dom.development.js"></script>
31
-
32
- <!-- IMPORT header-footer script -->
33
- <script type="module" src="https://static-hn-mas-01.int-hn.nhn.no/header-footer/static/js/header-footer/header-footer.js"></script>
34
- <script type="module" src="index.js"></script>
35
- </body>
36
- </html>
package/start.d.ts DELETED
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=start.d.ts.map
package/start.d.ts.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"start.d.ts","sourceRoot":"","sources":["../src/start.ts"],"names":[],"mappings":""}
package/start.js DELETED
@@ -1,70 +0,0 @@
1
- import { existsSync, mkdirSync, copyFileSync } from 'fs';
2
- import path from 'path';
3
- import url from 'url';
4
- import esbuild from 'esbuild';
5
- import { sassPlugin, postcssModules } from 'esbuild-sass-plugin';
6
- import yargs from 'yargs';
7
- import { hideBin } from 'yargs/helpers';
8
- const __filename = url.fileURLToPath(import.meta.url);
9
- const __dirname = path.dirname(__filename);
10
- (async () => {
11
- const { entry, outDir } = await yargs(hideBin(process.argv))
12
- .options({
13
- entry: { type: 'string', default: 'src/__devonly__/index.tsx' },
14
- outDir: { type: 'string', default: 'dist' },
15
- })
16
- .parse();
17
- if (!existsSync(outDir)) {
18
- mkdirSync(outDir);
19
- }
20
- copyFileSync(__dirname + '/index.html', outDir + '/index.html');
21
- const context = await esbuild.context({
22
- format: 'esm',
23
- logLevel: 'debug',
24
- entryPoints: [entry],
25
- outdir: outDir,
26
- bundle: true,
27
- define: {
28
- global: 'window',
29
- 'import.meta.env': '{}',
30
- },
31
- loader: {
32
- '.svg': 'dataurl',
33
- '.woff': 'dataurl',
34
- '.woff2': 'dataurl',
35
- },
36
- plugins: [
37
- sassPlugin({
38
- filter: /.module.(s[ac]ss|css)$/,
39
- type: 'css',
40
- transform: postcssModules({
41
- // ...put here the options for postcss-modules: https://github.com/madyankin/postcss-modules
42
- }),
43
- importMapper: path => (path.endsWith('styles.module') ? path + '.scss' : path),
44
- precompile(source, pathname) {
45
- const basedir = path.dirname(pathname);
46
- return source.replace(/(url\(['"]?)(\.\.?\/)([^'")]+['"]?\))/g, '$1'.concat(basedir.replace(/\\/g, '\\\\'), '/$2$3'));
47
- },
48
- }),
49
- sassPlugin({
50
- filter: /.(s[ac]ss|css)$/,
51
- type: 'style',
52
- }),
53
- {
54
- name: 'resolve-fonts',
55
- setup(build) {
56
- build.onResolve({ filter: /\.woff2?$/ }, ({ path }) => {
57
- return { path };
58
- });
59
- },
60
- },
61
- ],
62
- });
63
- await context.watch();
64
- await context.serve({
65
- port: 3000,
66
- host: 'localhost',
67
- servedir: outDir,
68
- fallback: outDir + '/index.html',
69
- });
70
- })();