@forsakringskassan/vue-lib-template 1.3.0 → 1.4.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.
@@ -6,6 +6,7 @@
6
6
 
7
7
  @use "@fkui/design/src/fonts";
8
8
  @use "@fkui/design/src/fkui";
9
+ @use "../../src/theme";
9
10
 
10
11
  :root {
11
12
  --f-logo-image-small: hotpink;
@@ -1,8 +1,8 @@
1
1
  /* This file is managed by @forsakringskassan/vue-lib-template. Changes will be overwritten! */
2
2
 
3
3
  import path from "node:path";
4
- import { fileURLToPath } from "node:url";
5
4
  import {
5
+ type Processor,
6
6
  Generator,
7
7
  extractMarkdownProcessor,
8
8
  frontMatterFileReader,
@@ -11,11 +11,24 @@ import {
11
11
  } from "@forsakringskassan/docs-generator";
12
12
  import pkg from "../package.json" with { type: "json" };
13
13
 
14
+ function teleportTarget(): Processor {
15
+ return {
16
+ after: "generate-docs",
17
+ name: "fkui:teleport",
18
+ async handler(context) {
19
+ context.addTemplateBlock("body:end", "teleport-target", {
20
+ filename: "partials/teleport.html",
21
+ });
22
+ },
23
+ };
24
+ }
25
+
14
26
  const docs = new Generator(import.meta.url, {
15
27
  site: { name: pkg.name, lang: "sv" },
16
28
  outputFolder: path.resolve(import.meta.dirname, "public"),
17
29
  exampleFolders: [path.resolve(import.meta.dirname, "../src")],
18
30
  setupPath: path.resolve(import.meta.dirname, "src/setup.ts"),
31
+ templateFolders: ["./templates"],
19
32
  vendor: [
20
33
  { package: "vue", alias: "vue/dist/vue.esm-bundler.js" },
21
34
  {
@@ -31,6 +44,7 @@ const docs = new Generator(import.meta.url, {
31
44
  outputFolder: path.join(import.meta.dirname, "../dist/docs"),
32
45
  }),
33
46
  manifestProcessor(),
47
+ teleportTarget(),
34
48
  ],
35
49
  });
36
50
 
@@ -42,9 +56,8 @@ docs.compileStyle("main", "./src/main.scss", {
42
56
  appendTo: "head",
43
57
  });
44
58
 
45
- const styleUrl = import.meta.resolve(`../dist/esm/style.css`);
46
- const stylePath = fileURLToPath(styleUrl); // workaround for https://github.com/Forsakringskassan/docs-generator/issues/499
47
- docs.compileStyle("lib", stylePath, {
59
+ const styleUrl = new URL(import.meta.resolve(`../dist/esm/style.css`));
60
+ docs.compileStyle("lib", styleUrl, {
48
61
  appendTo: "head",
49
62
  });
50
63
 
@@ -52,9 +65,8 @@ docs.compileScript("mocks", "./src/bundle-mocks.mjs", {
52
65
  appendTo: "head",
53
66
  });
54
67
 
55
- const mswUrl = import.meta.resolve("msw/mockServiceWorker.js");
56
- const mswPath = fileURLToPath(mswUrl); // workaround for https://github.com/Forsakringskassan/docs-generator/issues/499
57
- docs.compileWorker("msw", mswPath);
68
+ const mswUrl = new URL(import.meta.resolve("msw/mockServiceWorker.js"));
69
+ docs.compileWorker("mock-service-worker", mswUrl);
58
70
 
59
71
  await docs.build([
60
72
  {
@@ -7,10 +7,10 @@
7
7
  "start": "http-server public"
8
8
  },
9
9
  "devDependencies": {
10
- "@fkui/icon-lib-default": "6.58.0",
11
- "@fkui/vue": "6.58.0",
10
+ "@fkui/icon-lib-default": "6.59.0",
11
+ "@fkui/vue": "6.59.0",
12
12
  "@forsakringskassan/apimock-express": "4.1.0",
13
- "@forsakringskassan/docs-generator": "3.11.1",
13
+ "@forsakringskassan/docs-generator": "3.12.0",
14
14
  "@tsconfig/node24": "24.0.5",
15
15
  "@tsconfig/recommended": "1.0.13",
16
16
  "http-server": "14.1.1",
@@ -11,12 +11,13 @@ const handlers = [
11
11
  const worker = setupWorker(...handlers);
12
12
  // eslint-disable-next-line no-undef -- technical debt
13
13
  const rootUrl = document.documentElement.dataset["rootUrl"];
14
- const url = `${rootUrl}/msw.js`;
14
+ const url = `${rootUrl}/mock-service-worker.js`;
15
15
 
16
16
  // Used in setup.ts
17
17
  // eslint-disable-next-line unicorn/no-global-object-property-assignment, no-undef -- technical debt
18
18
  window.bundleMocks = worker.start({
19
19
  serviceWorker: {
20
20
  url,
21
+ options: { type: "module" },
21
22
  },
22
23
  });
@@ -1,20 +1,8 @@
1
1
  @use "@forsakringskassan/docs-generator/style.css";
2
- @use "@fkui/theme-default" as theme with (
3
- $global: false
4
- );
5
- @use "@fkui/font-default" as font with (
6
- $global: false
7
- );
8
2
  @use "@fkui/design";
9
3
  @use "@fkui/design/lib/fonts.css";
10
4
  @use "@forsakringskassan/docs-live-example";
11
-
12
- @include font.font-face;
13
-
14
- :root {
15
- @include theme.auto;
16
- @include font.font-family;
17
- }
5
+ @use "../../src/theme";
18
6
 
19
7
  html,
20
8
  body {
@@ -0,0 +1 @@
1
+ <div id="teleport-target" class="user-theme"></div>
@@ -87,38 +87,38 @@
87
87
  "devDependencies": {
88
88
  "@babel/core": "7.29.7",
89
89
  "@babel/preset-env": "7.29.7",
90
- "@fkui/design": "6.58.0",
91
- "@fkui/font-default": "6.58.0",
92
- "@fkui/icon-lib-default": "6.58.0",
93
- "@fkui/logic": "6.58.0",
94
- "@fkui/test-utils": "6.58.0",
95
- "@fkui/theme-default": "6.58.0",
96
- "@fkui/vue": "6.58.0",
90
+ "@fkui/design": "6.59.0",
91
+ "@fkui/font-default": "6.59.0",
92
+ "@fkui/icon-lib-default": "6.59.0",
93
+ "@fkui/logic": "6.59.0",
94
+ "@fkui/test-utils": "6.59.0",
95
+ "@fkui/theme-default": "6.59.0",
96
+ "@fkui/vue": "6.59.0",
97
97
  "@forsakringskassan/apimock-express": "4.1.0",
98
98
  "@forsakringskassan/commitlint-config": "4.2.8",
99
99
  "@forsakringskassan/cypress-config": "1.10.0",
100
100
  "@forsakringskassan/cypress-visual-regression": "5.2.0",
101
- "@forsakringskassan/docs-generator": "3.11.1",
101
+ "@forsakringskassan/docs-generator": "3.12.0",
102
102
  "@forsakringskassan/docs-live-example": "3.0.2",
103
- "@forsakringskassan/eslint-config": "15.10.0",
104
- "@forsakringskassan/eslint-config-cli": "15.10.0",
105
- "@forsakringskassan/eslint-config-cypress": "15.10.0",
106
- "@forsakringskassan/eslint-config-jest": "15.10.0",
107
- "@forsakringskassan/eslint-config-typescript": "15.10.0",
108
- "@forsakringskassan/eslint-config-typescript-typeinfo": "15.10.0",
109
- "@forsakringskassan/eslint-config-vitest": "15.10.0",
110
- "@forsakringskassan/eslint-config-vue": "15.10.0",
103
+ "@forsakringskassan/eslint-config": "15.11.0",
104
+ "@forsakringskassan/eslint-config-cli": "15.11.0",
105
+ "@forsakringskassan/eslint-config-cypress": "15.11.0",
106
+ "@forsakringskassan/eslint-config-jest": "15.11.0",
107
+ "@forsakringskassan/eslint-config-typescript": "15.11.0",
108
+ "@forsakringskassan/eslint-config-typescript-typeinfo": "15.11.0",
109
+ "@forsakringskassan/eslint-config-vitest": "15.11.0",
110
+ "@forsakringskassan/eslint-config-vue": "15.11.0",
111
111
  "@forsakringskassan/prettier-config": "3.7.10",
112
112
  "@forsakringskassan/stylelint-config": "3.5.0",
113
113
  "@forsakringskassan/vite-lib-config": "5.12.4",
114
114
  "@forsakringskassan/vitest-config-jsdom": "5.0.0",
115
- "@forsakringskassan/vue-lib-template": "1.3.0",
115
+ "@forsakringskassan/vue-lib-template": "1.4.0",
116
116
  "@html-validate/release-scripts": "7.6.12",
117
- "@types/node": "24.13.5",
117
+ "@types/node": "24.13.6",
118
118
  "@typescript/native": "npm:typescript@7.0.2",
119
119
  "@vue/server-renderer": "3.5.43",
120
120
  "@vue/test-utils": "2.5.1",
121
- "cloneman": "1.24.1",
121
+ "cloneman": "1.25.0",
122
122
  "core-js": "3.50.0",
123
123
  "cypress": "16.1.0",
124
124
  "html-validate": "11.16.0",
@@ -1,19 +1,7 @@
1
- @use "@fkui/theme-default" as theme with (
2
- $global: false
3
- );
4
- @use "@fkui/font-default" as font with (
5
- $global: false
6
- );
7
1
  @use "@fkui/design";
8
2
  @use "@fkui/design/lib/fonts.css";
9
3
  @use "@forsakringskassan/docs-live-example";
10
-
11
- @include font.font-face;
12
-
13
- :root {
14
- @include theme.auto;
15
- @include font.font-family;
16
- }
4
+ @use "theme";
17
5
 
18
6
  html,
19
7
  body {
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Theme selection.
3
+ *
4
+ * This file can be customized to set theme and related features for:
5
+ *
6
+ * - Local builds (`npm start`)
7
+ * - Cypress component tests
8
+ * - Documentation
9
+ *
10
+ * It is not included in the production build.
11
+ *
12
+ * --- This notice must be kept ---
13
+ */
14
+
15
+ @use "@fkui/theme-default" as theme with (
16
+ $global: false
17
+ );
18
+
19
+ @use "@fkui/font-default" as font with (
20
+ $global: false
21
+ );
22
+
23
+ @include font.font-face;
24
+
25
+ :root {
26
+ @include theme.auto;
27
+ @include font.font-family;
28
+ }
package/index.js CHANGED
@@ -7,7 +7,7 @@
7
7
 
8
8
  const options = {
9
9
  ...packageJson.cloneman,
10
- fileHash: "3ed96f7ccd01c366c430cf3081cbf47d160888c6d793dc177709a483b78000f9",
10
+ fileHash: "06d2b6a7e26a9d5b9df47375fe9fc0d856d30afd18da47362ccf24b6fa6c1468",
11
11
  filesDir: path.join(import.meta.dirname, "files"),
12
12
  hooksDir: path.join(import.meta.dirname, "hooks"),
13
13
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@forsakringskassan/vue-lib-template",
3
- "version": "1.3.0",
3
+ "version": "1.4.0",
4
4
  "description": "Vue library template based on Cloneman",
5
5
  "keywords": [
6
6
  "template",
@@ -54,6 +54,7 @@
54
54
  "docs/src/main.js",
55
55
  "docs/src/main.scss",
56
56
  "docs/src/setup.ts",
57
+ "docs/templates/partials/teleport.html",
57
58
  "docs/tsconfig.json",
58
59
  "eslint.config.mjs",
59
60
  "etc/lib.api.md",
@@ -96,6 +97,7 @@
96
97
  "src/selectors/guide/index.ts",
97
98
  "src/selectors/index.ts",
98
99
  "src/style.scss",
100
+ "src/theme.scss",
99
101
  "src/vite-dev/app.vue",
100
102
  "tsconfig.cypress.json",
101
103
  "tsconfig.json",
@@ -142,6 +144,14 @@
142
144
  "tsconfig.selectors.json",
143
145
  "vite.config.mts"
144
146
  ],
147
+ "partiallyManagedFiles": [
148
+ {
149
+ "filename": "src/theme.scss",
150
+ "include": {
151
+ "above": "--- This notice must be kept ---"
152
+ }
153
+ }
154
+ ],
145
155
  "removeFiles": [
146
156
  "api-extractor.json",
147
157
  "index.html",