File tree Expand file tree Collapse file tree 10 files changed +43
-7
lines changed Expand file tree Collapse file tree 10 files changed +43
-7
lines changed Original file line number Diff line number Diff line change 765765 default = None ,
766766 help = 'build nghttp2 with DEBUGBUILD (default is false)' )
767767
768+ parser .add_argument ('--without-amaro' ,
769+ action = 'store_true' ,
770+ dest = 'without_amaro' ,
771+ default = None ,
772+ help = 'do not install the bundled Amaro (TypeScript utils)' )
773+
768774parser .add_argument ('--without-npm' ,
769775 action = 'store_true' ,
770776 dest = 'without_npm' ,
@@ -1381,6 +1387,7 @@ def configure_node(o):
13811387 o ['variables' ]['node_prefix' ] = options .prefix
13821388 o ['variables' ]['node_install_npm' ] = b (not options .without_npm )
13831389 o ['variables' ]['node_install_corepack' ] = b (not options .without_corepack )
1390+ o ['variables' ]['node_use_amaro' ] = b (not options .without_amaro )
13841391 o ['variables' ]['debug_node' ] = b (options .debug_node )
13851392 o ['default_configuration' ] = 'Debug' if options .debug else 'Release'
13861393 o ['variables' ]['error_on_warn' ] = b (options .error_on_warn )
Original file line number Diff line number Diff line change 1414 'force_dynamic_crt%' : 0 ,
1515 'ossfuzz' : 'false' ,
1616 'node_module_version%' : '' ,
17+ 'node_use_amaro%' : 'true' ,
1718 'node_shared_brotli%' : 'false' ,
1819 'node_shared_zlib%' : 'false' ,
1920 'node_shared_http_parser%' : 'false' ,
5657 'deps/acorn/acorn/dist/acorn.js' ,
5758 'deps/acorn/acorn-walk/dist/walk.js' ,
5859 'deps/minimatch/index.js' ,
59- 'deps/amaro/dist/index.js' ,
6060 '<@(node_builtin_shareable_builtins)' ,
6161 ],
6262 'node_sources' : [
461461 }, {
462462 'use_openssl_def%' : 0 ,
463463 }],
464+ [ 'node_use_amaro=="true"' , {
465+ 'deps_files' : [
466+ 'deps/amaro/dist/index.js' ,
467+ ]
468+ } ]
464469 ],
465470 },
466471
Original file line number Diff line number Diff line change 412412 }, {
413413 'defines' : [ 'HAVE_OPENSSL=0' ]
414414 }],
415+ [ 'node_use_amaro=="true"' , {
416+ 'defines' : [ 'HAVE_AMARO=1' ],
417+ }, {
418+ 'defines' : [ 'HAVE_AMARO=0' ]
419+ }],
415420 ],
416421}
Original file line number Diff line number Diff line change @@ -126,7 +126,10 @@ Metadata::Versions::Versions() {
126126 acorn = ACORN_VERSION;
127127 cjs_module_lexer = CJS_MODULE_LEXER_VERSION;
128128 uvwasi = UVWASI_VERSION_STRING;
129+
130+ #if HAVE_AMARO
129131 amaro = AMARO_VERSION;
132+ #endif
130133
131134#if HAVE_OPENSSL
132135 openssl = GetOpenSSLVersion ();
Original file line number Diff line number Diff line change @@ -27,6 +27,12 @@ namespace node {
2727#define NODE_HAS_RELEASE_URLS
2828#endif
2929
30+ #if HAVE_AMARO
31+ #define NODE_VERSIONS_KEY_AMARO (V ) V(amaro)
32+ #else
33+ #define NODE_VERSIONS_KEY_AMARO (V )
34+ #endif
35+
3036#ifndef NODE_SHARED_BUILTIN_UNDICI_UNDICI_PATH
3137#define NODE_VERSIONS_KEY_UNDICI (V ) V(undici)
3238#else
@@ -51,7 +57,7 @@ namespace node {
5157 V (sqlite) \
5258 V (ada) \
5359 V (nbytes) \
54- V (amaro) \
60+ NODE_VERSIONS_KEY_AMARO (V) \
5561 NODE_VERSIONS_KEY_UNDICI (V) \
5662 V (cjs_module_lexer)
5763
Original file line number Diff line number Diff line change 1- import { spawnPromisified } from '../common/index.mjs' ;
1+ import { skip , spawnPromisified } from '../common/index.mjs' ;
22import * as fixtures from '../common/fixtures.mjs' ;
33import { match , strictEqual } from 'node:assert' ;
44import { test } from 'node:test' ;
55
6+ if ( ! process . config . variables . node_use_amaro ) skip ( 'Requires Amaro' ) ;
7+
68test ( 'require a .ts file with explicit extension succeeds' , async ( ) => {
79 const result = await spawnPromisified ( process . execPath , [
810 '--experimental-strip-types' ,
Original file line number Diff line number Diff line change 1- import { spawnPromisified } from '../common/index.mjs' ;
1+ import { skip , spawnPromisified } from '../common/index.mjs' ;
22import { match , strictEqual } from 'node:assert' ;
33import { test } from 'node:test' ;
44
5+ if ( ! process . config . variables . node_use_amaro ) skip ( 'Requires Amaro' ) ;
6+
57test ( 'eval TypeScript ESM syntax' , async ( ) => {
68 const result = await spawnPromisified ( process . execPath , [
79 '--experimental-strip-types' ,
Original file line number Diff line number Diff line change 1- import { spawnPromisified } from '../common/index.mjs' ;
1+ import { skip , spawnPromisified } from '../common/index.mjs' ;
22import * as fixtures from '../common/fixtures.mjs' ;
33import { match , strictEqual } from 'node:assert' ;
44import { test } from 'node:test' ;
55
6+ if ( ! process . config . variables . node_use_amaro ) skip ( 'Requires Amaro' ) ;
7+
68test ( 'expect failure of a .mts file with CommonJS syntax' , async ( ) => {
79 const result = await spawnPromisified ( process . execPath , [
810 '--experimental-strip-types' ,
Original file line number Diff line number Diff line change 1- import { spawnPromisified } from '../common/index.mjs' ;
1+ import { skip , spawnPromisified } from '../common/index.mjs' ;
22import * as fixtures from '../common/fixtures.mjs' ;
33import { match , strictEqual } from 'node:assert' ;
44import { test } from 'node:test' ;
55
6+ if ( ! process . config . variables . node_use_amaro ) skip ( 'Requires Amaro' ) ;
7+
68test ( 'execute a TypeScript file' , async ( ) => {
79 const result = await spawnPromisified ( process . execPath , [
810 '--experimental-strip-types' ,
Original file line number Diff line number Diff line change @@ -24,11 +24,13 @@ const expected_keys = [
2424 'ada' ,
2525 'cjs_module_lexer' ,
2626 'nbytes' ,
27- 'amaro' ,
2827] ;
2928
3029const hasUndici = process . config . variables . node_builtin_shareable_builtins . includes ( 'deps/undici/undici.js' ) ;
3130
31+ if ( process . config . variables . node_use_amaro ) {
32+ expected_keys . push ( 'amaro' ) ;
33+ }
3234if ( hasUndici ) {
3335 expected_keys . push ( 'undici' ) ;
3436}
You can’t perform that action at this time.
0 commit comments