|
1 | | -import { getDirname } from '@poppinss/utils' |
| 1 | +import kleur from 'kleur' |
2 | 2 | import { execaNode } from 'execa' |
3 | | -import { cyan, green, red } from 'kleur' |
| 3 | +import { fileURLToPath } from 'node:url' |
4 | 4 |
|
5 | 5 | async function run() { |
6 | | - console.log(cyan('Benchmarking against flat object')) |
7 | | - await execaNode('./flat-object.js', { |
8 | | - cwd: getDirname(new URL('./', import.meta.url)), |
| 6 | + console.log(kleur.cyan('Benchmarking against flat object')) |
| 7 | + await execaNode('./flat_object.js', { |
| 8 | + cwd: fileURLToPath(new URL('./', import.meta.url)), |
9 | 9 | stdio: 'inherit', |
10 | 10 | }) |
11 | 11 |
|
12 | | - console.log(cyan('Benchmarking against flat object with extra properties')) |
13 | | - await execaNode('./flat-object-extra-properties.js', { |
14 | | - cwd: getDirname(new URL('./', import.meta.url)), |
| 12 | + console.log(kleur.cyan('Benchmarking against flat object with extra properties')) |
| 13 | + await execaNode('./flat_object_extra_properties.js', { |
| 14 | + cwd: fileURLToPath(new URL('./', import.meta.url)), |
15 | 15 | stdio: 'inherit', |
16 | 16 | }) |
17 | 17 |
|
18 | | - console.log(cyan('Benchmarking against nested object')) |
19 | | - await execaNode('./nested-object.js', { |
20 | | - cwd: getDirname(new URL('./', import.meta.url)), |
| 18 | + console.log(kleur.cyan('Benchmarking against nested object')) |
| 19 | + await execaNode('./nested_object.js', { |
| 20 | + cwd: fileURLToPath(new URL('./', import.meta.url)), |
21 | 21 | stdio: 'inherit', |
22 | 22 | }) |
23 | 23 |
|
24 | | - console.log(cyan('Benchmarking against array of objects')) |
| 24 | + console.log(kleur.cyan('Benchmarking against array of objects')) |
25 | 25 | await execaNode('./array.js', { |
26 | | - cwd: getDirname(new URL('./', import.meta.url)), |
| 26 | + cwd: fileURLToPath(new URL('./', import.meta.url)), |
27 | 27 | stdio: 'inherit', |
28 | 28 | }) |
29 | 29 | } |
30 | 30 |
|
31 | 31 | run() |
32 | 32 | .then(() => { |
33 | | - console.log(green('completed')) |
| 33 | + console.log(kleur.green('completed')) |
34 | 34 | }) |
35 | 35 | .catch((error) => { |
36 | | - console.log(red(error)) |
| 36 | + console.log(kleur.red(error)) |
37 | 37 | }) |
0 commit comments