Skip to content

Commit 7bceb70

Browse files
committed
Update node resolve rules
- Add missing modules - Branch master -> main - Resolve `node:` prefixed modules
1 parent 259e3dd commit 7bceb70

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

hyper_click/generic_path_resolver.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
'constants',
1414
'crypto',
1515
'dgram',
16+
'diagnostics_channel',
1617
'dns',
1718
'dns/promises',
1819
'domain',
@@ -22,6 +23,7 @@
2223
'http',
2324
'http2',
2425
'https',
26+
'inspector',
2527
'module',
2628
'net',
2729
'os',
@@ -34,8 +36,10 @@
3436
'repl',
3537
'stream',
3638
'stream/promises',
39+
'stream/web',
3740
'string_decoder',
3841
'sys',
42+
'test',
3943
'timers',
4044
'timers/promises',
4145
'tls',
@@ -49,7 +53,7 @@
4953
'worker_threads',
5054
'zlib',
5155
}
52-
NODE_CORE_MODULES_TEMPLATE = "https://github.com/nodejs/node/blob/master/lib/{}.js"
56+
NODE_CORE_MODULES_TEMPLATE = "https://github.com/nodejs/node/blob/main/lib/{}.js"
5357

5458
SASS_CORE_MODULES = {
5559
'sass:color',
@@ -141,6 +145,8 @@ def resolve(self):
141145
# Core modules
142146
if self.str_path in NODE_CORE_MODULES:
143147
return NODE_CORE_MODULES_TEMPLATE.format(self.str_path)
148+
if self.str_path.startswith('node:'):
149+
return NODE_CORE_MODULES_TEMPLATE.format(self.str_path[5:])
144150

145151
if self.scope_is_sass:
146152
# Core modules

0 commit comments

Comments
 (0)