{"_id":"@codehz/preeval","_rev":"10-aef6e25b9b8c25c3ae8b3f951671921f","name":"@codehz/preeval","dist-tags":{"latest":"0.5.0"},"versions":{"0.1.0":{"name":"@codehz/preeval","version":"0.1.0","keywords":["unplugin","vite","rollup","bun","build","const","precompute","preeval"],"license":"MIT","_id":"@codehz/preeval@0.1.0","maintainers":[{"name":"codehz","email":"CodeHz@Outlook.com"}],"dist":{"shasum":"a17385d10ed312ed1b3d25e5054573ec05fa7eae","tarball":"https://registry.npmjs.org/@codehz/preeval/-/preeval-0.1.0.tgz","fileCount":12,"integrity":"sha512-pdUh3L87Q4GwXgMkIitoHUNj8X9G8gjjEMREVGvveYMcT2Q528wcOfddXj2FLdoQZnEfps38ieIpvYkKpQkv9A==","signatures":[{"sig":"MEUCICi27uQsFmRoPK/8Sq3R+DUViWQ52tjN5KrePL2Mecp1AiEA+a2a7dh7iHyu9o+pdpXfKTHcFXubrJ3UB7ueXHhB+4Y=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":21295},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","shasum":"a17385d10ed312ed1b3d25e5054573ec05fa7eae","engines":{"node":"^20.19.0 || >=22.12.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./bun":{"types":"./dist/bun.d.ts","import":"./dist/bun.js"},"./vite":{"types":"./dist/vite.d.ts","import":"./dist/vite.js"},"./rollup":{"types":"./dist/rollup.d.ts","import":"./dist/rollup.js"},"./package.json":"./package.json"},"scripts":{"test":"vitest run","build":"tsdown","prepublishOnly":"bun run build"},"_npmUser":{"name":"codehz","email":"CodeHz@Outlook.com"},"_integrity":"sha512-pdUh3L87Q4GwXgMkIitoHUNj8X9G8gjjEMREVGvveYMcT2Q528wcOfddXj2FLdoQZnEfps38ieIpvYkKpQkv9A==","_npmVersion":"10.8.3","description":"Build-time pre-evaluation of // @preeval marked exported consts for library publish builds","directories":{},"_nodeVersion":"24.3.0","dependencies":{"unplugin":"^3.3.0","magic-string":"^0.30.21","@babel/parser":"^7.28.0"},"_hasShrinkwrap":false,"devDependencies":{"tsdown":"^0.22.14","vitest":"^4.1.10","sucrase":"^3.35.1","@types/bun":"latest","@types/babel__generator":"^7.27.0"},"peerDependencies":{"sucrase":"^3"},"peerDependenciesMeta":{"sucrase":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/preeval_0.1.0_1786274600480_0.8677971326105556","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@codehz/preeval","version":"0.1.1","keywords":["unplugin","vite","rollup","bun","build","const","precompute","preeval"],"license":"MIT","_id":"@codehz/preeval@0.1.1","maintainers":[{"name":"codehz","email":"CodeHz@Outlook.com"}],"dist":{"shasum":"8098c4bcb0f3017dc596a82d9682cf34417f1e32","tarball":"https://registry.npmjs.org/@codehz/preeval/-/preeval-0.1.1.tgz","fileCount":12,"integrity":"sha512-tez9gHOMvQatScCrVOGyNuSra/d7extQ4PhXpj/02ktSadr+XeXgQtrYuJHoZL5IhOw/XoQhrUOZurq/lxU6bg==","signatures":[{"sig":"MEUCIQDZFxTPzK/X9uNbf2nvvQXv0yRyxtNip15F/qCWphhjqwIgB4Tl/SEF82u9IkvIylhnn4CgcQRzXvkgJ+bziYPJ+NQ=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":35959},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","shasum":"8098c4bcb0f3017dc596a82d9682cf34417f1e32","engines":{"node":"^20.19.0 || >=22.12.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./bun":{"types":"./dist/bun.d.ts","import":"./dist/bun.js"},"./vite":{"types":"./dist/vite.d.ts","import":"./dist/vite.js"},"./rollup":{"types":"./dist/rollup.d.ts","import":"./dist/rollup.js"},"./package.json":"./package.json"},"scripts":{"test":"vitest run","build":"tsdown","prepublishOnly":"bun run build"},"_npmUser":{"name":"codehz","email":"CodeHz@Outlook.com"},"_integrity":"sha512-tez9gHOMvQatScCrVOGyNuSra/d7extQ4PhXpj/02ktSadr+XeXgQtrYuJHoZL5IhOw/XoQhrUOZurq/lxU6bg==","_npmVersion":"10.8.3","description":"Build-time pre-evaluation of // @preeval marked top-level consts for library publish builds","directories":{},"_nodeVersion":"24.3.0","dependencies":{"unplugin":"^3.3.0","@babel/types":"^7","magic-string":"^0.30.21","@babel/parser":"^7","@babel/traverse":"^7","@babel/generator":"^7"},"_hasShrinkwrap":false,"devDependencies":{"tsdown":"^0.22.14","vitest":"^4.1.10","sucrase":"^3.35.1","@types/bun":"latest","@types/babel__traverse":"^7.28.0","@types/babel__generator":"^7.27.0"},"peerDependencies":{"sucrase":"^3"},"peerDependenciesMeta":{"sucrase":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/preeval_0.1.1_1786277362353_0.632621684977738","host":"s3://npm-registry-packages-npm-production"}},"0.1.2":{"name":"@codehz/preeval","version":"0.1.2","keywords":["unplugin","vite","rollup","bun","build","const","precompute","preeval"],"license":"MIT","_id":"@codehz/preeval@0.1.2","maintainers":[{"name":"codehz","email":"CodeHz@Outlook.com"}],"dist":{"shasum":"ee058380243446a98bc6333767b2729072aaab44","tarball":"https://registry.npmjs.org/@codehz/preeval/-/preeval-0.1.2.tgz","fileCount":12,"integrity":"sha512-mDha/u5d72nXJyGFXO+kDuuBzE0UCQECSTt65TsP8/jAkkoxX0VFDtj5yt0k4LzHT7ZEcsEimEj21+LLlfn8rg==","signatures":[{"sig":"MEYCIQDt82KsylcxJoVl+U18Y3PUXBNSGjDHbJvYCt1fRlGAJQIhANE5qjsbYBzPyOLBOywL2L30A0kxrIek7XD32gGp7fG0","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":41611},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","shasum":"ee058380243446a98bc6333767b2729072aaab44","engines":{"node":"^20.19.0 || >=22.12.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./bun":{"types":"./dist/bun.d.ts","import":"./dist/bun.js"},"./vite":{"types":"./dist/vite.d.ts","import":"./dist/vite.js"},"./rollup":{"types":"./dist/rollup.d.ts","import":"./dist/rollup.js"},"./package.json":"./package.json"},"scripts":{"test":"vitest run","build":"tsdown","prepublishOnly":"bun run build"},"_npmUser":{"name":"codehz","email":"CodeHz@Outlook.com"},"_integrity":"sha512-mDha/u5d72nXJyGFXO+kDuuBzE0UCQECSTt65TsP8/jAkkoxX0VFDtj5yt0k4LzHT7ZEcsEimEj21+LLlfn8rg==","_npmVersion":"10.8.3","description":"Build-time pre-evaluation of // @preeval marked top-level consts for library publish builds","directories":{},"_nodeVersion":"24.3.0","dependencies":{"unplugin":"^3.3.0","@babel/types":"^7","magic-string":"^0.30.21","@babel/parser":"^7","@babel/traverse":"^7","@babel/generator":"^7"},"_hasShrinkwrap":false,"devDependencies":{"tsdown":"^0.22.14","vitest":"^4.1.10","sucrase":"^3.35.1","@types/bun":"latest","@types/babel__traverse":"^7.28.0","@types/babel__generator":"^7.27.0"},"peerDependencies":{"sucrase":"^3"},"peerDependenciesMeta":{"sucrase":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/preeval_0.1.2_1786281493015_0.691519046110983","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@codehz/preeval","version":"0.2.0","keywords":["unplugin","vite","rollup","bun","build","const","precompute","preeval"],"license":"MIT","_id":"@codehz/preeval@0.2.0","maintainers":[{"name":"codehz","email":"CodeHz@Outlook.com"}],"dist":{"shasum":"1fd013b3ec40c3f4236202179e8a39a98e47c3dd","tarball":"https://registry.npmjs.org/@codehz/preeval/-/preeval-0.2.0.tgz","fileCount":12,"integrity":"sha512-Z3KaH5Zo5J3uk2YYd7+DHzR9rnRLpvslyvMcQcFgkzkoZtgdliF/B4W5FlN0zeMJ6AJMm31LVJ/hwpv3RSNcUQ==","signatures":[{"sig":"MEUCIFyFN+qGTJKaUORx5lzHN9ioz2fpZ0lk6EMtbladTPeRAiEA3RrkrqaUhLOAeksKCdB7UzAxFLn2ijCs2SpZJniBg4g=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":61768},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","shasum":"1fd013b3ec40c3f4236202179e8a39a98e47c3dd","engines":{"node":"^20.19.0 || >=22.12.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./bun":{"types":"./dist/bun.d.ts","import":"./dist/bun.js"},"./vite":{"types":"./dist/vite.d.ts","import":"./dist/vite.js"},"./rollup":{"types":"./dist/rollup.d.ts","import":"./dist/rollup.js"},"./package.json":"./package.json"},"scripts":{"test":"vitest run","build":"tsdown","prepublishOnly":"bun run build"},"_npmUser":{"name":"codehz","email":"CodeHz@Outlook.com"},"_integrity":"sha512-Z3KaH5Zo5J3uk2YYd7+DHzR9rnRLpvslyvMcQcFgkzkoZtgdliF/B4W5FlN0zeMJ6AJMm31LVJ/hwpv3RSNcUQ==","_npmVersion":"10.8.3","description":"Build-time pre-evaluation of // @preeval marked top-level consts for library publish builds","directories":{},"_nodeVersion":"24.3.0","dependencies":{"unplugin":"^3.3.0","@babel/types":"^7","magic-string":"^0.30.21","@babel/parser":"^7","@babel/traverse":"^7","@babel/generator":"^7"},"_hasShrinkwrap":false,"devDependencies":{"tsdown":"^0.22.14","vitest":"^4.1.10","sucrase":"^3.35.1","@types/bun":"latest","@types/babel__traverse":"^7.28.0","@types/babel__generator":"^7.27.0"},"peerDependencies":{"sucrase":"^3"},"peerDependenciesMeta":{"sucrase":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/preeval_0.2.0_1786284928187_0.1794864090715791","host":"s3://npm-registry-packages-npm-production"}},"0.2.1":{"name":"@codehz/preeval","version":"0.2.1","keywords":["unplugin","vite","rollup","bun","build","const","precompute","preeval"],"license":"MIT","_id":"@codehz/preeval@0.2.1","maintainers":[{"name":"codehz","email":"CodeHz@Outlook.com"}],"dist":{"shasum":"a807a60f8066521c1518209c2abff89e57866750","tarball":"https://registry.npmjs.org/@codehz/preeval/-/preeval-0.2.1.tgz","fileCount":12,"integrity":"sha512-izCMcKVptPaLFhejJK/2ftbPR6igYHWaH8GslhGmtfnaUA66kLUWLfuYLLp7GNNQt66902xa2iZR9Ge4NfjL2A==","signatures":[{"sig":"MEUCIAPSbypbnDWl4Hj3mEr3LrpWd9BS83HKOxRirZ5p6fVPAiEAqbR6l9nnMnj5CMr8euk54o2IsZlWze9JKaL04g9L1Bw=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":62974},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","shasum":"a807a60f8066521c1518209c2abff89e57866750","engines":{"node":"^20.19.0 || >=22.12.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./bun":{"types":"./dist/bun.d.ts","import":"./dist/bun.js"},"./vite":{"types":"./dist/vite.d.ts","import":"./dist/vite.js"},"./rollup":{"types":"./dist/rollup.d.ts","import":"./dist/rollup.js"},"./package.json":"./package.json"},"scripts":{"test":"vitest run","build":"tsdown","prepublishOnly":"bun run build"},"_npmUser":{"name":"codehz","email":"CodeHz@Outlook.com"},"_integrity":"sha512-izCMcKVptPaLFhejJK/2ftbPR6igYHWaH8GslhGmtfnaUA66kLUWLfuYLLp7GNNQt66902xa2iZR9Ge4NfjL2A==","_npmVersion":"10.8.3","description":"Build-time pre-evaluation of // @preeval marked top-level consts for library publish builds","directories":{},"_nodeVersion":"24.3.0","dependencies":{"unplugin":"^3.3.0","@babel/types":"^7","magic-string":"^0.30.21","@babel/parser":"^7","@babel/traverse":"^7","@babel/generator":"^7"},"_hasShrinkwrap":false,"devDependencies":{"tsdown":"^0.22.14","vitest":"^4.1.10","sucrase":"^3.35.1","@types/bun":"latest","@types/babel__traverse":"^7.28.0","@types/babel__generator":"^7.27.0"},"peerDependencies":{"sucrase":"^3"},"peerDependenciesMeta":{"sucrase":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/preeval_0.2.1_1786285476830_0.4599528145776963","host":"s3://npm-registry-packages-npm-production"}},"0.2.2":{"name":"@codehz/preeval","version":"0.2.2","keywords":["unplugin","vite","rollup","bun","build","const","precompute","preeval"],"license":"MIT","_id":"@codehz/preeval@0.2.2","maintainers":[{"name":"codehz","email":"CodeHz@Outlook.com"}],"dist":{"shasum":"2545619369c89d9cbcaa1cbf3ac0426a3e248874","tarball":"https://registry.npmjs.org/@codehz/preeval/-/preeval-0.2.2.tgz","fileCount":12,"integrity":"sha512-Q0rNGWoFTJqde5OQaFCVT4X+8Ck+0Vy2H9XMcSqzxeynmoPBrZfRceoHXS9pOPtOFn1EyhuCKMaorgzvR+1LQQ==","signatures":[{"sig":"MEQCIGqyr5YDNgEPpsYcBVvFWBtZgq4UINirVgMKnMlEIDBcAiAkIveW/hXYqHPnJcun+8GTIiKaFrx4xWCEhhx2TpeFGw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":63704},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","shasum":"2545619369c89d9cbcaa1cbf3ac0426a3e248874","engines":{"node":"^20.19.0 || >=22.12.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./bun":{"types":"./dist/bun.d.ts","import":"./dist/bun.js"},"./vite":{"types":"./dist/vite.d.ts","import":"./dist/vite.js"},"./rollup":{"types":"./dist/rollup.d.ts","import":"./dist/rollup.js"},"./package.json":"./package.json"},"scripts":{"test":"vitest run","build":"tsdown","prepublishOnly":"bun run build"},"_npmUser":{"name":"codehz","email":"CodeHz@Outlook.com"},"_integrity":"sha512-Q0rNGWoFTJqde5OQaFCVT4X+8Ck+0Vy2H9XMcSqzxeynmoPBrZfRceoHXS9pOPtOFn1EyhuCKMaorgzvR+1LQQ==","_npmVersion":"10.8.3","description":"Build-time pre-evaluation of // @preeval marked top-level consts for library publish builds","directories":{},"_nodeVersion":"24.3.0","dependencies":{"unplugin":"^3.3.0","@babel/types":"^7","magic-string":"^0.30.21","@babel/parser":"^7","@babel/traverse":"^7","@babel/generator":"^7"},"_hasShrinkwrap":false,"devDependencies":{"tsdown":"^0.22.14","vitest":"^4.1.10","sucrase":"^3.35.1","@types/bun":"latest","@types/babel__traverse":"^7.28.0","@types/babel__generator":"^7.27.0"},"peerDependencies":{"sucrase":"^3"},"peerDependenciesMeta":{"sucrase":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/preeval_0.2.2_1786286929136_0.5493635090348967","host":"s3://npm-registry-packages-npm-production"}},"0.3.0":{"name":"@codehz/preeval","version":"0.3.0","keywords":["unplugin","vite","rollup","bun","build","const","precompute","preeval"],"license":"MIT","_id":"@codehz/preeval@0.3.0","maintainers":[{"name":"codehz","email":"CodeHz@Outlook.com"}],"dist":{"shasum":"c8db22885d12c8c0aa26b3708092b588111c9df0","tarball":"https://registry.npmjs.org/@codehz/preeval/-/preeval-0.3.0.tgz","fileCount":12,"integrity":"sha512-NMJsUXqIo/qFUNKcdur3nT3sTrVgUyA3AR9UGC2C28Igc0mbz7Nr5D395+G4n4954DV6qTDrMygRKWIMduNeXg==","signatures":[{"sig":"MEQCIGvZjif1xE8uI1licOvN/nHEQ4xbQ5htatvtwEZeSrhnAiB1j2+eOV0dPTgb4yXHOhGhg4sQRsrKNWx02YcZUtMaeA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":69834},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","shasum":"c8db22885d12c8c0aa26b3708092b588111c9df0","engines":{"node":"^20.19.0 || >=22.12.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./bun":{"types":"./dist/bun.d.ts","import":"./dist/bun.js"},"./vite":{"types":"./dist/vite.d.ts","import":"./dist/vite.js"},"./rollup":{"types":"./dist/rollup.d.ts","import":"./dist/rollup.js"},"./package.json":"./package.json"},"scripts":{"test":"vitest run","build":"tsdown","prepublishOnly":"bun run build"},"_npmUser":{"name":"codehz","email":"CodeHz@Outlook.com"},"_integrity":"sha512-NMJsUXqIo/qFUNKcdur3nT3sTrVgUyA3AR9UGC2C28Igc0mbz7Nr5D395+G4n4954DV6qTDrMygRKWIMduNeXg==","_npmVersion":"10.8.3","description":"Publish-build pre-evaluation of imported ESM calls with optional runtime materialization","directories":{},"_nodeVersion":"24.3.0","dependencies":{"unplugin":"^3.3.0","@babel/types":"^7","magic-string":"^0.30.21","@babel/parser":"^7","@babel/traverse":"^7","@babel/generator":"^7"},"_hasShrinkwrap":false,"devDependencies":{"tsdown":"^0.22.14","vitest":"^4.1.10","sucrase":"^3.35.1","@types/bun":"latest","@types/babel__traverse":"^7.28.0","@types/babel__generator":"^7.27.0"},"peerDependencies":{"sucrase":"^3"},"peerDependenciesMeta":{"sucrase":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/preeval_0.3.0_1786290228042_0.990153208555882","host":"s3://npm-registry-packages-npm-production"}},"0.3.1":{"name":"@codehz/preeval","version":"0.3.1","keywords":["build","bun","const","esbuild","precompute","preeval","rolldown","rollup","unplugin","vite"],"license":"MIT","_id":"@codehz/preeval@0.3.1","maintainers":[{"name":"codehz","email":"CodeHz@Outlook.com"}],"dist":{"shasum":"a2793765851de608ae994bec980ca7c34f39e67a","tarball":"https://registry.npmjs.org/@codehz/preeval/-/preeval-0.3.1.tgz","fileCount":16,"integrity":"sha512-Uvrk2oaZl9GCMzNuCe3MFbCPyUa3Pc8U7iD5paNuC3XPAs1m+eU4VssDV13DJD8qav3tSdmqv5q7CKKDzC15LQ==","signatures":[{"sig":"MEYCIQDRqx8rzQRGE86k4gfkXR0+N4x7wFcTAvXwKOvkUM5bEwIhAM9sGlv5Pa01G/g97etd/NKXcQloZ/0twQzX6C2YQ913","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":72872},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","shasum":"a2793765851de608ae994bec980ca7c34f39e67a","engines":{"node":"^20.19.0 || >=22.12.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./bun":{"types":"./dist/bun.d.ts","import":"./dist/bun.js"},"./vite":{"types":"./dist/vite.d.ts","import":"./dist/vite.js"},"./rollup":{"types":"./dist/rollup.d.ts","import":"./dist/rollup.js"},"./esbuild":{"types":"./dist/esbuild.d.ts","import":"./dist/esbuild.js"},"./rolldown":{"types":"./dist/rolldown.d.ts","import":"./dist/rolldown.js"},"./package.json":"./package.json"},"scripts":{"fmt":"oxfmt","lint":"oxlint","test":"vitest run","build":"tsdown","lint:fix":"oxlint --fix","fmt:check":"oxfmt --check","prepublishOnly":"bun run build"},"_npmUser":{"name":"codehz","email":"CodeHz@Outlook.com"},"_integrity":"sha512-Uvrk2oaZl9GCMzNuCe3MFbCPyUa3Pc8U7iD5paNuC3XPAs1m+eU4VssDV13DJD8qav3tSdmqv5q7CKKDzC15LQ==","_npmVersion":"10.8.3","description":"Publish-build pre-evaluation of imported ESM calls with optional runtime materialization","directories":{},"_nodeVersion":"24.3.0","dependencies":{"unplugin":"^3.3.0","@babel/types":"^7","magic-string":"^0.30.21","@babel/parser":"^7","@babel/traverse":"^7","@babel/generator":"^7"},"_hasShrinkwrap":false,"devDependencies":{"oxfmt":"^0.62.0","oxlint":"^1.77.0","tsdown":"^0.22.14","vitest":"^4.1.10","esbuild":"^0.25.0","sucrase":"^3.35.1","rolldown":"^1.2.3","@types/bun":"latest","@types/babel__traverse":"^7.28.0","@types/babel__generator":"^7.27.0"},"peerDependencies":{"sucrase":"^3"},"peerDependenciesMeta":{"sucrase":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/preeval_0.3.1_1786331837420_0.7736985660490263","host":"s3://npm-registry-packages-npm-production"}},"0.4.0":{"name":"@codehz/preeval","version":"0.4.0","keywords":["build","bun","const","esbuild","precompute","preeval","rolldown","rollup","unplugin","vite"],"license":"MIT","_id":"@codehz/preeval@0.4.0","maintainers":[{"name":"codehz","email":"CodeHz@Outlook.com"}],"dist":{"shasum":"d33ec8a0c8e4959a18dca5584dbbd03f88e83715","tarball":"https://registry.npmjs.org/@codehz/preeval/-/preeval-0.4.0.tgz","fileCount":16,"integrity":"sha512-Er6Map49UJRthCOITnSiqYJ0y2p2mrWaCJjxipYJW+L0zr/VUT5M4ax+Xx/q164PkMZE1atswBpruXJzjQby/Q==","signatures":[{"sig":"MEYCIQCtsCXBo3VombKMYadInobjO7vlw5rIqUL0MtiBNYLuJgIhAJeyiRdCFVV6A6WGlPhLJGi2KhVUQBVWiGpoFCOipMcN","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":70878},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","shasum":"d33ec8a0c8e4959a18dca5584dbbd03f88e83715","engines":{"node":"^20.19.0 || >=22.12.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./bun":{"types":"./dist/bun.d.ts","import":"./dist/bun.js"},"./vite":{"types":"./dist/vite.d.ts","import":"./dist/vite.js"},"./rollup":{"types":"./dist/rollup.d.ts","import":"./dist/rollup.js"},"./esbuild":{"types":"./dist/esbuild.d.ts","import":"./dist/esbuild.js"},"./rolldown":{"types":"./dist/rolldown.d.ts","import":"./dist/rolldown.js"},"./package.json":"./package.json"},"scripts":{"fmt":"oxfmt","lint":"oxlint","test":"vitest run","build":"tsdown","lint:fix":"oxlint --fix","fmt:check":"oxfmt --check","prepublishOnly":"bun run build"},"_npmUser":{"name":"codehz","email":"CodeHz@Outlook.com"},"_integrity":"sha512-Er6Map49UJRthCOITnSiqYJ0y2p2mrWaCJjxipYJW+L0zr/VUT5M4ax+Xx/q164PkMZE1atswBpruXJzjQby/Q==","_npmVersion":"10.8.3","description":"Publish-build pre-evaluation of imported ESM calls with optional runtime materialization","directories":{},"_nodeVersion":"24.3.0","dependencies":{"unplugin":"^3.3.0","@babel/types":"^7","magic-string":"^0.30.21","@babel/parser":"^7","@babel/traverse":"^7","@babel/generator":"^7"},"_hasShrinkwrap":false,"devDependencies":{"oxfmt":"^0.62.0","oxlint":"^1.77.0","tsdown":"^0.22.14","vitest":"^4.1.10","esbuild":"^0.25.0","rolldown":"^1.2.3","@types/bun":"latest","@types/babel__traverse":"^7.28.0","@types/babel__generator":"^7.27.0"},"_npmOperationalInternal":{"tmp":"tmp/preeval_0.4.0_1786339235342_0.42314577641658","host":"s3://npm-registry-packages-npm-production"}},"0.5.0":{"name":"@codehz/preeval","version":"0.5.0","description":"Publish-build pre-evaluation of imported ESM calls with optional runtime materialization","keywords":["build","bun","const","esbuild","precompute","preeval","rolldown","rollup","unplugin","vite"],"license":"MIT","type":"module","main":"./dist/index.js","module":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./vite":{"types":"./dist/vite.d.ts","import":"./dist/vite.js"},"./rollup":{"types":"./dist/rollup.d.ts","import":"./dist/rollup.js"},"./rolldown":{"types":"./dist/rolldown.d.ts","import":"./dist/rolldown.js"},"./esbuild":{"types":"./dist/esbuild.d.ts","import":"./dist/esbuild.js"},"./bun":{"types":"./dist/bun.d.ts","import":"./dist/bun.js"},"./package.json":"./package.json"},"scripts":{"build":"tsdown","test":"vitest run","fmt":"oxfmt","fmt:check":"oxfmt --check","lint":"oxlint","lint:fix":"oxlint --fix","prepublishOnly":"bun run build"},"dependencies":{"@babel/generator":"^7","@babel/parser":"^7","@babel/traverse":"^7","@babel/types":"^7","magic-string":"^0.30.21","unplugin":"^3.3.0"},"devDependencies":{"@types/babel__generator":"^7.27.0","@types/babel__traverse":"^7.28.0","@types/bun":"latest","esbuild":"^0.25.0","oxfmt":"^0.62.0","oxlint":"^1.77.0","rolldown":"^1.2.3","tsdown":"^0.22.14","vitest":"^4.1.10"},"engines":{"node":"^20.19.0 || >=22.12.0"},"_id":"@codehz/preeval@0.5.0","_integrity":"sha512-QljcNF+cDjy0yRAZySZYpQbtLC//t1znDbl7p2+LlJC0QWJE/hRDjPeCB/UkNw3gNraDrBP/CFu9M5uW6p48Yw==","_nodeVersion":"24.3.0","_npmVersion":"10.8.3","shasum":"8408cf9bc5be5be5824c8c22df59dfc34b1fabc9","dist":{"integrity":"sha512-QljcNF+cDjy0yRAZySZYpQbtLC//t1znDbl7p2+LlJC0QWJE/hRDjPeCB/UkNw3gNraDrBP/CFu9M5uW6p48Yw==","shasum":"8408cf9bc5be5be5824c8c22df59dfc34b1fabc9","tarball":"https://registry.npmjs.org/@codehz/preeval/-/preeval-0.5.0.tgz","fileCount":16,"unpackedSize":77038,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIDYRW1G03kqFTvZ2L3ucAylCGWRJautT07BcNhCSO0kRAiEAh+FIdZv1V6g9Tz0qtFOH18mAbvZctYlTBRuBVD35VFk="}]},"_npmUser":{"name":"codehz","email":"CodeHz@Outlook.com"},"directories":{},"maintainers":[{"name":"codehz","email":"CodeHz@Outlook.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/preeval_0.5.0_1786361695898_0.1595849983143618"},"_hasShrinkwrap":false}},"time":{"created":"2026-08-09T11:23:20.371Z","modified":"2026-08-10T11:34:56.357Z","0.1.0":"2026-08-09T11:23:20.631Z","0.1.1":"2026-08-09T12:09:22.506Z","0.1.2":"2026-08-09T13:18:13.161Z","0.2.0":"2026-08-09T14:15:28.339Z","0.2.1":"2026-08-09T14:24:36.980Z","0.2.2":"2026-08-09T14:48:49.285Z","0.3.0":"2026-08-09T15:43:48.187Z","0.3.1":"2026-08-10T03:17:17.589Z","0.4.0":"2026-08-10T05:20:35.483Z","0.5.0":"2026-08-10T11:34:56.051Z"},"license":"MIT","keywords":["build","bun","const","esbuild","precompute","preeval","rolldown","rollup","unplugin","vite"],"description":"Publish-build pre-evaluation of imported ESM calls with optional runtime materialization","maintainers":[{"name":"codehz","email":"CodeHz@Outlook.com"}],"readme":"# @codehz/preeval\n\nBuild-time pre-evaluation of marked constants and selected statically imported ESM function calls. The plugin serializes static results into the author-side publish build and can pass those payloads through explicit runtime materializers for values such as `Map`, class instances, proxies, or registration handles.\n\n## Install\n\n```bash\nbun add -d @codehz/preeval\n```\n\n```bash\nnpm i -D @codehz/preeval\n```\n\n```bash\npnpm add -D @codehz/preeval\n```\n\n## Mark constants\n\nPut a `// @preeval` line comment directly above a top-level `const` (exported or not):\n\n```ts\n// @preeval\nexport const answer = 40 + 2\n\n// @preeval\nconst label = ['a', 'b'].join('-')\nexport { label }\n\nconst base = 40\n// @preeval\nconst local = base + 2\nexport const out = local\n```\n\nRules:\n\n- Line comment only, exact text `@preeval` (whitespace around it is trimmed).\n- Must be the closest comment above the declaration; blank lines between the comment and the declaration are allowed, other comments are not.\n- The declaration must be a **module top-level** `const` with a single identifier declarator and an initializer. Function/block-local consts, destructuring targets, and multi-declarator declarations are ignored.\n- Export is optional: `export const x`, `const x; export { x }`, and non-exported `const x` are all valid targets.\n- The value must be JSON-superset (see [Value domain](#value-domain)).\n\n## Configure imported functions\n\nUse `rules` to define an explicit match → evaluate → optional materialize pipeline:\n\n```ts\nimport preeval from '@codehz/preeval/vite'\n\nexport default defineConfig({\n  plugins: [\n    preeval({\n      rules: [\n        {\n          match: { from: 'message-compiler', import: 'compile' },\n        },\n        {\n          match: { from: 'runtime-package', import: 'compile' },\n          evaluate: { from: 'pure-package', import: 'compilePure' },\n          materialize: { from: 'runtime-package', import: 'materialize' },\n          onFailure: 'warn',\n        },\n      ],\n    }),\n  ],\n})\n```\n\n`match` selects the original binding by **host-resolved module identity** and ESM export name. When the bundler exposes a resolver (Rollup/Vite/Rolldown `this.resolve`, esbuild `build.resolve`, Bun `Bun.resolveSync`), `match.from` is resolved against `root` (default `process.cwd()`) and each import source against the current file; equal resolved ids match even when the written specifiers differ (`./x` vs `../lib/x.js`, aliases, extension resolution). Without a host resolver, matching falls back to exact source-string equality. Matching is binding-aware and supports named imports, default imports, import aliases, and static namespace properties (`ns.fn()` / `ns['fn']()`, including the same forms as tagged-template tags). Direct calls and tagged templates are macro sites. Local aliases, re-exports/barrels, CommonJS `require`, dynamic imports, and computed property expressions are not followed.\n\n`evaluate` selects the build-time callee/tag and defaults to `match`. The evaluator receives the original call arguments or tagged-template inputs. It must return a synchronous JSON-superset payload. The evaluator import exists only in the temporary evaluation module and is never emitted.\n\n`materialize` is an optional hard runtime boundary. A successful site emits `materialize(<serialized payload>)`; the materializer receives exactly one argument, never the original arguments or template inputs. It is imported only by the final emitted module and is never loaded or executed during pre-evaluation. Its return value may be any runtime value, including `Map`, class instances, proxies, and registration handles.\n\nEvery matched syntactic call or tagged template runs once during the build even inside a function, loop, or dead control-flow branch. Payload inputs may use literals, ambient globals, imports, stable module-level `const`/function/class/enum dependencies, and lexical bindings declared within that argument or interpolation. Captures of outer function/block bindings are rejected, as are `let`/`var`, reassigned module bindings, `this`, `arguments`, `super`, `new.target`, and `import.meta`.\n\nIf a later automatic target or marked binding depends directly or transitively on a materialized result, pre-evaluation stops at that boundary. The outer target follows its own failure policy instead of importing or executing the materializer at build time.\n\n## Usage\n\nThe plugin only runs during your publish build (Vite library mode, Rollup, Rolldown, esbuild, or Bun.build). It is a no-op for consumer builds, and consumers never need it.\n\n### Vite\n\n```ts\nimport preeval from '@codehz/preeval/vite'\n\nexport default defineConfig({\n  plugins: [preeval()],\n})\n```\n\n### Rollup\n\n```ts\nimport preeval from '@codehz/preeval/rollup'\n\nexport default {\n  plugins: [preeval()],\n}\n```\n\n### Rolldown\n\n```ts\nimport preeval from '@codehz/preeval/rolldown'\n\nexport default {\n  plugins: [preeval()],\n}\n```\n\n### esbuild\n\n```ts\nimport { build } from 'esbuild'\nimport preeval from '@codehz/preeval/esbuild'\n\nawait build({\n  entryPoints: ['src/index.ts'],\n  bundle: true,\n  outfile: 'dist/index.js',\n  plugins: [preeval()],\n})\n```\n\nesbuild does not honor `enforce`. Keep this plugin ahead of other plugins that rewrite the same modules. For tsup, use `@codehz/preeval/esbuild` (default) or `@codehz/preeval/rollup` when tsup is configured for the Rollup path.\n\n### Bun.build\n\n```ts\nimport preeval from '@codehz/preeval/bun'\n\nawait Bun.build({\n  plugins: [preeval()],\n})\n```\n\n## Options\n\n| Option      | Default             | Description                                                                                         |\n| ----------- | ------------------- | --------------------------------------------------------------------------------------------------- |\n| `onFailure` | `'warn'`            | Global `ignore \\| warn \\| error` policy for marked bindings and automatic calls.                    |\n| `rules`     | `[]`                | Explicit `match`, optional `evaluate`, optional `materialize`, and optional rule-level `onFailure`. |\n| `root`      | `process.cwd()`     | Base directory for resolving relative `rules[].match.from` values under host resolve.               |\n| `include`   | `/\\.[cm]?[jt]sx?$/` | File-id filter passed to the bundler.                                                               |\n| `exclude`   | `/node_modules/`    | File-id filter passed to the bundler.                                                               |\n\nWhen `rules` is empty, the plugin retains the marker-only source filter. When any automatic rule exists, every file passing `include`/`exclude` is inspected because substring filtering could miss aliased or namespace calls.\n\n`strict` is not accepted; use `onFailure: 'error'`.\n\n## Failure policy\n\n- `ignore`: preserve the original failed call/tag or marked initializer and emit no diagnostic.\n- `warn` (default): preserve the failed target and emit a source-located warning.\n- `error`: report through the bundler error hook and abort the build.\n\nRule-level `onFailure` overrides the global policy only for that automatic target. Configuration errors, including malformed references, missing fields, and duplicate `match` references, always throw when the plugin is created.\n\nAutomatic targets run before marked bindings. A failed automatic target cannot be executed again through a containing marked initializer. Materialized results similarly block every outer automatic or marked closure that reaches them; unrelated marked targets continue evaluating.\n\n## Value domain\n\nMarked values and automatic evaluator payloads must be JSON-superset values that round-trip through JSON without information loss:\n\n- `null`, booleans, strings, finite numbers\n- plain objects (prototype `Object.prototype` or `null`) and arrays, without circular references\n\nRejected evaluator payloads: `undefined`, `NaN`, `±Infinity`, `bigint`, functions, symbols, `Date`, `Map`, `Set`, class instances, and circular structures. A runtime materializer's return value is not serialized and is unrestricted.\n\n## Requirements / caveats\n\n- Use it on the author-side publish build (tsup, Vite, Rollup, Rolldown, esbuild, Bun.build) — not in consumer apps.\n- Evaluation extracts the same-file lexical dependency closure: imports and stable module-level `const`, function, class, and enum declarations. Unrelated top-level statements and side-effect-only imports are not executed.\n- Calls, constructors, getters, imported-module initialization, and other side effects inside the extracted closure are allowed. Configuring a rule is an explicit trust decision; there is no purity analysis or sandbox.\n- Only synchronous results are supported. Promise/thenable results are failures and are never implicitly awaited.\n- Imported modules load fully. There is no recursive project-graph trimming or persistent build cache. Rule `match` uses the host resolver when available (otherwise exact specifier strings). Evaluation still loads modules via adjacent temporary files and does not re-run the bundler graph.\n- Successful automatic replacements remove their original import specifier only when the binding has no remaining runtime references. Evaluator imports exist only in temporary modules. Materializer imports are emitted only for successful surviving materialized sites and are deduplicated by exact source/export reference.\n- Automatic calls use macro semantics and execute in expression/source order. Non-materialized successful results may feed later static evaluation; materialized results are runtime boundaries. A successful marked initializer takes precedence over nested non-materialized automatic edits.\n- Interference checks for marked bindings are per remaining mark. A runtime-boundary-blocked mark does not prevent unrelated marks from succeeding. Never-called top-level function/class declarations are ignored unless a pre-target call site can reach them.\n- **TypeScript**:\n  - **Bun**: evaluates TS/TSX natively (including relative `.ts` imports).\n  - **Node**: does not transpile TypeScript or JSX. Run the publish build with a host loader such as tsx (for example, `NODE_OPTIONS='--import tsx/esm' vite build`), or ensure the extracted entry and its dependencies are plain JS. The temporary entry keeps the original `.ts`/`.tsx`/`.jsx` extension so the loader can process the full relative dependency graph.\n- Hidden shared state from imported modules or ambient globals remains outside single-file static proof.\n- Static-analysis limits include dynamic code such as `eval(...)`/`new Function(...)`, and bundler-only virtual modules, path aliases, or package mappings that the adjacent temporary file cannot load. Failures follow `onFailure`.\n- `import.meta` in an extracted closure is refused because the temporary path would leak.\n- No declaration-file rewriting or first-class webpack support.\n\n## How it works\n\n1. **Analyze** — Babel finds configured direct import calls, tagged templates, and marked top-level constants, verifies binding identity (host-resolved `match.from` when possible), and builds stable same-file dependency closures.\n2. **Extract + evaluate** — automatic sites execute children-first with `evaluate ?? match`; marked bindings then evaluate against successful non-runtime intermediate constants. Temporary ESM files are written next to the source, dynamically imported, and removed in `finally`.\n3. **Serialize + emit** — evaluator payloads become literals. Rules with `materialize` emit a hygienic runtime import and `materialize(<literal>)`; other successes emit the literal directly. MagicString applies one non-overlapping final edit set and removes dead matched import bindings.\n","readmeFilename":"README.md"}