{"_id":"ecij","_rev":"6-9bfad7b35f8dc5e67687a539b50f3118","name":"ecij","dist-tags":{"latest":"0.5.0"},"versions":{"0.1.1":{"name":"ecij","version":"0.1.1","keywords":["css-in-js"],"author":{"name":"Nicolas Stepien"},"license":"MIT","_id":"ecij@0.1.1","maintainers":[{"name":"nstep","email":"stepien.nicolas+npm@gmail.com"}],"homepage":"https://github.com/nstepien/ecij#readme","bugs":{"url":"https://github.com/nstepien/ecij/issues"},"dist":{"shasum":"c108e8ab2dc7c6261a9ffb94fc6a44a5bea42cd1","tarball":"https://registry.npmjs.org/ecij/-/ecij-0.1.1.tgz","fileCount":7,"integrity":"sha512-tmzF1uRbt4wlbJ8OxvAgd36P1B4mUUfLxIYNj+vsLKfbJlb3i5GAljNM2Vrsou3ZSENQuU/KgmPgsGh477UkrA==","signatures":[{"sig":"MEYCIQCKidFucis85zUqfy8TRUVaSzRke5RwYDmVR+hSVPr/YwIhAMkgvU7DOcmOC7gO0Ajt5+gSKbOx3H+ueSr6wFaSmyLt","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/ecij@0.1.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":14544},"main":"index.js","type":"module","types":"./index.d.ts","exports":{".":{"types":"./index.d.ts","default":"./index.js"},"./plugin":{"types":"./dist/index.d.ts","default":"./dist/index.js"}},"gitHead":"cd8c84b5d8ba85f1f39338741062ffa3ab3a4aa7","scripts":{"build":"rolldown -c","format":"prettier --write .","typecheck":"tsc","format:check":"prettier --check ."},"_npmUser":{"name":"nstep","email":"stepien.nicolas+npm@gmail.com"},"repository":{"url":"git+https://github.com/nstepien/ecij.git","type":"git"},"_npmVersion":"11.6.2","description":"Rolldown and Vite plugin to Extract CSS-in-JS","directories":{},"_nodeVersion":"25.2.0","dependencies":{"oxc-parser":"^0.97.0"},"_hasShrinkwrap":false,"devDependencies":{"prettier":"^3.6.2","rolldown":"^1.0.0-beta.50","typescript":"^5.9.3","@types/node":"^24.10.1","rolldown-plugin-dts":"^0.17.7"},"_npmOperationalInternal":{"tmp":"tmp/ecij_0.1.1_1763168129074_0.27829706135362087","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"ecij","version":"0.2.0","keywords":["css-in-js"],"author":{"name":"Nicolas Stepien"},"license":"MIT","_id":"ecij@0.2.0","maintainers":[{"name":"nstep","email":"stepien.nicolas+npm@gmail.com"}],"homepage":"https://github.com/nstepien/ecij#readme","bugs":{"url":"https://github.com/nstepien/ecij/issues"},"dist":{"shasum":"d00a94903aac132bc263c94e2ffe9e6a574f6067","tarball":"https://registry.npmjs.org/ecij/-/ecij-0.2.0.tgz","fileCount":7,"integrity":"sha512-JVfw8Fu1fe5y1jBC7bCfbIfcYmB5WCu0/EZSLrFhgzFl5ikOB6wUWW9uODoP3XL5/7NppnAFCLSRiGtqTfTyWg==","signatures":[{"sig":"MEUCICYC3gHaqUKOMM7vNdt90sUjQDjcvwavlnrOYUxusDwFAiEA0L3CUs3NXXbnsO1Rl9C4UxWpkrDiR+IUCJOvuvGxy3w=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/ecij@0.2.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":15912},"main":"index.js","type":"module","types":"./index.d.ts","exports":{".":{"types":"./index.d.ts","default":"./index.js"},"./plugin":{"types":"./dist/index.d.ts","default":"./dist/index.js"}},"gitHead":"e5ed6669ef358c17f5722991e1220835c6ab2d7d","scripts":{"build":"rolldown -c","format":"prettier --write .","typecheck":"tsc","format:check":"prettier --check ."},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:8fe80b06-c123-4371-ba0e-ed76f569f598"}},"repository":{"url":"git+https://github.com/nstepien/ecij.git","type":"git"},"_npmVersion":"11.6.2","description":"Rolldown and Vite plugin to Extract CSS-in-JS","directories":{},"sideEffects":false,"_nodeVersion":"25.2.1","dependencies":{"oxc-parser":"^0.98.0","@rolldown/pluginutils":"^1.0.0-beta.50"},"_hasShrinkwrap":false,"devDependencies":{"prettier":"^3.6.2","rolldown":"^1.0.0-beta.50","typescript":"^5.9.3","@types/node":"^24.10.1","rolldown-plugin-dts":"^0.17.8"},"_npmOperationalInternal":{"tmp":"tmp/ecij_0.2.0_1763482478227_0.026497696228739986","host":"s3://npm-registry-packages-npm-production"}},"0.3.0":{"name":"ecij","version":"0.3.0","keywords":["css-in-js"],"author":{"name":"Nicolas Stepien"},"license":"MIT","_id":"ecij@0.3.0","maintainers":[{"name":"nstep","email":"stepien.nicolas+npm@gmail.com"}],"homepage":"https://github.com/nstepien/ecij#readme","bugs":{"url":"https://github.com/nstepien/ecij/issues"},"dist":{"shasum":"0cdc0d3afe5a6ec68555e732c9285afebdd69787","tarball":"https://registry.npmjs.org/ecij/-/ecij-0.3.0.tgz","fileCount":7,"integrity":"sha512-/LizdRvUoqKbyrrtcS+FzszyKv05xxw5oH8uhv2xGDGnClkdEcgXUk5lvG6OyppJbjgXQJrK7WT8JlqRAn4EvQ==","signatures":[{"sig":"MEUCIQCy2PzxdeoJk3zllmfKzeKn69O7cUkMsqjtJQf7ihafQQIgOqYNqRtNgkB05npVe6YOguaHD6MwnmJt2LEaoU7nlDk=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/ecij@0.3.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":15643},"main":"index.js","type":"module","types":"./index.d.ts","exports":{".":{"types":"./index.d.ts","default":"./index.js"},"./plugin":{"types":"./dist/index.d.ts","default":"./dist/index.js"}},"gitHead":"a68e98adf4ace1c9c2bc2e6707dcba421b364cd8","scripts":{"test":"vitest run","build":"rolldown -c","format":"prettier --write .","typecheck":"tsc --build","format:check":"prettier --check .","test:coverage":"vitest run --coverage"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:8fe80b06-c123-4371-ba0e-ed76f569f598"}},"overrides":{"vite":"$vite"},"repository":{"url":"git+https://github.com/nstepien/ecij.git","type":"git"},"_npmVersion":"11.6.2","description":"Rolldown and Vite plugin to Extract CSS-in-JS","directories":{},"sideEffects":false,"_nodeVersion":"25.2.1","dependencies":{"oxc-parser":"^0.102.0","@rolldown/pluginutils":"^1.0.0-beta.53"},"_hasShrinkwrap":false,"devDependencies":{"vite":"npm:rolldown-vite@^7.2.10","vitest":"^4.0.15","prettier":"^3.7.4","rolldown":"^1.0.0-beta.53","typescript":"^5.9.3","@types/node":"^24.10.1","@vitest/coverage-v8":"^4.0.15","rolldown-plugin-dts":"^0.18.3"},"_npmOperationalInternal":{"tmp":"tmp/ecij_0.3.0_1765377999649_0.00038612360741585583","host":"s3://npm-registry-packages-npm-production"}},"0.4.0":{"name":"ecij","version":"0.4.0","keywords":["css-in-js"],"author":{"name":"Nicolas Stepien"},"license":"MIT","_id":"ecij@0.4.0","maintainers":[{"name":"nstep","email":"stepien.nicolas+npm@gmail.com"}],"homepage":"https://github.com/nstepien/ecij#readme","bugs":{"url":"https://github.com/nstepien/ecij/issues"},"dist":{"shasum":"7d7dfed9c6407e392b3cafcc820441f56c2ac34a","tarball":"https://registry.npmjs.org/ecij/-/ecij-0.4.0.tgz","fileCount":7,"integrity":"sha512-cwTatClzI6nxGwb6Bbo2fhfLnNv8W3DlGVQSpkS89TYbBipkTk1GFnr48NCC89vFlk5D9xaOT0KcqhO9nfl0uw==","signatures":[{"sig":"MEUCICC0183CQ16hIn9hWdkq9JExIHrZVNZqDEtYhu/5llAGAiEAxwsQlv+GR9svB0bz6fs6By3rpQ8dxBzxKgTvR3qT64E=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/ecij@0.4.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":15385},"main":"index.js","type":"module","types":"./index.d.ts","exports":{".":{"types":"./index.d.ts","default":"./index.js"},"./plugin":{"types":"./dist/index.d.ts","default":"./dist/index.js"}},"gitHead":"743f2b9c56646e33696d36cabeddc5ac5aae1ae1","scripts":{"test":"vitest run","build":"rolldown -c","format":"oxfmt","typecheck":"tsc --build","format:check":"oxfmt --check","test:coverage":"vitest run --coverage"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:8fe80b06-c123-4371-ba0e-ed76f569f598"}},"overrides":{"vite":"$vite"},"repository":{"url":"git+https://github.com/nstepien/ecij.git","type":"git"},"_npmVersion":"11.10.1","description":"Rolldown and Vite plugin to Extract CSS-in-JS","directories":{},"sideEffects":false,"_nodeVersion":"25.7.0","_hasShrinkwrap":false,"devDependencies":{"vite":"^8.0.0-beta.16","oxfmt":"^0.35.0","vitest":"^4.0.18","rolldown":"1.0.0-rc.5","typescript":"^5.9.3","@types/node":"^25.3.2","@vitest/coverage-v8":"^4.0.18","rolldown-plugin-dts":"^0.22.2"},"_npmOperationalInternal":{"tmp":"tmp/ecij_0.4.0_1772300239170_0.6076288240291212","host":"s3://npm-registry-packages-npm-production"}},"0.4.1":{"name":"ecij","version":"0.4.1","keywords":["css-in-js"],"author":{"name":"Nicolas Stepien"},"license":"MIT","_id":"ecij@0.4.1","maintainers":[{"name":"nstep","email":"stepien.nicolas+npm@gmail.com"}],"homepage":"https://github.com/nstepien/ecij#readme","bugs":{"url":"https://github.com/nstepien/ecij/issues"},"dist":{"shasum":"d2cf7d13948bf573c747d50fd6eab8c2fab3bf43","tarball":"https://registry.npmjs.org/ecij/-/ecij-0.4.1.tgz","fileCount":7,"integrity":"sha512-s0Tf5YixZI06oLiB6aQ/t2t+Oeul4ixD0qu7Xi//umChQxRXJGPdCf16jUgATewtVn7I+7CbOqj63NpM5/PHcg==","signatures":[{"sig":"MEUCIQCVAjZMvEcIkPeDbc+qJROODsnfa9br+OHVvrZCLSMQlQIgTdt4vGabYcM+TVkrvQfaGTI/96WNiOf9vsQxhq4GKMQ=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/ecij@0.4.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":15590},"main":"index.js","type":"module","types":"./index.d.ts","exports":{".":{"types":"./index.d.ts","default":"./index.js"},"./plugin":{"types":"./dist/index.d.ts","default":"./dist/index.js"}},"gitHead":"7c5c94de046045515f7547dfe679defa2e9da3e2","scripts":{"test":"vitest run","build":"rolldown -c","format":"oxfmt","typecheck":"tsc --build","format:check":"oxfmt --check","test:coverage":"vitest run --coverage"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:8fe80b06-c123-4371-ba0e-ed76f569f598"}},"overrides":{"vite":"$vite"},"repository":{"url":"git+https://github.com/nstepien/ecij.git","type":"git"},"_npmVersion":"11.10.1","description":"Rolldown and Vite plugin to Extract CSS-in-JS","directories":{},"sideEffects":false,"_nodeVersion":"25.7.0","_hasShrinkwrap":false,"devDependencies":{"vite":"^8.0.0-beta.16","oxfmt":"^0.35.0","vitest":"^4.0.18","rolldown":"^1.0.0-rc.6","typescript":"^5.9.3","@types/node":"^25.3.2","@vitest/coverage-v8":"^4.0.18","rolldown-plugin-dts":"^0.22.2"},"_npmOperationalInternal":{"tmp":"tmp/ecij_0.4.1_1772308121685_0.32237487294774914","host":"s3://npm-registry-packages-npm-production"}},"0.5.0":{"name":"ecij","version":"0.5.0","description":"Rolldown and Vite plugin to Extract CSS-in-JS","keywords":["css-in-js","rolldown-plugin","vite-plugin"],"homepage":"https://github.com/nstepien/ecij#readme","bugs":{"url":"https://github.com/nstepien/ecij/issues"},"license":"MIT","author":{"name":"Nicolas Stepien"},"repository":{"type":"git","url":"git+https://github.com/nstepien/ecij.git"},"type":"module","sideEffects":false,"main":"index.js","exports":{".":{"types":"./index.d.ts","default":"./index.js"},"./plugin":{"types":"./dist/index.d.ts","default":"./dist/index.js"}},"scripts":{"build":"rolldown -c","format":"oxfmt","format:check":"oxfmt --check","typecheck":"tsc --build","test":"vitest run"},"devDependencies":{"@jridgewell/trace-mapping":"^0.3.31","@types/node":"^26.4.0","@vitest/coverage-v8":"^4.1.11","oxfmt":"^0.65.0","rolldown":"^1.2.6","rolldown-plugin-dts":"^0.28.4","typescript":"^7.0.2","vite":"^8.2.2","vitest":"^4.1.11"},"peerDependencies":{"rolldown":"^1.2.0","vite":"^8.2.0"},"peerDependenciesMeta":{"vite":{"optional":true}},"gitHead":"3a77453d873c6d3866c8ed68ed522309b6150684","types":"./index.d.ts","_id":"ecij@0.5.0","_nodeVersion":"24.20.0","_npmVersion":"11.19.0","dist":{"integrity":"sha512-g4yPRbb7EWwD8CfPcx20bHd6sTljXp61CDe4V6kg8APs5NAG2ajxR9+dIIYzI83B745CGqK8wP45c3BB59PW3Q==","shasum":"c90b947a4857a3bb149e81318b65fdbe151f411b","tarball":"https://registry.npmjs.org/ecij/-/ecij-0.5.0.tgz","fileCount":7,"unpackedSize":21488,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/ecij@0.5.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCID2qVGsmHBVVA8mILN5SX/b1qmJfVqB8llH1nXD/zj0ZAiARTJLlM3FZQz5ydgJSTqjbfLHK2IyXYghGxZ9GLqImRw=="}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:8fe80b06-c123-4371-ba0e-ed76f569f598"}},"directories":{},"maintainers":[{"name":"nstep","email":"stepien.nicolas+npm@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/ecij_0.5.0_1788179732375_0.8790063414323499"},"_hasShrinkwrap":false}},"time":{"created":"2025-11-15T00:55:28.968Z","modified":"2026-08-31T12:35:32.866Z","0.1.1":"2025-11-15T00:55:29.252Z","0.2.0":"2025-11-18T16:14:38.396Z","0.3.0":"2025-12-10T14:46:39.794Z","0.4.0":"2026-02-28T17:37:19.315Z","0.4.1":"2026-02-28T19:48:41.853Z","0.5.0":"2026-08-31T12:35:32.519Z"},"bugs":{"url":"https://github.com/nstepien/ecij/issues"},"author":{"name":"Nicolas Stepien"},"license":"MIT","homepage":"https://github.com/nstepien/ecij#readme","keywords":["css-in-js","rolldown-plugin","vite-plugin"],"repository":{"type":"git","url":"git+https://github.com/nstepien/ecij.git"},"description":"Rolldown and Vite plugin to Extract CSS-in-JS","maintainers":[{"name":"nstep","email":"stepien.nicolas+npm@gmail.com"}],"readme":"# ecij\n\n[![npm version](https://img.shields.io/npm/v/ecij)](https://www.npmjs.com/package/ecij)\n[![CI](https://github.com/nstepien/ecij/actions/workflows/ci.yml/badge.svg)](https://github.com/nstepien/ecij/actions/workflows/ci.yml)\n\necij (**E**xtract **C**SS-**i**n-**J**S) is a zero-runtime css-in-js plugin for [Rolldown](https://rolldown.rs/) and [Vite](https://vite.dev/).\n\nIt achieves this via static analysis by using [oxc-parser](https://www.npmjs.com/package/oxc-parser), as such it is limited to static expressions. The plugin will ignore dynamic or complex expressions.\n\nThe plugin does not process the CSS in any way whatsoever, it is merely output in virtual CSS files for Rolldown and Vite to handle. Separate plugins may be used to process these virtual CSS files.\n\n## Installation\n\n```bash\nnpm install -D ecij\n```\n\nThe plugin is built on Rolldown's APIs, so `rolldown` is a required peer dependency. In a Vite project it is already part of the dependency tree — npm and pnpm resolve the peer to that same copy — but package managers which do not install peer dependencies automatically (e.g. Yarn) require it to be installed explicitly.\n\n## Usage\n\nSource input:\n\n```ts\n/* main.ts */\nimport { css } from 'ecij';\nimport { redClassname } from './styles';\n\nconst myButtonClassname = css`\n  border: 1px solid blue;\n\n  &.${redClassname} {\n    border-color: red;\n  }\n`;\n```\n\n```ts\n/* styles.ts */\nimport { css } from 'ecij';\n\nconst color = 'red';\n\nexport const redClassname = css`\n  color: ${color};\n`;\n```\n\nBuild output:\n\n```js\n/* js */\nconst color = 'red';\n\nconst redClassname = 'css-a1b2c3d4';\n\nconst myButtonClassname = 'css-1d2c3b4a';\n```\n\n```css\n/* css */\n.css-a1b2c3d4 {\n  color: red;\n}\n\n.css-1d2c3b4a {\n  border: 1px solid blue;\n\n  &.css-a1b2c3d4 {\n    border-color: red;\n  }\n}\n```\n\n## Set up\n\nIn `rolldown.config.ts`:\n\n```ts\nimport { defineConfig } from 'rolldown';\nimport { ecij } from 'ecij/plugin';\n\nexport default defineConfig({\n  // ...\n  plugins: [ecij()],\n});\n```\n\nIn `vite.config.ts`:\n\n```ts\nimport { defineConfig } from 'vite';\nimport { ecij } from 'ecij/plugin';\n\nexport default defineConfig({\n  // ...\n  plugins: [ecij()],\n});\n```\n\n## Configuration\n\nThe `ecij()` plugin accepts an optional configuration object:\n\n```ts\nexport interface Configuration {\n  /**\n   * Include patterns for files to process.\n   * Can be a string, RegExp, or array of strings/RegExp.\n   * @default /\\.[cm]?[jt]sx?$/\n   */\n  include?: string | RegExp | ReadonlyArray<string | RegExp> | undefined | null;\n\n  /**\n   * Exclude patterns for files to skip.\n   * Can be a string, RegExp, or array of strings/RegExp.\n   * @default [/\\/node_modules\\//, /\\.d\\.ts$/]\n   */\n  exclude?: string | RegExp | ReadonlyArray<string | RegExp> | undefined | null;\n\n  /**\n   * Prefix for generated CSS class names.\n   * Should not be empty, as generated hashes may start with a digit, resulting in invalid CSS class names.\n   * @default 'css-'\n   */\n  classPrefix?: string | undefined | null;\n}\n```\n\n**Example:**\n\n```ts\necij({\n  classPrefix: 'lib-',\n});\n```\n\n## Development\n\n### Building\n\n```bash\nnpm run build\n```\n\n### Formatting\n\n```bash\nnpm run format\n```\n\n### Type Checking\n\n```bash\nnpm run typecheck\n```\n\n### Running Tests\n\nThe project uses **integration tests** with **inline snapshot testing** to validate transformations.\n\n```bash\n# Run tests once\nnpm test\n\n# Update inline snapshots after intentional changes\nnpm test -- -u\n```\n\n## TODO\n\n- Full import/export handling (default/namespace import/export)\n","readmeFilename":"README.md"}