Skip to content

Commit 94a3b99

Browse files
authored
Merge pull request #142 from MatrixAI/feature-eng-553-js-quic-migration-to-esm
Migration to ESM
2 parents a2bc562 + 1d0920c commit 94a3b99

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+2329
-1837
lines changed

.eslintrc

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,18 @@
77
"jest": true
88
},
99
"parser": "@typescript-eslint/parser",
10-
"extends": [
11-
"eslint:recommended",
12-
"plugin:@typescript-eslint/recommended",
13-
"plugin:prettier/recommended",
14-
"prettier"
15-
],
16-
"plugins": [
17-
"import"
18-
],
1910
"parserOptions": {
2011
"project": "tsconfig.json",
2112
"sourceType": "module"
2213
},
14+
"plugins": [
15+
"import"
16+
],
17+
"extends": [
18+
"eslint:recommended",
19+
"plugin:@typescript-eslint/recommended",
20+
"plugin:prettier/recommended"
21+
],
2322
"rules": {
2423
"linebreak-style": ["error", "unix"],
2524
"no-empty": 1,
@@ -182,3 +181,4 @@
182181
]
183182
}
184183
}
184+

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ npm run prebuild
3030
# build the dist and native objects
3131
npm run build
3232
# run the repl (this allows you to import from ./src)
33-
npm run ts-node
33+
npm run tsx
3434
# run the tests
3535
npm run test
3636
# lint the source code

benches/index.ts

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
#!/usr/bin/env ts-node
22

3-
import type { Summary } from 'benny/lib/internal/common-types';
3+
import type { Summary } from 'benny/lib/internal/common-types.js';
44
import fs from 'fs';
55
import path from 'path';
6+
import url from 'node:url';
67
import si from 'systeminformation';
7-
import { fsWalk, resultsPath, suitesPath } from './utils';
8+
import { fsWalk, resultsPath, suitesPath } from './utils.js';
9+
10+
const dirname = url.fileURLToPath(new URL('.', import.meta.url));
811

912
async function main(): Promise<void> {
10-
await fs.promises.mkdir(path.join(__dirname, 'results'), { recursive: true });
13+
await fs.promises.mkdir(path.join(dirname, 'results'), { recursive: true });
1114
// Running all suites
1215
for await (const suitePath of fsWalk(suitesPath)) {
1316
// Skip over non-ts and non-js files
@@ -44,12 +47,12 @@ async function main(): Promise<void> {
4447
system: 'model, manufacturer',
4548
});
4649
await fs.promises.writeFile(
47-
path.join(__dirname, 'results', 'system.json'),
50+
path.join(dirname, 'results', 'system.json'),
4851
JSON.stringify(systemData, null, 2),
4952
);
5053
}
5154

52-
if (require.main === module) {
55+
if (process.argv[1] === url.fileURLToPath(import.meta.url)) {
5356
void main();
5457
}
5558

benches/results/buffers/buffer_allocation.chart.html

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
</head>
2929
<body>
3030
<div class="container">
31-
<canvas id="chart1697506316266" width="16" height="9"></canvas>
31+
<canvas id="chart1742779743420" width="16" height="9"></canvas>
3232
</div>
3333
<script>
3434
const format = (num) => {
@@ -51,18 +51,18 @@
5151
chunked.map((chunk) => chunk.join('')).join(' ') + fractionStr
5252
)
5353
}
54-
const ctx1697506316266 = document
55-
.getElementById('chart1697506316266')
54+
const ctx1742779743420 = document
55+
.getElementById('chart1742779743420')
5656
.getContext('2d')
57-
const chart1697506316266 = new Chart(ctx1697506316266, {
57+
const chart1742779743420 = new Chart(ctx1742779743420, {
5858
type: 'bar',
5959
data: {
6060
labels: ["Buffer.alloc","Buffer.allocUnsafe","Buffer.allocUnsafeSlow","Buffer.from subarray","Buffer.copyBytesFrom","Uint8Array","Uint8Array slice"],
6161
datasets: [
6262
{
63-
data: [1342250,7102874,1589200,3509682,936376,1310106,1435174],
64-
backgroundColor: ["hsl(22.680000000000007, 85%, 55%)","hsl(120, 85%, 55%)","hsl(26.844000000000005, 85%, 55%)","hsl(59.292, 85%, 55%)","hsl(15.816000000000006, 85%, 55%)","hsl(22.127999999999997, 85%, 55%)","hsl(24.251999999999995, 85%, 55%)"],
65-
borderColor: ["hsl(22.680000000000007, 85%, 55%)","hsl(120, 85%, 55%)","hsl(26.844000000000005, 85%, 55%)","hsl(59.292, 85%, 55%)","hsl(15.816000000000006, 85%, 55%)","hsl(22.127999999999997, 85%, 55%)","hsl(24.251999999999995, 85%, 55%)"],
63+
data: [1370590,5346372,1350702,2741252,676306,1146307,1027805],
64+
backgroundColor: ["hsl(30.768, 85%, 55%)","hsl(120, 85%, 55%)","hsl(30.312000000000005, 85%, 55%)","hsl(61.52400000000001, 85%, 55%)","hsl(15.180000000000007, 85%, 55%)","hsl(25.727999999999998, 85%, 55%)","hsl(23.063999999999997, 85%, 55%)"],
65+
borderColor: ["hsl(30.768, 85%, 55%)","hsl(120, 85%, 55%)","hsl(30.312000000000005, 85%, 55%)","hsl(61.52400000000001, 85%, 55%)","hsl(15.180000000000007, 85%, 55%)","hsl(25.727999999999998, 85%, 55%)","hsl(23.063999999999997, 85%, 55%)"],
6666
borderWidth: 2,
6767
},
6868
],

0 commit comments

Comments
 (0)