@forsakringskassan/vue-lib-template 1.2.0 → 1.2.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/docs/{kattinformation → guide}/index.md +1 -0
- package/files/docs/src/bundle-mocks.mjs +1 -1
- package/files/package.json +2 -2
- package/files/src/{FcCatInfoComponent.cy.ts → components/guide/FcCatInfo/FcCatInfoComponent.cy.ts} +1 -1
- package/files/src/{FcCatInfoComponent.vue → components/guide/FcCatInfo/FcCatInfoComponent.vue} +2 -2
- package/files/src/{FcCatInfoComponentLiveExample.vue → components/guide/FcCatInfo/examples/FcCatInfoComponentLiveExample.vue} +5 -3
- package/files/src/components/guide/FcCatInfo/index.ts +1 -0
- package/files/src/components/guide/README.md +7 -0
- package/files/src/components/guide/index.ts +1 -0
- package/files/src/components/index.ts +1 -0
- package/files/src/index.ts +1 -1
- package/files/src/{cat-api-mock.spec.ts → mocks/guide/cat-api-mock.spec.ts} +5 -7
- package/files/src/{cat-api.mock.mts → mocks/guide/cat-api.mock.mts} +2 -2
- package/files/src/mocks/index.mts +1 -0
- package/files/src/selectors/guide/index.ts +1 -0
- package/files/src/selectors/index.ts +1 -1
- package/files/tsconfig.lib.json +1 -7
- package/files/vite.config.mts +1 -1
- package/index.js +1 -1
- package/package.json +24 -18
- /package/files/src/{CatInfoEdit.vue → components/guide/FcCatInfo/CatInfoEdit.vue} +0 -0
- /package/files/src/{CatInfoShow.vue → components/guide/FcCatInfo/CatInfoShow.vue} +0 -0
- /package/files/src/{cat-api.spec.ts → components/guide/FcCatInfo/cat-api.spec.ts} +0 -0
- /package/files/src/{cat-api.ts → components/guide/FcCatInfo/cat-api.ts} +0 -0
- /package/files/src/{cat-data.ts → components/guide/FcCatInfo/cat-data.ts} +0 -0
- /package/files/src/{CatInfoLogic.spec.ts → components/guide/FcCatInfo/cat-info-logic.spec.ts} +0 -0
- /package/files/src/{cat-info-logic.ts → components/guide/FcCatInfo/cat-info-logic.ts} +0 -0
- /package/files/src/{cat-types.ts → components/guide/FcCatInfo/cat-types.ts} +0 -0
- /package/files/src/{examples/CatInfoExample.vue → components/guide/FcCatInfo/examples/FcCatInfoComponentExample.vue} +0 -0
- /package/files/src/{mocks.mts → mocks/guide/index.mts} +0 -0
- /package/files/src/selectors/{FcCatInfoComponent.selectors.ts → guide/FcCatInfoComponent.selectors.ts} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { matchRequest } from "@forsakringskassan/apimock-express/browser";
|
|
2
2
|
import { http } from "msw";
|
|
3
3
|
import { setupWorker } from "msw/browser";
|
|
4
|
-
import mocks from "../../src/mocks.mts";
|
|
4
|
+
import mocks from "../../src/mocks/index.mts";
|
|
5
5
|
|
|
6
6
|
const handlers = [
|
|
7
7
|
http.all("/api/*", async (req) => {
|
package/files/package.json
CHANGED
|
@@ -102,9 +102,9 @@
|
|
|
102
102
|
"@forsakringskassan/eslint-config-vue": "15.9.8",
|
|
103
103
|
"@forsakringskassan/prettier-config": "3.7.8",
|
|
104
104
|
"@forsakringskassan/stylelint-config": "3.4.6",
|
|
105
|
-
"@forsakringskassan/vite-lib-config": "5.
|
|
105
|
+
"@forsakringskassan/vite-lib-config": "5.12.0",
|
|
106
106
|
"@forsakringskassan/vitest-config-jsdom": "5.0.0",
|
|
107
|
-
"@forsakringskassan/vue-lib-template": "1.2.
|
|
107
|
+
"@forsakringskassan/vue-lib-template": "1.2.1",
|
|
108
108
|
"@html-validate/release-scripts": "7.6.11",
|
|
109
109
|
"@types/node": "24.13.4",
|
|
110
110
|
"@typescript/native": "npm:typescript@7.0.2",
|
package/files/src/{FcCatInfoComponent.cy.ts → components/guide/FcCatInfo/FcCatInfoComponent.cy.ts}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { FLoaderSelectors } from "@fkui/vue/selectors";
|
|
2
|
+
import { FcCatInfoComponentSelectors } from "../../../selectors/guide/FcCatInfoComponent.selectors";
|
|
2
3
|
import FcCatInfoComponent from "./FcCatInfoComponent.vue";
|
|
3
4
|
import { cats } from "./cat-data";
|
|
4
|
-
import { FcCatInfoComponentSelectors } from "./selectors";
|
|
5
5
|
|
|
6
6
|
describe("FcCatInfoComponent", () => {
|
|
7
7
|
const testCat = cats[0];
|
package/files/src/{FcCatInfoComponent.vue → components/guide/FcCatInfo/FcCatInfoComponent.vue}
RENAMED
|
@@ -3,8 +3,8 @@ import { ref, watch } from "vue";
|
|
|
3
3
|
import { FCard, FLoader } from "@fkui/vue";
|
|
4
4
|
import CatInfoEdit from "./CatInfoEdit.vue";
|
|
5
5
|
import CatInfoShow from "./CatInfoShow.vue";
|
|
6
|
-
import { useCatInfo } from "./cat-info-logic";
|
|
7
|
-
import { type Cat } from "./cat-types";
|
|
6
|
+
import { useCatInfo } from "./cat-info-logic.js";
|
|
7
|
+
import { type Cat } from "./cat-types.js";
|
|
8
8
|
|
|
9
9
|
interface Props {
|
|
10
10
|
/**
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
import { defineComponent } from "vue";
|
|
3
3
|
import { FCheckboxField, FSelectField } from "@fkui/vue";
|
|
4
4
|
import { LiveExample } from "@forsakringskassan/docs-live-example";
|
|
5
|
-
import FcCatInfoComponent from "
|
|
6
|
-
import { getCatIds } from "
|
|
5
|
+
import FcCatInfoComponent from "../FcCatInfoComponent.vue";
|
|
6
|
+
import { getCatIds } from "../cat-data.js";
|
|
7
7
|
|
|
8
8
|
export default defineComponent({
|
|
9
9
|
name: "FcCatInfoComponentLiveExample",
|
|
@@ -23,7 +23,9 @@ export default defineComponent({
|
|
|
23
23
|
return this.isEditable ? " is-editable" : "";
|
|
24
24
|
},
|
|
25
25
|
template(): string {
|
|
26
|
-
return /* HTML */ `
|
|
26
|
+
return /* HTML */ `
|
|
27
|
+
<fc-cat-info-component cat-id="${this.selectedCatId}" ${this.editableAttr} />
|
|
28
|
+
`;
|
|
27
29
|
},
|
|
28
30
|
},
|
|
29
31
|
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as FcCatInfoComponent } from "./FcCatInfoComponent.vue";
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# Component guide
|
|
2
|
+
|
|
3
|
+
This directory contains an example component, `FcCatInfoComponent`, that demonstrates the setup and conventions used by this template.
|
|
4
|
+
It includes the component, selectors, tests, mock data, related support files, and belonging documentation in `docs/guide`.
|
|
5
|
+
|
|
6
|
+
This guide will stay in sync when you update to later versions of your template,
|
|
7
|
+
with intention to serve as a working reference while building your own components.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { FcCatInfoComponent } from "./FcCatInfo";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./guide";
|
package/files/src/index.ts
CHANGED
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
import { matchRequest } from "@forsakringskassan/apimock-express/browser";
|
|
2
2
|
import { describe, expect, it } from "vitest";
|
|
3
|
-
import
|
|
3
|
+
import catApiMock from "./cat-api.mock.mts";
|
|
4
4
|
|
|
5
5
|
describe("Cat API Mock Reproduction", () => {
|
|
6
6
|
it("should return 200 for a valid cat id /api/cat?id=whiskers-001", async () => {
|
|
7
7
|
expect.assertions(2);
|
|
8
|
-
const req = new Request(
|
|
9
|
-
|
|
10
|
-
);
|
|
11
|
-
const response = await matchRequest(mocks, req);
|
|
8
|
+
const req = new Request("http://localhost:8080/cat?id=whiskers-001");
|
|
9
|
+
const response = await matchRequest([catApiMock], req);
|
|
12
10
|
expect(response.status).toBe(200);
|
|
13
11
|
|
|
14
12
|
const data = await response.json();
|
|
@@ -17,8 +15,8 @@ describe("Cat API Mock Reproduction", () => {
|
|
|
17
15
|
|
|
18
16
|
it("should return 404 for an invalid cat id /api/cat?id=unknown", async () => {
|
|
19
17
|
expect.assertions(2);
|
|
20
|
-
const req = new Request("http://localhost:8080/
|
|
21
|
-
const response = await matchRequest(
|
|
18
|
+
const req = new Request("http://localhost:8080/cat?id=unknown");
|
|
19
|
+
const response = await matchRequest([catApiMock], req);
|
|
22
20
|
expect(response.status).toBe(404);
|
|
23
21
|
|
|
24
22
|
const data = await response.json();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineMock } from "@forsakringskassan/apimock-express/helpers";
|
|
2
|
-
import { cats } from "
|
|
3
|
-
import type { Cat } from "
|
|
2
|
+
import { cats } from "../../components/guide/FcCatInfo/cat-data.ts";
|
|
3
|
+
import type { Cat } from "../../components/guide/FcCatInfo/cat-types.ts";
|
|
4
4
|
|
|
5
5
|
export default defineMock<Cat | { error: string }>({
|
|
6
6
|
meta: {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./guide/index.mts";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { FcCatInfoComponentSelectors } from "./FcCatInfoComponent.selectors";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export * from "./guide";
|
package/files/tsconfig.lib.json
CHANGED
|
@@ -3,17 +3,11 @@
|
|
|
3
3
|
{
|
|
4
4
|
"extends": "@forsakringskassan/vite-lib-config/tsconfig.lib.json",
|
|
5
5
|
"compilerOptions": {
|
|
6
|
-
"allowImportingTsExtensions": true,
|
|
7
6
|
"paths": {
|
|
8
7
|
"@forsakringskassan/vue-lib-template/selectors": [
|
|
9
8
|
"./src/selectors/index.ts"
|
|
10
9
|
],
|
|
11
10
|
"@forsakringskassan/vue-lib-template": ["./src/index.ts"]
|
|
12
11
|
}
|
|
13
|
-
}
|
|
14
|
-
"include": [
|
|
15
|
-
"${configDir}/src/**/*.mts",
|
|
16
|
-
"${configDir}/src/**/*.ts",
|
|
17
|
-
"${configDir}/src/**/*.vue"
|
|
18
|
-
]
|
|
12
|
+
}
|
|
19
13
|
}
|
package/files/vite.config.mts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import { defineConfig } from "@forsakringskassan/vite-lib-config/vite";
|
|
4
4
|
import { defineTestConfig } from "@forsakringskassan/vitest-config-jsdom";
|
|
5
|
-
import mocks from "./src/mocks.mts";
|
|
5
|
+
import mocks from "./src/mocks/index.mts";
|
|
6
6
|
|
|
7
7
|
export default defineConfig({
|
|
8
8
|
test: defineTestConfig(),
|
package/index.js
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
const options = {
|
|
9
9
|
...packageJson.cloneman,
|
|
10
|
-
fileHash: "
|
|
10
|
+
fileHash: "b15cb2f279a719719dfa19b85ed5587db8036c5e984ba398bce5a3cd69d0b0f5",
|
|
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.2.
|
|
3
|
+
"version": "1.2.1",
|
|
4
4
|
"description": "Vue library template based on Cloneman",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"template",
|
|
@@ -46,8 +46,8 @@
|
|
|
46
46
|
"cypress/tsconfig.json",
|
|
47
47
|
"cypress/types/mocha.d.ts",
|
|
48
48
|
"docs/build.mts",
|
|
49
|
+
"docs/guide/index.md",
|
|
49
50
|
"docs/index.md",
|
|
50
|
-
"docs/kattinformation/index.md",
|
|
51
51
|
"docs/package.json",
|
|
52
52
|
"docs/src/bundle-mocks.mjs",
|
|
53
53
|
"docs/src/global.d.ts",
|
|
@@ -62,25 +62,31 @@
|
|
|
62
62
|
"LICENSE.md",
|
|
63
63
|
"README.md",
|
|
64
64
|
"renovate.json",
|
|
65
|
-
"src/cat-api
|
|
66
|
-
"src/cat-api.
|
|
67
|
-
"src/cat-
|
|
68
|
-
"src/cat-
|
|
69
|
-
"src/cat-
|
|
70
|
-
"src/cat-
|
|
71
|
-
"src/
|
|
72
|
-
"src/
|
|
73
|
-
"src/
|
|
74
|
-
"src/
|
|
75
|
-
"src/
|
|
76
|
-
"src/FcCatInfoComponent.
|
|
77
|
-
"src/
|
|
78
|
-
"src/
|
|
65
|
+
"src/components/guide/FcCatInfo/cat-api.spec.ts",
|
|
66
|
+
"src/components/guide/FcCatInfo/cat-api.ts",
|
|
67
|
+
"src/components/guide/FcCatInfo/cat-data.ts",
|
|
68
|
+
"src/components/guide/FcCatInfo/cat-info-logic.spec.ts",
|
|
69
|
+
"src/components/guide/FcCatInfo/cat-info-logic.ts",
|
|
70
|
+
"src/components/guide/FcCatInfo/cat-types.ts",
|
|
71
|
+
"src/components/guide/FcCatInfo/CatInfoEdit.vue",
|
|
72
|
+
"src/components/guide/FcCatInfo/CatInfoShow.vue",
|
|
73
|
+
"src/components/guide/FcCatInfo/examples/FcCatInfoComponentExample.vue",
|
|
74
|
+
"src/components/guide/FcCatInfo/examples/FcCatInfoComponentLiveExample.vue",
|
|
75
|
+
"src/components/guide/FcCatInfo/FcCatInfoComponent.cy.ts",
|
|
76
|
+
"src/components/guide/FcCatInfo/FcCatInfoComponent.vue",
|
|
77
|
+
"src/components/guide/FcCatInfo/index.ts",
|
|
78
|
+
"src/components/guide/index.ts",
|
|
79
|
+
"src/components/guide/README.md",
|
|
80
|
+
"src/components/index.ts",
|
|
79
81
|
"src/index.ts",
|
|
80
82
|
"src/local.scss",
|
|
81
83
|
"src/local.ts",
|
|
82
|
-
"src/mocks.
|
|
83
|
-
"src/
|
|
84
|
+
"src/mocks/guide/cat-api-mock.spec.ts",
|
|
85
|
+
"src/mocks/guide/cat-api.mock.mts",
|
|
86
|
+
"src/mocks/guide/index.mts",
|
|
87
|
+
"src/mocks/index.mts",
|
|
88
|
+
"src/selectors/guide/FcCatInfoComponent.selectors.ts",
|
|
89
|
+
"src/selectors/guide/index.ts",
|
|
84
90
|
"src/selectors/index.ts",
|
|
85
91
|
"src/style.scss",
|
|
86
92
|
"src/vite-dev/app.vue",
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/files/src/{CatInfoLogic.spec.ts → components/guide/FcCatInfo/cat-info-logic.spec.ts}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|