@schmock/vue 2.0.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.
@@ -0,0 +1,8 @@
1
+ import { type Plugin } from "vue";
2
+ export interface SchmockPluginOptions {
3
+ mock: Schmock.CallableMockInstance;
4
+ interceptOptions?: Schmock.InterceptOptions;
5
+ }
6
+ export declare const schmockPlugin: Plugin<SchmockPluginOptions>;
7
+ export declare function useSchmock(): Schmock.CallableMockInstance;
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAuC,KAAK,MAAM,EAAE,MAAM,KAAK,CAAC;AASvE,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,OAAO,CAAC,oBAAoB,CAAC;IACnC,gBAAgB,CAAC,EAAE,OAAO,CAAC,gBAAgB,CAAC;CAC7C;AAED,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,oBAAoB,CAYtD,CAAC;AAIF,wBAAgB,UAAU,IAAI,OAAO,CAAC,oBAAoB,CAQzD"}
package/dist/index.js ADDED
@@ -0,0 +1 @@
1
+ import{inject as s}from"vue";var o=Symbol("schmock"),m={install(c,t){let{mock:n,interceptOptions:e}=t,i=n.intercept(e);c.provide(o,n),c.onUnmount(()=>{i.restore()})}};function p(){let c=s(o);if(!c)throw Error("useSchmock must be used in a component with schmockPlugin installed");return c}export{p as useSchmock,m as schmockPlugin};
package/package.json ADDED
@@ -0,0 +1,50 @@
1
+ {
2
+ "name": "@schmock/vue",
3
+ "version": "2.0.0",
4
+ "description": "Vue adapter for Schmock — Plugin and composables",
5
+ "type": "module",
6
+ "main": "./dist/index.js",
7
+ "types": "./dist/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./dist/index.d.ts",
11
+ "import": "./dist/index.js"
12
+ },
13
+ "./package.json": "./package.json"
14
+ },
15
+ "files": [
16
+ "dist"
17
+ ],
18
+ "scripts": {
19
+ "build": "bun build:lib && bun build:types",
20
+ "build:lib": "bun build --minify --target browser --outdir=dist src/index.ts --external @schmock/core --external vue",
21
+ "build:types": "tsc -p tsconfig.json",
22
+ "test": "vitest run",
23
+ "test:watch": "vitest --watch",
24
+ "test:bdd": "vitest run --config vitest.config.bdd.ts",
25
+ "lint": "biome check src/",
26
+ "lint:fix": "biome check --write --unsafe src/",
27
+ "check:publish": "publint && attw --pack --ignore-rules cjs-resolves-to-esm"
28
+ },
29
+ "license": "MIT",
30
+ "dependencies": {},
31
+ "peerDependencies": {
32
+ "@schmock/core": "^2.0.0",
33
+ "vue": "^3.3.0"
34
+ },
35
+ "devDependencies": {
36
+ "@amiceli/vitest-cucumber": "^6.3.0",
37
+ "@vue/test-utils": "^2.4.0",
38
+ "jsdom": "^26.0.0",
39
+ "vue": "^3.5.0",
40
+ "vitest": "^4.1.2"
41
+ },
42
+ "keywords": [
43
+ "schmock",
44
+ "mock",
45
+ "vue",
46
+ "testing",
47
+ "api"
48
+ ],
49
+ "author": "Khalic Lab"
50
+ }