@forsakringskassan/vue-lib-template 1.4.0 → 1.5.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.
- package/files/CODEOWNERS +2 -2
- package/files/docs/build.mts +3 -3
- 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 +14 -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
|
{
|
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.0",
|
|
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.0",
|
|
4
4
|
"description": "Vue library template based on Cloneman",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"template",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"docs/guide/index.md",
|
|
50
50
|
"docs/index.md",
|
|
51
51
|
"docs/package.json",
|
|
52
|
-
"docs/src/bundle-mocks.
|
|
52
|
+
"docs/src/bundle-mocks.ts",
|
|
53
53
|
"docs/src/global.d.ts",
|
|
54
54
|
"docs/src/main.js",
|
|
55
55
|
"docs/src/main.scss",
|
|
@@ -127,7 +127,7 @@
|
|
|
127
127
|
"cypress/types/mocha.d.ts",
|
|
128
128
|
"docs/build.mts",
|
|
129
129
|
"docs/package.json",
|
|
130
|
-
"docs/src/bundle-mocks.
|
|
130
|
+
"docs/src/bundle-mocks.ts",
|
|
131
131
|
"docs/src/global.d.ts",
|
|
132
132
|
"docs/src/main.js",
|
|
133
133
|
"docs/src/main.scss",
|
|
@@ -165,6 +165,7 @@
|
|
|
165
165
|
"cypress/types/forced-colors.d.ts",
|
|
166
166
|
"etc/vue-lib-template-selectors.api.md",
|
|
167
167
|
"etc/vue-lib-template.api.md",
|
|
168
|
+
"docs/src/bundle-mocks.mjs",
|
|
168
169
|
"docs/components/AwesomeComponent.md",
|
|
169
170
|
"src/examples/DummyExample.vue",
|
|
170
171
|
"src/AwesomeComponent.cy.ts",
|
|
@@ -182,6 +183,16 @@
|
|
|
182
183
|
"!@fkui/tsconfig",
|
|
183
184
|
"@forsakringskassan/*-api",
|
|
184
185
|
"fk-icons"
|
|
186
|
+
],
|
|
187
|
+
"parameters": [
|
|
188
|
+
{
|
|
189
|
+
"key": "docs-repo-url",
|
|
190
|
+
"description": "URL to repository to deploy documentation to",
|
|
191
|
+
"help": "Format: ssh://user@host/project/repo.git",
|
|
192
|
+
"required": false,
|
|
193
|
+
"defaultValue": "",
|
|
194
|
+
"pattern": "ssh://.*.git"
|
|
195
|
+
}
|
|
185
196
|
]
|
|
186
197
|
}
|
|
187
198
|
}
|
|
@@ -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
|
-
});
|