File tree 10 files changed +43
-7
lines changed
10 files changed +43
-7
lines changed Original file line number Diff line number Diff line change 765
765
default = None ,
766
766
help = 'build nghttp2 with DEBUGBUILD (default is false)' )
767
767
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
+
768
774
parser .add_argument ('--without-npm' ,
769
775
action = 'store_true' ,
770
776
dest = 'without_npm' ,
@@ -1381,6 +1387,7 @@ def configure_node(o):
1381
1387
o ['variables' ]['node_prefix' ] = options .prefix
1382
1388
o ['variables' ]['node_install_npm' ] = b (not options .without_npm )
1383
1389
o ['variables' ]['node_install_corepack' ] = b (not options .without_corepack )
1390
+ o ['variables' ]['node_use_amaro' ] = b (not options .without_amaro )
1384
1391
o ['variables' ]['debug_node' ] = b (options .debug_node )
1385
1392
o ['default_configuration' ] = 'Debug' if options .debug else 'Release'
1386
1393
o ['variables' ]['error_on_warn' ] = b (options .error_on_warn )
Original file line number Diff line number Diff line change 14
14
'force_dynamic_crt%' : 0 ,
15
15
'ossfuzz' : 'false' ,
16
16
'node_module_version%' : '' ,
17
+ 'node_use_amaro%' : 'true' ,
17
18
'node_shared_brotli%' : 'false' ,
18
19
'node_shared_zlib%' : 'false' ,
19
20
'node_shared_http_parser%' : 'false' ,
56
57
'deps/acorn/acorn/dist/acorn.js' ,
57
58
'deps/acorn/acorn-walk/dist/walk.js' ,
58
59
'deps/minimatch/index.js' ,
59
- 'deps/amaro/dist/index.js' ,
60
60
'<@(node_builtin_shareable_builtins)' ,
61
61
],
62
62
'node_sources' : [
461
461
}, {
462
462
'use_openssl_def%' : 0 ,
463
463
}],
464
+ [ 'node_use_amaro=="true"' , {
465
+ 'deps_files' : [
466
+ 'deps/amaro/dist/index.js' ,
467
+ ]
468
+ } ]
464
469
],
465
470
},
466
471
Original file line number Diff line number Diff line change 412
412
}, {
413
413
'defines' : [ 'HAVE_OPENSSL=0' ]
414
414
}],
415
+ [ 'node_use_amaro=="true"' , {
416
+ 'defines' : [ 'HAVE_AMARO=1' ],
417
+ }, {
418
+ 'defines' : [ 'HAVE_AMARO=0' ]
419
+ }],
415
420
],
416
421
}
Original file line number Diff line number Diff line change @@ -126,7 +126,10 @@ Metadata::Versions::Versions() {
126
126
acorn = ACORN_VERSION;
127
127
cjs_module_lexer = CJS_MODULE_LEXER_VERSION;
128
128
uvwasi = UVWASI_VERSION_STRING;
129
+
130
+ #if HAVE_AMARO
129
131
amaro = AMARO_VERSION;
132
+ #endif
130
133
131
134
#if HAVE_OPENSSL
132
135
openssl = GetOpenSSLVersion ();
Original file line number Diff line number Diff line change @@ -27,6 +27,12 @@ namespace node {
27
27
#define NODE_HAS_RELEASE_URLS
28
28
#endif
29
29
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
+
30
36
#ifndef NODE_SHARED_BUILTIN_UNDICI_UNDICI_PATH
31
37
#define NODE_VERSIONS_KEY_UNDICI (V ) V(undici)
32
38
#else
@@ -51,7 +57,7 @@ namespace node {
51
57
V (sqlite) \
52
58
V (ada) \
53
59
V (nbytes) \
54
- V (amaro) \
60
+ NODE_VERSIONS_KEY_AMARO (V) \
55
61
NODE_VERSIONS_KEY_UNDICI (V) \
56
62
V (cjs_module_lexer)
57
63
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' ;
2
2
import * as fixtures from '../common/fixtures.mjs' ;
3
3
import { match , strictEqual } from 'node:assert' ;
4
4
import { test } from 'node:test' ;
5
5
6
+ if ( ! process . config . variables . node_use_amaro ) skip ( 'Requires Amaro' ) ;
7
+
6
8
test ( 'require a .ts file with explicit extension succeeds' , async ( ) => {
7
9
const result = await spawnPromisified ( process . execPath , [
8
10
'--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' ;
2
2
import { match , strictEqual } from 'node:assert' ;
3
3
import { test } from 'node:test' ;
4
4
5
+ if ( ! process . config . variables . node_use_amaro ) skip ( 'Requires Amaro' ) ;
6
+
5
7
test ( 'eval TypeScript ESM syntax' , async ( ) => {
6
8
const result = await spawnPromisified ( process . execPath , [
7
9
'--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' ;
2
2
import * as fixtures from '../common/fixtures.mjs' ;
3
3
import { match , strictEqual } from 'node:assert' ;
4
4
import { test } from 'node:test' ;
5
5
6
+ if ( ! process . config . variables . node_use_amaro ) skip ( 'Requires Amaro' ) ;
7
+
6
8
test ( 'expect failure of a .mts file with CommonJS syntax' , async ( ) => {
7
9
const result = await spawnPromisified ( process . execPath , [
8
10
'--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' ;
2
2
import * as fixtures from '../common/fixtures.mjs' ;
3
3
import { match , strictEqual } from 'node:assert' ;
4
4
import { test } from 'node:test' ;
5
5
6
+ if ( ! process . config . variables . node_use_amaro ) skip ( 'Requires Amaro' ) ;
7
+
6
8
test ( 'execute a TypeScript file' , async ( ) => {
7
9
const result = await spawnPromisified ( process . execPath , [
8
10
'--experimental-strip-types' ,
Original file line number Diff line number Diff line change @@ -24,11 +24,13 @@ const expected_keys = [
24
24
'ada' ,
25
25
'cjs_module_lexer' ,
26
26
'nbytes' ,
27
- 'amaro' ,
28
27
] ;
29
28
30
29
const hasUndici = process . config . variables . node_builtin_shareable_builtins . includes ( 'deps/undici/undici.js' ) ;
31
30
31
+ if ( process . config . variables . node_use_amaro ) {
32
+ expected_keys . push ( 'amaro' ) ;
33
+ }
32
34
if ( hasUndici ) {
33
35
expected_keys . push ( 'undici' ) ;
34
36
}
You can’t perform that action at this time.
0 commit comments