main repo

This commit is contained in:
Basilosaurusrex
2025-11-24 18:09:40 +01:00
parent b636ee5e70
commit f027651f9b
34146 changed files with 4436636 additions and 0 deletions

20
node_modules/is-bun-module/LICENSE generated vendored Normal file
View 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.

28
node_modules/is-bun-module/README.md generated vendored Normal file
View File

@@ -0,0 +1,28 @@
# is-bun-module
## How to use
To check 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
```
To check if a specifier is a Node module [supported by Bun](https://bun.sh/docs/runtime/nodejs-apis):
```typescript
import { isSupportedNodeModule } from "is-bun-module";
isSupportedNodeModule("fs"); // true
isSupportedNodeModule("node:fs"); // true
isSupportedNodeModule("node:notNodeModule"); // false
isSupportedNodeModule("node:http2", "1.0.0"); // false, added in 1.0.13
```
## 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)

9
node_modules/is-bun-module/dist/cjs/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,9 @@
type SemVerBaseStringified = `${bigint}.${bigint}.${bigint}`;
type SemVerStringifiedWithReleaseName = `${SemVerBaseStringified}-${string}`;
type SemVerStringified = SemVerBaseStringified | SemVerStringifiedWithReleaseName;
type Version = SemVerStringified | "latest";
declare const MINIMUM_BUN_VERSION = "1.0.0";
declare function isBunModule(moduleName: string, bunVersion?: Version): boolean;
declare function isSupportedNodeModule(moduleName: string, bunVersion?: Version): boolean;
export { MINIMUM_BUN_VERSION, type Version, isBunModule, isSupportedNodeModule };

130
node_modules/is-bun-module/dist/cjs/index.js generated vendored Normal file
View File

@@ -0,0 +1,130 @@
"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/index.ts
var src_exports = {};
__export(src_exports, {
MINIMUM_BUN_VERSION: () => MINIMUM_BUN_VERSION,
isBunModule: () => isBunModule,
isSupportedNodeModule: () => isSupportedNodeModule
});
module.exports = __toCommonJS(src_exports);
var import_semver = __toESM(require("semver"));
// src/assets/bun-modules.json
var bun_modules_default = {
bun: true,
"bun:ffi": true,
"bun:jsc": true,
"bun:sqlite": true,
"bun:test": true
};
// src/assets/node-modules.json
var node_modules_default = {
assert: true,
async_hooks: true,
buffer: true,
child_process: true,
cluster: ">= 1.1.25",
console: true,
crypto: true,
dgram: ">= 1.1.6",
dns: true,
domain: true,
events: true,
fs: true,
http: true,
http2: ">= 1.0.13",
https: true,
module: true,
net: true,
os: true,
path: true,
perf_hooks: true,
process: true,
punycode: true,
querystring: true,
readline: true,
stream: true,
string_decoder: true,
sys: true,
timers: true,
tls: true,
tty: true,
url: true,
util: true,
vm: true,
wasi: true,
worker_threads: true,
zlib: true
};
// src/index.ts
var MINIMUM_BUN_VERSION = "1.0.0";
function isBunModule(moduleName, bunVersion) {
return checkModule(moduleName, bun_modules_default, bunVersion);
}
function isSupportedNodeModule(moduleName, bunVersion) {
return checkModule(moduleName.replace(/^node:/, ""), node_modules_default, bunVersion);
}
function checkModule(moduleName, modules, bunVersion) {
var _a;
if (typeof moduleName !== "string") throw new TypeError("Module name must be a string");
if (!(moduleName in modules)) return false;
let targetBunVersion;
if (bunVersion) {
targetBunVersion = toSemVerStringified(bunVersion);
if (!targetBunVersion) {
throw new TypeError("Bun version must be a string like 1.0.0 or 'latest'");
}
} else {
if (typeof process === "undefined" || !((_a = process.versions) == null ? void 0 : _a.bun)) {
throw new Error("Bun version is not provided and cannot be detected");
}
targetBunVersion = process.versions.bun;
}
if (import_semver.default.lt(targetBunVersion, MINIMUM_BUN_VERSION)) {
throw new RangeError(`Bun version must be at least ${MINIMUM_BUN_VERSION}`);
}
const versionRange = modules[moduleName];
if (typeof versionRange === "boolean") return versionRange;
return import_semver.default.satisfies(targetBunVersion, versionRange);
}
function toSemVerStringified(input) {
if (typeof input !== "string") return;
if (input === "latest") return "999.999.999";
if (import_semver.default.valid(input)) return input;
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
MINIMUM_BUN_VERSION,
isBunModule,
isSupportedNodeModule
});

9
node_modules/is-bun-module/dist/esm/index.d.mts generated vendored Normal file
View File

@@ -0,0 +1,9 @@
type SemVerBaseStringified = `${bigint}.${bigint}.${bigint}`;
type SemVerStringifiedWithReleaseName = `${SemVerBaseStringified}-${string}`;
type SemVerStringified = SemVerBaseStringified | SemVerStringifiedWithReleaseName;
type Version = SemVerStringified | "latest";
declare const MINIMUM_BUN_VERSION = "1.0.0";
declare function isBunModule(moduleName: string, bunVersion?: Version): boolean;
declare function isSupportedNodeModule(moduleName: string, bunVersion?: Version): boolean;
export { MINIMUM_BUN_VERSION, type Version, isBunModule, isSupportedNodeModule };

93
node_modules/is-bun-module/dist/esm/index.mjs generated vendored Normal file
View File

@@ -0,0 +1,93 @@
// src/index.ts
import semver from "semver";
// src/assets/bun-modules.json
var bun_modules_default = {
bun: true,
"bun:ffi": true,
"bun:jsc": true,
"bun:sqlite": true,
"bun:test": true
};
// src/assets/node-modules.json
var node_modules_default = {
assert: true,
async_hooks: true,
buffer: true,
child_process: true,
cluster: ">= 1.1.25",
console: true,
crypto: true,
dgram: ">= 1.1.6",
dns: true,
domain: true,
events: true,
fs: true,
http: true,
http2: ">= 1.0.13",
https: true,
module: true,
net: true,
os: true,
path: true,
perf_hooks: true,
process: true,
punycode: true,
querystring: true,
readline: true,
stream: true,
string_decoder: true,
sys: true,
timers: true,
tls: true,
tty: true,
url: true,
util: true,
vm: true,
wasi: true,
worker_threads: true,
zlib: true
};
// src/index.ts
var MINIMUM_BUN_VERSION = "1.0.0";
function isBunModule(moduleName, bunVersion) {
return checkModule(moduleName, bun_modules_default, bunVersion);
}
function isSupportedNodeModule(moduleName, bunVersion) {
return checkModule(moduleName.replace(/^node:/, ""), node_modules_default, bunVersion);
}
function checkModule(moduleName, modules, bunVersion) {
var _a;
if (typeof moduleName !== "string") throw new TypeError("Module name must be a string");
if (!(moduleName in modules)) return false;
let targetBunVersion;
if (bunVersion) {
targetBunVersion = toSemVerStringified(bunVersion);
if (!targetBunVersion) {
throw new TypeError("Bun version must be a string like 1.0.0 or 'latest'");
}
} else {
if (typeof process === "undefined" || !((_a = process.versions) == null ? void 0 : _a.bun)) {
throw new Error("Bun version is not provided and cannot be detected");
}
targetBunVersion = process.versions.bun;
}
if (semver.lt(targetBunVersion, MINIMUM_BUN_VERSION)) {
throw new RangeError(`Bun version must be at least ${MINIMUM_BUN_VERSION}`);
}
const versionRange = modules[moduleName];
if (typeof versionRange === "boolean") return versionRange;
return semver.satisfies(targetBunVersion, versionRange);
}
function toSemVerStringified(input) {
if (typeof input !== "string") return;
if (input === "latest") return "999.999.999";
if (semver.valid(input)) return input;
}
export {
MINIMUM_BUN_VERSION,
isBunModule,
isSupportedNodeModule
};

69
node_modules/is-bun-module/package.json generated vendored Normal file
View 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": "1.2.1",
"license": "MIT",
"files": [
"dist/**/*"
],
"main": "./dist/cjs/index.js",
"module": "./dist/esm/index.mjs",
"exports": {
".": {
"import": {
"default": "./dist/esm/index.mjs",
"types": "./dist/esm/index.d.mts"
},
"require": {
"default": "./dist/cjs/index.js",
"types": "./dist/cjs/index.d.ts"
}
},
"./package.json": "./package.json"
},
"homepage": "https://github.com/SunsetTechuila/is-bun-module",
"repository": "github:SunsetTechuila/is-bun-module",
"bugs": {
"url": "https://github.com/SunsetTechuila/is-bun-module/issues"
},
"keywords": [
"core",
"modules",
"module",
"node",
"dependencies",
"bun"
],
"scripts": {
"build": "bun --bun tsup",
"check-all": "concurrently --kill-others=failure 'bun run test' 'bun lint' 'bun type-check' 'bun format:check'",
"test": "bun run build && bun test",
"format": "bun format:base --write",
"format:check": "bun format:base --check",
"format:base": "bun --bun prettier . --cache",
"lint": "bun --bun eslint . --cache",
"type-check": "bun --bun tsc"
},
"dependencies": {
"semver": "^7.6.3"
},
"devDependencies": {
"@commitlint/cli": "^19.4.1",
"@commitlint/config-conventional": "^19.4.1",
"@eslint/js": "^9.10.0",
"@semantic-release/exec": "^6.0.3",
"@types/bun": "^1.1.8",
"@types/eslint__js": "^8.42.3",
"@types/semver": "^7.5.8",
"concurrently": "^9.0.0",
"eslint": "^9.10.0",
"eslint-config-prettier": "^9.1.0",
"husky": "^9.1.5",
"prettier": "^3.3.3",
"semantic-release": "^24.1.0",
"tsup": "^8.2.4",
"typescript": "^5.5.4",
"typescript-eslint": "^8.4.0"
}
}