From 7bceb7007f2dfbcd85efd367188edce1617d7ae7 Mon Sep 17 00:00:00 2001 From: Cristian Lorsson Date: Thu, 23 Mar 2023 18:55:47 -0300 Subject: [PATCH] Update node resolve rules - Add missing modules - Branch master -> main - Resolve `node:` prefixed modules --- hyper_click/generic_path_resolver.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/hyper_click/generic_path_resolver.py b/hyper_click/generic_path_resolver.py index 37a0bb8..0b05af5 100644 --- a/hyper_click/generic_path_resolver.py +++ b/hyper_click/generic_path_resolver.py @@ -13,6 +13,7 @@ 'constants', 'crypto', 'dgram', + 'diagnostics_channel', 'dns', 'dns/promises', 'domain', @@ -22,6 +23,7 @@ 'http', 'http2', 'https', + 'inspector', 'module', 'net', 'os', @@ -34,8 +36,10 @@ 'repl', 'stream', 'stream/promises', + 'stream/web', 'string_decoder', 'sys', + 'test', 'timers', 'timers/promises', 'tls', @@ -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', @@ -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