first commit
This commit is contained in:
20
node_modules/is-bun-module/LICENSE
generated
vendored
Normal file
20
node_modules/is-bun-module/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2024 SunsetTechuila
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
||||
the Software, and to permit persons to whom the Software is furnished to do so,
|
||||
subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
79
node_modules/is-bun-module/README.md
generated
vendored
Normal file
79
node_modules/is-bun-module/README.md
generated
vendored
Normal file
@@ -0,0 +1,79 @@
|
||||
# is-bun-module
|
||||
|
||||
A utility library to check if a module is a Bun built-in module or a Node.js module implemented in Bun.
|
||||
|
||||
## API
|
||||
|
||||
### Module Checking Functions
|
||||
|
||||
#### `isBunModule(moduleName, bunVersion?)`
|
||||
|
||||
Checks if a specifier is a [Bun module](https://bun.sh/docs/runtime/bun-apis).
|
||||
|
||||
```typescript
|
||||
import { isBunModule } from "is-bun-module";
|
||||
isBunModule("bun"); // true
|
||||
isBunModule("bun:test", "1.0.0"); // true
|
||||
isBunModule("notBunModule"); // false
|
||||
```
|
||||
|
||||
#### `isBunImplementedNodeModule(moduleName, bunVersion?)`
|
||||
|
||||
Checks if a specifier is a Node module [implemented in Bun](https://bun.sh/docs/runtime/nodejs-apis).
|
||||
|
||||
```typescript
|
||||
import { isBunImplementedNodeModule } from "is-bun-module";
|
||||
isBunImplementedNodeModule("fs"); // true
|
||||
isBunImplementedNodeModule("node:fs"); // true
|
||||
isBunImplementedNodeModule("node:notNodeModule"); // false
|
||||
isBunImplementedNodeModule("node:http2", "1.0.0"); // false, added in 1.0.13
|
||||
```
|
||||
|
||||
#### `isBunBuiltin(moduleName, bunVersion?)`
|
||||
|
||||
Checks if a specifier is either a Bun module or a Node.js module implemented in Bun.
|
||||
|
||||
```typescript
|
||||
import { isBunBuiltin } from "is-bun-module";
|
||||
isBunBuiltin("bun"); // true
|
||||
isBunBuiltin("fs"); // true
|
||||
isBunBuiltin("notBunModule"); // false
|
||||
```
|
||||
|
||||
### Module Listing Functions
|
||||
|
||||
#### `getBunModules(bunVersion?)`
|
||||
|
||||
Returns an array of all Bun modules available in the specified version.
|
||||
|
||||
```typescript
|
||||
import { getBunModules } from "is-bun-module";
|
||||
getBunModules(); // ["bun", "bun:ffi", ...]
|
||||
getBunModules("1.0.0"); // Returns modules available in version 1.0.0
|
||||
```
|
||||
|
||||
#### `getBunImplementedNodeModules(bunVersion?)`
|
||||
|
||||
Returns an array of all Node.js modules implemented in Bun for the specified version.
|
||||
|
||||
```typescript
|
||||
import { getBunImplementedNodeModules } from "is-bun-module";
|
||||
getBunImplementedNodeModules(); // ["fs", "path", ...]
|
||||
getBunImplementedNodeModules("1.0.0"); // Returns implemented Node.js modules in version 1.0.0
|
||||
```
|
||||
|
||||
#### `getBunBuiltinModules(bunVersion?)`
|
||||
|
||||
Returns an array of all builtin modules (both Bun modules and implemented Node.js modules).
|
||||
|
||||
```typescript
|
||||
import { getBunBuiltinModules } from "is-bun-module";
|
||||
getBunBuiltinModules(); // ["bun", "bun:ffi", "fs", "path", ...]
|
||||
```
|
||||
|
||||
## Notes
|
||||
|
||||
- **Only Bun v1.0.0+ is supported**
|
||||
- You can also pass `latest` as Bun version
|
||||
- Inspired by [is-core-module](https://github.com/inspect-js/is-core-module) and made for [eslint-import-resolver-typescript](https://github.com/import-js/eslint-import-resolver-typescript)
|
||||
- Runtime-independent
|
||||
38
node_modules/is-bun-module/dist/bun.mjs
generated
vendored
Normal file
38
node_modules/is-bun-module/dist/bun.mjs
generated
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
// src/bun.ts
|
||||
import { builtinModules } from "node:module";
|
||||
import { checkModule, getModules, bundledBunModules, implementedNodeModules } from "./shared";
|
||||
import { MINIMUM_BUN_VERSION } from "./shared";
|
||||
var currentBunVersion = Bun.version;
|
||||
var bunModules = { ...bundledBunModules };
|
||||
for (const moduleName of builtinModules) {
|
||||
if (moduleName.startsWith("bun:")) {
|
||||
bunModules[moduleName] ??= `>=${currentBunVersion}`;
|
||||
}
|
||||
}
|
||||
function isBunModule(moduleName, bunVersion) {
|
||||
return checkModule(moduleName, bunModules, bunVersion ?? currentBunVersion);
|
||||
}
|
||||
function isBunImplementedNodeModule(moduleName, bunVersion) {
|
||||
return checkModule(moduleName, implementedNodeModules, bunVersion ?? currentBunVersion);
|
||||
}
|
||||
function isBunBuiltin(moduleName, bunVersion) {
|
||||
return isBunModule(moduleName, bunVersion) || isBunImplementedNodeModule(moduleName, bunVersion);
|
||||
}
|
||||
function getBunModules(bunVersion) {
|
||||
return getModules(bunModules, bunVersion ?? currentBunVersion);
|
||||
}
|
||||
function getBunImplementedNodeModules(bunVersion) {
|
||||
return getModules(implementedNodeModules, bunVersion ?? currentBunVersion);
|
||||
}
|
||||
function getBunBuiltinModules(bunVersion) {
|
||||
return [...getBunModules(bunVersion), ...getBunImplementedNodeModules(bunVersion)];
|
||||
}
|
||||
export {
|
||||
MINIMUM_BUN_VERSION,
|
||||
getBunBuiltinModules,
|
||||
getBunImplementedNodeModules,
|
||||
getBunModules,
|
||||
isBunBuiltin,
|
||||
isBunImplementedNodeModule,
|
||||
isBunModule
|
||||
};
|
||||
44
node_modules/is-bun-module/dist/generic.d.ts
generated
vendored
Normal file
44
node_modules/is-bun-module/dist/generic.d.ts
generated
vendored
Normal file
@@ -0,0 +1,44 @@
|
||||
import { BunVersion } from './shared';
|
||||
export { BunVersion, MINIMUM_BUN_VERSION } from './shared';
|
||||
|
||||
/**
|
||||
* Checks if the given module name is a native Bun module.
|
||||
* @param moduleName - The name of the module to check
|
||||
* @param bunVersion - Optional. The Bun version to check against. Defaults to the current Bun version if available, otherwise "latest".
|
||||
* @returns `true` if the module is a Bun module, `false` otherwise
|
||||
*/
|
||||
declare function isBunModule(moduleName: string, bunVersion?: BunVersion): boolean;
|
||||
/**
|
||||
* Checks if the given module name is a Node.js module implemented in Bun.
|
||||
* @param moduleName - The name of the module to check
|
||||
* @param bunVersion - Optional. The Bun version to check against. Defaults to the current Bun version if available, otherwise "latest".
|
||||
* @returns `true` if the module is a Node.js module implemented in Bun, `false` otherwise
|
||||
*/
|
||||
declare function isBunImplementedNodeModule(moduleName: string, bunVersion?: BunVersion): boolean;
|
||||
/**
|
||||
* Checks if the given module name is a Bun builtin (either a Bun module or a Node.js module implemented in Bun).
|
||||
* @param moduleName - The name of the module to check
|
||||
* @param bunVersion - Optional. The Bun version to check against. Defaults to the current Bun version if available, otherwise "latest".
|
||||
* @returns `true` if the module is a Bun builtin, `false` otherwise
|
||||
*/
|
||||
declare function isBunBuiltin(moduleName: string, bunVersion?: BunVersion): boolean;
|
||||
/**
|
||||
* Gets a list of all native Bun modules.
|
||||
* @param bunVersion - Optional. The Bun version to check against. Defaults to the current Bun version if available, otherwise "latest".
|
||||
* @returns An array of module names
|
||||
*/
|
||||
declare function getBunModules(bunVersion?: BunVersion): string[];
|
||||
/**
|
||||
* Gets a list of all Node.js modules implemented in Bun.
|
||||
* @param bunVersion - Optional. The Bun version to check against. Defaults to the current Bun version if available, otherwise "latest".
|
||||
* @returns An array of module names
|
||||
*/
|
||||
declare function getBunImplementedNodeModules(bunVersion?: BunVersion): string[];
|
||||
/**
|
||||
* Gets a list of all Bun builtin modules (both Bun modules and Node.js modules implemented in Bun).
|
||||
* @param bunVersion - Optional. The Bun version to check against. Defaults to the current Bun version if available, otherwise "latest".
|
||||
* @returns An array of module names
|
||||
*/
|
||||
declare function getBunBuiltinModules(bunVersion?: BunVersion): string[];
|
||||
|
||||
export { getBunBuiltinModules, getBunImplementedNodeModules, getBunModules, isBunBuiltin, isBunImplementedNodeModule, isBunModule };
|
||||
61
node_modules/is-bun-module/dist/generic.js
generated
vendored
Normal file
61
node_modules/is-bun-module/dist/generic.js
generated
vendored
Normal file
@@ -0,0 +1,61 @@
|
||||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
|
||||
// src/generic.ts
|
||||
var generic_exports = {};
|
||||
__export(generic_exports, {
|
||||
MINIMUM_BUN_VERSION: () => import_shared2.MINIMUM_BUN_VERSION,
|
||||
getBunBuiltinModules: () => getBunBuiltinModules,
|
||||
getBunImplementedNodeModules: () => getBunImplementedNodeModules,
|
||||
getBunModules: () => getBunModules,
|
||||
isBunBuiltin: () => isBunBuiltin,
|
||||
isBunImplementedNodeModule: () => isBunImplementedNodeModule,
|
||||
isBunModule: () => isBunModule
|
||||
});
|
||||
module.exports = __toCommonJS(generic_exports);
|
||||
var import_shared = require("./shared");
|
||||
var import_shared2 = require("./shared");
|
||||
function isBunModule(moduleName, bunVersion) {
|
||||
return (0, import_shared.checkModule)(moduleName, import_shared.bundledBunModules, bunVersion != null ? bunVersion : "latest");
|
||||
}
|
||||
function isBunImplementedNodeModule(moduleName, bunVersion) {
|
||||
return (0, import_shared.checkModule)(moduleName, import_shared.implementedNodeModules, bunVersion != null ? bunVersion : "latest");
|
||||
}
|
||||
function isBunBuiltin(moduleName, bunVersion) {
|
||||
return isBunModule(moduleName, bunVersion) || isBunImplementedNodeModule(moduleName, bunVersion);
|
||||
}
|
||||
function getBunModules(bunVersion) {
|
||||
return (0, import_shared.getModules)(import_shared.bundledBunModules, bunVersion != null ? bunVersion : "latest");
|
||||
}
|
||||
function getBunImplementedNodeModules(bunVersion) {
|
||||
return (0, import_shared.getModules)(import_shared.implementedNodeModules, bunVersion != null ? bunVersion : "latest");
|
||||
}
|
||||
function getBunBuiltinModules(bunVersion) {
|
||||
return [...getBunModules(bunVersion), ...getBunImplementedNodeModules(bunVersion)];
|
||||
}
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
MINIMUM_BUN_VERSION,
|
||||
getBunBuiltinModules,
|
||||
getBunImplementedNodeModules,
|
||||
getBunModules,
|
||||
isBunBuiltin,
|
||||
isBunImplementedNodeModule,
|
||||
isBunModule
|
||||
});
|
||||
164
node_modules/is-bun-module/dist/shared.d.ts
generated
vendored
Normal file
164
node_modules/is-bun-module/dist/shared.d.ts
generated
vendored
Normal file
@@ -0,0 +1,164 @@
|
||||
var bun = true;
|
||||
var bunModules = {
|
||||
bun: bun,
|
||||
"bun:ffi": true,
|
||||
"bun:jsc": true,
|
||||
"bun:sqlite": true,
|
||||
"bun:test": true,
|
||||
"bun:wrap": true
|
||||
};
|
||||
|
||||
var assert = true;
|
||||
var async_hooks = true;
|
||||
var buffer = true;
|
||||
var child_process = true;
|
||||
var constants = true;
|
||||
var cluster = ">= 1.1.25";
|
||||
var console = true;
|
||||
var crypto = true;
|
||||
var dgram = ">= 1.1.6";
|
||||
var diagnostics_channel = true;
|
||||
var dns = true;
|
||||
var domain = true;
|
||||
var events = true;
|
||||
var fs = true;
|
||||
var http = true;
|
||||
var http2 = ">= 1.0.13";
|
||||
var https = true;
|
||||
var module = true;
|
||||
var net = true;
|
||||
var os = true;
|
||||
var path = true;
|
||||
var perf_hooks = true;
|
||||
var process = true;
|
||||
var punycode = true;
|
||||
var querystring = true;
|
||||
var readline = true;
|
||||
var stream = true;
|
||||
var string_decoder = true;
|
||||
var sys = true;
|
||||
var timers = true;
|
||||
var tls = true;
|
||||
var tty = true;
|
||||
var url = true;
|
||||
var util = true;
|
||||
var v8 = true;
|
||||
var vm = true;
|
||||
var wasi = true;
|
||||
var worker_threads = true;
|
||||
var zlib = true;
|
||||
var implementedNodeModules = {
|
||||
assert: assert,
|
||||
"assert/strict": true,
|
||||
"node:assert": true,
|
||||
"node:assert/strict": true,
|
||||
async_hooks: async_hooks,
|
||||
"node:async_hooks": true,
|
||||
"async_hooks/async_context": true,
|
||||
buffer: buffer,
|
||||
"node:buffer": true,
|
||||
child_process: child_process,
|
||||
"node:child_process": true,
|
||||
constants: constants,
|
||||
"node:constants": true,
|
||||
cluster: cluster,
|
||||
"node:cluster": ">= 1.1.25",
|
||||
console: console,
|
||||
"node:console": true,
|
||||
crypto: crypto,
|
||||
"node:crypto": true,
|
||||
dgram: dgram,
|
||||
"node:dgram": ">= 1.1.6",
|
||||
diagnostics_channel: diagnostics_channel,
|
||||
"node:diagnostics_channel": true,
|
||||
dns: dns,
|
||||
"dns/promises": true,
|
||||
"node:dns": true,
|
||||
"node:dns/promises": true,
|
||||
domain: domain,
|
||||
"node:domain": true,
|
||||
events: events,
|
||||
"node:events": true,
|
||||
fs: fs,
|
||||
"fs/promises": true,
|
||||
"node:fs": true,
|
||||
"node:fs/promises": true,
|
||||
http: http,
|
||||
"node:http": true,
|
||||
http2: http2,
|
||||
"node:http2": ">= 1.0.13",
|
||||
https: https,
|
||||
"node:https": true,
|
||||
module: module,
|
||||
"node:module": true,
|
||||
net: net,
|
||||
"node:net": true,
|
||||
os: os,
|
||||
"node:os": true,
|
||||
path: path,
|
||||
"path/posix": true,
|
||||
"path/win32": true,
|
||||
"node:path": true,
|
||||
"node:path/posix": true,
|
||||
"node:path/win32": true,
|
||||
perf_hooks: perf_hooks,
|
||||
"node:perf_hooks": true,
|
||||
process: process,
|
||||
"node:process": true,
|
||||
punycode: punycode,
|
||||
"node:punycode": true,
|
||||
querystring: querystring,
|
||||
"node:querystring": true,
|
||||
readline: readline,
|
||||
"readline/promises": true,
|
||||
"node:readline": true,
|
||||
"node:readline/promises": true,
|
||||
stream: stream,
|
||||
"stream/consumers": true,
|
||||
"stream/promises": true,
|
||||
"stream/web": true,
|
||||
"node:stream": true,
|
||||
"node:stream/consumers": true,
|
||||
"node:stream/promises": true,
|
||||
"node:stream/web": true,
|
||||
string_decoder: string_decoder,
|
||||
"node:string_decoder": true,
|
||||
sys: sys,
|
||||
"node:sys": true,
|
||||
timers: timers,
|
||||
"timers/promises": true,
|
||||
"node:timers": true,
|
||||
"node:timers/promises": true,
|
||||
tls: tls,
|
||||
"node:tls": true,
|
||||
tty: tty,
|
||||
"node:tty": true,
|
||||
url: url,
|
||||
"node:url": true,
|
||||
util: util,
|
||||
"util/types": true,
|
||||
"node:util": true,
|
||||
"node:util/types": true,
|
||||
v8: v8,
|
||||
"node:v8": true,
|
||||
vm: vm,
|
||||
"node:vm": true,
|
||||
wasi: wasi,
|
||||
"node:wasi": true,
|
||||
worker_threads: worker_threads,
|
||||
"node:worker_threads": true,
|
||||
zlib: zlib,
|
||||
"node:zlib": true,
|
||||
"node:test": ">=1.2.6"
|
||||
};
|
||||
|
||||
type SemVerBaseStringified = `${bigint}.${bigint}.${bigint}`;
|
||||
type SemVerStringifiedWithReleaseName = `${SemVerBaseStringified}-${string}`;
|
||||
type SemVerStringified = SemVerBaseStringified | SemVerStringifiedWithReleaseName;
|
||||
type BunVersion = SemVerStringified | "latest";
|
||||
type Modules = Record<string, string | boolean>;
|
||||
declare const MINIMUM_BUN_VERSION = "1.0.0";
|
||||
declare function checkModule(moduleName: string, modules: Modules, bunVersion: BunVersion): boolean;
|
||||
declare function getModules(modules: Modules, bunVersion?: BunVersion): string[];
|
||||
|
||||
export { type BunVersion, MINIMUM_BUN_VERSION, type Modules, bunModules as bundledBunModules, checkModule, getModules, implementedNodeModules };
|
||||
197
node_modules/is-bun-module/dist/shared.js
generated
vendored
Normal file
197
node_modules/is-bun-module/dist/shared.js
generated
vendored
Normal file
@@ -0,0 +1,197 @@
|
||||
"use strict";
|
||||
var __create = Object.create;
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __getProtoOf = Object.getPrototypeOf;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
||||
// If the importer is in node compatibility mode or this is not an ESM
|
||||
// file that has been converted to a CommonJS file using a Babel-
|
||||
// compatible transform (i.e. "__esModule" has not been set), then set
|
||||
// "default" to the CommonJS "module.exports" for node compatibility.
|
||||
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
||||
mod
|
||||
));
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
|
||||
// src/shared.ts
|
||||
var shared_exports = {};
|
||||
__export(shared_exports, {
|
||||
MINIMUM_BUN_VERSION: () => MINIMUM_BUN_VERSION,
|
||||
bundledBunModules: () => bun_modules_default,
|
||||
checkModule: () => checkModule,
|
||||
getModules: () => getModules,
|
||||
implementedNodeModules: () => implemented_node_modules_default
|
||||
});
|
||||
module.exports = __toCommonJS(shared_exports);
|
||||
var import_valid = __toESM(require("semver/functions/valid"));
|
||||
var import_satisfies = __toESM(require("semver/functions/satisfies"));
|
||||
var import_lt = __toESM(require("semver/functions/lt"));
|
||||
|
||||
// src/assets/bun-modules.json
|
||||
var bun_modules_default = {
|
||||
bun: true,
|
||||
"bun:ffi": true,
|
||||
"bun:jsc": true,
|
||||
"bun:sqlite": true,
|
||||
"bun:test": true,
|
||||
"bun:wrap": true
|
||||
};
|
||||
|
||||
// src/assets/implemented-node-modules.json
|
||||
var implemented_node_modules_default = {
|
||||
assert: true,
|
||||
"assert/strict": true,
|
||||
"node:assert": true,
|
||||
"node:assert/strict": true,
|
||||
async_hooks: true,
|
||||
"node:async_hooks": true,
|
||||
"async_hooks/async_context": true,
|
||||
buffer: true,
|
||||
"node:buffer": true,
|
||||
child_process: true,
|
||||
"node:child_process": true,
|
||||
constants: true,
|
||||
"node:constants": true,
|
||||
cluster: ">= 1.1.25",
|
||||
"node:cluster": ">= 1.1.25",
|
||||
console: true,
|
||||
"node:console": true,
|
||||
crypto: true,
|
||||
"node:crypto": true,
|
||||
dgram: ">= 1.1.6",
|
||||
"node:dgram": ">= 1.1.6",
|
||||
diagnostics_channel: true,
|
||||
"node:diagnostics_channel": true,
|
||||
dns: true,
|
||||
"dns/promises": true,
|
||||
"node:dns": true,
|
||||
"node:dns/promises": true,
|
||||
domain: true,
|
||||
"node:domain": true,
|
||||
events: true,
|
||||
"node:events": true,
|
||||
fs: true,
|
||||
"fs/promises": true,
|
||||
"node:fs": true,
|
||||
"node:fs/promises": true,
|
||||
http: true,
|
||||
"node:http": true,
|
||||
http2: ">= 1.0.13",
|
||||
"node:http2": ">= 1.0.13",
|
||||
https: true,
|
||||
"node:https": true,
|
||||
module: true,
|
||||
"node:module": true,
|
||||
net: true,
|
||||
"node:net": true,
|
||||
os: true,
|
||||
"node:os": true,
|
||||
path: true,
|
||||
"path/posix": true,
|
||||
"path/win32": true,
|
||||
"node:path": true,
|
||||
"node:path/posix": true,
|
||||
"node:path/win32": true,
|
||||
perf_hooks: true,
|
||||
"node:perf_hooks": true,
|
||||
process: true,
|
||||
"node:process": true,
|
||||
punycode: true,
|
||||
"node:punycode": true,
|
||||
querystring: true,
|
||||
"node:querystring": true,
|
||||
readline: true,
|
||||
"readline/promises": true,
|
||||
"node:readline": true,
|
||||
"node:readline/promises": true,
|
||||
stream: true,
|
||||
"stream/consumers": true,
|
||||
"stream/promises": true,
|
||||
"stream/web": true,
|
||||
"node:stream": true,
|
||||
"node:stream/consumers": true,
|
||||
"node:stream/promises": true,
|
||||
"node:stream/web": true,
|
||||
string_decoder: true,
|
||||
"node:string_decoder": true,
|
||||
sys: true,
|
||||
"node:sys": true,
|
||||
timers: true,
|
||||
"timers/promises": true,
|
||||
"node:timers": true,
|
||||
"node:timers/promises": true,
|
||||
tls: true,
|
||||
"node:tls": true,
|
||||
tty: true,
|
||||
"node:tty": true,
|
||||
url: true,
|
||||
"node:url": true,
|
||||
util: true,
|
||||
"util/types": true,
|
||||
"node:util": true,
|
||||
"node:util/types": true,
|
||||
v8: true,
|
||||
"node:v8": true,
|
||||
vm: true,
|
||||
"node:vm": true,
|
||||
wasi: true,
|
||||
"node:wasi": true,
|
||||
worker_threads: true,
|
||||
"node:worker_threads": true,
|
||||
zlib: true,
|
||||
"node:zlib": true,
|
||||
"node:test": ">=1.2.6"
|
||||
};
|
||||
|
||||
// src/shared.ts
|
||||
var MINIMUM_BUN_VERSION = "1.0.0";
|
||||
function checkModule(moduleName, modules, bunVersion) {
|
||||
if (typeof moduleName !== "string") throw new TypeError("Module name must be a string");
|
||||
if (!(moduleName in modules)) return false;
|
||||
const targetBunVersion = toSemVerStringified(bunVersion);
|
||||
if ((0, import_lt.default)(targetBunVersion, MINIMUM_BUN_VERSION)) {
|
||||
throw new RangeError(`Bun version must be at least ${MINIMUM_BUN_VERSION}`);
|
||||
}
|
||||
return satisfiesVersionRange(targetBunVersion, modules[moduleName]);
|
||||
}
|
||||
function getModules(modules, bunVersion) {
|
||||
const targetBunVersion = toSemVerStringified(bunVersion);
|
||||
if ((0, import_lt.default)(targetBunVersion, MINIMUM_BUN_VERSION)) {
|
||||
throw new RangeError(`Bun version must be at least ${MINIMUM_BUN_VERSION}`);
|
||||
}
|
||||
return Object.keys(modules).filter((moduleName) => {
|
||||
return satisfiesVersionRange(targetBunVersion, modules[moduleName]);
|
||||
});
|
||||
}
|
||||
function satisfiesVersionRange(version, versionRange) {
|
||||
if (typeof versionRange === "boolean") return versionRange;
|
||||
return (0, import_satisfies.default)(version, versionRange);
|
||||
}
|
||||
function toSemVerStringified(input) {
|
||||
if (typeof input !== "string") throw new TypeError("Bun version must be a string");
|
||||
if (input === "latest") return "999.999.999";
|
||||
if ((0, import_valid.default)(input)) return input;
|
||||
throw new TypeError("Bun version must be a string like '1.0.0' or 'latest'");
|
||||
}
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
MINIMUM_BUN_VERSION,
|
||||
bundledBunModules,
|
||||
checkModule,
|
||||
getModules,
|
||||
implementedNodeModules
|
||||
});
|
||||
69
node_modules/is-bun-module/package.json
generated
vendored
Normal file
69
node_modules/is-bun-module/package.json
generated
vendored
Normal file
@@ -0,0 +1,69 @@
|
||||
{
|
||||
"name": "is-bun-module",
|
||||
"author": "SunsetTechuila <techuila.sunset@gmail.com>",
|
||||
"description": "Is this specifier a Bun core module or supported Node one?",
|
||||
"version": "2.0.0",
|
||||
"license": "MIT",
|
||||
"files": [
|
||||
"dist/**/*"
|
||||
],
|
||||
"main": "./dist/generic.js",
|
||||
"exports": {
|
||||
".": {
|
||||
"bun": "./dist/bun.mjs",
|
||||
"types": "./dist/generic.d.ts",
|
||||
"default": "./dist/generic.js"
|
||||
},
|
||||
"./package.json": "./package.json"
|
||||
},
|
||||
"homepage": "https://github.com/SunsetTechuila/is-bun-module",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/SunsetTechuila/is-bun-module.git"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/SunsetTechuila/is-bun-module/issues"
|
||||
},
|
||||
"keywords": [
|
||||
"core",
|
||||
"modules",
|
||||
"module",
|
||||
"node",
|
||||
"dependencies",
|
||||
"bun"
|
||||
],
|
||||
"scripts": {
|
||||
"build": "bun tsup",
|
||||
"check-all": "bun concurrently --kill-others=failure 'bun run test' 'bun lint' 'bun type-check' 'bun format:check'",
|
||||
"precheck-all": "bun run build",
|
||||
"test": "bun test",
|
||||
"format": "bun format:base --write",
|
||||
"format:check": "bun format:base --check",
|
||||
"format:base": "bun prettier . --cache",
|
||||
"lint": "bun eslint . --cache",
|
||||
"type-check": "bun tsc",
|
||||
"get-bun-blogs": "bun scripts/getBunBlogs.ts",
|
||||
"publish": "bun semantic-release",
|
||||
"prepare": "bun husky"
|
||||
},
|
||||
"dependencies": {
|
||||
"semver": "^7.7.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@commitlint/cli": "^19.8.0",
|
||||
"@commitlint/config-conventional": "^19.8.0",
|
||||
"@eslint/js": "^9.22.0",
|
||||
"@semantic-release/exec": "^7.0.3",
|
||||
"@types/bun": "^1.2.5",
|
||||
"@types/semver": "^7.5.8",
|
||||
"concurrently": "^9.1.2",
|
||||
"eslint": "^9.22.0",
|
||||
"eslint-config-prettier": "^10.1.1",
|
||||
"husky": "^9.1.7",
|
||||
"prettier": "^3.5.3",
|
||||
"semantic-release": "^24.2.3",
|
||||
"tsup": "^8.4.0",
|
||||
"typescript": "~5.8.2",
|
||||
"typescript-eslint": "^8.26.1"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user