Skip to content

Commit

Permalink
Update node resolve rules
Browse files Browse the repository at this point in the history
- Add missing modules
- Branch master -> main
- Resolve `node:` prefixed modules
  • Loading branch information
cristianl committed Mar 23, 2023
1 parent 259e3dd commit 7bceb70
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion hyper_click/generic_path_resolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
'constants',
'crypto',
'dgram',
'diagnostics_channel',
'dns',
'dns/promises',
'domain',
Expand All @@ -22,6 +23,7 @@
'http',
'http2',
'https',
'inspector',
'module',
'net',
'os',
Expand All @@ -34,8 +36,10 @@
'repl',
'stream',
'stream/promises',
'stream/web',
'string_decoder',
'sys',
'test',
'timers',
'timers/promises',
'tls',
Expand All @@ -49,7 +53,7 @@
'worker_threads',
'zlib',
}
NODE_CORE_MODULES_TEMPLATE = "https://github.com/nodejs/node/blob/master/lib/{}.js"
NODE_CORE_MODULES_TEMPLATE = "https://github.com/nodejs/node/blob/main/lib/{}.js"

SASS_CORE_MODULES = {
'sass:color',
Expand Down Expand Up @@ -141,6 +145,8 @@ def resolve(self):
# Core modules
if self.str_path in NODE_CORE_MODULES:
return NODE_CORE_MODULES_TEMPLATE.format(self.str_path)
if self.str_path.startswith('node:'):
return NODE_CORE_MODULES_TEMPLATE.format(self.str_path[5:])

if self.scope_is_sass:
# Core modules
Expand Down

0 comments on commit 7bceb70

Please sign in to comment.