{"_id":"@codeduet-sh/react-vite-component-tagger","name":"@codeduet-sh/react-vite-component-tagger","dist-tags":{"latest":"0.8.0"},"versions":{"0.8.0":{"name":"@codeduet-sh/react-vite-component-tagger","version":"0.8.0","description":"A Vite plugin that automatically adds data attributes to your React components.","main":"dist/index.js","module":"dist/index.mjs","types":"dist/index.d.ts","type":"module","scripts":{"build":"tsup src/index.ts --format cjs,esm --dts","dev":"npm run build -- --watch","lint":"eslint . --max-warnings 0","prepublishOnly":"npm run build"},"keywords":["vite","vite-plugin","react","codeduet"],"author":{"name":"CodeDuet"},"license":"Apache-2.0","peerDependencies":{"vite":"^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0"},"dependencies":{"@babel/parser":"^7.23.0","estree-walker":"^2.0.2","magic-string":"^0.30.5"},"devDependencies":{"@types/node":"^20.8.9","eslint":"^8.52.0","tsup":"^8.0.2","typescript":"^5.2.2","vite":"^5.0.0"},"publishConfig":{"access":"public"},"_id":"@codeduet-sh/react-vite-component-tagger@0.8.0","gitHead":"6198d883162dea33c545e6a9d50090cbc44986fb","_nodeVersion":"21.6.1","_npmVersion":"10.9.2","dist":{"integrity":"sha512-aNjdsTYlBrKDonflYxVsE7Ggkcxoz2I3MNCHhuVY3AC85tLHBAPiNZqEq1tgAJikX5weLJ11Umn6Y7kJPCd1Zg==","shasum":"90711fcedc1a801d56f3364db673d666e4fe4304","tarball":"https://registry.npmjs.org/@codeduet-sh/react-vite-component-tagger/-/react-vite-component-tagger-0.8.0.tgz","fileCount":7,"unpackedSize":20234,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDPRqZSobiYgJps0JQR3/yKfmoQ5CdXvJ3tL7KTOUiRAgIgOwUHpNSxtaJrKFc72MksdVyIdJbl29q8schm49h66L0="}]},"_npmUser":{"name":"codeduet","email":"codeduet@gmail.com"},"directories":{},"maintainers":[{"name":"codeduet","email":"codeduet@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/react-vite-component-tagger_0.8.0_1757952528721_0.4051244595207133"},"_hasShrinkwrap":false}},"time":{"created":"2025-09-15T16:08:48.581Z","0.8.0":"2025-09-15T16:08:48.888Z","modified":"2025-09-15T16:08:49.252Z"},"maintainers":[{"name":"codeduet","email":"codeduet@gmail.com"}],"description":"A Vite plugin that automatically adds data attributes to your React components.","keywords":["vite","vite-plugin","react","codeduet"],"author":{"name":"CodeDuet"},"license":"Apache-2.0","readme":"# @codeduet-sh/react-vite-component-tagger\n\nA Vite plugin that automatically adds `data-dyad-id` and `data-dyad-name` attributes to your React components. This is useful for identifying components in the DOM, for example for testing or analytics.\n\n## Installation\n\n```bash\nnpm install @codeduet-sh/react-vite-component-tagger\n# or\nyarn add @codeduet-sh/react-vite-component-tagger\n# or\npnpm add @codeduet-sh/react-vite-component-tagger\n```\n\n## Usage\n\nAdd the plugin to your `vite.config.ts` file:\n\n```ts\nimport { defineConfig } from \"vite\";\nimport react from \"@vitejs/plugin-react\";\nimport dyadTagger from \"@codeduet-sh/react-vite-component-tagger\";\n\n// https://vitejs.dev/config/\nexport default defineConfig({\n  plugins: [react(), dyadTagger()],\n});\n```\n\nThe plugin will automatically add `data-dyad-id` and `data-dyad-name` to all your React components.\n\nThe `data-dyad-id` will be a unique identifier for each component instance, in the format `path/to/file.tsx:line:column`.\n\nThe `data-dyad-name` will be the name of the component.\n\n## Testing & Publishing\n\nBump it to an alpha version and test in Dyad app, eg. `\"version\": \"0.0.1-alpha.0\",`\n\nThen publish it:\n\n```sh\ncd packages/@codeduet-sh/react-vite-component-tagger/ && npm run prepublishOnly && npm publish\n```\n\nUpdate the scaffold like this:\n\n```sh\ncd scaffold && pnpm remove @codeduet-sh/react-vite-component-tagger && pnpm add -D @codeduet-sh/react-vite-component-tagger\n```\n\nRun the E2E tests and make sure it passes.\n\nThen, bump to a normal version, e.g. \"0.1.0\" and then re-publish. We'll try to match the main Dyad app version where possible.\n","readmeFilename":"README.md","_rev":"1-2c4951b25da98475a99ffef73b5bc48c"}