{"_id":"@corekraft/vitest-plugin-lwc","_rev":"5-37cc09c3b0ba04131d63714b51356f6f","name":"@corekraft/vitest-plugin-lwc","dist-tags":{"latest":"1.1.0","beta":"1.0.6"},"versions":{"1.0.0":{"name":"@corekraft/vitest-plugin-lwc","version":"1.0.0","keywords":["vitest","lwc","salesforce","sfdx","sf-cli","unit-test","jest"],"author":{"name":"Jun Jose","email":"junners"},"license":"ISC","_id":"@corekraft/vitest-plugin-lwc@1.0.0","maintainers":[{"name":"junners","email":"jose.junryan@gmail.com"}],"dist":{"shasum":"a2bc4286963b151667ff20d5cbc72c1e37595986","tarball":"https://registry.npmjs.org/@corekraft/vitest-plugin-lwc/-/vitest-plugin-lwc-1.0.0.tgz","fileCount":15,"integrity":"sha512-kvQQrp3lPdJ9BQOm2/VA8vZIa+cHVAJtYAXf/xQwuTdhTpKw8NhjC9Oz3FaWa/Qs6PoWavyDB2dcjqvP8yvxyQ==","signatures":[{"sig":"MEUCIHKNP6aPmb44hiSTuzvEWqAWN1KRRPrdlt+FzgbBSwpiAiEAuQk1L88P8qhIKFL5lw9ZrZkfqHfk6R54W6zpSsDqo0I=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":22647},"main":"dist/index.js","type":"module","types":"./dist/index.d.ts","gitHead":"e85785dd9bdb483ea2c040cdc7fd8029e02f2040","scripts":{"lint":"eslint","test":"vitest run","build":"tsc","prepare":"husky","pretest":"tsc -p tsconfig.vitest.json","prettier":"prettier --write .","test:cov":"vitest run --coverage","test:e2e":"vitest run --config tests/vitest.config.ts","pretest:cov":"npm run pretest","pretest:e2e":"npm run pretest","test:profile":"node ./scripts/profile-fixture-runners.mjs"},"_npmUser":{"name":"junners","email":"jose.junryan@gmail.com"},"prettier":{"semi":true,"useTabs":false,"tabWidth":2,"printWidth":120,"singleQuote":false},"_npmVersion":"11.7.0","description":"Vitest plugin for lwc/ salesforce/ lightning web components","directories":{},"lint-staged":{"*.ts":["eslint --fix","prettier --write"]},"_nodeVersion":"22.17.0","_hasShrinkwrap":false,"packageManager":"pnpm@10.32.1+sha512.a706938f0e89ac1456b6563eab4edf1d1faf3368d1191fc5c59790e96dc918e4456ab2e67d613de1043d2e8c81f87303e6b40d4ffeca9df15ef1ad567348f2be","devDependencies":{"jiti":"2.6.1","vite":"8.0.1","husky":"9.1.7","eslint":"10.1.0","vitest":"4.1.0","globals":"17.4.0","prettier":"3.8.1","@eslint/js":"10.0.1","typescript":"5.9.3","@types/node":"25.5.0","lint-staged":"16.4.0","typescript-eslint":"8.57.1","@vitest/coverage-v8":"4.1.0","eslint-config-prettier":"10.1.8"},"_npmOperationalInternal":{"tmp":"tmp/vitest-plugin-lwc_1.0.0_1774246748050_0.4568746816931457","host":"s3://npm-registry-packages-npm-production"}},"1.0.4":{"name":"@corekraft/vitest-plugin-lwc","version":"1.0.4","keywords":["vitest","lwc","salesforce","sfdx","sf-cli","unit-test","jest"],"author":{"name":"Jun Jose","email":"junners"},"license":"ISC","_id":"@corekraft/vitest-plugin-lwc@1.0.4","maintainers":[{"name":"junners","email":"jose.junryan@gmail.com"}],"dist":{"shasum":"c299347f78c9626d084e207e70670de6859962e7","tarball":"https://registry.npmjs.org/@corekraft/vitest-plugin-lwc/-/vitest-plugin-lwc-1.0.4.tgz","fileCount":3,"integrity":"sha512-46mgZ54Bh8oiM9vATOrGUKo45CYZhAspbwW6tYTTyKgZoNY41+Wh3eO4qRjNyBcJ8o8VEpDgjjF4p1ZY9IKulQ==","signatures":[{"sig":"MEYCIQCiC5ld/jzuJ89cUStVCXPAxtn6slmQV3NIodA3a+TflwIhAOqwd9i+DGeiwrq0wWhgiRxswZdVQ4CC8FEfVqDt+wfI","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":4308},"main":"index.js","type":"module","types":"index.d.ts","exports":{".":{"types":"./index.d.ts","default":"./index.js"}},"gitHead":"6bd280850d34e6ca8f30d24f38d3b107ae67bc39","_npmUser":{"name":"junners","email":"jose.junryan@gmail.com"},"_npmVersion":"11.7.0","description":"Vitest plugin for lwc/ salesforce/ lightning web components","directories":{},"_nodeVersion":"22.17.0","_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/vitest-plugin-lwc_1.0.4_1774257359835_0.8899821402601154","host":"s3://npm-registry-packages-npm-production"}},"1.0.5":{"name":"@corekraft/vitest-plugin-lwc","version":"1.0.5","keywords":["vitest","lwc","salesforce","sfdx","sf-cli","unit-test","jest"],"author":{"name":"Jun Jose","email":"junners"},"license":"ISC","_id":"@corekraft/vitest-plugin-lwc@1.0.5","maintainers":[{"name":"junners","email":"jose.junryan@gmail.com"}],"dist":{"shasum":"51caafd8e37b06639aa3e1acfe689fcd2c18b14b","tarball":"https://registry.npmjs.org/@corekraft/vitest-plugin-lwc/-/vitest-plugin-lwc-1.0.5.tgz","fileCount":3,"integrity":"sha512-oODJNqrma1JbHnbXU6pYJOyaZSpiauGgSEyXLC3Xxy4l2rs2Z92ky+tMjn75IKIGosxQHs2odlB9dgQKM8hWEg==","signatures":[{"sig":"MEYCIQD/YWpcLivc4O4xsaWDgozvmASov/0Ph86cKwvv3MQ+2wIhAI2St5o/A7nhy407SqUcYULZ/LMmkuMKZNG6zstw1bdd","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":4308},"main":"index.js","type":"module","types":"index.d.ts","exports":{".":{"types":"./index.d.ts","default":"./index.js"}},"gitHead":"36b072a4f681bbb8c27f8f72bafdc7f8a41e1357","_npmUser":{"name":"junners","email":"jose.junryan@gmail.com"},"_npmVersion":"11.7.0","description":"Vitest plugin for lwc/ salesforce/ lightning web components","directories":{},"_nodeVersion":"22.17.0","_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/vitest-plugin-lwc_1.0.5_1774257823670_0.1034407907253585","host":"s3://npm-registry-packages-npm-production"}},"1.0.6":{"name":"@corekraft/vitest-plugin-lwc","version":"1.0.6","keywords":["vitest","lwc","salesforce","sfdx","sf-cli","unit-test","jest"],"author":{"name":"Jun Jose","email":"junners"},"license":"ISC","_id":"@corekraft/vitest-plugin-lwc@1.0.6","maintainers":[{"name":"junners","email":"jose.junryan@gmail.com"}],"dist":{"shasum":"335f8fa4aa289d7b87118a0e27f8bfdb519fe4c8","tarball":"https://registry.npmjs.org/@corekraft/vitest-plugin-lwc/-/vitest-plugin-lwc-1.0.6.tgz","fileCount":15,"integrity":"sha512-3aiage9q1+ZtCKW8NgvKNzN600gghP7XHwaVHT9kpH/9pRUEyosRsSvPURBNQ1Ko0tIg5zfGs96jywYvpnCgnQ==","signatures":[{"sig":"MEYCIQDgZNowPD3w+HkOhAXoxxwZinW5iRsq2uE+Ng1R1owzsQIhAL6NdWmK6scaECSerXLuo5jjHHhxI/H8vNxHJL9JoS+U","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":23592},"main":"index.js","type":"module","types":"index.d.ts","exports":{".":{"types":"./index.d.ts","default":"./index.js"}},"gitHead":"36b072a4f681bbb8c27f8f72bafdc7f8a41e1357","_npmUser":{"name":"junners","email":"jose.junryan@gmail.com"},"_npmVersion":"11.7.0","description":"Vitest plugin for lwc/ salesforce/ lightning web components","directories":{},"_nodeVersion":"22.17.0","_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/vitest-plugin-lwc_1.0.6_1774257956369_0.5910795004608596","host":"s3://npm-registry-packages-npm-production"}},"1.1.0":{"name":"@corekraft/vitest-plugin-lwc","version":"1.1.0","description":"Vitest plugin for lwc/ salesforce/ lightning web components","main":"index.js","types":"index.d.ts","exports":{".":{"types":"./index.d.ts","default":"./index.js"}},"type":"module","keywords":["vitest","lwc","salesforce","sfdx","sf-cli","unit-test","jest"],"author":{"name":"Jun Jose","email":"junners"},"license":"ISC","gitHead":"36b072a4f681bbb8c27f8f72bafdc7f8a41e1357","_id":"@corekraft/vitest-plugin-lwc@1.1.0","_nodeVersion":"22.17.0","_npmVersion":"11.7.0","dist":{"integrity":"sha512-wFpRazTjF3Hmzy63MryTn42T5Tr65LueAHTKsPmMYLTTA7FSthQNV5lZ3DbFur2WJQ7Kf1SPDFBqcVdmkO+/Bw==","shasum":"98bc791709a37cf0c4c02d140fc05b256a0574fb","tarball":"https://registry.npmjs.org/@corekraft/vitest-plugin-lwc/-/vitest-plugin-lwc-1.1.0.tgz","fileCount":15,"unpackedSize":23592,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCwSUfb5ZnjrYUjeILphJXSpxQ5X8LwOrbF6CjEsnGlWQIgFp3+ps7kSqTiKIj/f/31tQ+/H+GgJejyq4s66DQ2JPA="}]},"_npmUser":{"name":"junners","email":"jose.junryan@gmail.com"},"directories":{},"maintainers":[{"name":"junners","email":"jose.junryan@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/vitest-plugin-lwc_1.1.0_1774258178785_0.3297169062351577"},"_hasShrinkwrap":false}},"time":{"created":"2026-03-23T06:19:07.926Z","modified":"2026-03-23T09:29:39.064Z","1.0.0":"2026-03-23T06:19:08.202Z","1.0.4":"2026-03-23T09:15:59.978Z","1.0.5":"2026-03-23T09:23:43.813Z","1.0.6":"2026-03-23T09:25:56.504Z","1.1.0":"2026-03-23T09:29:38.933Z"},"author":{"name":"Jun Jose","email":"junners"},"license":"ISC","keywords":["vitest","lwc","salesforce","sfdx","sf-cli","unit-test","jest"],"description":"Vitest plugin for lwc/ salesforce/ lightning web components","maintainers":[{"name":"junners","email":"jose.junryan@gmail.com"}],"readme":"# `@corekraft/vitest-plugin-lwc`\n\nVitest plugin for testing Lightning Web Components in Salesforce projects.\n\n## Setup\n\nCreate [vitest.config.mjs](/Users/jun/Development/github/vitest-plugin-lwc/fixtures/lwc-recipes/vitest.config.mjs):\n\n```js\nimport { defineConfig } from \"vitest/config\";\nimport lwc from \"@corekraft/vitest-plugin-lwc\";\n\nexport default defineConfig({\n  plugins: [lwc()],\n});\n```\n\nThis configuration is all you need as a starting vitest configuration. Follow [#package-scripts](#package-scripts)\n\n### Package Scripts\n\nAdd or modify your test script in your package.json. Follow [#running](#running)\n\n```json\n{\n  \"scripts\": {\n    \"test:unit\": \"vitest run\"\n  }\n}\n```\n\n### Running\n\nThen run:\n\n```bash\nnpm test:unit\n```\n\n## What It Does\n\nOut of the box, the plugin:\n\n- resolves `c/*` component imports from `force-app/main/default/lwc`\n- resolves `lightning/*` modules from project mocks or `@salesforce/sfdx-lwc-jest` stubs\n- provides virtual shims for `@salesforce/*` imports such as `apex`, `schema`, `user`, `i18n`, `resourceUrl`, and message channels\n- compiles LWC source with `@lwc/compiler`\n- generates a managed Vitest setup file automatically\n- enables `jsdom`, globals, coverage defaults, and LWC test file discovery\n- exposes `jest` as `vi` compatibility for existing tests that still use `jest.mock()` and `jest.fn()`\n\n## Install\n\n```bash\npnpm add -D vitest @vitest/coverage-v8 @corekraft/vitest-plugin-lwc\n```\n\nIf your project already uses `@salesforce/sfdx-lwc-jest`, keep it installed. The plugin reuses its Lightning stubs.\n\n## Existing Jest-Style LWC Tests\n\nThis plugin is designed to help projects move from `sfdx-lwc-jest` to Vitest with minimal churn.\n\nExisting test suites can continue to use patterns like:\n\n- `jest.mock(...)`\n- `jest.fn(...)`\n- `jest.requireActual(...)`\n\nThe plugin rewrites those test helpers to Vitest-compatible behavior during transform.\n\n## Optional Extras\n\nIf these packages exist in the project, the generated setup file will use them automatically:\n\n- `jest-canvas-mock`\n- `@sa11y/preset-rules`\n- `@sa11y/matcher`\n\nThat means you can add them only when your test suite needs them.\n\n## Notes\n\n- This plugin expects a Salesforce DX project with `sfdx-project.json`.\n- The default test include pattern is `**/lwc/**/*.test.js`.\n- The default test environment is `jsdom`.\n- The plugin writes a managed setup file under `.vitest-plugin-lwc/`.\n\n## Example\n\nThe fixtures in this repository show the intended setup shape:\n\n- [fixtures/sfdx-project/vitest.config.js](/Users/jun/Development/github/vitest-plugin-lwc/fixtures/sfdx-project/vitest.config.js)\n- [fixtures/lwc-recipes/vitest.config.mjs](/Users/jun/Development/github/vitest-plugin-lwc/fixtures/lwc-recipes/vitest.config.mjs)\n","readmeFilename":"README.md"}