{"_id":"@codama/fragments","_rev":"7-30c1edf4797e4ca74e85f4cb9ae2b859","name":"@codama/fragments","dist-tags":{"latest":"1.0.0"},"versions":{"0.1.0":{"name":"@codama/fragments","version":"0.1.0","keywords":["codama","code-generation","fragments","framework","import-maps","solana"],"license":"MIT","_id":"@codama/fragments@0.1.0","maintainers":[{"name":"lorisleiva","email":"loris.leiva@gmail.com"}],"homepage":"https://github.com/codama-idl/codama#readme","bugs":{"url":"http://github.com/codama-idl/codama/issues"},"dist":{"shasum":"bade2c856b94da0170fdcd4f96a0cbd047a575fd","tarball":"https://registry.npmjs.org/@codama/fragments/-/fragments-0.1.0.tgz","fileCount":97,"integrity":"sha512-rWnSKw4UA9LS7mMQyzKnR1woibVEYrYgp66+i+JB+O1lnvU/i/KCH4TmoV+S6Y3ADL2WyznrwfDA3rBET6U5Cg==","signatures":[{"sig":"MEUCIEYUEYiJ2ir9urQVpq4FuSIkUljtUA9i0u4ZIKEFzQXiAiEAsgON9GqaF5h/xKgAy2eurzj+vf9gCR3e98IFdPxNwxk=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":945606},"main":"./dist/index.node.cjs","type":"commonjs","_from":"file:codama-fragments-0.1.0.tgz","types":"./dist/types/index.d.ts","module":"./dist/index.node.mjs","browser":{"./dist/rust.node.cjs":"./dist/rust.browser.cjs","./dist/rust.node.mjs":"./dist/rust.browser.mjs","./dist/index.node.cjs":"./dist/index.browser.cjs","./dist/index.node.mjs":"./dist/index.browser.mjs","./dist/javascript.node.cjs":"./dist/javascript.browser.cjs","./dist/javascript.node.mjs":"./dist/javascript.browser.mjs"},"exports":{".":{"node":{"import":"./dist/index.node.mjs","require":"./dist/index.node.cjs"},"types":"./dist/types/index.d.ts","browser":{"import":"./dist/index.browser.mjs","require":"./dist/index.browser.cjs"},"react-native":"./dist/index.react-native.mjs"},"./rust":{"node":{"import":"./dist/rust.node.mjs","require":"./dist/rust.node.cjs"},"types":"./dist/types/rust/index.d.ts","browser":{"import":"./dist/rust.browser.mjs","require":"./dist/rust.browser.cjs"},"react-native":"./dist/rust.react-native.mjs"},"./javascript":{"node":{"import":"./dist/javascript.node.mjs","require":"./dist/javascript.node.cjs"},"types":"./dist/types/javascript/index.d.ts","browser":{"import":"./dist/javascript.browser.mjs","require":"./dist/javascript.browser.cjs"},"react-native":"./dist/javascript.react-native.mjs"}},"scripts":{"dev":"vitest --project node","lint":"eslint . && prettier --check .","test":"pnpm test:types && pnpm test:treeshakability && pnpm test:unit","build":"rimraf dist && tsup && tsc -p ./tsconfig.declarations.json","lint:fix":"eslint --fix . && prettier --write .","test:unit":"vitest run","test:types":"tsc --noEmit","test:treeshakability":"for file in dist/index.*.mjs dist/javascript.*.mjs dist/rust.*.mjs; do agadoo $file; done"},"_npmUser":{"name":"lorisleiva","email":"loris.leiva@gmail.com"},"_resolved":"/tmp/9c85c5f48d1517e3c693952ecdc42867/codama-fragments-0.1.0.tgz","_integrity":"sha512-rWnSKw4UA9LS7mMQyzKnR1woibVEYrYgp66+i+JB+O1lnvU/i/KCH4TmoV+S6Y3ADL2WyznrwfDA3rBET6U5Cg==","repository":{"url":"git+https://github.com/codama-idl/codama.git","type":"git"},"_npmVersion":"10.8.2","description":"Composable code-generation fragments and language-aware import maps for Codama renderers","directories":{},"sideEffects":false,"_nodeVersion":"20.20.2","browserslist":["supports bigint and not dead","maintained node versions"],"dependencies":{"@codama/errors":"1.7.0"},"react-native":"./dist/index.react-native.mjs","typesVersions":{"*":{"rust":["./dist/types/rust/index.d.ts"],"javascript":["./dist/types/javascript/index.d.ts"]}},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/fragments_0.1.0_1780415286775_0.30765540083166854","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@codama/fragments","version":"0.1.1","keywords":["codama","code-generation","fragments","framework","import-maps","solana"],"license":"MIT","_id":"@codama/fragments@0.1.1","maintainers":[{"name":"lorisleiva","email":"loris.leiva@gmail.com"}],"homepage":"https://github.com/codama-idl/codama#readme","bugs":{"url":"http://github.com/codama-idl/codama/issues"},"dist":{"shasum":"55e8587a8fec446e8dd836fdc3e016fd5e260086","tarball":"https://registry.npmjs.org/@codama/fragments/-/fragments-0.1.1.tgz","fileCount":97,"integrity":"sha512-+DeC2YklyYf+qjRkoTKeG6HFgwsW7hiQko7er18dgsxF15M316EwYL2W40nKDPWlEhB/iME+sZR5++VQPUO/6w==","signatures":[{"sig":"MEQCIF/ZAoHQwGydag374qPVoQ8bFkngIzqDaMgHz2Rc0ekJAiAv9tepw1B0i1NF6fg7aQ603aHP3lPzHwzAbhBQRW+0fw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":945606},"main":"./dist/index.node.cjs","type":"commonjs","_from":"file:codama-fragments-0.1.1.tgz","types":"./dist/types/index.d.ts","module":"./dist/index.node.mjs","browser":{"./dist/rust.node.cjs":"./dist/rust.browser.cjs","./dist/rust.node.mjs":"./dist/rust.browser.mjs","./dist/index.node.cjs":"./dist/index.browser.cjs","./dist/index.node.mjs":"./dist/index.browser.mjs","./dist/javascript.node.cjs":"./dist/javascript.browser.cjs","./dist/javascript.node.mjs":"./dist/javascript.browser.mjs"},"exports":{".":{"node":{"import":"./dist/index.node.mjs","require":"./dist/index.node.cjs"},"types":"./dist/types/index.d.ts","browser":{"import":"./dist/index.browser.mjs","require":"./dist/index.browser.cjs"},"react-native":"./dist/index.react-native.mjs"},"./rust":{"node":{"import":"./dist/rust.node.mjs","require":"./dist/rust.node.cjs"},"types":"./dist/types/rust/index.d.ts","browser":{"import":"./dist/rust.browser.mjs","require":"./dist/rust.browser.cjs"},"react-native":"./dist/rust.react-native.mjs"},"./javascript":{"node":{"import":"./dist/javascript.node.mjs","require":"./dist/javascript.node.cjs"},"types":"./dist/types/javascript/index.d.ts","browser":{"import":"./dist/javascript.browser.mjs","require":"./dist/javascript.browser.cjs"},"react-native":"./dist/javascript.react-native.mjs"}},"scripts":{"dev":"vitest --project node","lint":"eslint . && prettier --check .","test":"pnpm test:types && pnpm test:treeshakability && pnpm test:unit","build":"rimraf dist && tsup && tsc -p ./tsconfig.declarations.json","lint:fix":"eslint --fix . && prettier --write .","test:unit":"vitest run","test:types":"tsc --noEmit","test:treeshakability":"for file in dist/index.*.mjs dist/javascript.*.mjs dist/rust.*.mjs; do agadoo $file; done"},"_npmUser":{"name":"lorisleiva","email":"loris.leiva@gmail.com"},"_resolved":"/tmp/9da3c13614e6ed425bafae33a8f1b601/codama-fragments-0.1.1.tgz","_integrity":"sha512-+DeC2YklyYf+qjRkoTKeG6HFgwsW7hiQko7er18dgsxF15M316EwYL2W40nKDPWlEhB/iME+sZR5++VQPUO/6w==","repository":{"url":"git+https://github.com/codama-idl/codama.git","type":"git"},"_npmVersion":"10.8.2","description":"Composable code-generation fragments and language-aware import maps for Codama renderers","directories":{},"sideEffects":false,"_nodeVersion":"20.20.2","browserslist":["supports bigint and not dead","maintained node versions"],"dependencies":{"@codama/errors":"1.8.0"},"react-native":"./dist/index.react-native.mjs","typesVersions":{"*":{"rust":["./dist/types/rust/index.d.ts"],"javascript":["./dist/types/javascript/index.d.ts"]}},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/fragments_0.1.1_1781624337137_0.4199247848984551","host":"s3://npm-registry-packages-npm-production"}},"0.1.2":{"name":"@codama/fragments","version":"0.1.2","keywords":["codama","code-generation","fragments","framework","import-maps","solana"],"license":"MIT","_id":"@codama/fragments@0.1.2","maintainers":[{"name":"lorisleiva","email":"loris.leiva@gmail.com"}],"homepage":"https://github.com/codama-idl/codama#readme","bugs":{"url":"http://github.com/codama-idl/codama/issues"},"dist":{"shasum":"ebb711b947e62fe9c7b190de19a74f58115fe62c","tarball":"https://registry.npmjs.org/@codama/fragments/-/fragments-0.1.2.tgz","fileCount":97,"integrity":"sha512-6u0bPrdFjv3wQ6wwRx8NhmgO9ngHvRmJXqsJeV4LYI2gbvLSjs+Havei5dg7qoBIwg8LyF6sEmLNBzkQ4wQ0Hg==","signatures":[{"sig":"MEQCIG8n1vKJ/U3nxQAW3zWM2quIy0kWDaPSKwU6thVwwCafAiBoXke1LwG8dLb6CcF2dE/cxXT+rJW75yM6iHk9/wZAdw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":945606},"main":"./dist/index.node.cjs","type":"commonjs","_from":"file:codama-fragments-0.1.2.tgz","types":"./dist/types/index.d.ts","module":"./dist/index.node.mjs","browser":{"./dist/rust.node.cjs":"./dist/rust.browser.cjs","./dist/rust.node.mjs":"./dist/rust.browser.mjs","./dist/index.node.cjs":"./dist/index.browser.cjs","./dist/index.node.mjs":"./dist/index.browser.mjs","./dist/javascript.node.cjs":"./dist/javascript.browser.cjs","./dist/javascript.node.mjs":"./dist/javascript.browser.mjs"},"exports":{".":{"node":{"import":"./dist/index.node.mjs","require":"./dist/index.node.cjs"},"types":"./dist/types/index.d.ts","browser":{"import":"./dist/index.browser.mjs","require":"./dist/index.browser.cjs"},"react-native":"./dist/index.react-native.mjs"},"./rust":{"node":{"import":"./dist/rust.node.mjs","require":"./dist/rust.node.cjs"},"types":"./dist/types/rust/index.d.ts","browser":{"import":"./dist/rust.browser.mjs","require":"./dist/rust.browser.cjs"},"react-native":"./dist/rust.react-native.mjs"},"./javascript":{"node":{"import":"./dist/javascript.node.mjs","require":"./dist/javascript.node.cjs"},"types":"./dist/types/javascript/index.d.ts","browser":{"import":"./dist/javascript.browser.mjs","require":"./dist/javascript.browser.cjs"},"react-native":"./dist/javascript.react-native.mjs"}},"scripts":{"dev":"vitest --project node","lint":"eslint . && prettier --check .","test":"pnpm test:types && pnpm test:treeshakability && pnpm test:unit","build":"rimraf dist && tsup && tsc -p ./tsconfig.declarations.json","lint:fix":"eslint --fix . && prettier --write .","test:unit":"vitest run","test:types":"tsc --noEmit","test:treeshakability":"for file in dist/index.*.mjs dist/javascript.*.mjs dist/rust.*.mjs; do agadoo $file; done"},"_npmUser":{"name":"lorisleiva","email":"loris.leiva@gmail.com"},"_resolved":"/tmp/db5757ad649222df8536dcc82e0b5d7c/codama-fragments-0.1.2.tgz","_integrity":"sha512-6u0bPrdFjv3wQ6wwRx8NhmgO9ngHvRmJXqsJeV4LYI2gbvLSjs+Havei5dg7qoBIwg8LyF6sEmLNBzkQ4wQ0Hg==","repository":{"url":"git+https://github.com/codama-idl/codama.git","type":"git"},"_npmVersion":"10.8.2","description":"Composable code-generation fragments and language-aware import maps for Codama renderers","directories":{},"sideEffects":false,"_nodeVersion":"20.20.2","browserslist":["supports bigint and not dead","maintained node versions"],"dependencies":{"@codama/errors":"1.9.0"},"react-native":"./dist/index.react-native.mjs","typesVersions":{"*":{"rust":["./dist/types/rust/index.d.ts"],"javascript":["./dist/types/javascript/index.d.ts"]}},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/fragments_0.1.2_1783674600665_0.49348690726970723","host":"s3://npm-registry-packages-npm-production"}},"0.1.3":{"name":"@codama/fragments","version":"0.1.3","keywords":["codama","code-generation","fragments","framework","import-maps","solana"],"license":"MIT","_id":"@codama/fragments@0.1.3","maintainers":[{"name":"lorisleiva","email":"loris.leiva@gmail.com"}],"homepage":"https://github.com/codama-idl/codama#readme","bugs":{"url":"http://github.com/codama-idl/codama/issues"},"dist":{"shasum":"fc29b474f227c3cd42b3c68c2bc26bead709202a","tarball":"https://registry.npmjs.org/@codama/fragments/-/fragments-0.1.3.tgz","fileCount":97,"integrity":"sha512-ITa3UYs74AWx7se/6EZN+YXqV1Vu89L3n2v0/irsQNbPcy8wP26p/GKns/1H4a8vGvAKuzWdIGO535dwcauInw==","signatures":[{"sig":"MEUCIQDwlg0+APvpx/YsMeVABHoY3jMIKxswUM5SigAbSobybQIgcsn8BacMm1Szay7iGdTHZ/GOFoqYKQM1agZcMD0eVFQ=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":945607},"main":"./dist/index.node.cjs","type":"commonjs","_from":"file:codama-fragments-0.1.3.tgz","types":"./dist/types/index.d.ts","module":"./dist/index.node.mjs","browser":{"./dist/rust.node.cjs":"./dist/rust.browser.cjs","./dist/rust.node.mjs":"./dist/rust.browser.mjs","./dist/index.node.cjs":"./dist/index.browser.cjs","./dist/index.node.mjs":"./dist/index.browser.mjs","./dist/javascript.node.cjs":"./dist/javascript.browser.cjs","./dist/javascript.node.mjs":"./dist/javascript.browser.mjs"},"exports":{".":{"node":{"import":"./dist/index.node.mjs","require":"./dist/index.node.cjs"},"types":"./dist/types/index.d.ts","browser":{"import":"./dist/index.browser.mjs","require":"./dist/index.browser.cjs"},"react-native":"./dist/index.react-native.mjs"},"./rust":{"node":{"import":"./dist/rust.node.mjs","require":"./dist/rust.node.cjs"},"types":"./dist/types/rust/index.d.ts","browser":{"import":"./dist/rust.browser.mjs","require":"./dist/rust.browser.cjs"},"react-native":"./dist/rust.react-native.mjs"},"./javascript":{"node":{"import":"./dist/javascript.node.mjs","require":"./dist/javascript.node.cjs"},"types":"./dist/types/javascript/index.d.ts","browser":{"import":"./dist/javascript.browser.mjs","require":"./dist/javascript.browser.cjs"},"react-native":"./dist/javascript.react-native.mjs"}},"scripts":{"dev":"vitest --project node","lint":"eslint . && prettier --check .","test":"pnpm test:types && pnpm test:treeshakability && pnpm test:unit","build":"rimraf dist && tsup && tsc -p ./tsconfig.declarations.json","lint:fix":"eslint --fix . && prettier --write .","test:unit":"vitest run","test:types":"tsc --noEmit","test:treeshakability":"for file in dist/index.*.mjs dist/javascript.*.mjs dist/rust.*.mjs; do agadoo $file; done"},"_npmUser":{"name":"lorisleiva","email":"loris.leiva@gmail.com"},"_resolved":"/tmp/426f320103ed6396877732ab1320c28d/codama-fragments-0.1.3.tgz","_integrity":"sha512-ITa3UYs74AWx7se/6EZN+YXqV1Vu89L3n2v0/irsQNbPcy8wP26p/GKns/1H4a8vGvAKuzWdIGO535dwcauInw==","repository":{"url":"git+https://github.com/codama-idl/codama.git","type":"git"},"_npmVersion":"10.8.2","description":"Composable code-generation fragments and language-aware import maps for Codama renderers","directories":{},"sideEffects":false,"_nodeVersion":"20.20.2","browserslist":["supports bigint and not dead","maintained node versions"],"dependencies":{"@codama/errors":"1.10.0"},"react-native":"./dist/index.react-native.mjs","typesVersions":{"*":{"rust":["./dist/types/rust/index.d.ts"],"javascript":["./dist/types/javascript/index.d.ts"]}},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/fragments_0.1.3_1785064421441_0.7129702485519136","host":"s3://npm-registry-packages-npm-production"}},"0.1.4":{"name":"@codama/fragments","version":"0.1.4","keywords":["codama","code-generation","fragments","framework","import-maps","solana"],"license":"MIT","_id":"@codama/fragments@0.1.4","maintainers":[{"name":"lorisleiva","email":"loris.leiva@gmail.com"}],"homepage":"https://github.com/codama-idl/codama#readme","bugs":{"url":"http://github.com/codama-idl/codama/issues"},"dist":{"shasum":"1289342558ff2118195bed0e1068cb951acfc80c","tarball":"https://registry.npmjs.org/@codama/fragments/-/fragments-0.1.4.tgz","fileCount":97,"integrity":"sha512-hDykTocyNL0nFKbYZjGPJKtAlMKtKM3PZJbzA8FPOFF1H7U2Z8zd+71UrH9jbSEzdnobAeaRqV71LMPg1yUG8w==","signatures":[{"sig":"MEQCIC/9+n1XPMWe7ORWOraq5hsYsmLHdg/bw21WikZKCB/yAiAhv7h9cGoiHRttt3yjljQiFBF6eAyOr/CZdvkBLT/9Ww==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":954347},"main":"./dist/index.node.cjs","type":"commonjs","_from":"file:codama-fragments-0.1.4.tgz","types":"./dist/types/index.d.ts","module":"./dist/index.node.mjs","browser":{"./dist/rust.node.cjs":"./dist/rust.browser.cjs","./dist/rust.node.mjs":"./dist/rust.browser.mjs","./dist/index.node.cjs":"./dist/index.browser.cjs","./dist/index.node.mjs":"./dist/index.browser.mjs","./dist/javascript.node.cjs":"./dist/javascript.browser.cjs","./dist/javascript.node.mjs":"./dist/javascript.browser.mjs"},"exports":{".":{"node":{"import":"./dist/index.node.mjs","require":"./dist/index.node.cjs"},"types":"./dist/types/index.d.ts","browser":{"import":"./dist/index.browser.mjs","require":"./dist/index.browser.cjs"},"react-native":"./dist/index.react-native.mjs"},"./rust":{"node":{"import":"./dist/rust.node.mjs","require":"./dist/rust.node.cjs"},"types":"./dist/types/rust/index.d.ts","browser":{"import":"./dist/rust.browser.mjs","require":"./dist/rust.browser.cjs"},"react-native":"./dist/rust.react-native.mjs"},"./javascript":{"node":{"import":"./dist/javascript.node.mjs","require":"./dist/javascript.node.cjs"},"types":"./dist/types/javascript/index.d.ts","browser":{"import":"./dist/javascript.browser.mjs","require":"./dist/javascript.browser.cjs"},"react-native":"./dist/javascript.react-native.mjs"}},"scripts":{"dev":"vitest --project node","lint":"eslint . && prettier --check .","test":"pnpm test:types && pnpm test:treeshakability && pnpm test:unit","build":"rimraf dist && tsup && tsc -p ./tsconfig.declarations.json","lint:fix":"eslint --fix . && prettier --write .","test:unit":"vitest run","test:types":"tsc --noEmit","test:treeshakability":"for file in dist/index.*.mjs dist/javascript.*.mjs dist/rust.*.mjs; do agadoo $file; done"},"_npmUser":{"name":"lorisleiva","email":"loris.leiva@gmail.com"},"_resolved":"/tmp/37f118699c89fd600a22c492090940d4/codama-fragments-0.1.4.tgz","_integrity":"sha512-hDykTocyNL0nFKbYZjGPJKtAlMKtKM3PZJbzA8FPOFF1H7U2Z8zd+71UrH9jbSEzdnobAeaRqV71LMPg1yUG8w==","repository":{"url":"git+https://github.com/codama-idl/codama.git","type":"git"},"_npmVersion":"10.8.2","description":"Composable code-generation fragments and language-aware import maps for Codama renderers","directories":{},"sideEffects":false,"_nodeVersion":"20.20.2","browserslist":["supports bigint and not dead","maintained node versions"],"dependencies":{"@codama/errors":"1.10.1"},"react-native":"./dist/index.react-native.mjs","typesVersions":{"*":{"rust":["./dist/types/rust/index.d.ts"],"javascript":["./dist/types/javascript/index.d.ts"]}},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/fragments_0.1.4_1786700325433_0.3384038062632482","host":"s3://npm-registry-packages-npm-production"}},"0.1.5":{"name":"@codama/fragments","version":"0.1.5","keywords":["codama","code-generation","fragments","framework","import-maps","solana"],"license":"MIT","_id":"@codama/fragments@0.1.5","maintainers":[{"name":"lorisleiva","email":"loris.leiva@gmail.com"}],"homepage":"https://github.com/codama-idl/codama#readme","bugs":{"url":"http://github.com/codama-idl/codama/issues"},"dist":{"shasum":"3e409e7248011b3714c10fe46308f7200900361c","tarball":"https://registry.npmjs.org/@codama/fragments/-/fragments-0.1.5.tgz","fileCount":97,"integrity":"sha512-aisr+cdayABykLhysE1pcDWMJJZNAAWyi5NEzkMLpyTmQrhIK6Mca14gSJIw3a0uo3E5s5Zc4d6gsxRjfYpLuw==","signatures":[{"sig":"MEUCIQCmOF6+13yuODal0JlUQZH1FFSRpwuIfnBb10ZIAWphtQIgZoB0tb7AYftL3CvwkxluUqwmvOc/zYETmloU0bFM7So=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":953495},"main":"./dist/index.node.cjs","type":"commonjs","_from":"file:codama-fragments-0.1.5.tgz","types":"./dist/types/index.d.ts","module":"./dist/index.node.mjs","browser":{"./dist/rust.node.cjs":"./dist/rust.browser.cjs","./dist/rust.node.mjs":"./dist/rust.browser.mjs","./dist/index.node.cjs":"./dist/index.browser.cjs","./dist/index.node.mjs":"./dist/index.browser.mjs","./dist/javascript.node.cjs":"./dist/javascript.browser.cjs","./dist/javascript.node.mjs":"./dist/javascript.browser.mjs"},"exports":{".":{"node":{"import":"./dist/index.node.mjs","require":"./dist/index.node.cjs"},"types":"./dist/types/index.d.ts","browser":{"import":"./dist/index.browser.mjs","require":"./dist/index.browser.cjs"},"react-native":"./dist/index.react-native.mjs"},"./rust":{"node":{"import":"./dist/rust.node.mjs","require":"./dist/rust.node.cjs"},"types":"./dist/types/rust/index.d.ts","browser":{"import":"./dist/rust.browser.mjs","require":"./dist/rust.browser.cjs"},"react-native":"./dist/rust.react-native.mjs"},"./javascript":{"node":{"import":"./dist/javascript.node.mjs","require":"./dist/javascript.node.cjs"},"types":"./dist/types/javascript/index.d.ts","browser":{"import":"./dist/javascript.browser.mjs","require":"./dist/javascript.browser.cjs"},"react-native":"./dist/javascript.react-native.mjs"}},"scripts":{"dev":"vitest --project node","test":"pnpm test:types && pnpm test:treeshakability && pnpm test:unit","build":"rimraf dist && tsup && tsc -p ./tsconfig.declarations.json","test:unit":"vitest run","test:types":"tsc --noEmit","test:treeshakability":"for file in dist/index.*.mjs dist/javascript.*.mjs dist/rust.*.mjs; do agadoo $file; done"},"_npmUser":{"name":"lorisleiva","email":"loris.leiva@gmail.com"},"_resolved":"/tmp/668104629524099a481e20ab82694910/codama-fragments-0.1.5.tgz","_integrity":"sha512-aisr+cdayABykLhysE1pcDWMJJZNAAWyi5NEzkMLpyTmQrhIK6Mca14gSJIw3a0uo3E5s5Zc4d6gsxRjfYpLuw==","repository":{"url":"git+https://github.com/codama-idl/codama.git","type":"git"},"_npmVersion":"11.17.0","description":"Composable code-generation fragments and language-aware import maps for Codama renderers","directories":{},"sideEffects":false,"_nodeVersion":"24.19.0","browserslist":["supports bigint and not dead","maintained node versions"],"dependencies":{"@codama/errors":"1.10.2"},"react-native":"./dist/index.react-native.mjs","typesVersions":{"*":{"rust":["./dist/types/rust/index.d.ts"],"javascript":["./dist/types/javascript/index.d.ts"]}},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/fragments_0.1.5_1787148970856_0.5046298667108411","host":"s3://npm-registry-packages-npm-production"}},"1.0.0":{"_id":"@codama/fragments@1.0.0","bugs":{"url":"http://github.com/codama-idl/codama/issues"},"dist":{"shasum":"4fc639f9170b298b96cafc6cd319487f86bc83ea","tarball":"https://registry.npmjs.org/@codama/fragments/-/fragments-1.0.0.tgz","fileCount":97,"integrity":"sha512-hwiteKd/MC3JdU8YS6BwdsEqs7NLcNDd6zz433ac85VUMT17YaYVLlfSCqb1RZRRXzgBA2Kso8DtWFlvwd3UIw==","signatures":[{"sig":"MEUCIH1zdvG+OWoSYosS1RPpbqE6s+jNNqRcMYUZL9iFCoj8AiEAymMF2bZjjfnBUupOZ6CAl/jmjq5LgcAwrQtcxzrHZrw=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCJemapu0sgv0wDs+6jgws7VeLyVKR3innvWC1sO3ulAgIgQkjz15QXrFs3HOYC9A+ne9ZsccEG60wKI6UGc8Prdbw="}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@codama%2ffragments@1.0.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":953495},"main":"./dist/index.node.cjs","name":"@codama/fragments","type":"commonjs","_from":"file:codama-fragments-1.0.0.tgz","types":"./dist/types/index.d.ts","module":"./dist/index.node.mjs","browser":{"./dist/rust.node.cjs":"./dist/rust.browser.cjs","./dist/rust.node.mjs":"./dist/rust.browser.mjs","./dist/index.node.cjs":"./dist/index.browser.cjs","./dist/index.node.mjs":"./dist/index.browser.mjs","./dist/javascript.node.cjs":"./dist/javascript.browser.cjs","./dist/javascript.node.mjs":"./dist/javascript.browser.mjs"},"exports":{".":{"node":{"import":"./dist/index.node.mjs","require":"./dist/index.node.cjs"},"types":"./dist/types/index.d.ts","browser":{"import":"./dist/index.browser.mjs","require":"./dist/index.browser.cjs"},"react-native":"./dist/index.react-native.mjs"},"./rust":{"node":{"import":"./dist/rust.node.mjs","require":"./dist/rust.node.cjs"},"types":"./dist/types/rust/index.d.ts","browser":{"import":"./dist/rust.browser.mjs","require":"./dist/rust.browser.cjs"},"react-native":"./dist/rust.react-native.mjs"},"./javascript":{"node":{"import":"./dist/javascript.node.mjs","require":"./dist/javascript.node.cjs"},"types":"./dist/types/javascript/index.d.ts","browser":{"import":"./dist/javascript.browser.mjs","require":"./dist/javascript.browser.cjs"},"react-native":"./dist/javascript.react-native.mjs"}},"license":"MIT","scripts":{"dev":"vitest --project node","test":"pnpm test:types && pnpm test:treeshakability && pnpm test:unit","build":"rimraf dist && tsup && tsc -p ./tsconfig.declarations.json","test:unit":"vitest run","test:types":"tsc --noEmit","test:treeshakability":"for file in dist/index.*.mjs dist/javascript.*.mjs dist/rust.*.mjs; do agadoo $file; done"},"version":"1.0.0","_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:b73934d4-0229-46de-a62b-64f8fcde9d22"}},"homepage":"https://github.com/codama-idl/codama#readme","keywords":["codama","code-generation","fragments","framework","import-maps","solana"],"_resolved":"/tmp/f186a8be08d9a682b7c67c9680c50061/codama-fragments-1.0.0.tgz","_integrity":"sha512-hwiteKd/MC3JdU8YS6BwdsEqs7NLcNDd6zz433ac85VUMT17YaYVLlfSCqb1RZRRXzgBA2Kso8DtWFlvwd3UIw==","repository":{"url":"git+https://github.com/codama-idl/codama.git","type":"git"},"_npmVersion":"11.19.0","description":"Composable code-generation fragments and language-aware import maps for Codama renderers","directories":{},"maintainers":[{"name":"lorisleiva","email":"loris.leiva@gmail.com"}],"sideEffects":false,"_nodeVersion":"24.20.0","browserslist":["supports bigint and not dead","maintained node versions"],"dependencies":{"@codama/errors":"1.11.0"},"react-native":"./dist/index.react-native.mjs","typesVersions":{"*":{"rust":["./dist/types/rust/index.d.ts"],"javascript":["./dist/types/javascript/index.d.ts"]}},"_hasShrinkwrap":false,"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/fragments_1.0.0_1789458107184_0.20485795477830582"}}},"time":{"created":"2026-06-02T15:48:06.586Z","modified":"2026-09-15T07:41:47.571Z","0.1.0":"2026-06-02T15:48:06.931Z","0.1.1":"2026-06-16T15:38:57.335Z","0.1.2":"2026-07-10T09:10:00.805Z","0.1.3":"2026-07-26T11:13:41.625Z","0.1.4":"2026-08-14T09:38:45.589Z","0.1.5":"2026-08-19T14:16:11.012Z","1.0.0":"2026-09-15T07:41:47.269Z"},"bugs":{"url":"http://github.com/codama-idl/codama/issues"},"license":"MIT","homepage":"https://github.com/codama-idl/codama#readme","keywords":["codama","code-generation","fragments","framework","import-maps","solana"],"repository":{"url":"git+https://github.com/codama-idl/codama.git","type":"git"},"description":"Composable code-generation fragments and language-aware import maps for Codama renderers","maintainers":[{"name":"lorisleiva","email":"loris.leiva@gmail.com"}],"readme":"# Codama ➤ Fragments\n\n[![npm][npm-image]][npm-url]\n[![npm-downloads][npm-downloads-image]][npm-url]\n\n[npm-downloads-image]: https://img.shields.io/npm/dm/@codama/fragments.svg?style=flat\n[npm-image]: https://img.shields.io/npm/v/@codama/fragments.svg?style=flat&label=%40codama%2Ffragments\n[npm-url]: https://www.npmjs.com/package/@codama/fragments\n\nThis package provides the building blocks Codama renderers and code generators use to compose generated source. The core idea is the `Fragment` — a snippet of code paired with the imports it depends on — and the `fragment` tagged template that lets you stitch fragments together while propagating imports automatically.\n\n## Installation\n\n```sh\npnpm install @codama/fragments\n```\n\n> [!NOTE]\n> This package is **not** included in the main [`codama`](../library) package. The language-agnostic core primitives are also re-exported from [`@codama/renderers-core`](../renderers-core) for backward compatibility with existing renderers; new code should import from `@codama/fragments` directly.\n\n## What's a fragment?\n\nWhen you generate code, you usually need to track two things in parallel: the source string itself, and the imports that source depends on. Threading imports through every helper that builds a piece of code becomes painful very quickly. Fragments solve this by carrying both pieces together.\n\nA fragment, at minimum, is just an object with a `content` string. Each language flavor — JavaScript or Rust — extends this with an `ImportMap`, a symbolic record of what the content imports.\n\n```ts\nimport { fragment, use } from '@codama/fragments/javascript';\n\nconst pubkey = use('type Address', '@solana/kit');\nconst interfaceFragment = fragment`\nexport interface Account {\n    readonly owner: ${pubkey};\n}\n`;\n\nconsole.log(interfaceFragment.content);\n// export interface Account {\n//     readonly owner: Address;\n// }\n\nconsole.log(interfaceFragment.imports);\n// Map { '@solana/kit' => Map { 'Address' => { ..., isType: true } } }\n```\n\nNotice that `pubkey` was a small fragment carrying both the identifier `Address` and an import for it. When `pubkey` was interpolated into `interfaceFragment`, both pieces propagated upwards — the outer fragment ended up with the right content **and** with the import already attached.\n\nThat propagation is the whole point. You can build a fragment for a single field, compose it into a fragment for a struct, compose that into a fragment for a file, and only at the very end stringify the imports into actual `import { … } from '…';` (or `use foo::Bar;`) lines.\n\n## Subpaths\n\nThe package exposes three subpaths so the JavaScript and Rust flavors don't clash on names like `Fragment`, `ImportMap`, or `fragment`.\n\n```ts\n// Root: language-agnostic core primitives only.\nimport type { BaseFragment } from '@codama/fragments';\nimport { createFragmentTemplate } from '@codama/fragments';\n\n// JavaScript / TypeScript flavor.\nimport { fragment, use } from '@codama/fragments/javascript';\n\n// Rust flavor.\nimport { addFragmentImports, fragment } from '@codama/fragments/rust';\n```\n\nIf you're writing a renderer that emits JavaScript or TypeScript, you'll spend most of your time in `@codama/fragments/javascript`. If you're emitting Rust, in `@codama/fragments/rust`. Each subpath re-exports the core too, so a single import per file is enough.\n\n## Core primitives\n\nThe root entrypoint contains a handful of language-agnostic primitives. Most renderers won't import from here directly — the language subpaths re-export everything — but if you're building your own fragment flavor (for a new target language, for example), this is where you start.\n\n### `BaseFragment`\n\nThe minimal shape every flavored fragment extends. It only requires a `content` string; flavored fragments layer on additional fields like an import map.\n\n```ts\nimport type { BaseFragment } from '@codama/fragments';\n\ntype MyFragment = BaseFragment & Readonly<{ tags: ReadonlySet<string> }>;\n```\n\n### `createFragmentTemplate`\n\nThe generic engine behind every flavor's `fragment` tagged template. You only need this when defining a new flavor: pass it the template parts, the items, an `isFragment` predicate, and a `mergeFragments` function. Everything else is handled for you.\n\n```ts\nimport { createFragmentTemplate } from '@codama/fragments';\n\nfunction fragment(template: TemplateStringsArray, ...items: unknown[]): MyFragment {\n    return createFragmentTemplate(template, items, isMyFragment, mergeMyFragments);\n}\n```\n\n### `mapFragmentContent` and `mapFragmentContentAsync`\n\nApply a content transformation while preserving every other field on the fragment.\n\n```ts\nimport { mapFragmentContent } from '@codama/fragments';\n\nconst upper = mapFragmentContent(myFragment, content => content.toUpperCase());\n```\n\nAn async variant is available for transformations that return promises (e.g. running Prettier on the content).\n\n```ts\nimport { mapFragmentContentAsync } from '@codama/fragments';\n\nconst formatted = await mapFragmentContentAsync(myFragment, formatWithPrettier);\n```\n\n### `setFragmentContent`\n\nReplace a fragment's content outright.\n\n```ts\nimport { setFragmentContent } from '@codama/fragments';\n\nconst replaced = setFragmentContent(myFragment, '/* removed */');\n```\n\n## JavaScript flavor\n\n`@codama/fragments/javascript` provides the concrete machinery for emitting TypeScript and JavaScript source.\n\n### Composing JavaScript fragments\n\nThe `fragment` tagged template builds a fragment from a string template. Interpolated values that are themselves fragments get inlined and contribute their imports; primitives are coerced to strings.\n\n```ts\nimport { fragment } from '@codama/fragments/javascript';\n\nconst greeting = fragment`hello ${'world'}`;\n// greeting.content: 'hello world'\n// greeting.imports.size: 0\n```\n\nWhen you need a fragment that references an imported identifier, the `use` helper is the shortcut. It accepts the same shorthand TypeScript accepts inside an `import { … }` block — bare names, `type` prefixes, and `as` aliases all work.\n\n```ts\nimport { fragment, use } from '@codama/fragments/javascript';\n\nconst address = use('type Address', '@solana/kit');\nconst owner = use('PublicKey as PK', '@solana/kit');\n\nconst struct = fragment`\nexport interface Owner {\n    readonly address: ${address};\n    readonly pubkey: ${owner};\n}\n`;\n```\n\nBoth interpolated fragments propagated their imports into `struct`. The outer fragment's import map will now have one entry for `@solana/kit` containing both `Address` (as a type-only import) and `PublicKey as PK`.\n\n### Common helpers\n\nTwo small helpers cover the most repetitive bits of code generators.\n\n`getDocblockFragment(lines)` builds a JSDoc block from an array of lines. Empty input returns `undefined`, which composes naturally with the `fragment` tag (interpolated `undefined` renders as the empty string), so optional documentation can be threaded through without explicit checks. Any `*/` sequences inside the lines are silently defanged so user-supplied content cannot accidentally close the comment early.\n\n```ts\nimport { fragment, getDocblockFragment } from '@codama/fragments/javascript';\n\nconst docs = getDocblockFragment(['Greets the user.', '', 'Returns nothing.']);\nconst fn = fragment`${docs}\\nexport function greet(name: string): void {}`;\n// /**\n//  * Greets the user.\n//  *\n//  * Returns nothing.\n//  */\n// export function greet(name: string): void {}\n```\n\n`getExportAllFragment(module)` builds a re-export line. The fragment carries no imports — `export * from` only forwards bindings out, it does not bring `module` into local scope.\n\n```ts\nimport { getExportAllFragment } from '@codama/fragments/javascript';\n\ngetExportAllFragment('./accounts').content;\n// export * from './accounts';\n```\n\n### The JavaScript `ImportMap`\n\nThe JavaScript `ImportMap` is a frozen, immutable `ReadonlyMap<Module, ReadonlyMap<UsedIdentifier, ImportInfo>>`. The outer key is the source module (e.g. `'@solana/kit'`), and the inner key is the identifier as it appears in the consuming code (after aliasing). Every operation returns a new map — there are no methods or mutation.\n\nThe shorthand strings the API accepts follow TypeScript's own:\n\n| Input               | Imported identifier | Used identifier | Type-only? |\n| ------------------- | ------------------- | --------------- | ---------- |\n| `'Foo'`             | `Foo`               | `Foo`           | no         |\n| `'type Foo'`        | `Foo`               | `Foo`           | yes        |\n| `'Foo as Bar'`      | `Foo`               | `Bar`           | no         |\n| `'type Foo as Bar'` | `Foo`               | `Bar`           | yes        |\n\n### Building import maps\n\n#### `createImportMap`\n\nReturns an empty frozen map.\n\n```ts\nimport { createImportMap } from '@codama/fragments/javascript';\n\nconst map = createImportMap();\n```\n\n#### `addToImportMap`\n\nReturns a new map with extra identifiers attached to a module. When the same identifier appears as both a value and a type-only import — anywhere in a single batch or across merged maps — the value form wins.\n\n```ts\nimport { addToImportMap, createImportMap } from '@codama/fragments/javascript';\n\nlet map = createImportMap();\nmap = addToImportMap(map, '@solana/kit', ['Address', 'type SignerKey']);\nmap = addToImportMap(map, '../shared', ['CamelCaseString']);\n```\n\n#### `removeFromImportMap`\n\nDrops identifiers from a module entry. If no identifiers remain, the module entry itself is removed.\n\n```ts\nimport { removeFromImportMap } from '@codama/fragments/javascript';\n\nconst trimmed = removeFromImportMap(map, '@solana/kit', ['SignerKey']);\n```\n\n#### `mergeImportMaps`\n\nCombines multiple maps into one, applying the same value-wins rule on identifier conflicts.\n\n```ts\nimport { mergeImportMaps } from '@codama/fragments/javascript';\n\nconst merged = mergeImportMaps([mapA, mapB, mapC]);\n```\n\n#### `parseImportInput`\n\nIf you ever need to inspect the parsed shape of a shorthand string without putting it in a map, this is the underlying parser.\n\n```ts\nimport { parseImportInput } from '@codama/fragments/javascript';\n\nparseImportInput('type Foo as Bar');\n// { importedIdentifier: 'Foo', usedIdentifier: 'Bar', isType: true }\n```\n\n### Attaching imports to a fragment\n\nThe fragment helpers mirror the import-map helpers, except they take a fragment and update its `imports` field in place (returning a new frozen fragment).\n\n#### `addFragmentImports`\n\n```ts\nimport { addFragmentImports, fragment } from '@codama/fragments/javascript';\n\nlet f = fragment`hello`;\nf = addFragmentImports(f, '@solana/kit', ['type Address']);\n```\n\n#### `mergeFragmentImports`\n\nUseful when you have a standalone import map (e.g. from a `getExternalDependencies` result) you want to fold into a fragment.\n\n```ts\nimport { mergeFragmentImports } from '@codama/fragments/javascript';\n\nconst updated = mergeFragmentImports(fragment, [extraMapA, extraMapB]);\n```\n\n#### `removeFragmentImports`\n\n```ts\nimport { removeFragmentImports } from '@codama/fragments/javascript';\n\nconst trimmed = removeFragmentImports(fragment, '@solana/kit', ['SignerKey']);\n```\n\n### Resolving symbolic modules\n\nRenderers usually don't write the final module path everywhere. Instead, they accumulate imports under symbolic names like `'solanaAddresses'` or `'generatedAccounts'` and resolve those names to real specifiers at the very end. This keeps the rendering code decoupled from the consumer's package layout.\n\n#### `resolveImportMap`\n\nReplaces the keys of a map according to the entries of a dependency record. Keys not present in the record are kept as-is. When two source modules resolve to the same target, their inner identifier maps are merged automatically.\n\n```ts\nimport { resolveImportMap } from '@codama/fragments/javascript';\n\nconst resolved = resolveImportMap(map, {\n    solanaAddresses: '@solana/kit',\n    generatedAccounts: '../accounts',\n});\n```\n\n#### `getExternalDependencies`\n\nReturns the set of root package names referenced by an import map (after resolution). For scoped packages, the scope is included; for relative imports, nothing is reported. Useful when a renderer needs to sync a generated `package.json` with the imports it actually emitted.\n\n```ts\nimport { getExternalDependencies } from '@codama/fragments/javascript';\n\nconst externals = getExternalDependencies(map, dependencyMap);\n// Set { '@solana/kit', '@codama/spec' }\n```\n\n#### `importMapToString`\n\nRenders the map as a block of `import { … } from '…';` lines. The dependency record is applied first, then non-relative paths are listed before relative ones, identifiers are alphabetized within each module, and a block-level `import type { … }` form is used when every identifier on the line is type-only.\n\n```ts\nimport { importMapToString } from '@codama/fragments/javascript';\n\nconsole.log(importMapToString(map, { solanaAddresses: '@solana/kit' }));\n// import type { Address } from '@solana/kit';\n// import { CamelCaseString } from '../shared';\n```\n\n## Rust flavor\n\n`@codama/fragments/rust` mirrors the JavaScript flavor for emitting Rust source. The shape of the import map is different to match Rust's `use` syntax, but the operations follow the same naming and immutability discipline.\n\n### Composing Rust fragments\n\nThe `fragment` tagged template behaves the same way as on the JavaScript side: interpolated fragments propagate their imports, primitives are coerced to strings.\n\n```ts\nimport { fragment } from '@codama/fragments/rust';\n\nconst struct = fragment`\npub struct AccountNode {\n    pub pubkey: Pubkey,\n}\n`;\n```\n\nUnlike the JavaScript flavor, there is no `use(input, module)` helper. Rust references identifiers inline by their full `::`-qualified path, so building content and attaching imports happen in two steps: write the content with `fragment`, then attach imports with `addFragmentImports`.\n\n```ts\nimport { addFragmentImports, fragment } from '@codama/fragments/rust';\n\nlet body = fragment`\npub struct AccountNode {\n    pub pubkey: Pubkey,\n}\n`;\nbody = addFragmentImports(body, ['solana_program::pubkey::Pubkey']);\n```\n\nWhen you need an alias, use `addFragmentImportAlias`.\n\n```ts\nimport { addFragmentImportAlias, addFragmentImports, fragment } from '@codama/fragments/rust';\n\nlet body = fragment`pub fn fail() -> ProgError { ProgError::InvalidArgument }`;\nbody = addFragmentImports(body, ['solana_program::program_error::ProgramError']);\nbody = addFragmentImportAlias(body, 'solana_program::program_error::ProgramError', 'ProgError');\n```\n\n### Common helpers\n\n`getDocblockFragment(lines)` builds a Rust doc-comment block. Empty input returns `undefined`, which composes naturally with the `fragment` tag (interpolated `undefined` renders as the empty string), so optional documentation can be threaded through without explicit checks. Pass `{ internal: true }` to emit inner doc comments (`//!`) instead of outer ones (`///`).\n\n```ts\nimport { fragment, getDocblockFragment } from '@codama/fragments/rust';\n\nconst docs = getDocblockFragment(['Greets the user.', '', 'Returns nothing.']);\nconst fn = fragment`${docs}\\npub fn greet(name: &str) {}`;\n// /// Greets the user.\n// ///\n// /// Returns nothing.\n// pub fn greet(name: &str) {}\n\nconst moduleDocs = getDocblockFragment(['Crate-level docs.'], { internal: true });\n// //! Crate-level docs.\n```\n\n### The Rust `ImportMap`\n\nThe Rust `ImportMap` is a flat, frozen `ReadonlyMap<ImportPath, ImportInfo>`. The key is the fully-qualified `::`-separated path; the value is `{ importedPath, alias? }`. There is no per-module grouping the way JavaScript imports have, because each Rust `use` statement names a single path.\n\nLike the JavaScript flavor, every operation returns a new map. There are no methods, no classes, no mutation.\n\n### Building import maps\n\n#### `createImportMap`\n\n```ts\nimport { createImportMap } from '@codama/fragments/rust';\n\nconst map = createImportMap();\n```\n\n#### `addToImportMap`\n\nAppends one or more paths. Accepts a single string, an array, or a `Set`. Paths already present in the map are skipped, so any existing aliases are preserved.\n\n```ts\nimport { addToImportMap, createImportMap } from '@codama/fragments/rust';\n\nlet map = createImportMap();\nmap = addToImportMap(map, ['borsh::BorshDeserialize', 'borsh::BorshSerialize']);\nmap = addToImportMap(map, 'solana_program::pubkey::Pubkey');\n```\n\n#### `addAliasToImportMap`\n\nRecords an alias for a path. If the path isn't yet imported, it is added; if it's already present, the alias replaces any existing one.\n\n```ts\nimport { addAliasToImportMap } from '@codama/fragments/rust';\n\nconst aliased = addAliasToImportMap(map, 'solana_program::program_error::ProgramError', 'ProgError');\n```\n\n#### `removeFromImportMap`\n\n```ts\nimport { removeFromImportMap } from '@codama/fragments/rust';\n\nconst trimmed = removeFromImportMap(map, 'borsh::BorshDeserialize');\n```\n\n#### `mergeImportMaps`\n\nCombines multiple maps. When the same path appears in more than one map, the latest occurrence wins on alias conflicts.\n\n```ts\nimport { mergeImportMaps } from '@codama/fragments/rust';\n\nconst merged = mergeImportMaps([mapA, mapB]);\n```\n\n### Attaching imports to a fragment\n\n#### `addFragmentImports`\n\n```ts\nimport { addFragmentImports, fragment } from '@codama/fragments/rust';\n\nlet f = fragment`Pubkey`;\nf = addFragmentImports(f, 'solana_program::pubkey::Pubkey');\n```\n\n#### `addFragmentImportAlias`\n\n```ts\nimport { addFragmentImportAlias } from '@codama/fragments/rust';\n\nconst aliased = addFragmentImportAlias(f, 'solana_program::pubkey::Pubkey', 'Pk');\n```\n\n#### `mergeFragmentImports`\n\n```ts\nimport { mergeFragmentImports } from '@codama/fragments/rust';\n\nconst updated = mergeFragmentImports(f, [extraMap]);\n```\n\n#### `removeFragmentImports`\n\n```ts\nimport { removeFragmentImports } from '@codama/fragments/rust';\n\nconst trimmed = removeFragmentImports(f, 'borsh::BorshDeserialize');\n```\n\n### Resolving symbolic prefixes\n\nWhere the JavaScript flavor resolves entire module names, the Rust flavor resolves `::`-prefixes. This matches how Rust crate paths compose: a renderer might accumulate imports under `'generated::accounts::Foo'` and resolve `generated` to `crate::generated` at the end.\n\n#### `resolveImportMap`\n\n```ts\nimport { resolveImportMap } from '@codama/fragments/rust';\n\nconst resolved = resolveImportMap(map, { generated: 'crate::generated' });\n// 'generated::accounts::Foo' -> 'crate::generated::accounts::Foo'\n```\n\n#### `getExternalDependencies`\n\nReturns the set of top-level crate names referenced by the map after resolution. Rust's standard-library crates and crate-local prefixes are filtered out via `RUST_CORE_IMPORTS` (`std`, `crate`, `self`, `super`, `core`, `alloc`, `clippy`).\n\n```ts\nimport { getExternalDependencies } from '@codama/fragments/rust';\n\nconst externals = getExternalDependencies(map, { generated: 'crate::generated' });\n// Set { 'borsh', 'solana_program' }\n```\n\n#### `importMapToString`\n\nRenders the map as a block of `use foo::Bar;` (and `use foo::Bar as Baz;`) lines, alphabetized for stable diffs and resolved against the dependency record.\n\n```ts\nimport { importMapToString } from '@codama/fragments/rust';\n\nconsole.log(importMapToString(map, { generated: 'crate::generated' }));\n// use borsh::BorshSerialize;\n// use crate::generated::accounts::Foo;\n// use solana_program::pubkey::Pubkey;\n```\n\n## Putting it all together\n\nHere's a tiny end-to-end example: a generator that emits a TypeScript interface for an account, given the account's name and the type of its `owner` field.\n\n```ts\nimport { fragment, importMapToString, use } from '@codama/fragments/javascript';\n\nfunction emitAccountInterface(name: string, ownerModule: string): string {\n    const owner = use(`type ${name}OwnerKey`, ownerModule);\n    const body = fragment`\nexport interface ${name}Account {\n    readonly owner: ${owner};\n}\n`;\n    const importBlock = importMapToString(body.imports);\n    return `${importBlock}\\n\\n${body.content.trim()}\\n`;\n}\n\nconsole.log(emitAccountInterface('Mint', '@solana/kit'));\n// import type { MintOwnerKey } from '@solana/kit';\n//\n// export interface MintAccount {\n//     readonly owner: MintOwnerKey;\n// }\n```\n\nThe interesting bit is what we _didn't_ have to do: at no point did `emitAccountInterface` keep a list of imports next to the content. The `use` helper attached the import to a small fragment; interpolation propagated it; `importMapToString` rendered it at the end.\n\nReal generators take this further. They build dozens of small fragments per file, compose them into pages, and use `resolveImportMap` to translate symbolic module names into the consumer's actual package layout. The same patterns apply on the Rust side — replace `use` with explicit `addFragmentImports` calls and `importMapToString` will emit `use foo::Bar;` lines instead.\n\n## Related packages\n\n- [`@codama/renderers-core`](../renderers-core) — re-exports the language-agnostic core for backward compatibility with existing renderers.\n","readmeFilename":"README.md"}