Files
viem/scripts/version:update.ts
jxomandClaude Fable 5 007a7e115d refactor: freeze v2 sources as src-old/, rebuild src/ on ox v1
- src/ -> src-old/, test/ -> test-old/; the test/tempo submodule and
  trusted-setups/ keep their paths
- new src/: core/internal helpers (types, errors, uid, lru, regex,
  wait, poll, stringify, observe, promise), Errors module (BaseError
  extends ox Errors.BaseError; setConfig replaces setErrorConfig),
  Hex/Bytes/Rlp namespaces re-exporting ox
- v2 unit suites ported into colocated _test/ directories (202 tests);
  test/src/utils.ts createHttpServer extracted from the v2 test infra
- tooling: exports map regenerated from the new tree; version:update
  writes src/version.ts; vite fmt/lint/test exclude the frozen trees;
  knip entry/ignores rewritten; size-limit reset to the root entry
  (7 kB); @noble/* and @scure/* removed from published dependencies

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-06-12 13:27:42 +10:00

11 lines
404 B
TypeScript

import { join } from 'node:path'
// Writes the current package.json version to `./src/version.ts`.
const versionFilePath = join(import.meta.dir, '../src/version.ts')
const packageJsonPath = join(import.meta.dir, '../package.json')
const packageVersion = (await Bun.file(packageJsonPath).json()).version
Bun.write(
versionFilePath,
`/** @internal */\nexport const version = '${packageVersion}'\n`,
)