@brillout/test-e2e 0.6.22 → 0.6.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/buildTs.js
CHANGED
|
@@ -1,21 +1,29 @@
|
|
|
1
1
|
export { buildTs };
|
|
2
2
|
export { sourceMaps };
|
|
3
|
-
import
|
|
3
|
+
import { build } from 'rolldown';
|
|
4
4
|
import fs from 'fs';
|
|
5
|
+
import path from 'path';
|
|
5
6
|
import { cliOptions } from './utils.js';
|
|
6
7
|
const sourceMaps = {};
|
|
7
8
|
async function buildTs(entry, outfile) {
|
|
8
|
-
await
|
|
9
|
+
await build({
|
|
9
10
|
platform: 'node',
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
11
|
+
input: entry,
|
|
12
|
+
external: (id, _importer, isResolved) => !isResolved &&
|
|
13
|
+
isNpmPackageImport(id) &&
|
|
14
|
+
// Helpers injected by Rolldown's transformer (e.g. when down-leveling syntax) need to be bundled
|
|
15
|
+
!id.startsWith('@oxc-project/runtime/'),
|
|
16
|
+
logLevel: 'warn',
|
|
17
|
+
transform: {
|
|
18
|
+
target: 'es2022',
|
|
19
|
+
},
|
|
20
|
+
output: {
|
|
21
|
+
file: outfile,
|
|
22
|
+
sourcemap: true,
|
|
23
|
+
format: 'esm',
|
|
24
|
+
minify: false,
|
|
25
|
+
codeSplitting: false,
|
|
26
|
+
},
|
|
19
27
|
});
|
|
20
28
|
{
|
|
21
29
|
const sourceMapFile = `${outfile}.map`;
|
|
@@ -23,10 +31,14 @@ async function buildTs(entry, outfile) {
|
|
|
23
31
|
fs.unlinkSync(sourceMapFile);
|
|
24
32
|
}
|
|
25
33
|
const clean = () => {
|
|
26
|
-
if (cliOptions.
|
|
34
|
+
if (cliOptions.debugRolldown) {
|
|
27
35
|
return;
|
|
28
36
|
}
|
|
29
37
|
fs.unlinkSync(`${outfile}`);
|
|
30
38
|
};
|
|
31
39
|
return clean;
|
|
32
40
|
}
|
|
41
|
+
// Same as esbuild's `packages: 'external'`
|
|
42
|
+
function isNpmPackageImport(importPath) {
|
|
43
|
+
return !importPath.startsWith('.') && !path.isAbsolute(importPath);
|
|
44
|
+
}
|
package/dist/utils/cliOptions.js
CHANGED
|
@@ -3,7 +3,7 @@ import { check, prepare, validate } from './parseCli.js';
|
|
|
3
3
|
prepare();
|
|
4
4
|
const verbose = check('--verbose');
|
|
5
5
|
const inspect = check('--inspect');
|
|
6
|
-
const
|
|
6
|
+
const debugRolldown = check('--debug-rolldown');
|
|
7
7
|
const bail = check('--bail');
|
|
8
8
|
// Defined & used in ./findFiles.ts
|
|
9
9
|
const exclude = check('--exclude');
|
|
@@ -11,6 +11,6 @@ validate();
|
|
|
11
11
|
const cliOptions = {
|
|
12
12
|
verbose,
|
|
13
13
|
inspect,
|
|
14
|
-
|
|
14
|
+
debugRolldown,
|
|
15
15
|
bail,
|
|
16
16
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { runCommandLongRunning };
|
|
2
2
|
import { spawn } from 'child_process';
|
|
3
3
|
import stripAnsi from 'strip-ansi';
|
|
4
|
-
import { assert, runCommandShortLived, humanizeTime, isWindows, isLinux, isCallable } from '../utils.js';
|
|
4
|
+
import { assert, runCommandShortLived, humanizeTime, isWindows, isLinux, isCallable, isMac } from '../utils.js';
|
|
5
5
|
function runCommandLongRunning({ cmd, cwd, killPort, isReadyLog, isReadyTimeout, onStdout, onStderr, onExit, onTerminationError, terminationTimeout, tolerateExitCode, }) {
|
|
6
6
|
if (killPort)
|
|
7
7
|
killByPort(killPort);
|
|
@@ -220,7 +220,12 @@ async function killByPort(port) {
|
|
|
220
220
|
await runCommandShortLived(`fuser -k ${port}/tcp`, { swallowError: true, timeout: 10 * 1000 });
|
|
221
221
|
}
|
|
222
222
|
function isSuccessCode(code, tolerateExitCode) {
|
|
223
|
-
if (code === 0 ||
|
|
223
|
+
if (code === 0 ||
|
|
224
|
+
code === null ||
|
|
225
|
+
// Exit code can be `1` on Windows on nominal exit — I don't know why
|
|
226
|
+
(code === 1 && isWindows()) ||
|
|
227
|
+
// Exit code can be `143` on MacOS on nominal exit — I don't know why
|
|
228
|
+
(code === 143 && isMac())) {
|
|
224
229
|
return true;
|
|
225
230
|
}
|
|
226
231
|
if (tolerateExitCode?.includes(code)) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@brillout/test-e2e",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.24",
|
|
4
4
|
"bin": "./bin.js",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -8,17 +8,17 @@
|
|
|
8
8
|
"@brillout/part-regex": "^0.1.4",
|
|
9
9
|
"@brillout/picocolors": "^1.0.9",
|
|
10
10
|
"chai": "^4.3.6",
|
|
11
|
-
"esbuild": "^0.23.0",
|
|
12
11
|
"fast-glob": "^3.2.12",
|
|
13
12
|
"pixelmatch": "^5.3.0",
|
|
14
13
|
"playwright-chromium": "^1.22.2",
|
|
15
14
|
"pngjs": "^6.0.0",
|
|
15
|
+
"rolldown": "^1.0.0",
|
|
16
16
|
"source-map-support": "^0.5.21",
|
|
17
17
|
"strip-ansi": "^6.0.1"
|
|
18
18
|
},
|
|
19
19
|
"devDependencies": {
|
|
20
20
|
"@biomejs/biome": "^1.5.3",
|
|
21
|
-
"@brillout/release-me": "^0.4.
|
|
21
|
+
"@brillout/release-me": "^0.4.18",
|
|
22
22
|
"@types/chai": "^4.3.3",
|
|
23
23
|
"@types/node": "^15.6.1",
|
|
24
24
|
"@types/pixelmatch": "^5.2.4",
|