@forsakringskassan/vite-lib-config 5.13.6 → 5.14.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/README.md CHANGED
@@ -5,7 +5,7 @@ Toolchain for building Vue framework libraries.
5
5
  - Hybrid ESM/CJS packages.
6
6
  - Transpiled with Babel.
7
7
  - Supports monorepo.
8
- - Optional: build pageobjects and selectors.
8
+ - Optional: build pageobjects, selectors, and mocks.
9
9
  - Optional: shared typescript configuration.
10
10
 
11
11
  ## Configuration
@@ -107,6 +107,27 @@ If `src/selectors/index.ts` it will be built to `dist/${format}/selectors.${cjs,
107
107
 
108
108
  If `src/cypress/index.ts` it will be built to `dist/${format}/cypress.${cjs,mjs}`.
109
109
 
110
+ ### Optional: build mocks
111
+
112
+ ```diff
113
+ {
114
+ "scripts": {
115
+ "build": "fk-build-vue-lib --mocks",
116
+ }
117
+ }
118
+ ```
119
+
120
+ This builds `src/mocks/index.ts` to `dist/${format}/mocks.${cjs,mjs}`. The file must export a list of mocks of type [`apimock-express`](https://github.com/Forsakringskassan/apimock-express) (`MockEntry[]` or `Mock[]`).
121
+
122
+ **src/mocks/index.ts**
123
+
124
+ ```typescript
125
+ import { type Mock } from "@forsakringskassan/apimock-express";
126
+
127
+ const mocks: Mock[] = [...];
128
+ export default mocks;
129
+ ```
130
+
110
131
  ### Dev-server
111
132
 
112
133
  ```json
package/dist/cli.mjs CHANGED
@@ -2217,6 +2217,9 @@ async function cli(args) {
2217
2217
  selectors: {
2218
2218
  type: "boolean"
2219
2219
  },
2220
+ mocks: {
2221
+ type: "boolean"
2222
+ },
2220
2223
  help: {
2221
2224
  type: "boolean",
2222
2225
  default: false
@@ -2229,6 +2232,7 @@ async function cli(args) {
2229
2232
  --clean Clean dist folder before building.
2230
2233
  --pageobjects Build cypress pageobjects.
2231
2234
  --selectors Build selector objects.
2235
+ --mocks Build mocks.
2232
2236
  --help Show this help.
2233
2237
  `);
2234
2238
  return;
@@ -2246,6 +2250,9 @@ async function cli(args) {
2246
2250
  if (flags.selectors) {
2247
2251
  await build3("src/selectors/index.ts", { external, formats });
2248
2252
  }
2253
+ if (flags.mocks) {
2254
+ await build3("src/mocks/index.ts", { external, formats });
2255
+ }
2249
2256
  }
2250
2257
  export {
2251
2258
  cli
@@ -5,7 +5,7 @@
5
5
  "toolPackages": [
6
6
  {
7
7
  "packageName": "@microsoft/api-extractor",
8
- "packageVersion": "7.59.4"
8
+ "packageVersion": "7.60.0"
9
9
  }
10
10
  ]
11
11
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@forsakringskassan/vite-lib-config",
3
- "version": "5.13.6",
3
+ "version": "5.14.1",
4
4
  "description": "Försäkringskassan toolchain to build libraries with Vite",
5
5
  "keywords": [
6
6
  "vite"
@@ -55,7 +55,7 @@
55
55
  "tsconfig"
56
56
  ],
57
57
  "dependencies": {
58
- "@microsoft/api-extractor": "7.59.4",
58
+ "@microsoft/api-extractor": "7.60.0",
59
59
  "@vue/babel-preset-app": "5.0.9",
60
60
  "esbuild": "^0.28.0"
61
61
  },