{"_id":"@chrshnv/fluentui-next-appdir-directive","name":"@chrshnv/fluentui-next-appdir-directive","dist-tags":{"latest":"0.2.1"},"versions":{"0.2.1":{"name":"@chrshnv/fluentui-next-appdir-directive","version":"0.2.1","description":"SWC plugin to add \"use client\" directive to Fluent UI, Griffel, and any other packages.","author":{"name":"Esteban Munoz Facusse & Artemij Chereshnevvv"},"license":"ISC","keywords":["swc-plugin"],"main":"target/wasm32-wasi/release/fluentui_next_appdir_directive.wasm","scripts":{"build-wasi":"cargo build --target wasm32-wasip1","build-wasm32":"cargo build --target wasm32-unknown-unknown","prepare":"yarn build-wasi --release","prepare:release":"yarn build-wasi --release && cp target/wasm32-wasi/release/fluentui_next_appdir_directive.wasm ./fluentui_next_appdir_directive.wasm","test":"cargo test -p directive_transform"},"preferUnplugged":true,"_id":"@chrshnv/fluentui-next-appdir-directive@0.2.1","gitHead":"aec22b93dff41c0da99e41642328e398954e5a81","_nodeVersion":"23.5.0","_npmVersion":"11.0.0","dist":{"integrity":"sha512-x/Hyp/82tdtvvMDxxOIiWklM6JdS+XBtRbDHWnU05T4P7V3wV2K7qZkRy27v00WkjtwvYDC+f1pFTcuDJ5kAwQ==","shasum":"f52d908fc71bf728036952efac0b1a57a365dd01","tarball":"https://registry.npmjs.org/@chrshnv/fluentui-next-appdir-directive/-/fluentui-next-appdir-directive-0.2.1.tgz","fileCount":3,"unpackedSize":2573141,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQC9XAZYXScvyNzc01lBox5VBj0KXDi1d3CwB1Cdpth4GAIgbMi8+J1UZ0GEwqSZGlrB76k4xNcTlLUJwcSy5oQVADI="}]},"_npmUser":{"name":"chereshnevvv","email":"chereshnevvv4real@gmail.com"},"directories":{},"maintainers":[{"name":"chereshnevvv","email":"chereshnevvv4real@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/fluentui-next-appdir-directive_0.2.1_1754976131570_0.11070201171353822"},"_hasShrinkwrap":false}},"time":{"created":"2025-08-12T05:22:11.497Z","0.2.1":"2025-08-12T05:22:11.789Z","modified":"2025-08-12T05:22:12.127Z"},"maintainers":[{"name":"chereshnevvv","email":"chereshnevvv4real@gmail.com"}],"description":"SWC plugin to add \"use client\" directive to Fluent UI, Griffel, and any other packages.","keywords":["swc-plugin"],"author":{"name":"Esteban Munoz Facusse & Artemij Chereshnevvv"},"license":"ISC","readme":"# [@Fluent UI v9](https://react.fluentui.dev/) NextJS AppDir router support plugin\n\nThis plugin allows the use of `@fluentui/react-components` and `@griffel` in the new NextJS@13+ appDir router. The goal of this plugin is to add the `\"use client\";` directive to all files in `@fluentui/react-components` and `@griffel`, but note it's not limited to these libraries.\n\n### Installation\n\n```sh\n# yarn\nyarn add fluentui-next-appdir-directive\n\n# npm\nnpm i fluentui-next-appdir-directive\n```\n\n### Configuration for `@fluentui/react-components` and `@griffel`:\n\n```js\n// next.config.js\n\n/** @type {import('next').NextConfig} */\nconst nextConfig = {\n  experimental: {\n    swcPlugins: [\n      [\"fluentui-next-appdir-directive\",{\n         paths: [\n          \"@griffel\",\n          \"@fluentui\"\n          // 👇 you can add another dependency that needs the directive\n          \"your dependency name\"\n        ]\n      }],\n    ],\n  },\n};\n\nmodule.exports = nextConfig;\n```\n\n### Configuration for usage outside of NextJS\n\n```json\n// .swcrc\n{\n  \"jsc\": {\n    \"experimental\": {\n      \"plugins\": [\n        [\"fluentui-next-appdir-directive\", {\n          \"paths\": [\n            \"@griffel\",\n            \"@fluentui\"\n             // 👇 you can add another dependency that needs the directive\n             \"your dependency name\"\n          ]\n        }]\n      ]\n    }\n  }\n}\n```\n\n> Note: strings inside paths should only contain the scope/package name, in our case @fluentui/react-components -> @fluentui\n\n### My modules are getting ignored and gives me an error in NextJS 14.1.2+:\n\n```js\n// next.config.js\n\n/** @type {import('next').NextConfig} */\nconst nextConfig = {\n  experimental: {\n    swcPlugins: [\n      [\"fluentui-next-appdir-directive\",{\n         paths: [\n          \"@griffel\",\n          \"@fluentui\"\n          // 👇 you can add another dependency that needs the directive\n          \"your dependency name\"\n        ]\n      }],\n    ],\n  },\n  // 👇 packages that need the directive\n  transpilePackages: [\"@fluentui/react-components\"]\n};\n\nmodule.exports = nextConfig;\n```\n\n### Version compat\n\n- For versions `< 14.1.2` please use `0.1.5` otherwise there wil be issues with the swc_core version causing rust to panic.\n- For versions `>= 14.1.2` please use `0.1.7` for the same reason as above, `0.1.7` introduced version `0.90.*` of swc_core which makes it compatible with the versions used in `<= 14.1.2`.\n- For versions `>= 15.0.0` please use `0.2.0` due to a necessary swc_core bump.\n\n### My packages aren't getting tree-shaken\n\nThis is a known issue of using this directive, one way to get around it is to optimizePackage/modularizeImports imports:\n\n- https://nextjs.org/docs/app/api-reference/next-config-js/optimizePackageImports\n- https://nextjs.org/docs/architecture/nextjs-compiler#modularize-imports\n","readmeFilename":"README.md","_rev":"1-a141a6dd2ec8a669cafd85fb90b99e5b"}