Skip to content

Commit f657808

Browse files
chore: use github runners
1 parent 8d09a3a commit f657808

File tree

4 files changed

+16
-20
lines changed

4 files changed

+16
-20
lines changed

.github/workflows/node.js.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ on:
1111

1212
jobs:
1313
build:
14-
runs-on: self-hosted-arc
14+
runs-on: ubuntu-latest
1515

1616
strategy:
1717
matrix:

.github/workflows/publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ permissions:
1515
jobs:
1616
publish:
1717
name: Publishing to NPM
18-
runs-on: self-hosted-arc
18+
runs-on: ubuntu-latest
1919
steps:
2020
- name: Checkout
2121
uses: actions/checkout@v4

.github/workflows/standalone-e2e.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66

77
jobs:
88
integration-test:
9-
runs-on: self-hosted-arc
9+
runs-on: ubuntu-latest
1010
strategy:
1111
matrix:
1212
node-version: [20.18.1]

src/utils/typescript.ts

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import * as logger from "./logger";
44

55
const TESTPLANE_TRANSFORM_HOOK = Symbol.for("testplane.transform.hook");
66

7-
const TRANSFORM_EXTENSIONS = [".js", ".jsx", ".ts", ".tsx", ".mjs", ".cjs", ".mts", ".cts"];
7+
const TRANSFORM_CODE_EXTENSIONS = [".js", ".jsx", ".ts", ".tsx", ".mjs", ".cjs", ".mts", ".cts"];
88
const ASSET_EXTENSIONS = [
99
".css",
1010
".scss",
@@ -94,16 +94,19 @@ export const registerTransformHook = (isSilent: boolean = false): void => {
9494
}
9595

9696
try {
97+
const mkTransformCodeHook =
98+
(sourceMaps = false): Parameters<typeof addHook>[0] =>
99+
(code, sourceFile) =>
100+
transformCode(code, { sourceFile, sourceMaps, isSilent });
101+
102+
const transformCodeOptions: Parameters<typeof addHook>[1] = {
103+
exts: TRANSFORM_CODE_EXTENSIONS,
104+
ignoreNodeModules: true,
105+
};
106+
97107
let areSourceMapsEnabled = false;
98108

99-
let revertTransformHook = addHook(
100-
(code, filename) => transformCode(code, { sourceFile: filename, sourceMaps: false, isSilent }),
101-
{
102-
exts: TRANSFORM_EXTENSIONS,
103-
matcher: filename => !filename.includes("node_modules"),
104-
ignoreNodeModules: false,
105-
},
106-
);
109+
let revertTransformHook = addHook(mkTransformCodeHook(), transformCodeOptions);
107110

108111
const revertAssetHook = addHook(() => "module.exports = {};", {
109112
exts: ASSET_EXTENSIONS,
@@ -119,14 +122,7 @@ export const registerTransformHook = (isSilent: boolean = false): void => {
119122

120123
revertTransformHook();
121124

122-
revertTransformHook = addHook(
123-
(code, filename) => transformCode(code, { sourceFile: filename, sourceMaps: true, isSilent }),
124-
{
125-
exts: TRANSFORM_EXTENSIONS,
126-
matcher: filename => !filename.includes("node_modules"),
127-
ignoreNodeModules: false,
128-
},
129-
);
125+
revertTransformHook = addHook(mkTransformCodeHook(true), transformCodeOptions);
130126
};
131127

132128
const revertAll = (): void => {

0 commit comments

Comments
 (0)