aboutsummaryrefslogtreecommitdiff
path: root/packages/bun-polyfills/tools/updateversions.ts
blob: bf838ac55c78ffb3976ecac4de82247c504bd6ce (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import path from 'path';

const abort = (...msg: string[]): never => (console.error(...msg), process.exit(1));

const makefilePath = path.resolve(import.meta.dir, '../../../Makefile');
const makefile = Bun.file(makefilePath);
if (!await makefile.exists()) abort('Makefile not found at', makefilePath);

const makefileContent = await makefile.text();
const matched = makefileContent.match(/^BUN_BASE_VERSION\s*=\s*(\d+.\d+)/m);
if (!matched) abort('Could not find BUN_BASE_VERSION in Makefile');

const buildidPath = path.resolve(import.meta.dir, '../../../src/build-id');
const buildid = Bun.file(buildidPath);
if (!await buildid.exists()) abort('Build ID file not found at', buildidPath);

const [, BUN_BASE_VERSION] = matched!;
const BUN_VERSION = `${BUN_BASE_VERSION}.${await buildid.text()}`.trim();

const bunTsPath = path.resolve(import.meta.dir, '../src/modules/bun.ts');
const bunTs = Bun.file(bunTsPath);
if (!await bunTs.exists()) abort('bun.ts source file not found at', bunTsPath);

const bunTsContent = await bunTs.text();
const bunTsContentNew = bunTsContent.replace(
    /^export const version = '.+' satisfies typeof Bun.version;$/m,
    `export const version = '${BUN_VERSION}' satisfies typeof Bun.version;`
);
if (bunTsContentNew !== bunTsContent) console.info('Updated Bun.version polyfill to', BUN_VERSION);

const git = Bun.spawnSync({ cmd: ['git', 'rev-parse', 'HEAD'] });
if (!git.success) abort('Could not get git HEAD commit hash');
const BUN_REVISION = git.stdout.toString('utf8').trim();

const bunTsContentNewer = bunTsContentNew.replace(
    /^export const revision = '.+' satisfies typeof Bun.revision;$/m,
    `export const revision = '${BUN_REVISION}' satisfies typeof Bun.revision;`
);
if (bunTsContentNewer !== bunTsContentNew) console.info('Updated Bun.revision polyfill to', BUN_REVISION);

Bun.write(bunTs, bunTsContentNewer);
d types * don't lock getting contextId * array buffer test 2023-07-28mark tests as todoGravatar Jarred Sumner 2-81/+75 2023-07-28add fork to child_process (#3851)Gravatar Vlad Sirenko 7-19/+446 * add fork to child_process * fix export * add test to child_process method `fork` * fmt fork * remove only from test 2023-07-28feat(bun/test): Impl. expect().pass() & expect().fail() (#3843)Gravatar Tiramify (A.K. Daniel) 6-5/+212 * Impl. pass & fail * fix * fix 2 * smol 2023-07-28fix the chunk boundary (`node:stream:createReadStream`) (#3853)Gravatar Ai Hoshino 3-8/+90 * fix the slice boundary. Close: #3668 * Add more boundary test case. * fix end is 0. 2023-07-28Support file: URLs in `fetch` (#3858)Gravatar Jarred Sumner 6-183/+281 * Support file: URLs in `fetch` * Update url.zig --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> 2023-07-28fix(tls) exposes native canonicalizeIP and fix rootCertificates (#3866)Gravatar Ciro Spaciari 7-29/+125 * exposes native canonicalizeIP * remove unintended duplicate * add tests * add tests for debug builds * add rootCertificates test and fix len * just randomize test ids on prisma * remove work around and bump usockets with the actual fix * fix case * bump uws 2023-07-28Fixes #3795 (#3856)Gravatar Jarred Sumner 11-6/+140 Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> 2023-07-28Add todoGravatar Jarred Sumner 2-0/+8 cc @cirospaciari 2023-07-28Update pull_request_template.mdGravatar Jarred Sumner 1-1/+1 2023-07-28Update pull_request_template.mdGravatar Jarred Sumner 1-11/+16 2023-07-27Fix bug with // @bun annotation in main thread (#3855)Gravatar Jarred Sumner 4-2/+53 * Uncomment test * Fix bug with // @bun + async transpiler --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> 2023-07-27Add `Bun.isMainThread`Gravatar Jarred Sumner 7-3/+48 2023-07-27Uncomment testGravatar Jarred Sumner 1-1/+1 2023-07-27Resolve watch directories outside main thread + async iterator and symlink ↵Gravatar Ciro Spaciari 8-197/+523 fixes (#3846) * linux working pending tests with FSEvents * add more tests, fix async iterator * remove unnecessary check * fix macos symlink on directories * remove indirection layer * todos * fixes and some permission test * fix opsie and make prisma test more reliable * rebase with main * add comptime check for macOS * oops * oops2 * fix symlinks cascade on FSEvents * use JSC.WorkPool * use withResolver, createFIFO and fix close event on async iterator * remove unused events --------- Co-authored-by: Jarred Sumner <jarred@jarredsumner.com> 2023-07-27Update pull_request_template.mdGravatar Jarred Sumner 1-1/+1 2023-07-27Update pull_request_template.mdGravatar Jarred Sumner 1-1/+1 2023-07-27Update pull_request_template.mdGravatar Jarred Sumner 1-1/+1 2023-07-27Update pull_request_template.mdGravatar Jarred Sumner 1-2/+2 2023-07-27Update pull_request_template.mdGravatar Jarred Sumner 1-0/+4 2023-07-27Update pull_request_template.mdGravatar Jarred Sumner 1-5/+11