feat: refactoring project

This commit is contained in:
Carlos
2024-11-23 14:56:07 -05:00
parent f0c2a50c18
commit 1c6db5818d
2351 changed files with 39323 additions and 60326 deletions

View File

@@ -5,6 +5,16 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [v2.15.1](https://github.com/inspect-js/is-core-module/compare/v2.15.0...v2.15.1) - 2024-08-21
### Commits
- [Tests] add `process.getBuiltinModule` tests [`28c7791`](https://github.com/inspect-js/is-core-module/commit/28c7791c196d58c64cfdf638b7e68ed1b62a4da0)
- [Fix] `test/mock_loader` is no longer exposed as of v22.7 [`68b08b0`](https://github.com/inspect-js/is-core-module/commit/68b08b0d7963447dbffa5142e8810dca550383af)
- [Tests] replace `aud` with `npm audit` [`32f8060`](https://github.com/inspect-js/is-core-module/commit/32f806026dac14f9016be4401a643851240c76b9)
- [Dev Deps] update `mock-property` [`f7d3c8f`](https://github.com/inspect-js/is-core-module/commit/f7d3c8f01e922be49621683eb41477c4f50522e1)
- [Dev Deps] add missing peer dep [`eaee885`](https://github.com/inspect-js/is-core-module/commit/eaee885b67238819e9c8ed5bd2098766e1d05331)
## [v2.15.0](https://github.com/inspect-js/is-core-module/compare/v2.14.0...v2.15.0) - 2024-07-17
### Commits

View File

@@ -117,8 +117,8 @@
"node:sys": [">= 14.18 && < 15", ">= 16"],
"test/reporters": ">= 19.9 && < 20.2",
"node:test/reporters": [">= 18.17 && < 19", ">= 19.9", ">= 20"],
"test/mock_loader": ">= 22.3",
"node:test/mock_loader": ">= 22.3",
"test/mock_loader": ">= 22.3 && < 22.7",
"node:test/mock_loader": ">= 22.3 && < 22.7",
"node:test": [">= 16.17 && < 17", ">= 18"],
"timers": true,
"node:timers": [">= 14.18 && < 15", ">= 16"],

View File

@@ -1,6 +1,6 @@
{
"name": "is-core-module",
"version": "2.15.0",
"version": "2.15.1",
"description": "Is this specifier a node.js core module?",
"main": "index.js",
"sideEffects": false,
@@ -16,7 +16,7 @@
"pretest": "npm run lint",
"tests-only": "nyc tape 'test/**/*.js'",
"test": "npm run tests-only",
"posttest": "aud --production",
"posttest": "npx npm@'>=10.2' audit --production",
"version": "auto-changelog && git add CHANGELOG.md",
"postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\""
},
@@ -46,11 +46,11 @@
},
"devDependencies": {
"@ljharb/eslint-config": "^21.1.1",
"aud": "^2.0.4",
"auto-changelog": "^2.4.0",
"encoding": "^0.1.13",
"eslint": "=8.8.0",
"in-publish": "^2.0.1",
"mock-property": "^1.0.3",
"mock-property": "^1.1.0",
"npmignore": "^0.3.1",
"nyc": "^10.3.2",
"safe-publish-latest": "^2.0.0",

View File

@@ -72,7 +72,8 @@ test('core modules', function (t) {
});
t.test('core via builtinModules list', { skip: !data.module }, function (st) {
var libs = require('module').builtinModules;
var Module = require('module');
var libs = Module.builtinModules;
if (!libs) {
st.skip('module.builtinModules does not exist');
} else {
@@ -96,10 +97,24 @@ test('core modules', function (t) {
var mod = libs[i];
if (excludeList.indexOf(mod) === -1) {
st.ok(data[mod], mod + ' is a core module');
if (Module.isBuiltin) {
st.ok(Module.isBuiltin(mod), 'module.isBuiltin(' + mod + ') is true');
}
st.doesNotThrow(
function () { require(mod); }, // eslint-disable-line no-loop-func
'requiring ' + mod + ' does not throw'
);
if (process.getBuiltinModule) {
st.equal(
process.getBuiltinModule(mod),
require(mod),
'process.getBuiltinModule(' + mod + ') === require(' + mod + ')'
);
}
if (mod.slice(0, 5) !== 'node:') {
if (supportsNodePrefix) {
st.doesNotThrow(
@@ -116,6 +131,7 @@ test('core modules', function (t) {
}
}
}
st.end();
});