Comparing version 3.0.0-alpha.11 to 3.0.0-alpha.12
@@ -7,2 +7,6 @@ # Changelog | ||
- Use latest metacom 3.0.0-alpha.9 | ||
## [3.0.0-alpha.11][] - 2023-03-14 | ||
- Add `node:` prefix in require for built-in modules | ||
@@ -328,3 +332,4 @@ - Use latest metacom 3.0.0-alpha.8 and update typings | ||
[unreleased]: https://github.com/metarhia/impress/compare/v3.0.0-alpha.11...HEAD | ||
[unreleased]: https://github.com/metarhia/impress/compare/v3.0.0-alpha.12...HEAD | ||
[3.0.0-alpha.12]: https://github.com/metarhia/impress/compare/v3.0.0-alpha.11...v3.0.0-alpha.12 | ||
[3.0.0-alpha.11]: https://github.com/metarhia/impress/compare/v3.0.0-alpha.10...v3.0.0-alpha.11 | ||
@@ -331,0 +336,0 @@ [3.0.0-alpha.10]: https://github.com/metarhia/impress/compare/v3.0.0-alpha.9...v3.0.0-alpha.10 |
@@ -225,6 +225,3 @@ 'use strict'; | ||
serveStatic(channel) { | ||
const { req, res } = channel; | ||
if (res.writableEnded) return; | ||
const { url } = req; | ||
serveStatic(url, transport) { | ||
const [urlPath, params] = metautil.split(url, '?'); | ||
@@ -236,3 +233,3 @@ const folder = urlPath.endsWith('/'); | ||
if (data) { | ||
channel.write(data, 200, fileExt); | ||
transport.write(data, 200, fileExt); | ||
return; | ||
@@ -242,6 +239,6 @@ } | ||
const query = params ? '?' + params : ''; | ||
channel.redirect(urlPath + '/' + query); | ||
transport.redirect(urlPath + '/' + query); | ||
return; | ||
} | ||
channel.error(404); | ||
transport.error(404); | ||
} | ||
@@ -248,0 +245,0 @@ } |
@@ -9,10 +9,11 @@ 'use strict'; | ||
const system = ['util', 'buffer', 'child_process', 'os', 'v8', 'vm']; | ||
const tools = ['path', 'url', 'string_decoder', 'querystring', 'assert']; | ||
const sys = ['util', 'buffer', 'child_process', 'os', 'v8', 'vm']; | ||
const tools = ['path', 'url', 'string_decoder', 'querystring']; | ||
const test = ['assert', 'test']; | ||
const streams = ['stream', 'fs', 'crypto', 'zlib', 'readline']; | ||
const async = ['perf_hooks', 'async_hooks', 'timers', 'events']; | ||
const network = ['dns', 'net', 'tls', 'http', 'https', 'http2', 'dgram']; | ||
const internals = [...system, ...tools, ...streams, ...async, ...network]; | ||
const net = ['dns', 'net', 'tls', 'http', 'https', 'http2', 'dgram']; | ||
const internals = [...sys, ...tools, ...streams, ...async, ...net, ...test]; | ||
const optional = ['metasql']; | ||
const optional = ['metasql', 'test']; | ||
const metapkg = ['metautil', 'metacom', 'metaschema', ...optional]; | ||
@@ -45,3 +46,3 @@ | ||
try { | ||
lib = require(name); | ||
lib = internals.includes(name) ? require(`node:${name}`) : require(name); | ||
} catch { | ||
@@ -48,0 +49,0 @@ if (npmpkg.includes(name) || !optional.includes(name)) { |
@@ -66,3 +66,3 @@ 'use strict'; | ||
const options = { ...config.server, port, kind }; | ||
application.server = new Server(options, application); | ||
application.server = new Server(application, options); | ||
} | ||
@@ -69,0 +69,0 @@ |
{ | ||
"name": "impress", | ||
"version": "3.0.0-alpha.11", | ||
"version": "3.0.0-alpha.12", | ||
"author": "Timur Shemsedinov <timur.shemsedinov@gmail.com>", | ||
@@ -62,3 +62,3 @@ "description": "Enterprise application server for Node.js", | ||
"engines": { | ||
"node": "^14.18 || 16 || 18 || 19" | ||
"node": "^14.18 || 16 || 18 || 19 || 20" | ||
}, | ||
@@ -65,0 +65,0 @@ "dependencies": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
74226
1608
5