{"_id":"@autotracer/inject-react19","name":"@autotracer/inject-react19","dist-tags":{"latest":"1.0.0-alpha.55"},"versions":{"1.0.0-alpha.55":{"name":"@autotracer/inject-react19","version":"1.0.0-alpha.55","description":"Shared AST transform logic for auto-injecting useReactTracer","author":{"name":"Carl Ribbegårdh"},"license":"MIT","type":"module","main":"./dist/cjs/index.cjs","module":"./dist/esm/index.js","types":"./dist/esm/index.d.ts","exports":{".":{"import":{"types":"./dist/esm/index.d.ts","default":"./dist/esm/index.js"},"require":{"types":"./dist/cjs/index.d.ts","default":"./dist/cjs/index.cjs"}}},"dependencies":{"@babel/generator":"^7.23.0","@babel/parser":"^7.23.0","@babel/traverse":"^7.23.0","@babel/types":"^7.23.0"},"devDependencies":{"@rollup/plugin-commonjs":"^28.0.2","@rollup/plugin-node-resolve":"^15.3.0","@types/babel__generator":"^7.6.0","@types/babel__traverse":"^7.18.0","@types/node":"^22.12.0","@typescript/typescript6":"~6.0.2","@vitest/coverage-v8":"4.1.10","jsdom":"^24.1.0","oxlint":"1.77.0","rimraf":"^6.0.1","rollup":"^4.61.1","typescript":"~7.0.2","vitest":"4.1.10","@autotracer/filter-utils":"1.0.0-alpha.55"},"sideEffects":false,"scripts":{"build":"pnpm run check:typescript6 && pnpm run build:esm && pnpm run build:cjs","check:typescript6":"tsc6 --project tsconfig.typescript6.json","prebuild":"pnpm run clean","build:esm":"tsc --project tsconfig.esm.json && rollup -c rollup.config.esm.js","build:cjs":"tsc --project tsconfig.cjs.json && rollup -c rollup.config.cjs.js","clean":"rimraf dist .build coverage","lint":"oxlint src tests","lint:fix":"oxlint src tests --fix","test":"vitest run","test:coverage":"vitest run --coverage","postbuild":"tsc --project ./tests/tsconfig.json --noEmit && pnpm run check:typescript6:consumer","check:typescript6:consumer":"tsc6 --project tests/typescript6-consumer/tsconfig.json","_test":"vitest","_test:coverage":"vitest --coverage"},"_id":"@autotracer/inject-react19@1.0.0-alpha.55","_integrity":"sha512-halXkOA6/bcYqefEhXS+zjpJPEVr9dTeM2H09+dyxy2LhIQcuNyzQk1Ut0KYqGRYNHlGbLr5Uu+1fbPfyf0IeA==","_resolved":"C:\\Users\\CARL~1.DES\\AppData\\Local\\Temp\\34930f18cdcea98132374ffd67d2e2f2\\autotracer-inject-react19-1.0.0-alpha.55.tgz","_from":"file:autotracer-inject-react19-1.0.0-alpha.55.tgz","_nodeVersion":"24.19.0","_npmVersion":"11.17.0","dist":{"integrity":"sha512-halXkOA6/bcYqefEhXS+zjpJPEVr9dTeM2H09+dyxy2LhIQcuNyzQk1Ut0KYqGRYNHlGbLr5Uu+1fbPfyf0IeA==","shasum":"a91abeccc86080e7863f797d4e424d46c9a7e75b","tarball":"https://registry.npmjs.org/@autotracer/inject-react19/-/inject-react19-1.0.0-alpha.55.tgz","fileCount":122,"unpackedSize":1007618,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCaDc0Ms+lrLg/Kx8KqfauJ6pZqAAt8qishQUyK03JqAAIhAL+pqJV9by+Dv96RTZ5HWpNQDdFWdm1c+gpqDZzH+qc+"}]},"_npmUser":{"name":"carlribbegaardh","email":"carl.ribbegaardh+npm@gmail.com"},"directories":{},"maintainers":[{"name":"carlribbegaardh","email":"carl.ribbegaardh+npm@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/inject-react19_1.0.0-alpha.55_1787724300798_0.4363866966120289"},"_hasShrinkwrap":false}},"time":{"created":"2026-08-26T06:05:00.219Z","1.0.0-alpha.55":"2026-08-26T06:05:00.959Z","modified":"2026-08-26T06:05:01.170Z"},"maintainers":[{"name":"carlribbegaardh","email":"carl.ribbegaardh+npm@gmail.com"}],"description":"Shared AST transform logic for auto-injecting useReactTracer","author":{"name":"Carl Ribbegårdh"},"license":"MIT","readme":"# @autotracer/inject-react19\r\n\r\n## Overview\r\n\r\n`@autotracer/inject-react19` is the shared low-level transform package behind the React 19 ReactTracer build plugins. It is for tool authors who need direct control over the AST transform instead of using the Vite or Babel integration packages.\r\n\r\n## Why Use It\r\n\r\nThis package exposes the shared transform pipeline directly. That gives custom tooling access to `transform()`, `normalizeConfig()`, the shared eligibility helpers, and the shared config model without having to reimplement React component detection and hook-label injection yourself.\r\n\r\n## Requirements\r\n\r\n- Node.js 24 for repository development and package tooling\r\n- TypeScript 6 or newer for TypeScript consumers\r\n- Babel 7 parser and AST packages supplied through this package's dependencies\r\n\r\n## Installation\r\n\r\n```bash\r\npnpm add -D @autotracer/inject-react19\r\n```\r\n\r\nMost app integrations should use `@autotracer/plugin-vite-react19` or `@autotracer/plugin-babel-react19` instead.\r\n\r\n## Configuration\r\n\r\nStart from `normalizeConfig()` so the shared defaults are applied before you call `transform()`:\r\n\r\n```typescript\r\nimport { normalizeConfig } from \"@autotracer/inject-react19\";\r\n\r\nconst config = normalizeConfig({\r\n  mode: \"opt-out\",\r\n});\r\n```\r\n\r\nUse these documentation pages for exact behavior:\r\n\r\n- Shared transform overview: https://docs.autotracer.dev/reference/build/react19/inject/\r\n- Shared transform API: https://docs.autotracer.dev/api/inject-react19\r\n- `mode`: https://docs.autotracer.dev/reference/build/react19/inject/config/mode\r\n- `include`: https://docs.autotracer.dev/reference/build/react19/inject/config/include\r\n- `exclude`: https://docs.autotracer.dev/reference/build/react19/inject/config/exclude\r\n- `serverComponents`: https://docs.autotracer.dev/reference/build/react19/inject/config/serverComponents\r\n- `importSource`: https://docs.autotracer.dev/reference/build/react19/inject/config/importSource\r\n- `labelHooks`: https://docs.autotracer.dev/reference/build/react19/inject/config/labelHooks\r\n- `labelHooksPattern`: https://docs.autotracer.dev/reference/build/react19/inject/config/labelHooksPattern\r\n\r\nThis package does not initialize `reactTracer()`, does not expose `globalThis.autoTracer`, and does not load theme files.\r\n\r\n## Usage\r\n\r\nUse the shared transform directly only in custom tooling:\r\n\r\n```typescript\r\nimport { normalizeConfig, transform } from \"@autotracer/inject-react19\";\r\n\r\nconst config = normalizeConfig({\r\n  mode: \"opt-out\",\r\n  labelHooks: [\"useSelector\"],\r\n});\r\n\r\nconst result = transform(sourceCode, {\r\n  filename: \"Widget.tsx\",\r\n  config,\r\n  prefix: \"ShellA\",\r\n});\r\n```\r\n\r\nUse `prefix` when multiple islands, micro-frontends, or other independent React entry points share one browser tab and you need injected component names to stay distinguishable as `prefix:ComponentName`.\r\n\r\nFor the exported helper surface and type shapes, use the package API page:\r\n\r\n- https://docs.autotracer.dev/api/inject-react19\r\n\r\nFor normal app integrations, use these packages instead:\r\n\r\n- Vite path: https://docs.autotracer.dev/api/plugin-vite-react19\r\n- Babel path: https://docs.autotracer.dev/api/plugin-babel-react19\r\n\r\n## Building And Testing\r\n\r\nRun repository-defined scripts from the monorepo root:\r\n\r\n```bash\r\npnpm build\r\npnpm test\r\npnpm verify\r\n```\r\n\r\nThe package emits ESM and CommonJS builds with TypeScript 7, checks source with TypeScript 6, and compiles a TypeScript 6 consumer fixture against the emitted declarations.\r\n\r\n## License\r\n\r\nMIT © Carl Ribbegårdh\r\n","readmeFilename":"README.md","_rev":"1-664c683c3f5b2f4289749fb811d40147"}