{"_id":"@crazydos/nuxt-msw","_rev":"12-01f7f8353d87ef4897d4db5cbe944b3c","name":"@crazydos/nuxt-msw","dist-tags":{"latest":"1.0.2"},"versions":{"0.1.0":{"name":"@crazydos/nuxt-msw","version":"0.1.0","license":"MIT","_id":"@crazydos/nuxt-msw@0.1.0","maintainers":[{"name":"crazydos","email":"wendell20904102@gmail.com"}],"homepage":"https://github.com/shunnNet/nuxt-msw#readme","bugs":{"url":"https://github.com/shunnNet/nuxt-msw/issues"},"msw":{"workerDirectory":["playground/public"]},"dist":{"shasum":"7493b21fb3ed59b82d305cdba88975e09d4374d8","tarball":"https://registry.npmjs.org/@crazydos/nuxt-msw/-/nuxt-msw-0.1.0.tgz","fileCount":21,"integrity":"sha512-noQmUq0A8RMwLMNtX6wrQlDxbyJbmmWzGpLDmurYGFPJtO7zY5+XBNnDNGqnfrNULvTL9J+ODAafmV2Yi19ojA==","signatures":[{"sig":"MEUCIG9Unxp6K2+vYZXoZZBTsL/EYguWLYFxTkThFoUx+OaqAiEAuRuzy1uJyUoKac93fOwSxhDJquyr6YJlFRuETR+9Was=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":19411},"main":"./dist/module.cjs","type":"module","types":"./dist/types.d.ts","exports":{".":{"types":"./dist/types.d.ts","import":"./dist/module.mjs","require":"./dist/module.cjs"}},"gitHead":"ac57a6777ffb4ea1d37af1ce3d1f0e7f00f3cfdf","scripts":{"dev":"nuxi dev playground","lint":"eslint .","test":"vitest run","prepack":"nuxt-module-build build","release":"npm run lint && npm run test && npm run prepack && changelogen --release && npm publish && git push --follow-tags","dev:build":"nuxi build playground","test:types":"vue-tsc --noEmit && cd playground && vue-tsc --noEmit","test:watch":"vitest watch","dev:prepare":"nuxt-module-build build --stub && nuxt-module-build prepare && nuxi prepare playground"},"_npmUser":{"name":"crazydos","email":"wendell20904102@gmail.com"},"repository":{"url":"git+https://github.com/shunnNet/nuxt-msw.git","type":"git"},"_npmVersion":"10.1.0","description":"Nuxt module integration for MSW (Mock Service Worker)","directories":{},"_nodeVersion":"20.9.0","dependencies":{"unimport":"^3.7.1","@nuxt/kit":"^3.11.2"},"_hasShrinkwrap":false,"devDependencies":{"msw":"^2.3.0","nuxt":"^3.11.2","eslint":"^9.2.0","vitest":"^1.6.0","vue-tsc":"^2.0.16","typescript":"latest","@types/node":"^20.12.11","changelogen":"^0.5.5","@nuxt/schema":"^3.11.2","@nuxt/devtools":"^1.2.0","@nuxt/test-utils":"^3.12.1","@nuxt/eslint-config":"^0.3.10","@nuxt/module-builder":"^0.6.0"},"_npmOperationalInternal":{"tmp":"tmp/nuxt-msw_0.1.0_1716647941880_0.6139836422042548","host":"s3://npm-registry-packages"}},"0.1.1":{"name":"@crazydos/nuxt-msw","version":"0.1.1","license":"MIT","_id":"@crazydos/nuxt-msw@0.1.1","maintainers":[{"name":"crazydos","email":"wendell20904102@gmail.com"}],"homepage":"https://github.com/shunnNet/nuxt-msw#readme","bugs":{"url":"https://github.com/shunnNet/nuxt-msw/issues"},"msw":{"workerDirectory":["playground/public"]},"dist":{"shasum":"a0b482e369bb1394c3f87e9da67605154244f04b","tarball":"https://registry.npmjs.org/@crazydos/nuxt-msw/-/nuxt-msw-0.1.1.tgz","fileCount":21,"integrity":"sha512-X925F95fbup4DA4dPKIzo8vQX60n1ISKN724Jp6sADJjzyCq4rvMyDPE8yGSHtzx1UOPbsAVbQ/yeYPagtFAdQ==","signatures":[{"sig":"MEUCIQCecn7QDmgJh+qyv6U9yn6h0KoEVkss9BHXbdLbU8vgnAIgQl91NRw1bRSNWQFr6a8g6hOFoJHNy/I4MQdP6hGydXg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":19488},"main":"./dist/module.cjs","type":"module","types":"./dist/types.d.ts","exports":{".":{"types":"./dist/types.d.ts","import":"./dist/module.mjs","require":"./dist/module.cjs"}},"gitHead":"bab572f8886c9074a7f38e386f805a9bc3f56245","scripts":{"dev":"nuxi dev playground","lint":"eslint .","test":"vitest run","prepack":"nuxt-module-build build","release":"npm run lint && npm run test && npm run prepack && changelogen --release && npm publish && git push --follow-tags","dev:build":"nuxi build playground","test:types":"vue-tsc --noEmit && cd playground && vue-tsc --noEmit","test:watch":"vitest watch","dev:prepare":"nuxt-module-build build --stub && nuxt-module-build prepare && nuxi prepare playground"},"_npmUser":{"name":"crazydos","email":"wendell20904102@gmail.com"},"repository":{"url":"git+https://github.com/shunnNet/nuxt-msw.git","type":"github"},"_npmVersion":"10.1.0","description":"Nuxt module integration for MSW (Mock Service Worker)","directories":{},"_nodeVersion":"20.9.0","dependencies":{"unimport":"^3.7.1","@nuxt/kit":"^3.11.2"},"_hasShrinkwrap":false,"devDependencies":{"msw":"^2.3.0","nuxt":"^3.11.2","eslint":"^9.2.0","vitest":"^1.6.0","vue-tsc":"^2.0.16","typescript":"latest","@types/node":"^20.12.11","changelogen":"^0.5.5","@nuxt/schema":"^3.11.2","@nuxt/devtools":"^1.2.0","@nuxt/test-utils":"^3.12.1","@nuxt/eslint-config":"^0.3.10","@nuxt/module-builder":"^0.6.0"},"_npmOperationalInternal":{"tmp":"tmp/nuxt-msw_0.1.1_1716652158372_0.8282543338582198","host":"s3://npm-registry-packages"}},"0.1.2":{"name":"@crazydos/nuxt-msw","version":"0.1.2","license":"MIT","_id":"@crazydos/nuxt-msw@0.1.2","maintainers":[{"name":"crazydos","email":"wendell20904102@gmail.com"}],"homepage":"https://github.com/shunnNet/nuxt-msw#readme","bugs":{"url":"https://github.com/shunnNet/nuxt-msw/issues"},"msw":{"workerDirectory":["playground/public"]},"dist":{"shasum":"4986f7e40fbc72530ba88f4ef9609545d2fbde46","tarball":"https://registry.npmjs.org/@crazydos/nuxt-msw/-/nuxt-msw-0.1.2.tgz","fileCount":21,"integrity":"sha512-PXdfuPg9Q8dtFbDAqwK4jmj2eSi65QBksm9vYrQFQSBnuIcc6KR716tOIcQsMSTs9VuxD9SV6bTHKTeEW/j3WA==","signatures":[{"sig":"MEUCIDQC0t1EZOn5y//Eg3PlodSoJOm7JYozZ0Op7yMU6hk2AiEAlsEn1nc+86cNZ6gsIYDsBIebmpfubfsRb4K0U5DNQVM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":19488},"main":"./dist/module.cjs","type":"module","types":"./dist/types.d.ts","exports":{".":{"types":"./dist/types.d.ts","import":"./dist/module.mjs","require":"./dist/module.cjs"}},"gitHead":"2144e3e516521c43006b1bcf1e3fbab79f711f22","scripts":{"dev":"nuxi dev playground","lint":"eslint .","test":"vitest run","prepack":"nuxt-module-build build","release":"npm run lint && npm run test && npm run prepack && changelogen --release && npm publish && git push --follow-tags","dev:build":"nuxi build playground","test:types":"vue-tsc --noEmit && cd playground && vue-tsc --noEmit","test:watch":"vitest watch","dev:prepare":"nuxt-module-build build --stub && nuxt-module-build prepare && nuxi prepare playground"},"_npmUser":{"name":"crazydos","email":"wendell20904102@gmail.com"},"repository":{"url":"git+https://github.com/shunnNet/nuxt-msw.git","type":"github"},"_npmVersion":"10.1.0","description":"Nuxt module integration for MSW (Mock Service Worker)","directories":{},"_nodeVersion":"20.9.0","dependencies":{"unimport":"^3.7.1","@nuxt/kit":"^3.11.2"},"_hasShrinkwrap":false,"devDependencies":{"msw":"^2.3.0","nuxt":"^3.11.2","eslint":"^9.2.0","vitest":"^1.6.0","vue-tsc":"^2.0.16","typescript":"latest","@types/node":"^20.12.11","changelogen":"^0.5.5","@nuxt/schema":"^3.11.2","@nuxt/devtools":"^1.2.0","@nuxt/test-utils":"^3.12.1","@nuxt/eslint-config":"^0.3.10","@nuxt/module-builder":"^0.6.0"},"_npmOperationalInternal":{"tmp":"tmp/nuxt-msw_0.1.2_1716653712093_0.9643384203608867","host":"s3://npm-registry-packages"}},"0.1.3":{"name":"@crazydos/nuxt-msw","version":"0.1.3","license":"MIT","_id":"@crazydos/nuxt-msw@0.1.3","maintainers":[{"name":"crazydos","email":"wendell20904102@gmail.com"}],"homepage":"https://github.com/shunnNet/nuxt-msw#readme","bugs":{"url":"https://github.com/shunnNet/nuxt-msw/issues"},"msw":{"workerDirectory":["playground/public"]},"dist":{"shasum":"ad5799a57ae875ae058d09c76ed8a24eda34de3e","tarball":"https://registry.npmjs.org/@crazydos/nuxt-msw/-/nuxt-msw-0.1.3.tgz","fileCount":21,"integrity":"sha512-oTZa7KjLZMZ0Y+ZUGr4AdhMXBDgNOVpd1Im668aEsu4rSgXwPbSnblcXCjZs1s//bnC8bnx1Nz+5jh29ZZp5eg==","signatures":[{"sig":"MEYCIQD0+hbCf3/CSR+hHJPgEUuwF2zrWNy6xKwbX1TTHkqd7gIhAIGj89oXhxljAgiq6/+gkwwcJngcp8egElUOP4CYJv7L","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":19488},"main":"./dist/module.cjs","type":"module","types":"./dist/types.d.ts","exports":{".":{"types":"./dist/types.d.ts","import":"./dist/module.mjs","require":"./dist/module.cjs"}},"gitHead":"d56fb5da751a84f45fa0fad550a6842022df46bd","scripts":{"dev":"nuxi dev playground","lint":"eslint .","test":"vitest run","prepack":"nuxt-module-build build","release":"npm run lint && npm run test && npm run prepack && changelogen --release && npm publish && git push --follow-tags","dev:build":"nuxi build playground","test:types":"vue-tsc --noEmit && cd playground && vue-tsc --noEmit","test:watch":"vitest watch","dev:prepare":"nuxt-module-build build --stub && nuxt-module-build prepare && nuxi prepare playground"},"_npmUser":{"name":"crazydos","email":"wendell20904102@gmail.com"},"repository":{"url":"git+https://github.com/shunnNet/nuxt-msw.git","type":"github"},"_npmVersion":"10.1.0","description":"Nuxt module integration for MSW (Mock Service Worker)","directories":{},"_nodeVersion":"20.9.0","dependencies":{"unimport":"^3.7.1","@nuxt/kit":"^3.11.2"},"_hasShrinkwrap":false,"devDependencies":{"msw":"^2.3.0","nuxt":"^3.11.2","eslint":"^9.2.0","vitest":"^1.6.0","vue-tsc":"^2.0.16","typescript":"latest","@types/node":"^20.12.11","changelogen":"^0.5.5","@nuxt/schema":"^3.11.2","@nuxt/devtools":"^1.2.0","@nuxt/test-utils":"^3.12.1","@nuxt/eslint-config":"^0.3.10","@nuxt/module-builder":"^0.6.0"},"_npmOperationalInternal":{"tmp":"tmp/nuxt-msw_0.1.3_1716653919393_0.8112905848861371","host":"s3://npm-registry-packages"}},"0.1.4":{"name":"@crazydos/nuxt-msw","version":"0.1.4","license":"MIT","_id":"@crazydos/nuxt-msw@0.1.4","maintainers":[{"name":"crazydos","email":"wendell20904102@gmail.com"}],"homepage":"https://github.com/shunnNet/nuxt-msw#readme","bugs":{"url":"https://github.com/shunnNet/nuxt-msw/issues"},"msw":{"workerDirectory":["playground/public"]},"dist":{"shasum":"f1f46b108a57746ab8376822bc2ec204ca800cf5","tarball":"https://registry.npmjs.org/@crazydos/nuxt-msw/-/nuxt-msw-0.1.4.tgz","fileCount":21,"integrity":"sha512-2iMXWTpcqSmoUofR/3IoPOKa1HiaTDAQVmnERILbqE9qB4jLY415tnmkXOCwYdDNI1wf769/LuXm4Uwp2ZXIDQ==","signatures":[{"sig":"MEYCIQCjOlq4hsqJhAlwLYVR8tEfPOlBNDKfikq44vQM13J7DgIhAP3kM2c+q+Tf5h8jnjjamifB0FG2CEp1jbkhvwT5L1sz","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":19488},"main":"./dist/module.cjs","type":"module","types":"./dist/types.d.ts","exports":{".":{"types":"./dist/types.d.ts","import":"./dist/module.mjs","require":"./dist/module.cjs"}},"gitHead":"36ce3cceb1814c2525be2e8e2b42c811986d279a","scripts":{"dev":"nuxi dev playground","lint":"eslint .","test":"vitest run","prepack":"nuxt-module-build build","release":"npm run lint && npm run test && npm run prepack && changelogen --release && npm publish && git push --follow-tags","dev:build":"nuxi build playground","test:types":"vue-tsc --noEmit && cd playground && vue-tsc --noEmit","test:watch":"vitest watch","dev:prepare":"nuxt-module-build build --stub && nuxt-module-build prepare && nuxi prepare playground"},"_npmUser":{"name":"crazydos","email":"wendell20904102@gmail.com"},"repository":{"url":"git+https://github.com/shunnNet/nuxt-msw.git","type":"github"},"_npmVersion":"10.1.0","description":"Nuxt module integration for MSW (Mock Service Worker)","directories":{},"_nodeVersion":"20.9.0","dependencies":{"unimport":"^3.7.1","@nuxt/kit":"^3.11.2"},"_hasShrinkwrap":false,"devDependencies":{"msw":"^2.3.0","nuxt":"^3.11.2","eslint":"^9.2.0","vitest":"^1.6.0","vue-tsc":"^2.0.16","typescript":"latest","@types/node":"^20.12.11","changelogen":"^0.5.5","@nuxt/schema":"^3.11.2","@nuxt/devtools":"^1.2.0","@nuxt/test-utils":"^3.12.1","@nuxt/eslint-config":"^0.3.10","@nuxt/module-builder":"^0.6.0"},"_npmOperationalInternal":{"tmp":"tmp/nuxt-msw_0.1.4_1716654060329_0.7220962543948513","host":"s3://npm-registry-packages"}},"0.1.6":{"name":"@crazydos/nuxt-msw","version":"0.1.6","license":"MIT","_id":"@crazydos/nuxt-msw@0.1.6","maintainers":[{"name":"crazydos","email":"wendell20904102@gmail.com"}],"homepage":"https://github.com/shunnNet/nuxt-msw#readme","bugs":{"url":"https://github.com/shunnNet/nuxt-msw/issues"},"msw":{"workerDirectory":["playground/public"]},"dist":{"shasum":"06a1f3ef3e4ab7df74e0a5d38a0f8b388878e184","tarball":"https://registry.npmjs.org/@crazydos/nuxt-msw/-/nuxt-msw-0.1.6.tgz","fileCount":20,"integrity":"sha512-Xn9sWT2hEv61u12tO4XsgQkoHcfCm5gmqult0kCLCmPZXnKkujVUBxpS5Xvutg2IIOInIPmQx1jOKHaAFBT9fQ==","signatures":[{"sig":"MEUCIQDgDTp8RkJojxZQkOC1rqapeiuARMiK00fIm0Ep3cUa9AIgGF7EsDJo9t3MSL+cBzHqaqmP/o/l5bb/3oVtSma/IWI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":18607},"main":"./dist/module.cjs","type":"module","types":"./dist/types.d.ts","exports":{".":{"types":"./dist/types.d.ts","import":"./dist/module.mjs","require":"./dist/module.cjs"}},"gitHead":"4a82decdf4c9a9f9b2d4c302437accb8485000b4","scripts":{"dev":"nuxi dev playground","lint":"eslint .","test":"vitest run","prepack":"nuxt-module-build build","dev:build":"nuxi build playground","test:types":"vue-tsc --noEmit && cd playground && vue-tsc --noEmit","test:watch":"vitest watch","dev:prepare":"nuxt-module-build build --stub && nuxt-module-build prepare && nuxi prepare playground"},"_npmUser":{"name":"crazydos","email":"wendell20904102@gmail.com"},"repository":{"url":"git+https://github.com/shunnNet/nuxt-msw.git","type":"github"},"_npmVersion":"10.1.0","description":"Nuxt module integration for MSW (Mock Service Worker)","directories":{},"_nodeVersion":"20.9.0","dependencies":{"unimport":"^3.7.1","@nuxt/kit":"^3.11.2"},"_hasShrinkwrap":false,"devDependencies":{"msw":"^2.3.0","nuxt":"^3.11.2","eslint":"^9.2.0","vitest":"^1.6.0","vue-tsc":"^2.0.16","typescript":"latest","@types/node":"^20.12.11","changelogen":"^0.5.5","@nuxt/schema":"^3.11.2","@nuxt/devtools":"^1.2.0","@nuxt/test-utils":"^3.12.1","@nuxt/eslint-config":"^0.3.10","@nuxt/module-builder":"^0.6.0"},"_npmOperationalInternal":{"tmp":"tmp/nuxt-msw_0.1.6_1716655223786_0.5012078869136412","host":"s3://npm-registry-packages"}},"0.1.7":{"name":"@crazydos/nuxt-msw","version":"0.1.7","license":"MIT","_id":"@crazydos/nuxt-msw@0.1.7","maintainers":[{"name":"crazydos","email":"wendell20904102@gmail.com"}],"homepage":"https://github.com/shunnNet/nuxt-msw#readme","bugs":{"url":"https://github.com/shunnNet/nuxt-msw/issues"},"msw":{"workerDirectory":["playground/public"]},"dist":{"shasum":"53f4194b9ffc898ff9886d4ca25a7610f325cf89","tarball":"https://registry.npmjs.org/@crazydos/nuxt-msw/-/nuxt-msw-0.1.7.tgz","fileCount":20,"integrity":"sha512-nKgOrntNYOzjD1I0K1GabP4gIXCYsjaQ1el8Z+lUx0GXmIaCwlRiLBRFn3wyo1xVv1/3vX1aNjbBCNGTKmxznw==","signatures":[{"sig":"MEUCIQDpwoTVtt17EmyBTFxn+1bttTxvOUJHgY+tj3mrUwDt7wIgbbiU2aQNd47Ve7JSk7QzkK3GyLQbbKbNVV0V1iSqJhE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":18617},"main":"./bundle/module.cjs","type":"module","types":"./bundle/types.d.ts","exports":{".":{"types":"./bundle/types.d.ts","import":"./bundle/module.mjs","require":"./bundle/module.cjs"}},"gitHead":"135ebc6c036fb7b1c9ffd919a14740e80d0b39ad","scripts":{"dev":"nuxi dev playground","lint":"eslint .","test":"vitest run","prepack":"nuxt-module-build build","dev:build":"nuxi build playground","test:types":"vue-tsc --noEmit && cd playground && vue-tsc --noEmit","test:watch":"vitest watch","dev:prepare":"nuxt-module-build build --stub && nuxt-module-build prepare && nuxi prepare playground"},"_npmUser":{"name":"crazydos","email":"wendell20904102@gmail.com"},"repository":{"url":"git+https://github.com/shunnNet/nuxt-msw.git","type":"github"},"_npmVersion":"10.1.0","description":"Nuxt module integration for MSW (Mock Service Worker)","directories":{},"_nodeVersion":"20.9.0","dependencies":{"unimport":"^3.7.1","@nuxt/kit":"^3.11.2"},"_hasShrinkwrap":false,"devDependencies":{"msw":"^2.3.0","nuxt":"^3.11.2","eslint":"^9.2.0","vitest":"^1.6.0","vue-tsc":"^2.0.16","typescript":"latest","@types/node":"^20.12.11","changelogen":"^0.5.5","@nuxt/schema":"^3.11.2","@nuxt/devtools":"^1.2.0","@nuxt/test-utils":"^3.12.1","@nuxt/eslint-config":"^0.3.10","@nuxt/module-builder":"^0.6.0"},"_npmOperationalInternal":{"tmp":"tmp/nuxt-msw_0.1.7_1716655428014_0.1781871735315208","host":"s3://npm-registry-packages"}},"0.1.8":{"name":"@crazydos/nuxt-msw","version":"0.1.8","license":"MIT","_id":"@crazydos/nuxt-msw@0.1.8","maintainers":[{"name":"crazydos","email":"wendell20904102@gmail.com"}],"homepage":"https://github.com/shunnNet/nuxt-msw#readme","bugs":{"url":"https://github.com/shunnNet/nuxt-msw/issues"},"msw":{"workerDirectory":["playground/public"]},"dist":{"shasum":"45cfb7da89e3fc3c68e20955fc788da500441827","tarball":"https://registry.npmjs.org/@crazydos/nuxt-msw/-/nuxt-msw-0.1.8.tgz","fileCount":21,"integrity":"sha512-hUHOmOEwPuxsT2fYZFEt4tzSSXkNga0UtYEjVVnDXpSVlutt4Kw7CfTAmuPg2rcWNchXyr1JWKNBaUHtS3y07w==","signatures":[{"sig":"MEUCIA7W8QI4RIr+fB6Eu9rSLrx1CFiqD8e7GlK9O1KyfN3+AiEA+FMCxy90hfJ92AXyy27iwYCZhya9p1yr6UR7kNE7buM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":23167},"main":"./bundle/module.cjs","type":"module","types":"./bundle/types.d.ts","exports":{".":{"types":"./bundle/types.d.ts","import":"./bundle/module.mjs","require":"./bundle/module.cjs"}},"gitHead":"14081a752bf58f1cb87f00712e4aa7361ba963c4","scripts":{"dev":"nuxi dev playground","lint":"eslint .","test":"vitest run","prepack":"nuxt-module-build build","dev:build":"nuxi build playground","test:types":"vue-tsc --noEmit && cd playground && vue-tsc --noEmit","test:watch":"vitest watch","dev:prepare":"nuxt-module-build build --stub && nuxt-module-build prepare && nuxi prepare playground"},"_npmUser":{"name":"crazydos","email":"wendell20904102@gmail.com"},"repository":{"url":"git+https://github.com/shunnNet/nuxt-msw.git","type":"github"},"_npmVersion":"10.1.0","description":"Nuxt module integration for MSW (Mock Service Worker)","directories":{},"_nodeVersion":"20.9.0","dependencies":{"unimport":"^3.7.1","@nuxt/kit":"^3.11.2"},"_hasShrinkwrap":false,"devDependencies":{"msw":"^2.3.0","nuxt":"^3.11.2","eslint":"^9.2.0","vitest":"^1.6.0","vue-tsc":"^2.0.16","typescript":"latest","@types/node":"^20.12.11","changelogen":"^0.5.5","@nuxt/schema":"^3.11.2","@nuxt/devtools":"^1.2.0","@nuxt/test-utils":"^3.12.1","@nuxt/eslint-config":"^0.3.10","@nuxt/module-builder":"^0.6.0"},"_npmOperationalInternal":{"tmp":"tmp/nuxt-msw_0.1.8_1716655979734_0.2544333896644335","host":"s3://npm-registry-packages"}},"0.1.9":{"name":"@crazydos/nuxt-msw","version":"0.1.9","license":"MIT","_id":"@crazydos/nuxt-msw@0.1.9","maintainers":[{"name":"crazydos","email":"wendell20904102@gmail.com"}],"homepage":"https://github.com/shunnNet/nuxt-msw#readme","bugs":{"url":"https://github.com/shunnNet/nuxt-msw/issues"},"msw":{"workerDirectory":["playground/public"]},"dist":{"shasum":"4ad137187df202390e6fc914e4c68296831d022b","tarball":"https://registry.npmjs.org/@crazydos/nuxt-msw/-/nuxt-msw-0.1.9.tgz","fileCount":21,"integrity":"sha512-/THeMUpibk/0bfab+63BCrL1u2nmcg72zuSa9OiSN6MBSMJs+FbrlafqVuKJfJov0s1NvRd4qy5w4Q2ajizogg==","signatures":[{"sig":"MEUCIA/1SzXheZm7A+7UFF9iTJRPKQcYV/3fC8/V0iht2ohBAiEAlk02tdfyP5F4T5dulHFyeBH2JY2RNm1ERZIJngf+XL8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":24790},"main":"./dist/module.cjs","type":"module","types":"./dist/types.d.ts","exports":{".":{"types":"./dist/types.d.ts","import":"./dist/module.mjs","require":"./dist/module.cjs"}},"gitHead":"be232d437fd961e83b6f6326fe0c29760c7f54d4","scripts":{"dev":"nuxi dev playground","lint":"eslint .","test":"vitest run","build":"sh scripts/build.sh","release":"npm run lint && npm run test && npm run build && changelogen --release && npm publish && git push --follow-tags","dev:build":"nuxi build playground","test:types":"vue-tsc --noEmit && cd playground && vue-tsc --noEmit","test:watch":"vitest watch","dev:prepare":"nuxt-module-build build --stub && nuxt-module-build prepare && nuxi prepare playground"},"_npmUser":{"name":"crazydos","email":"wendell20904102@gmail.com"},"repository":{"url":"git+https://github.com/shunnNet/nuxt-msw.git","type":"github"},"_npmVersion":"10.5.0","description":"Nuxt module integration for MSW (Mock Service Worker)","directories":{},"_nodeVersion":"20.12.2","dependencies":{"unimport":"^3.7.1","@nuxt/kit":"^3.11.2"},"_hasShrinkwrap":false,"devDependencies":{"msw":"^2.3.0","nuxt":"^3.11.2","eslint":"^9.2.0","vitest":"^1.6.0","vue-tsc":"^2.0.16","typescript":"latest","@types/node":"^20.12.11","changelogen":"^0.5.5","@nuxt/schema":"^3.11.2","@nuxt/devtools":"^1.2.0","@nuxt/test-utils":"^3.12.1","@playwright/test":"^1.44.1","@nuxt/eslint-config":"^0.3.10","@nuxt/module-builder":"^0.6.0"},"_npmOperationalInternal":{"tmp":"tmp/nuxt-msw_0.1.9_1716682014861_0.8456737073748375","host":"s3://npm-registry-packages"}},"0.2.0":{"name":"@crazydos/nuxt-msw","version":"0.2.0","license":"MIT","_id":"@crazydos/nuxt-msw@0.2.0","maintainers":[{"name":"crazydos","email":"wendell20904102@gmail.com"}],"homepage":"https://github.com/shunnNet/nuxt-msw#readme","bugs":{"url":"https://github.com/shunnNet/nuxt-msw/issues"},"msw":{"workerDirectory":["playground/public"]},"dist":{"shasum":"7731d067b49d5902907c6810342109c2270b0bbe","tarball":"https://registry.npmjs.org/@crazydos/nuxt-msw/-/nuxt-msw-0.2.0.tgz","fileCount":21,"integrity":"sha512-ZxKM0m9CzWvMhxD4xsUcrDZgWp2JXy3/mkpYcNWRabqf34P3rsqQF9F+ZSw+NOZUsOfIedku5m+YZarQ624BVA==","signatures":[{"sig":"MEUCIQCGNWnBYrqpJKeDk8o3jvFfl0lS6bPw6yMIRsfM3655mQIgXWnsyR37kdftFaXzXQm5ECwl4gA7m6A+YQpFjei36YM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25045},"main":"./dist/module.cjs","type":"module","types":"./dist/types.d.ts","exports":{".":{"types":"./dist/types.d.ts","import":"./dist/module.mjs","require":"./dist/module.cjs"}},"gitHead":"838a8ee2dcaca58217c41197bdcaa165cde007ef","scripts":{"dev":"nuxi dev playground","lint":"eslint .","test":"vitest run","build":"sh scripts/build.sh","release":"npm run lint && npm run test && npm run build && changelogen --release && npm publish && git push --follow-tags","dev:build":"nuxi build playground","test:types":"vue-tsc --noEmit && cd playground && vue-tsc --noEmit","test:watch":"vitest watch","dev:prepare":"nuxt-module-build build --stub && nuxt-module-build prepare && nuxi prepare playground"},"_npmUser":{"name":"crazydos","email":"wendell20904102@gmail.com"},"repository":{"url":"git+https://github.com/shunnNet/nuxt-msw.git","type":"github"},"_npmVersion":"10.5.0","description":"Nuxt module integration for MSW (Mock Service Worker)","directories":{},"_nodeVersion":"20.12.2","dependencies":{"unimport":"^3.7.1","@nuxt/kit":"^3.11.2"},"_hasShrinkwrap":false,"devDependencies":{"msw":"^2.3.0","nuxt":"^3.11.2","eslint":"^9.2.0","vitest":"^1.6.0","vue-tsc":"^2.0.16","typescript":"latest","@types/node":"^20.12.11","changelogen":"^0.5.5","@nuxt/schema":"^3.11.2","@nuxt/devtools":"^1.2.0","@nuxt/test-utils":"^3.12.1","@playwright/test":"^1.44.1","@nuxt/eslint-config":"^0.3.10","@nuxt/module-builder":"^0.6.0"},"_npmOperationalInternal":{"tmp":"tmp/nuxt-msw_0.2.0_1717337237173_0.5131760473781166","host":"s3://npm-registry-packages"}},"1.0.0":{"name":"@crazydos/nuxt-msw","version":"1.0.0","author":{"url":"https://github.com/shunnNet","name":"shunnNet","email":"wendell20904102@gmail.com"},"license":"MIT","_id":"@crazydos/nuxt-msw@1.0.0","maintainers":[{"name":"crazydos","email":"wendell20904102@gmail.com"}],"homepage":"https://github.com/shunnNet/nuxt-msw#readme","bugs":{"url":"https://github.com/shunnNet/nuxt-msw/issues"},"msw":{"workerDirectory":["playground/public"]},"dist":{"shasum":"319386f071a727ecb714dcb77439aab031d976b4","tarball":"https://registry.npmjs.org/@crazydos/nuxt-msw/-/nuxt-msw-1.0.0.tgz","fileCount":24,"integrity":"sha512-aKzFRKOlRYhdB0RnFOjtCZBynwvSuOUoTzuw3eOcYcwHeJoHxLBEfaV5GKPZY1XicOofn3GPYOZNarfVbGZOSA==","signatures":[{"sig":"MEUCIELkz7CU8TDWt+ZrjY5+flrANDDjLeaEWA6fT6k/kwccAiEAhlVuGZQu5XlWPiHXOjyH5bQfaII8U/dsYGz2AfmiCvE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":38350},"main":"./dist/module.cjs","type":"module","_from":"file:crazydos-nuxt-msw-1.0.0.tgz","types":"./dist/types.d.ts","exports":{".":{"types":"./dist/types.d.ts","import":"./dist/module.mjs","require":"./dist/module.cjs"},"./test-utils":{"types":"./dist/runtime/test-utils.d.ts","import":"./dist/runtime/test-utils.mjs"}},"scripts":{"dev":"nuxi dev playground","lint":"eslint .","test":"vitest run","build":"sh scripts/build.sh","release":"npm run lint && npm run test && npm run build && changelogen --release && npm publish && git push --follow-tags","test:pl":"playwright test","dev:build":"nuxi build playground","test:types":"vue-tsc --noEmit && cd playground && vue-tsc --noEmit","test:watch":"vitest watch","dev:prepare":"nuxt-module-build build --stub && nuxt-module-build prepare && nuxi prepare playground"},"_npmUser":{"name":"crazydos","email":"wendell20904102@gmail.com"},"_resolved":"/private/var/folders/cy/dkhc_bx936146krjt5tptv4m0000gn/T/70a9e9bbf86e9c120fdecefe34cc3a93/crazydos-nuxt-msw-1.0.0.tgz","_integrity":"sha512-aKzFRKOlRYhdB0RnFOjtCZBynwvSuOUoTzuw3eOcYcwHeJoHxLBEfaV5GKPZY1XicOofn3GPYOZNarfVbGZOSA==","repository":{"url":"git+https://github.com/shunnNet/nuxt-msw.git","type":"github"},"_npmVersion":"10.5.0","description":"Nuxt module integration for MSW (Mock Service Worker)","directories":{},"_nodeVersion":"20.12.2","dependencies":{"ofetch":"^1.3.4","unimport":"^3.7.1","@nuxt/kit":"^3.11.2"},"_hasShrinkwrap":false,"devDependencies":{"h3":"^1.12.0","msw":"^2.3.0","nuxt":"^3.11.2","eslint":"^9.2.0","vitest":"^1.6.0","vue-tsc":"^2.0.16","happy-dom":"^14.12.3","typescript":"latest","@types/node":"^20.12.11","changelogen":"^0.5.5","@nuxt/schema":"^3.11.2","@nuxt/devtools":"^1.2.0","@vue/test-utils":"^2.4.6","@nuxt/test-utils":"^3.12.1","@playwright/test":"^1.44.0","@nuxt/eslint-config":"^0.3.10","@nuxt/module-builder":"^0.6.0","vitest-environment-nuxt":"^1.0.1"},"peerDependencies":{"msw":"^2.x"},"_npmOperationalInternal":{"tmp":"tmp/nuxt-msw_1.0.0_1724256071546_0.21392005896601018","host":"s3://npm-registry-packages"}},"1.0.1":{"name":"@crazydos/nuxt-msw","version":"1.0.1","author":{"url":"https://github.com/shunnNet","name":"shunnNet","email":"wendell20904102@gmail.com"},"license":"MIT","_id":"@crazydos/nuxt-msw@1.0.1","maintainers":[{"name":"crazydos","email":"wendell20904102@gmail.com"}],"homepage":"https://github.com/shunnNet/nuxt-msw#readme","bugs":{"url":"https://github.com/shunnNet/nuxt-msw/issues"},"msw":{"workerDirectory":["playground/public"]},"dist":{"shasum":"e83c0afb9765b6a1d2686d62d361e4a9b710bd59","tarball":"https://registry.npmjs.org/@crazydos/nuxt-msw/-/nuxt-msw-1.0.1.tgz","fileCount":24,"integrity":"sha512-h6LEomMlFZcNtXGCVDgP/1hzB7AEGTvfD12BogAKhZFIZVA05sqD6Fsm7ObXJBLzPl3dciVth2om4FerHU8AVw==","signatures":[{"sig":"MEUCIGPlB0wBYfbeBNKXbL4f1fr6PWJKAhkaN7oT+5nceVezAiEAwJ/N/ePw/ZgtyBeEVdMRg+wxKZGiYj5rTY1zHXBqh7M=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":38361},"main":"./dist/module.cjs","type":"module","_from":"file:crazydos-nuxt-msw-1.0.1.tgz","types":"./dist/types.d.ts","exports":{".":{"types":"./dist/types.d.ts","import":"./dist/module.mjs","require":"./dist/module.cjs"},"./test-utils":{"types":"./dist/runtime/test-utils.d.ts","import":"./dist/runtime/test-utils.mjs"}},"scripts":{"dev":"nuxi dev playground","lint":"eslint .","test":"vitest run","build":"sh scripts/build.sh","release":"npm run lint && npm run test && npm run build && changelogen --release && npm publish && git push --follow-tags","test:pl":"playwright test","dev:build":"nuxi build playground","test:types":"vue-tsc --noEmit && cd playground && vue-tsc --noEmit","test:watch":"vitest watch","dev:prepare":"nuxt-module-build build --stub && nuxt-module-build prepare && nuxi prepare playground"},"_npmUser":{"name":"crazydos","email":"wendell20904102@gmail.com"},"_resolved":"/private/var/folders/cy/dkhc_bx936146krjt5tptv4m0000gn/T/5064a634338f73112308edd834a63996/crazydos-nuxt-msw-1.0.1.tgz","_integrity":"sha512-h6LEomMlFZcNtXGCVDgP/1hzB7AEGTvfD12BogAKhZFIZVA05sqD6Fsm7ObXJBLzPl3dciVth2om4FerHU8AVw==","repository":{"url":"git+https://github.com/shunnNet/nuxt-msw.git","type":"github"},"_npmVersion":"10.5.0","description":"Nuxt module integration for MSW (Mock Service Worker)","directories":{},"_nodeVersion":"20.12.2","dependencies":{"ofetch":"^1.3.4","unimport":"^3.7.1","@nuxt/kit":"^3.11.2"},"_hasShrinkwrap":false,"devDependencies":{"h3":"^1.12.0","msw":"^2.3.0","nuxt":"^3.11.2","eslint":"^9.2.0","vitest":"^1.6.0","vue-tsc":"^2.0.16","happy-dom":"^14.12.3","typescript":"latest","@types/node":"^20.12.11","changelogen":"^0.5.5","@nuxt/schema":"^3.11.2","@nuxt/devtools":"^1.2.0","@vue/test-utils":"^2.4.6","@nuxt/test-utils":"^3.12.1","@playwright/test":"^1.44.0","@nuxt/eslint-config":"^0.3.10","@nuxt/module-builder":"^0.6.0","vitest-environment-nuxt":"^1.0.1"},"peerDependencies":{"msw":"^2.x"},"_npmOperationalInternal":{"tmp":"tmp/nuxt-msw_1.0.1_1726589560742_0.6392073512878726","host":"s3://npm-registry-packages"}},"1.0.2":{"name":"@crazydos/nuxt-msw","version":"1.0.2","description":"Nuxt module integration for MSW (Mock Service Worker)","author":{"name":"shunnNet","email":"wendell20904102@gmail.com","url":"https://github.com/shunnNet"},"repository":{"type":"github","url":"git+https://github.com/shunnNet/nuxt-msw.git"},"license":"MIT","type":"module","exports":{".":{"types":"./dist/types.d.ts","import":"./dist/module.mjs","require":"./dist/module.cjs"},"./test-utils":{"types":"./dist/runtime/test-utils.d.ts","import":"./dist/runtime/test-utils.mjs"}},"main":"./dist/module.cjs","types":"./dist/types.d.ts","dependencies":{"@nuxt/kit":"^3.11.2"},"peerDependencies":{"msw":"^2.x"},"devDependencies":{"@nuxt/devtools":"^1.2.0","@nuxt/eslint-config":"^0.3.10","@nuxt/module-builder":"^0.6.0","@nuxt/schema":"^3.11.2","@nuxt/test-utils":"^3.12.1","@playwright/test":"^1.44.0","@types/node":"^20.12.11","@vue/test-utils":"^2.4.6","changelogen":"^0.5.5","eslint":"^9.2.0","h3":"^1.12.0","happy-dom":"^14.12.3","msw":"^2.3.0","nuxt":"^3.11.2","typescript":"latest","vitest":"^1.6.0","vitest-environment-nuxt":"^1.0.1","vue-tsc":"^2.0.16","ofetch":"^1.3.4","unimport":"^3.7.1"},"msw":{"workerDirectory":["playground/public"]},"scripts":{"build":"sh scripts/build.sh","dev":"nuxi dev playground","dev:build":"nuxi build playground","dev:prepare":"nuxt-module-build build --stub && nuxt-module-build prepare && nuxi prepare playground","release":"npm run lint && npm run test && npm run build && changelogen --release && npm publish && git push --follow-tags","lint":"eslint .","test":"vitest run","test:watch":"vitest watch","test:types":"vue-tsc --noEmit && cd playground && vue-tsc --noEmit","test:pl":"playwright test"},"bugs":{"url":"https://github.com/shunnNet/nuxt-msw/issues"},"homepage":"https://github.com/shunnNet/nuxt-msw#readme","_id":"@crazydos/nuxt-msw@1.0.2","_integrity":"sha512-vQsmA5piJ0oB3JJ+yDwul+GqdDs411HPn3ZGTg+6+OnTkxTn0jpWrPIQ0XFd2n5pfO9WTWpquW/P7/cn4wPKmQ==","_resolved":"/private/var/folders/cy/dkhc_bx936146krjt5tptv4m0000gn/T/bb0751dd6f33d29b7f010a65b30c3748/crazydos-nuxt-msw-1.0.2.tgz","_from":"file:crazydos-nuxt-msw-1.0.2.tgz","_nodeVersion":"20.12.2","_npmVersion":"10.5.0","dist":{"integrity":"sha512-vQsmA5piJ0oB3JJ+yDwul+GqdDs411HPn3ZGTg+6+OnTkxTn0jpWrPIQ0XFd2n5pfO9WTWpquW/P7/cn4wPKmQ==","shasum":"cd37c1905d14a8f1fbe127bc27f6d6ba525efa26","tarball":"https://registry.npmjs.org/@crazydos/nuxt-msw/-/nuxt-msw-1.0.2.tgz","fileCount":24,"unpackedSize":41512,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIG2NrnXVAYEmO2M+YtThAON3bxvGbJ/WcbsXSqB+IgpbAiEArWDaofhL1BeO3tf22UM/MFgVTFlb6sakQId+Lu+eyqw="}]},"_npmUser":{"name":"crazydos","email":"wendell20904102@gmail.com"},"directories":{},"maintainers":[{"name":"crazydos","email":"wendell20904102@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/nuxt-msw_1.0.2_1731857600712_0.47820973797857125"},"_hasShrinkwrap":false}},"time":{"created":"2024-05-25T14:39:01.560Z","modified":"2024-11-17T15:33:21.106Z","0.1.0":"2024-05-25T14:39:02.032Z","0.1.1":"2024-05-25T15:49:18.543Z","0.1.2":"2024-05-25T16:15:12.238Z","0.1.3":"2024-05-25T16:18:39.619Z","0.1.4":"2024-05-25T16:21:00.621Z","0.1.6":"2024-05-25T16:40:23.973Z","0.1.7":"2024-05-25T16:43:48.171Z","0.1.8":"2024-05-25T16:53:00.049Z","0.1.9":"2024-05-26T00:06:55.049Z","0.2.0":"2024-06-02T14:07:17.327Z","1.0.0":"2024-08-21T16:01:11.746Z","1.0.1":"2024-09-17T16:12:40.959Z","1.0.2":"2024-11-17T15:33:20.932Z"},"bugs":{"url":"https://github.com/shunnNet/nuxt-msw/issues"},"author":{"name":"shunnNet","email":"wendell20904102@gmail.com","url":"https://github.com/shunnNet"},"license":"MIT","homepage":"https://github.com/shunnNet/nuxt-msw#readme","repository":{"type":"github","url":"git+https://github.com/shunnNet/nuxt-msw.git"},"description":"Nuxt module integration for MSW (Mock Service Worker)","maintainers":[{"name":"crazydos","email":"wendell20904102@gmail.com"}],"readme":"# nuxt-msw\n[![npm version](https://img.shields.io/npm/v/@crazydos/nuxt-msw.svg?style=flat&colorA=18181B&colorB=28CF8D)](https://www.npmjs.com/package/@crazydos/nuxt-msw)\n[![npm downloads](https://img.shields.io/npm/dm/@crazydos/nuxt-msw.svg?style=flat&colorA=18181B&colorB=28CF8D)](https://www.npmjs.com/package/@crazydos/nuxt-msw)\n[![License](https://img.shields.io/github/license/nuxt/nuxt.svg?style=flat&colorA=18181B&colorB=28CF8D)](https://github.com/shunnNet/nuxt-msw/blob/main/LICENSE)\n\n`nuxt-msw` integrates [MSW (Mock Service Worker)](https://mswjs.io/) into a Nuxt project, allowing you to use it for API mocking during development. Most of the code can be directly shared with test mocks. \n\n\n[✨ Release Notes](/CHANGELOG.md)\n<!-- - [🏀 Online playground](https://stackblitz.com/github/your-org/nuxt-msw?file=playground%2Fapp.vue) -->\n<!-- - [📖 &nbsp;Documentation](https://example.com) -->\n\n- [nuxt-msw](#nuxt-msw)\n  - [Features](#features)\n  - [Online Playground](#online-playground)\n  - [Migrate: `0.x` -\\> `1.x` users](#migrate-0x---1x-users)\n  - [Setup](#setup)\n  - [Usage](#usage)\n    - [worker](#worker)\n    - [server](#server)\n  - [Module options](#module-options)\n  - [How to Use in Tests](#how-to-use-in-tests)\n    - [vitest](#vitest)\n    - [`@nuxt/test-utils`](#nuxttest-utils)\n      - [Unit Tests](#unit-tests)\n        - [Note: `baseURL` in unit test](#note-baseurl-in-unit-test)\n      - [E2E Tests](#e2e-tests)\n    - [Note: `$fetch` and `fetch` in `@nuxt/test-utils/e2e`](#note-fetch-and-fetch-in-nuxttest-utilse2e)\n  - [Nuxt Layer](#nuxt-layer)\n    - [nuxt layer and unit test](#nuxt-layer-and-unit-test)\n  - [Contribution](#contribution)\n\n\n## Features\n<!-- Highlight some of the features your module provide here -->\n- 🌲 Write once, use everywhere\n- 🚀 Use MSW powerful mocking features in Nuxt development\n- ⛰ Intercept both server-side and client-side request, including `$fetch`, `useFetch` and any other api requests.\n- 🥧 Support Nuxt layer.\n\n## Online Playground\nYou can try out the functionality of `nuxt-msw` online through the following website.\n\n[![Play in Codesandbox](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/p/devbox/3jdr8d?embed=1)\n<!-- [![Play in Stackblitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/edit/nuxt-starter-ex6po1?file=app.vue) -->\n\n## Migrate: `0.x` -> `1.x` users\nThank you to all the users of version 0.x. I believe you won’t need to put in too much effort to upgrade to version 1.x.\n\nThe differences between 0.x and 1.x are as follows:\n\n- `optionPath` in `nuxt.config` has been changed to `folderPath`. Originally, it pointed to a file, but now it points to a folder.\n- You need init MSW worker file manually. `nuxt-msw` no longer auto provide a worker file.\n- The settings for worker and server were previously written in the same file. To better utilize the environments they run in, worker and server will now run in separate files. Please refer to the instructions below.\n- Added support for unit testing in the Nuxt environment.\n- Added support for Nuxt layers.\n\nIf you don't want upgrade to 1.x now, you can find the 0.x doc here: [0.2.x doc](https://github.com/shunnNet/nuxt-msw/tree/v0.2.0)\n\n## Setup\nTo install the module to your Nuxt application:\n\n```bash\nnpm install @crazydos/nuxt-msw msw --save-dev\n```\n\n```ts\nexport default defineNuxtConfig({\n  modules: ['@crazydos/nuxt-msw'],\n  msw : {\n    // Options, see below\n  }\n})\n```\n\n## Usage\nYou need to set up the MSW worker and server separately. When either one is set up, that side will start running.\nThe setup location is in the `~/msw` directory (by default), and you configure it through the corresponding files.\n\n### worker\nTo set up the worker, you need follow the [MSW documentation](https://mswjs.io/docs/integrations/browser#generating-the-worker-script) to create a worker file. \n\n```sh\n# For example\nnpx msw init public --save\n```\n\nNext, you need to create a `worker.{ts|js|mjs|cjs}` file in the `~/msw` directory. The worker file will be run in the Nuxt client plugin, which in browser context. Means you can use browser api and Nuxt composable in this file.\n\n```ts\n// ~/msw/worker.ts\nimport { http, HttpResponse } from 'msw'\n\nexport default defineNuxtMswWorkerOption(() => {\n  const handlers = [\n    // Intercept \"GET /api/user\" requests...\n    http.get('/api/user', () => {\n      // ...and respond to them using this JSON response.\n      return HttpResponse.json({\n        message: \"Hello Worker!\",\n      })\n    }),\n  ]\n  // You can access any browser api\n  // window.location.href\n  \n  return {\n    handlers,\n    workerOptions: {\n      // ...you can pass options to worker.start()\n      // onUnhandledRequest: 'bypass',\n    },\n    onWorkerStarted(worker, nuxtApp) {\n      // Module will setup worker when nuxt run client plugin\n      // Means this function will be called after plugin call worker.start()\n\n      nuxtApp.hook('app:mounted', () => {\n        // const route = useRoute()\n        // console.log(worker.listHandlers())\n      })\n    },\n    \n  }\n})\n```\n\nYou can now try to fetch the data from the worker.\n\n```vue\n<script setup>\n\nonMounted(async () => {\n  const res = await $fetch(\"/api/user\")\n  console.log(res) // { message: \"Hello Worker!\" }\n})\n</script>\n```\n\n----------\n\n### server\nThe way to set up the server is similar to the worker. You need to create a `server.{ts|js|mjs|cjs}` file in the `~/msw` directory. \n\nThe server file will be run in Node.js `Nitro` context. Because it is before NuxtApp created, you can not access NuxtApp and composable which access it. But you can access msw server and request (h3Event).\n\nOne more important thing is that, for your mock and nitro server handler work properly, you need to set `baseURL` in the server option. The baseURL must be same as your server listening address.\n\nAnd, when mocking the server side request, you need include the baseURL in your handler's path.\n```ts\n// ~/msw/server.ts\nimport { http, HttpResponse } from 'msw'\n\nexport default defineNuxtMswServerOption(() => {\n  // assume your server listening at http://localhost:3000\n  const baseURL = \"http://localhost:3000\" \n  \n  // composables that not related to NuxtApp can be used here, like: useRuntimeConfig\n\n  const handlers = [\n    // Intercept \"GET http://localhost:3000/user\" requests...\n    http.get(baseURL + '/api/user', () => {\n      // ...and respond to them using this JSON response.\n      return HttpResponse.json({\n        message: \"Hello msw server!\"\n      })\n    }),\n  ]\n  return {\n    baseURL, // baseURL is required \n    handlers,\n    serverOptions: {\n      onUnhandledRequest: 'bypass',\n    },\n\n    onRequest(mswServer, h3Event) {\n      // This funtion will be call when Nitro server \"request\" hook\n      console.log('Hello from onRequest')\n      mswServer.use(/*...*/)\n    },\n    \n  }\n})\n```\n\nAfter setting up the server, you can now try to fetch the data from the server.\n\n```vue\n<template>\n  <h1>{{ data?.message }}</h1> \n  <!-- Hello msw server! -->\n</template>\n<script setup>\nconst { data, error } = await useFetch('/api/user')\n</script>\n```\n\nThe `h3Event` has some basic information about the request, such as `event.path`. If you need more, you can explicitly install [`h3`](https://h3.unjs.io/utils/request), and use it to get more.\n\n```ts\nimport { getQuery } from 'h3'\n\n// ...\n{\n  // ....\n  onRequest(mswServer, h3Event) {\n    const query = useQuery(h3Event)\n    // do something with query\n  }\n}\n\n```\n\n## Module options\nThe option usage could be found at following.\n\n> [!NOTE]  \n> It is important to understand that these options is build time config. So if you use environment variable like `.env` to decide these options, you need setup `.env` at `nuxi build` too.\n\n```ts\nexport default defineNuxtConfig({\n  modules: ['@crazydos/nuxt-msw'],\n  msw: {\n    /**\n     * Whether to enable the module. Default to `true`\n     * \n     * This is useful when you need to enable or disable msw based on the environment.\n     * \n     * When `enable: false`, the msw worker and server will not try to intercept requests, but keeps auto import composables for type checking.\n     * \n     * @default true\n     * \n     * @example\n     * {\n     *   enable: process.env.TEST === 'true'\n     * }\n     */\n    enable: true, // default: true\n     /**\n      * Path to the nuxt-msw runtime folder that include worker and server files.\n      * @default \"~/msw\"\n      */ \n    folderPath: \"~/msw\"\n    /**\n     * Should include nuxt layers msw settings or not\n     * @default true\n     */\n    includeLayer?: boolean\n    /**\n     *\n     * Enable unit test mode. default: false\n     *\n     * When this mode is enabled, you can use `setupNuxtMswServer` to start the msw server in a unit test environment (which is a Node.js environment).\n     *\n     *  When enable: false, this mode is inactive.\n     * \n     * @default true\n     */\n    testUtils?: boolean\n  },\n})\n```\n\n## How to Use in Tests\nWhen performing unit tests with Nuxt, you might use `@nuxt/test-utils` with `vitest`. \n\n### vitest\nIf you are only using Vitest without the `@nuxt/test-utils` environment, you will need to manually set up MSW.\n\nVitest has an [example](https://vitest.dev/guide/mocking#configuration) how to use msw in unit test. \n\n> [!NOTE]\n> In this scenario, if you have handlers set up in the Nuxt layer, you will need to export them for use.\n\n### `@nuxt/test-utils`\nLet's talk about unit test part first.\n\n#### Unit Tests\nAccording to the Nuxt official documentation, if you need to test within the Nuxt context (to ensure composables and other features function correctly), you must set up the Nuxt environment.\n\nTo ensure that MSW works correctly in this situation, nuxt-msw provides a helper function for environment setup and configuring the MSW server.\n\nFirst, you need enable `testUtils` option for `nuxt-msw` module. Suggest enable in `vitest.config.ts`.\n\n```ts\n// vitest.config.ts\nimport { defineVitestConfig } from '@nuxt/test-utils/config'\n\nexport default defineVitestConfig({\n  // any custom Vitest config you require\n  test: {\n    // .....\n    environmentOptions: {\n      nuxt: {\n        domEnvionment: 'happy-dom',\n        host: 3000,\n        overrides: {\n          msw: {\n            testUtils: true,\n          },\n        },\n      },\n    },\n  },\n})\n```\n\nThen, you can use `setupNuxtMswServer` to setup MSW server in unit test. (Note: can't run in setup files currently. So you need to run it in every test file.)\n\nThe component may look like this:\n\n```vue\n<script setup lang=\"ts\">\nconst { data } = await useFetch(\n  '/api/user', \n  { baseURL: 'http://localhost:3000' }\n)\n</script>\n\n<template>\n  <div id=\"name\">{{ data.name }}</div>\n</template>\n```\n\n```ts\n// @vitest-environment nuxt\nimport { it, expect, afterEach } from 'vitest'\nimport { mountSuspended } from '@nuxt/test-utils/runtime'\nimport UserName from './UserName.vue'\n\nimport { setupNuxtMswServer } from '@crazydos/nuxt-msw/test-utils'\nimport { http, HttpResponse } from \"msw\"\n\nconst mswServer = await setupNuxtMswServer({\n  handlers: [\n    http.get(\n      'http://localhost:3000/api/user', \n      () => HttpResponse.json({ name: 'msw server unit' })\n    )\n  ],\n  serverOptions: {\n    // onUnhandledRequest: 'bypass',\n  },\n})\nafterEach(() => {\n  // you can do anything with mswServer\n  mswServer.resetHandlers()\n})\n\nit('displays message', async () => {\n  // replace handler if needed\n  // mswServer.use(\n  //   http.get('/api/user', () => {\n  //     return HttpResponse.json({\n  //       name: 'msw server unit replaced',\n  //     })\n  //   })\n  // )\n  const component = await mountSuspended(UserName)\n\n  expect(component.find('#name').text()).toBe('msw server unit')\n})\n```\n\nThen you can run the test with `vitest`:\n\n```bash\nnpx vitest\n```\n\n##### Note: `baseURL` in unit test\nIf you are using `$fetch` or `useFetch` with no `baseURL` set, and use path with no domain like `/some/path`. You can mock like following:\n\n```ts\n// for example\nawait useFetch('/api/user') \n\n// mock with baseURL\nconst baseURL = 'http://localhost:3000'\nawait setupNuxtMswServer({\n  baseURL,\n  handlers: [\n    http.get(baseURL + '/api/user', () => {\n      return HttpResponse.json({ name: 'msw server unit' })\n    })\n  ]\n})\n```\n\n> [!NOTE] \n> `baseURL` here is just a valid domain, it is not necessary to match nuxt server address. But if you run a real server and want msw fallback to there, you need to set baseURL to the real server address.  \n\n\n#### E2E Tests\n`@nuxt/test-utils` uses Playwright as the E2E test driver, and it actually runs the Nuxt server and browser in a separate process. This means we can't directly modify mock in test.\n\nTo modify mocks in this situation, you need to employ workarounds, such as changing the mocks through  [dynamic mock](https://mswjs.io/docs/best-practices/dynamic-mock-scenarios).\n\nThe way nuxt-msw runs in this situation is just like normal Nuxt application. So you can just use the same way to setup MSW server and worker.\n\n```ts\n// For example: dynamic mock\n// Normal test case\ntest('normal mock', async ({ page, goto }) => {\n  await goto('/', { waitUntil: 'hydration' })\n  await expect(page.getByText('John')).toBeVisible()\n})\n\n// Alternative test case\ntest('test dynamic mock', async ({ page, goto }) => {\n  // The server response still the same\n  await goto('/?alternative=true', { waitUntil: 'hydration' })\n\n  // Next, we click a button that make a request from client side\n  await page.getByTestId('get-data-button').click()\n\n  // We get a different response from same api endpoints\n  await expect(page.getByText('Jane')).toBeVisible()\n})\n```\n### Note: `$fetch` and `fetch` in `@nuxt/test-utils/e2e`\n`@nuxt/test-utils/e2e` provide `$fetch` and `fetch` to make request to nuxt server in e2e test. `nuxt-msw` will do nothing with these two functions becuase they are outside the Nuxt application. So use them as normal.\n\n```ts\nimport { $fetch, fetch } from '@nuxt/test-utils/e2e'\n\nconst html = await $fetch('/')\n```\n\n## Nuxt Layer\n(Although I think the simplest way to share handlers is just share the handlers.) There may be some cases your teams want to share msw settings by [Nuxt layer](https://nuxt.com/docs/getting-started/layers). `nuxt-msw` also support this. \n\n`nuxt-msw` will merge the worker and server configurations at each level. Depending on the configuration options, they will either be merged or overwritten. Below is the behavior of each option:\n\n```ts\n// worker and server options\n{\n  handlers: [] // merge. the higher level take precedence\n  \n  workerOptions: {} // merge. the higher level take precedence\n  serverOptions: {} // merge. the higher level take precedence\n  \n  baseURL: \"\" // overwrite. the higher level take precedence\n  \n  onWorkerStarted: () => {} // merge. the lower level execute first\n  onRequest: () => {} // merge. the lower level execute first \n}\n```\n\nHere is how `nuxt.config` will be resolved:\n```ts\nexport default defineNuxtConfig({\n  msw: {\n    includeLayer // overwrite. the higher level take precedence\n    enable // overwrite. the higher level take precedence\n    testUtils // overwrite. the higher level take precedence \n    folderPath // every layer follow its own folderPath setting\n  }\n})\n```\n\n`folderPath` is the only option that is not merged. Each layer will follow its own `folderPath` setting. For example, if you set `folderPath` to `./msw` but set `~/msw` at the layer user level, nuxt-msw will find msw files in following folders:\n\n- `~/msw`\n- `/path-to-layer-folder/msw`\n\n### nuxt layer and unit test\nIf you need share msw settings in layers for unit test, you can add a file named `unit.{ts|js|mjs|cjs}` in the layer folder (app level also support this file). The merge strategy is same as worker and server file. \n\n`unit.{ts|js|mjs|cjs}` file will be run in Vitest environment, so you can access in this file. Acctually, a part of work of `setupNuxtMswServer` in unit test is import this file and merge the options.\n\n`setupNuxtMswServer` accept the same options as `defineNuxtMswTestOptions` return. The options of `setupNuxtMswServer` will be merged with the options of `unit.{ts|js|mjs|cjs}` file.  `setupNuxtMswServer` will take highest precedence.\n\n```ts\nimport { http, HttpResponse } from 'msw'\n\nexport default defineNuxtMswTestOptions(() => {\n  const handlers = [\n    http.get('/api/user', () => {\n      // ...and respond to them using this JSON response.\n      return HttpResponse.json({\n        id: 'Mock01',\n        name: 'msw server unit',\n      })\n    }),\n  ]\n  return {\n    baseURL: 'http://localhost:3000',\n    handlers,\n    serverOptions: {\n      // onUnhandledRequest: 'bypass',\n    },\n  }\n})\n```\n\n```ts\n// xxx.spec.ts\nimport { setupNuxtMswServer } from '@crazydos/nuxt-msw/test-utils'\nimport { http, HttpResponse } from \"msw\"\n\nconst mswServer = await setupNuxtMswServer(\n  /** \n   * You can still pass options to overwrite the options in unit.ts\n  */\n)\n\n```\n\n## Contribution\n\n<details>\n  <summary>Local development</summary>\n  \n  ```bash\n  # Install dependencies\n  pnpm install\n  \n  # Generate type stubs\n  pnpm dev:prepare\n  \n  # Develop with the playground\n  pnpm dev\n  \n  # Build the playground\n  pnpm dev:build\n  \n  # Run ESLint\n  pnpm lint\n  \n  ```\n\n</details>\n\nLearn more about [authoring nuxt module](https://nuxt.com/docs/guide/going-further/modules#module-anatomy)\n\n\n<!-- Badges -->\n<!-- [npm-version-src]: https://img.shields.io/npm/v/nuxt-msw/latest.svg?style=flat&colorA=020420&colorB=00DC82\n[npm-version-href]: https://npmjs.com/package/nuxt-msw\n\n[npm-downloads-src]: https://img.shields.io/npm/dm/nuxt-msw.svg?style=flat&colorA=020420&colorB=00DC82\n[npm-downloads-href]: https://npmjs.com/package/nuxt-msw\n\n[license-src]: https://img.shields.io/npm/l/nuxt-msw.svg?style=flat&colorA=020420&colorB=00DC82\n[license-href]: https://npmjs.com/package/nuxt-msw\n\n[nuxt-src]: https://img.shields.io/badge/Nuxt-020420?logo=nuxt.js\n[nuxt-href]: https://nuxt.com -->\n","readmeFilename":"README.md"}