@forsakringskassan/vue-lib-template 1.4.0 → 1.5.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.
- package/files/CODEOWNERS +2 -2
- package/files/docs/build.mts +3 -3
- package/files/docs/components/index.md +4 -0
- package/files/docs/guide/cat-info.md +28 -0
- package/files/docs/guide/index.md +2 -27
- package/files/docs/package.json +5 -2
- package/files/docs/src/bundle-mocks.ts +10 -0
- package/files/docs/src/setup.ts +8 -4
- package/files/docs/tsconfig.json +4 -0
- package/files/package.json +4 -4
- package/hooks/install.mjs +13 -0
- package/index.js +1 -1
- package/package.json +16 -3
- package/files/docs/src/bundle-mocks.mjs +0 -23
package/files/CODEOWNERS
CHANGED
package/files/docs/build.mts
CHANGED
|
@@ -61,12 +61,12 @@ docs.compileStyle("lib", styleUrl, {
|
|
|
61
61
|
appendTo: "head",
|
|
62
62
|
});
|
|
63
63
|
|
|
64
|
-
docs.compileScript("
|
|
65
|
-
appendTo: "
|
|
64
|
+
docs.compileScript("#apimock", "./src/bundle-mocks.ts", {
|
|
65
|
+
appendTo: "none",
|
|
66
66
|
});
|
|
67
67
|
|
|
68
68
|
const mswUrl = new URL(import.meta.resolve("msw/mockServiceWorker.js"));
|
|
69
|
-
docs.compileWorker("mock-service-worker", mswUrl);
|
|
69
|
+
docs.compileWorker("#mock-service-worker", mswUrl);
|
|
70
70
|
|
|
71
71
|
await docs.build([
|
|
72
72
|
{
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Kattinformation
|
|
3
|
+
status: Draft
|
|
4
|
+
layout: component
|
|
5
|
+
component: FcCatInfoComponent
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
Komponenten kan visa kattdata i visningsläge eller i ett redigerbart läge.
|
|
9
|
+
Den hämtar kattdata från ett mockat backend.
|
|
10
|
+
|
|
11
|
+
```import live-example
|
|
12
|
+
FcCatInfoComponentLiveExample.vue
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Tänk på att
|
|
16
|
+
|
|
17
|
+
- Detta är en exempelkomponent.
|
|
18
|
+
- Den ska inte användas i produktion.
|
|
19
|
+
|
|
20
|
+
## Copy
|
|
21
|
+
|
|
22
|
+
- Använd tydlig och begriplig text.
|
|
23
|
+
|
|
24
|
+
## API
|
|
25
|
+
|
|
26
|
+
::: api
|
|
27
|
+
vue:FcCatInfoComponent
|
|
28
|
+
:::
|
|
@@ -1,29 +1,4 @@
|
|
|
1
1
|
---
|
|
2
|
-
title:
|
|
3
|
-
|
|
4
|
-
layout: component
|
|
5
|
-
component: FcCatInfoComponent
|
|
6
|
-
visible: false
|
|
2
|
+
title: Guide
|
|
3
|
+
layout: article
|
|
7
4
|
---
|
|
8
|
-
|
|
9
|
-
Komponenten kan visa kattdata i visningsläge eller i ett redigerbart läge.
|
|
10
|
-
Den hämtar kattdata från ett mockat backend.
|
|
11
|
-
|
|
12
|
-
```import live-example
|
|
13
|
-
FcCatInfoComponentLiveExample.vue
|
|
14
|
-
```
|
|
15
|
-
|
|
16
|
-
## Tänk på att
|
|
17
|
-
|
|
18
|
-
- Detta är en exempelkomponent.
|
|
19
|
-
- Den ska inte användas i produktion.
|
|
20
|
-
|
|
21
|
-
## Copy
|
|
22
|
-
|
|
23
|
-
- Använd tydlig och begriplig text.
|
|
24
|
-
|
|
25
|
-
## API
|
|
26
|
-
|
|
27
|
-
::: api
|
|
28
|
-
vue:FcCatInfoComponent
|
|
29
|
-
:::
|
package/files/docs/package.json
CHANGED
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
"name": "docs",
|
|
3
3
|
"version": "0.0.0",
|
|
4
4
|
"private": true,
|
|
5
|
+
"imports": {
|
|
6
|
+
"#apimock": "./src/bundle-mocks.ts"
|
|
7
|
+
},
|
|
5
8
|
"scripts": {
|
|
6
9
|
"build": "node build.mts",
|
|
7
10
|
"start": "http-server public"
|
|
@@ -9,8 +12,8 @@
|
|
|
9
12
|
"devDependencies": {
|
|
10
13
|
"@fkui/icon-lib-default": "6.59.0",
|
|
11
14
|
"@fkui/vue": "6.59.0",
|
|
12
|
-
"@forsakringskassan/apimock-express": "4.1
|
|
13
|
-
"@forsakringskassan/docs-generator": "3.12.
|
|
15
|
+
"@forsakringskassan/apimock-express": "4.2.1",
|
|
16
|
+
"@forsakringskassan/docs-generator": "3.12.1",
|
|
14
17
|
"@tsconfig/node24": "24.0.5",
|
|
15
18
|
"@tsconfig/recommended": "1.0.13",
|
|
16
19
|
"http-server": "14.1.1",
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { setupWorker } from "@forsakringskassan/apimock-express/browser";
|
|
2
|
+
import mocks from "../../src/mocks/index.mjs";
|
|
3
|
+
|
|
4
|
+
/* this is resolved from the importmap (mapped to the bundle with the same name
|
|
5
|
+
* compiled in `docs/build.mts`) */
|
|
6
|
+
const workerUrl = import.meta.resolve("#mock-service-worker");
|
|
7
|
+
|
|
8
|
+
export const apimockReady = setupWorker(workerUrl, mocks, {
|
|
9
|
+
type: "module",
|
|
10
|
+
});
|
package/files/docs/src/setup.ts
CHANGED
|
@@ -10,18 +10,22 @@ import {
|
|
|
10
10
|
} from "@fkui/vue";
|
|
11
11
|
import { type SetupOptions } from "@forsakringskassan/docs-generator";
|
|
12
12
|
|
|
13
|
+
/* this is resolved from the importmap (mapped to the bundle with the same name
|
|
14
|
+
* compiled in `docs/build.mts`) */
|
|
15
|
+
import { apimockReady } from "#apimock";
|
|
16
|
+
|
|
13
17
|
export async function setup(options: SetupOptions): Promise<void> {
|
|
14
18
|
const { rootComponent, selector } = options;
|
|
15
19
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
}
|
|
20
|
+
/* wait for apimock to be ready before we mount the example */
|
|
21
|
+
await apimockReady;
|
|
22
|
+
|
|
20
23
|
const app = createApp({
|
|
21
24
|
render() {
|
|
22
25
|
return h(FErrorHandlingApp, { defaultComponent: rootComponent });
|
|
23
26
|
},
|
|
24
27
|
});
|
|
28
|
+
|
|
25
29
|
setRunningContext(app);
|
|
26
30
|
app.use(ErrorPlugin, {
|
|
27
31
|
captureWarnings: true,
|
package/files/docs/tsconfig.json
CHANGED
package/files/package.json
CHANGED
|
@@ -94,11 +94,11 @@
|
|
|
94
94
|
"@fkui/test-utils": "6.59.0",
|
|
95
95
|
"@fkui/theme-default": "6.59.0",
|
|
96
96
|
"@fkui/vue": "6.59.0",
|
|
97
|
-
"@forsakringskassan/apimock-express": "4.1
|
|
97
|
+
"@forsakringskassan/apimock-express": "4.2.1",
|
|
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.12.
|
|
101
|
+
"@forsakringskassan/docs-generator": "3.12.1",
|
|
102
102
|
"@forsakringskassan/docs-live-example": "3.0.2",
|
|
103
103
|
"@forsakringskassan/eslint-config": "15.11.0",
|
|
104
104
|
"@forsakringskassan/eslint-config-cli": "15.11.0",
|
|
@@ -112,13 +112,13 @@
|
|
|
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.
|
|
115
|
+
"@forsakringskassan/vue-lib-template": "1.5.1",
|
|
116
116
|
"@html-validate/release-scripts": "7.6.12",
|
|
117
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.25.
|
|
121
|
+
"cloneman": "1.25.1",
|
|
122
122
|
"core-js": "3.50.0",
|
|
123
123
|
"cypress": "16.1.0",
|
|
124
124
|
"html-validate": "11.16.0",
|
package/hooks/install.mjs
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
|
|
2
2
|
|
|
3
|
+
async function enableDeployDocs(context ) {
|
|
4
|
+
const { getParameter, replaceInFile } = context;
|
|
5
|
+
const url = getParameter("docs-repo-url");
|
|
6
|
+
if (url === "") {
|
|
7
|
+
return;
|
|
8
|
+
}
|
|
9
|
+
await replaceInFile("Jenkinsfile", /deploy:/, "false", "true");
|
|
10
|
+
await replaceInFile("Jenkinsfile", /repositoryUrl:/, "null", `"${url}"`);
|
|
11
|
+
}
|
|
12
|
+
|
|
3
13
|
export async function install(context ) {
|
|
4
14
|
const { getApplicationName, replaceInFile } = context;
|
|
5
15
|
const scopedName = getApplicationName();
|
|
@@ -13,4 +23,7 @@ export async function install(context ) {
|
|
|
13
23
|
await replaceInFile("tsconfig.lib.json", placeholder, quotedName);
|
|
14
24
|
await replaceInFile("tsconfig.cypress.json", placeholder, quotedName);
|
|
15
25
|
await replaceInFile("tsconfig.selectors.json", placeholder, quotedName);
|
|
26
|
+
|
|
27
|
+
/* enable deployment of documentation if a documentation url is provided */
|
|
28
|
+
await enableDeployDocs(context);
|
|
16
29
|
}
|
package/index.js
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
const options = {
|
|
9
9
|
...packageJson.cloneman,
|
|
10
|
-
fileHash: "
|
|
10
|
+
fileHash: "509a23e5489100d974625d2197bd7e65aee36d3ce87686a907623db845674b81",
|
|
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
|
+
"version": "1.5.1",
|
|
4
4
|
"description": "Vue library template based on Cloneman",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"template",
|
|
@@ -46,10 +46,12 @@
|
|
|
46
46
|
"cypress/tsconfig.json",
|
|
47
47
|
"cypress/types/mocha.d.ts",
|
|
48
48
|
"docs/build.mts",
|
|
49
|
+
"docs/components/index.md",
|
|
50
|
+
"docs/guide/cat-info.md",
|
|
49
51
|
"docs/guide/index.md",
|
|
50
52
|
"docs/index.md",
|
|
51
53
|
"docs/package.json",
|
|
52
|
-
"docs/src/bundle-mocks.
|
|
54
|
+
"docs/src/bundle-mocks.ts",
|
|
53
55
|
"docs/src/global.d.ts",
|
|
54
56
|
"docs/src/main.js",
|
|
55
57
|
"docs/src/main.scss",
|
|
@@ -127,7 +129,7 @@
|
|
|
127
129
|
"cypress/types/mocha.d.ts",
|
|
128
130
|
"docs/build.mts",
|
|
129
131
|
"docs/package.json",
|
|
130
|
-
"docs/src/bundle-mocks.
|
|
132
|
+
"docs/src/bundle-mocks.ts",
|
|
131
133
|
"docs/src/global.d.ts",
|
|
132
134
|
"docs/src/main.js",
|
|
133
135
|
"docs/src/main.scss",
|
|
@@ -165,6 +167,7 @@
|
|
|
165
167
|
"cypress/types/forced-colors.d.ts",
|
|
166
168
|
"etc/vue-lib-template-selectors.api.md",
|
|
167
169
|
"etc/vue-lib-template.api.md",
|
|
170
|
+
"docs/src/bundle-mocks.mjs",
|
|
168
171
|
"docs/components/AwesomeComponent.md",
|
|
169
172
|
"src/examples/DummyExample.vue",
|
|
170
173
|
"src/AwesomeComponent.cy.ts",
|
|
@@ -182,6 +185,16 @@
|
|
|
182
185
|
"!@fkui/tsconfig",
|
|
183
186
|
"@forsakringskassan/*-api",
|
|
184
187
|
"fk-icons"
|
|
188
|
+
],
|
|
189
|
+
"parameters": [
|
|
190
|
+
{
|
|
191
|
+
"key": "docs-repo-url",
|
|
192
|
+
"description": "URL to repository to deploy documentation to",
|
|
193
|
+
"help": "Format: ssh://user@host/project/repo.git",
|
|
194
|
+
"required": false,
|
|
195
|
+
"defaultValue": "",
|
|
196
|
+
"pattern": "ssh://.*.git"
|
|
197
|
+
}
|
|
185
198
|
]
|
|
186
199
|
}
|
|
187
200
|
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { matchRequest } from "@forsakringskassan/apimock-express/browser";
|
|
2
|
-
import { http } from "msw";
|
|
3
|
-
import { setupWorker } from "msw/browser";
|
|
4
|
-
import mocks from "../../src/mocks/index.mts";
|
|
5
|
-
|
|
6
|
-
const handlers = [
|
|
7
|
-
http.all("/api/*", async (req) => {
|
|
8
|
-
return await matchRequest(mocks, req.request);
|
|
9
|
-
}),
|
|
10
|
-
];
|
|
11
|
-
const worker = setupWorker(...handlers);
|
|
12
|
-
// eslint-disable-next-line no-undef -- technical debt
|
|
13
|
-
const rootUrl = document.documentElement.dataset["rootUrl"];
|
|
14
|
-
const url = `${rootUrl}/mock-service-worker.js`;
|
|
15
|
-
|
|
16
|
-
// Used in setup.ts
|
|
17
|
-
// eslint-disable-next-line unicorn/no-global-object-property-assignment, no-undef -- technical debt
|
|
18
|
-
window.bundleMocks = worker.start({
|
|
19
|
-
serviceWorker: {
|
|
20
|
-
url,
|
|
21
|
-
options: { type: "module" },
|
|
22
|
-
},
|
|
23
|
-
});
|