From c5da92e0ca25fed890cef9b858f00c65810c87e1 Mon Sep 17 00:00:00 2001 From: Marco Ippolito Date: Fri, 9 Aug 2024 12:34:09 +0200 Subject: [PATCH] module: add --experimental-enable-transformation for strip-types --- doc/api/cli.md | 10 +++ doc/node.1 | 3 + lib/internal/main/eval_string.js | 4 +- lib/internal/modules/cjs/loader.js | 16 ++-- lib/internal/modules/esm/get_format.js | 6 +- lib/internal/modules/esm/translators.js | 8 +- lib/internal/modules/helpers.js | 39 ++++++++-- src/node_options.cc | 6 ++ src/node_options.h | 1 + test/es-module/test-typescript-transform.mjs | 73 +++++++++++++++++++ .../transformation/test-complex-stacktrace.ts | 67 +++++++++++++++++ .../ts/transformation/test-enum-stacktrace.ts | 4 + .../typescript/ts/transformation/test-enum.ts | 4 + 13 files changed, 217 insertions(+), 24 deletions(-) create mode 100644 test/es-module/test-typescript-transform.mjs create mode 100644 test/fixtures/typescript/ts/transformation/test-complex-stacktrace.ts create mode 100644 test/fixtures/typescript/ts/transformation/test-enum-stacktrace.ts create mode 100644 test/fixtures/typescript/ts/transformation/test-enum.ts diff --git a/doc/api/cli.md b/doc/api/cli.md index c0dfcd418b96a18..846b2bd6f12d999 100644 --- a/doc/api/cli.md +++ b/doc/api/cli.md @@ -933,6 +933,15 @@ files with no extension will be treated as WebAssembly if they begin with the WebAssembly magic number (`\0asm`); otherwise they will be treated as ES module JavaScript. +### `--experimental-enable-transformation` + + + +Enables the transformation of TypeScript only features. +Impiles `--experimental-strip-types`. + ### `--experimental-eventsource`