{"_id":"@apec1/barrel-loader","_rev":"4-6351b2f08930b9b92c8a2fd0b90cc818","name":"@apec1/barrel-loader","dist-tags":{"latest":"1.0.4"},"versions":{"1.0.0":{"name":"@apec1/barrel-loader","version":"1.0.0","keywords":["barrel","loader","webpack","rspack","rust","native","addon","performance","optimization"],"author":{"name":"Arpit Arya","email":"arpitarya@users.noreply.github.com"},"license":"MIT","_id":"@apec1/barrel-loader@1.0.0","maintainers":[{"name":"aarya11","email":"arpitarya.dev@gmail.com"}],"homepage":"https://github.com/arpitarya/barrel-loader#readme","bugs":{"url":"https://github.com/arpitarya/barrel-loader/issues"},"os":["darwin","linux"],"dist":{"shasum":"75ddabf7bf242125313278afc557f57e25910a87","tarball":"https://registry.npmjs.org/@apec1/barrel-loader/-/barrel-loader-1.0.0.tgz","fileCount":71,"integrity":"sha512-j8wI4/vH543s2b4WLeI1ePJrQEqokyJvYVxmHzi/bN9PXMMVUyd9y60IwWvDVTnP3TmD/ozxWZ3jOyqc7Ig/EQ==","signatures":[{"sig":"MEYCIQDYTewXPEHBNTtep2Y19Pgk0R4fkZ3W2g9ZXgykLpUJTwIhAOUZ8S/8j+mL8pxrdo/gwvYim5/0H8Y6M5B+sXZko2h5","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":3317260},"main":"./dist/index.cjs","type":"module","_from":"file:apec1-barrel-loader-1.0.0.tgz","types":"./dist/index.d.ts","module":"./dist/index.mjs","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.cjs"}},"private":false,"scripts":{"fmt":"biome format --write src && pnpm fmt:rust","lint":"biome lint src && pnpm lint:rust","test":"node test.cjs","build":"pnpm build:rust && pnpm build:ts && pnpm postbuild","check":"biome check --write src","fmt:ts":"biome format --write src","lint:ts":"biome lint src","build:ts":"rslib build","fmt:rust":"cargo fmt --all","lint:fix":"biome lint --write src && cargo clippy --all-targets --fix --allow-dirty --allow-staged","fmt:check":"biome format src && cargo fmt --all -- --check","lint:rust":"cargo clippy --all-targets -- -D warnings","postbuild":"node -e \"require('fs').cpSync('native/barrel_loader_rs.node', 'dist/barrel_loader_rs.node')\"","test:rust":"cargo test","build:rust":"cargo build --release && node scripts/copy-native.cjs","build:clean":"pnpm clean && pnpm build","build:debug":"cargo build && node scripts/copy-native.cjs --debug && pnpm build:ts"},"_npmUser":{"name":"aarya11","email":"arpitarya.dev@gmail.com"},"_resolved":"/private/var/folders/jh/xlrx0c9d7_vgkqm9xbjvf7d40000gn/T/b44dac0d78b1d6ef405b4afdddf7f483/apec1-barrel-loader-1.0.0.tgz","_integrity":"sha512-j8wI4/vH543s2b4WLeI1ePJrQEqokyJvYVxmHzi/bN9PXMMVUyd9y60IwWvDVTnP3TmD/ozxWZ3jOyqc7Ig/EQ==","repository":{"url":"git+https://github.com/arpitarya/barrel-loader.git","type":"git"},"_npmVersion":"11.6.2","description":"High-performance barrel file loader for webpack/rspack using Rust NAPI bindings","directories":{},"_nodeVersion":"24.13.0","dependencies":{"@apec1/node-utils":"1.0.0"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"5.7.3","@rslib/core":"0.19.6","@types/node":"22.10.5","@biomejs/biome":"2.3.15"},"_npmOperationalInternal":{"tmp":"tmp/barrel-loader_1.0.0_1772687505773_0.2903700893539767","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@apec1/barrel-loader","version":"1.0.1","keywords":["barrel","loader","webpack","rspack","rust","native","addon","performance","optimization"],"author":{"name":"Arpit Arya","email":"arpitarya@users.noreply.github.com"},"license":"MIT","_id":"@apec1/barrel-loader@1.0.1","maintainers":[{"name":"aarya11","email":"arpitarya.dev@gmail.com"}],"homepage":"https://github.com/arpitarya/barrel-loader#readme","bugs":{"url":"https://github.com/arpitarya/barrel-loader/issues"},"os":["darwin","linux"],"dist":{"shasum":"af5b013dfa97be1b6e2b4aaa34ae2a7f13bf38fe","tarball":"https://registry.npmjs.org/@apec1/barrel-loader/-/barrel-loader-1.0.1.tgz","fileCount":71,"integrity":"sha512-ilDt1hyqf2oGBk1kJLPwQ8RoYFBxdo7I8KvFM/1D22Zy/TTmTBY8RxMSwPedyFxXCGbAupwltodyx8HDpUJC8g==","signatures":[{"sig":"MEYCIQDKJepVw7a7xxi95jRmvILoJpAPsQxEr/Ehn/ki7x0uWgIhAOthMKr7xiLqgJhVLAuB9CtSHyt74e6A5tTp/4bd0QbI","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@apec1%2fbarrel-loader@1.0.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":4146348},"main":"./dist/index.cjs","type":"module","_from":"file:apec1-barrel-loader-1.0.1.tgz","types":"./dist/index.d.ts","module":"./dist/index.mjs","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.cjs"}},"private":false,"scripts":{"fmt":"biome format --write src && pnpm fmt:rust","lint":"biome lint src && pnpm lint:rust","test":"node test.cjs","build":"pnpm build:rust && pnpm build:ts && pnpm postbuild","check":"biome check --write src","fmt:ts":"biome format --write src","lint:ts":"biome lint src","build:ts":"rslib build","fmt:rust":"cargo fmt --all","lint:fix":"biome lint --write src && cargo clippy --all-targets --fix --allow-dirty --allow-staged","fmt:check":"biome format src && cargo fmt --all -- --check","lint:rust":"cargo clippy --all-targets -- -D warnings","postbuild":"node -e \"require('fs').cpSync('native/barrel_loader_rs.node', 'dist/barrel_loader_rs.node')\"","test:rust":"cargo test","build:rust":"cargo build --release && node scripts/copy-native.cjs","build:clean":"pnpm clean && pnpm build","build:debug":"cargo build && node scripts/copy-native.cjs --debug && pnpm build:ts"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:57aa7b83-7410-452e-ba9f-dc0ffbdc87ff"}},"_resolved":"/tmp/07f2cb5a79c353453d8d12b875db6dd9/apec1-barrel-loader-1.0.1.tgz","_integrity":"sha512-ilDt1hyqf2oGBk1kJLPwQ8RoYFBxdo7I8KvFM/1D22Zy/TTmTBY8RxMSwPedyFxXCGbAupwltodyx8HDpUJC8g==","repository":{"url":"git+https://github.com/arpitarya/barrel-loader.git","type":"git"},"_npmVersion":"11.9.0","description":"High-performance barrel file loader for webpack/rspack using Rust NAPI bindings","directories":{},"_nodeVersion":"24.14.0","dependencies":{"@apec1/node-utils":"1.0.0"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"5.7.3","@rslib/core":"0.19.6","@types/node":"22.10.5","@biomejs/biome":"2.3.15"},"_npmOperationalInternal":{"tmp":"tmp/barrel-loader_1.0.1_1772688095516_0.27335914808631623","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"name":"@apec1/barrel-loader","version":"1.0.2","keywords":["barrel","loader","webpack","rspack","rust","native","addon","performance","optimization"],"author":{"name":"Arpit Arya","email":"arpitarya@users.noreply.github.com"},"license":"MIT","_id":"@apec1/barrel-loader@1.0.2","maintainers":[{"name":"aarya11","email":"arpitarya.dev@gmail.com"}],"homepage":"https://github.com/arpitarya/barrel-loader#readme","bugs":{"url":"https://github.com/arpitarya/barrel-loader/issues"},"os":["darwin","linux"],"dist":{"shasum":"8c0b70a0371fbfd3ce502298c37b7040e72aef36","tarball":"https://registry.npmjs.org/@apec1/barrel-loader/-/barrel-loader-1.0.2.tgz","fileCount":71,"integrity":"sha512-0vjB8ZSqYw5QUZjVU3lEWNtg3G9iBjAjYWP/vEXMXIKxvn5QqaQw+anRIVm8v/gA83I7MURwR3shF3oWg1dAMA==","signatures":[{"sig":"MEYCIQDRkMnuQy0wvNvLnEm752JrYKQ5bM49dc8ve4ld/lOmqgIhAMQyIriJb4oxTu2aMD602IcdVUO7HTuHCh34OeqJhrpJ","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":3317228},"main":"./dist/index.cjs","type":"module","_from":"file:apec1-barrel-loader-1.0.2.tgz","types":"./dist/index.d.ts","module":"./dist/index.mjs","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.cjs"}},"private":false,"scripts":{"fmt":"biome format --write src && pnpm fmt:rust","lint":"biome lint src && pnpm lint:rust","test":"node test.cjs","build":"pnpm build:rust && pnpm build:ts && pnpm postbuild","check":"biome check --write src","fmt:ts":"biome format --write src","lint:ts":"biome lint src","build:ts":"rslib build","fmt:rust":"cargo fmt --all","lint:fix":"biome lint --write src && cargo clippy --all-targets --fix --allow-dirty --allow-staged","fmt:check":"biome format src && cargo fmt --all -- --check","lint:rust":"cargo clippy --all-targets -- -D warnings","postbuild":"node -e \"require('fs').cpSync('native/barrel_loader_rs.node', 'dist/barrel_loader_rs.node')\"","test:rust":"cargo test","build:rust":"cargo build --release && node scripts/copy-native.cjs","build:clean":"pnpm clean && pnpm build","build:debug":"cargo build && node scripts/copy-native.cjs --debug && pnpm build:ts"},"_npmUser":{"name":"aarya11","email":"arpitarya.dev@gmail.com"},"_resolved":"/private/var/folders/jh/xlrx0c9d7_vgkqm9xbjvf7d40000gn/T/1f790ef08883dc1043f4565e38b6fe0e/apec1-barrel-loader-1.0.2.tgz","_integrity":"sha512-0vjB8ZSqYw5QUZjVU3lEWNtg3G9iBjAjYWP/vEXMXIKxvn5QqaQw+anRIVm8v/gA83I7MURwR3shF3oWg1dAMA==","repository":{"url":"git+https://github.com/arpitarya/barrel-loader.git","type":"git"},"_npmVersion":"11.6.2","description":"High-performance barrel file loader for webpack/rspack using Rust NAPI bindings","directories":{},"_nodeVersion":"24.13.0","dependencies":{"@apec1/node-utils":"1.0.0"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"5.7.3","@rslib/core":"0.19.6","@types/node":"22.10.5","@biomejs/biome":"2.3.15"},"_npmOperationalInternal":{"tmp":"tmp/barrel-loader_1.0.2_1772768794461_0.37519004027783587","host":"s3://npm-registry-packages-npm-production"}},"1.0.4":{"name":"@apec1/barrel-loader","version":"1.0.4","description":"High-performance barrel file loader for webpack/rspack using Rust NAPI bindings","license":"MIT","author":{"name":"Arpit Arya","email":"arpitarya@users.noreply.github.com"},"type":"module","private":false,"main":"./dist/index.cjs","module":"./dist/index.mjs","types":"./dist/index.d.ts","publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"engines":{"node":">=18.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.cjs"}},"repository":{"type":"git","url":"git+https://github.com/arpitarya/barrel-loader.git"},"os":["darwin","linux"],"keywords":["barrel","loader","webpack","rspack","rust","native","addon","performance","optimization"],"devDependencies":{"@biomejs/biome":"2.3.15","@rslib/core":"0.19.6","@types/node":"22.10.5","typescript":"5.7.3"},"dependencies":{"@apec1/node-utils":"1.0.0"},"scripts":{"version:bump":"./scripts/bump-version.sh","version:check":"./scripts/check-version-sync.sh","release:verify":"pnpm run version:check && cargo test && node test.cjs && pnpm build","build":"pnpm build:rust && pnpm build:ts && pnpm postbuild","build:rust":"cargo build --release && node scripts/copy-native.cjs","build:ts":"rslib build","postbuild":"node -e \"require('fs').cpSync('native/barrel_loader_rs.node', 'dist/barrel_loader_rs.node')\"","build:debug":"cargo build && node scripts/copy-native.cjs --debug && pnpm build:ts","build:clean":"pnpm clean && pnpm build","test":"node test.cjs","test:rust":"cargo test","lint":"biome lint src && pnpm lint:rust","lint:ts":"biome lint src","lint:rust":"cargo clippy --all-targets -- -D warnings","lint:fix":"biome lint --write src && cargo clippy --all-targets --fix --allow-dirty --allow-staged","fmt":"biome format --write src && pnpm fmt:rust","fmt:ts":"biome format --write src","fmt:rust":"cargo fmt --all","fmt:check":"biome format src && cargo fmt --all -- --check","check":"biome check --write src"},"_id":"@apec1/barrel-loader@1.0.4","bugs":{"url":"https://github.com/arpitarya/barrel-loader/issues"},"homepage":"https://github.com/arpitarya/barrel-loader#readme","_integrity":"sha512-FVgV82IoBntStJfk+kLfUba+cSvl/OJRaHoCkpTB/iGurIfV2bp9fJmFHGtNVN+vXbBSn8uN8HGioXP3AmCNOQ==","_resolved":"/tmp/5eeef03df56e6490f88e88930988df49/apec1-barrel-loader-1.0.4.tgz","_from":"file:apec1-barrel-loader-1.0.4.tgz","_nodeVersion":"24.14.0","_npmVersion":"11.9.0","dist":{"integrity":"sha512-FVgV82IoBntStJfk+kLfUba+cSvl/OJRaHoCkpTB/iGurIfV2bp9fJmFHGtNVN+vXbBSn8uN8HGioXP3AmCNOQ==","shasum":"09af3918081764a794be3e8aa2f22a5657a43349","tarball":"https://registry.npmjs.org/@apec1/barrel-loader/-/barrel-loader-1.0.4.tgz","fileCount":71,"unpackedSize":4139218,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@apec1%2fbarrel-loader@1.0.4","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIDXfOSpj4p6UVNFIHUHRTI0cYjh9SRIz1a+lHkFUEFOcAiEA770+cNrB9kPxUfK59fV2adk1jMhLGB/SO4KQ/S8m+AE="}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:57aa7b83-7410-452e-ba9f-dc0ffbdc87ff"}},"directories":{},"maintainers":[{"name":"aarya11","email":"arpitarya.dev@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/barrel-loader_1.0.4_1772770249443_0.810692045435905"},"_hasShrinkwrap":false}},"time":{"created":"2026-03-05T05:11:45.646Z","modified":"2026-03-06T04:10:49.941Z","1.0.0":"2026-03-05T05:11:46.016Z","1.0.1":"2026-03-05T05:21:35.755Z","1.0.2":"2026-03-06T03:46:34.732Z","1.0.4":"2026-03-06T04:10:49.641Z"},"bugs":{"url":"https://github.com/arpitarya/barrel-loader/issues"},"author":{"name":"Arpit Arya","email":"arpitarya@users.noreply.github.com"},"license":"MIT","homepage":"https://github.com/arpitarya/barrel-loader#readme","keywords":["barrel","loader","webpack","rspack","rust","native","addon","performance","optimization"],"repository":{"type":"git","url":"git+https://github.com/arpitarya/barrel-loader.git"},"description":"High-performance barrel file loader for webpack/rspack using Rust NAPI bindings","maintainers":[{"name":"aarya11","email":"arpitarya.dev@gmail.com"}],"readme":"# barrel-loader\n\nHigh-performance barrel file optimization for webpack and rspack, powered by Rust + NAPI.\n\n`barrel-loader` rewrites `index.ts/js/tsx/jsx` barrel files into clean, explicit, deduplicated exports. It is designed for large codebases where deeply nested `export *` chains can slow builds and create noisy bundles.\n\n---\n\n## Table of Contents\n\n- [What this solves](#what-this-solves)\n- [How it works](#how-it-works)\n- [Features](#features)\n- [Install](#install)\n- [Quick start](#quick-start)\n- [Loader options](#loader-options)\n- [Examples](#examples)\n- [Behavior notes](#behavior-notes)\n- [Debugging](#debugging)\n- [Build from source](#build-from-source)\n- [Architecture](#architecture)\n- [Troubleshooting](#troubleshooting)\n- [Contributing](#contributing)\n- [License](#license)\n\n---\n\n## What this solves\n\nIn many projects, barrel files gradually become chains of wildcard exports:\n\n```ts\n// src/index.ts\nexport * from './components'\nexport * from './hooks'\n\n// src/components/index.ts\nexport * from './button'\nexport * from './input'\n```\n\nThis creates a few common issues:\n\n- Duplicate re-exports from different paths\n- Harder-to-predict export surfaces\n- Slower parsing and transform work in large projects\n- Mixed value/type export handling edge cases\n\n`barrel-loader` resolves these by parsing and flattening export graphs, then reconstructing a normalized barrel output.\n\n---\n\n## How it works\n\nPipeline at build time:\n\n1. Parse exports (native Rust parser)\n2. Resolve nested barrels recursively\n3. Expand namespace exports when configured\n4. Remove duplicates\n5. Sort output deterministically\n6. Reconstruct the final barrel source\n\nCore execution path is native (Rust + NAPI), with selective JavaScript handling around integration logic.\n\n---\n\n## Features\n\n- Native Rust parsing and transforms via NAPI\n- Webpack + rspack loader compatibility\n- Recursive barrel resolution\n- Namespace-to-named expansion support\n- Type-aware export reconstruction\n- Deterministic output ordering\n- Verbose and debug logging modes\n\n---\n\n## Install\n\n```bash\npnpm add @apec1/barrel-loader\n# or\nnpm install @apec1/barrel-loader\n```\n\nRuntime requirements:\n\n- Node.js >= 18\n- macOS or Linux (Windows is not officially supported)\n\n---\n\n## Quick start\n\n### webpack\n\n```js\n// webpack.config.js\nmodule.exports = {\n  module: {\n    rules: [\n      {\n        test: /\\/index\\.(ts|tsx|js|jsx)$/,\n        use: [\n          {\n            loader: '@apec1/barrel-loader',\n            options: {\n              verbose: false,\n              convertNamespaceToNamed: true\n            }\n          }\n        ]\n      }\n    ]\n  }\n}\n```\n\n### rspack\n\n```js\n// rspack.config.mjs\nexport default {\n  module: {\n    rules: [\n      {\n        test: /\\/index\\.(ts|tsx|js|jsx)$/,\n        use: [\n          {\n            loader: '@apec1/barrel-loader',\n            options: {\n              verbose: false,\n              convertNamespaceToNamed: true\n            }\n          }\n        ]\n      }\n    ]\n  }\n}\n```\n\n---\n\n## Loader options\n\n```ts\ntype BarrelLoaderOptions = {\n  resolveBarrelFiles?: boolean\n  removeDuplicates?: boolean\n  sort?: boolean\n  convertNamespaceToNamed?: boolean\n  verbose?: boolean\n}\n```\n\n| Option | Type | Default | Description |\n|---|---|---|---|\n| `resolveBarrelFiles` | `boolean` | `true` | Resolve nested barrel chains recursively |\n| `removeDuplicates` | `boolean` | `true` | Deduplicate repeated exports |\n| `sort` | `boolean` | `false` | Sort exports deterministically |\n| `convertNamespaceToNamed` | `boolean` | `false` | Convert `export *` to explicit named exports when resolvable |\n| `verbose` | `boolean` | `false` | Emit loader stage logs |\n\n---\n\n## Examples\n\n### 1) Flatten nested barrels\n\n**Input**\n\n```ts\n// src/index.ts\nexport * from './ui'\n\n// src/ui/index.ts\nexport * from './button'\nexport * from './input'\n```\n\n**Typical output intent**\n\n```ts\nexport { Button } from './ui/button'\nexport { Input } from './ui/input'\n```\n\n### 2) Convert namespace exports to named exports\n\nWith `convertNamespaceToNamed: true`:\n\n```ts\n// before\nexport * from './file'\n\n// after (when analyzable)\nexport { fnA, fnB, fnC } from './file'\n```\n\n### 3) Preserve type exports\n\n```ts\n// source\nexport * from './runtime'\nexport * from './types'\n\n// output keeps value/type semantics distinct\nexport { run } from './runtime'\nexport type { User, Session } from './types'\n```\n\n### 4) Enable trace-level diagnostics for local debugging\n\n```bash\nBARREL_LOADER_DEBUG=true pnpm build\n```\n\nThis enables detailed logs from parser/resolver stages and writes debug output files for transformed barrels.\n\nMore examples: [docs/EXAMPLES.md](docs/EXAMPLES.md)\n\n---\n\n## Behavior notes\n\n- The loader targets barrel-like entry files (`index.ts/js/tsx/jsx`) in your rule configuration.\n- Current transforms are export-focused; direct declaration rewriting is intentionally limited.\n- Native addon load failures can surface as fallback warnings, but build behavior depends on where the failure occurs.\n\n---\n\n## Debugging\n\nEnvironment flags:\n\n- `BARREL_LOADER_DEBUG=true` → deep debug logs + `.debug.ts` outputs for transformed files\n- `BARREL_LOADER_VERBOSE=true` → verbose parse/resolve logging\n\nExample:\n\n```bash\nBARREL_LOADER_DEBUG=true BARREL_LOADER_VERBOSE=true pnpm build\n```\n\n---\n\n## Build from source\n\n### Fast path\n\n```bash\n./setup.sh\n./build.sh\n```\n\n### Common scripts\n\n```bash\npnpm build        # Rust + TypeScript\npnpm build:rust   # Rust only\npnpm build:ts     # TypeScript bundles only\npnpm build:debug  # Debug Rust build + TypeScript\n\npnpm test         # JS integration checks\npnpm test:rust    # Rust tests\npnpm lint         # biome + clippy\npnpm fmt          # biome + rustfmt\n```\n\n### Build artifacts\n\n- `native/barrel_loader_rs.node`\n- `dist/index.cjs`\n- `dist/index.mjs`\n- `dist/index.d.ts`\n\n---\n\n## Architecture\n\n### Rust side\n\n- `src/lib.rs` – top-level native module\n- `src/types.rs` – shared NAPI object shapes\n- `src/rs_utils/parser/*` – export parsing\n- `src/rs_utils/deduplication.rs` – dedupe logic\n- `src/rs_utils/sorting.rs` – deterministic sort\n- `src/rs_utils/reconstruction/*` – source regeneration\n\n### TypeScript side\n\n- `src/barrel-loader.ts` – loader orchestration\n- `src/ts-utils/resolve-barrel.ts` – recursive traversal\n- `src/ts-utils/resolve-utils.ts` – export expansion helpers\n- `src/ts-utils/native-addon.ts` – native addon bridge\n- `src/index.ts` – package entry and exports\n\n### Bundling\n\n- `rslib` emits CJS + ESM bundles to `dist/`\n- Native `.node` addon is copied to `native/` and `dist/` during build\n\n---\n\n## Troubleshooting\n\nA full troubleshooting guide is available here:\n\n➡️ [docs/TROUBLESHOOTING.md](docs/TROUBLESHOOTING.md)\n\nIt includes fixes for:\n\n- Rust files accidentally parsed by rslib/rspack\n- Native addon field mismatch errors (`exportType` vs `export_type`)\n- `rslib: command not found` after cleaning dependencies\n- pnpm side-effects cache vs rspack build cache confusion\n- Native addon load failures and clean rebuild strategy\n\n---\n\n## Contributing\n\nContributions are welcome.\n\nRecommended contribution workflow:\n\n1. Open an issue describing the problem/feature\n2. Add or update tests (`pnpm test`, `pnpm test:rust`)\n3. Keep docs in sync (`README`, `docs/*`)\n4. Run lint/format before opening PR\n\nRelease and publish details: [PUBLISHING.md](PUBLISHING.md)\n\n---\n\n## License\n\nMIT\n","readmeFilename":"README.md"}