Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/publishWorkflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v2
with:
bun-version: "1.1.37"
bun-version: "1.2.14"
- uses: mangs/simple-release-notes-action@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pullRequestWorkflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v2
with:
bun-version: "1.1.37"
bun-version: "1.2.14"
- run: bun install --frozen-lockfile
- run: bun run check:environment
- run: bun run check:package-version
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## 2.34.0

- Upgrade target Bun version from `1.1.37` to `1.2.14`
- Upgrade dependency versions to latest

## 2.33.6

- Remove JSDoc `@file` annotations because they are unsupported by TypeDoc
Expand Down
983 changes: 983 additions & 0 deletions bun.lock

Large diffs are not rendered by default.

Binary file removed bun.lockb
Binary file not shown.
26 changes: 13 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"name": "@mangs/bun-utils",
"version": "2.33.6",
"version": "2.34.0",
"author": "Eric L. Goldstein",
"description": "Useful utils for your Bun projects",
"engines": {
"bun": "1.1.37"
"bun": "1.2.14"
},
"packageManager": "bun@1.1.37",
"packageManager": "bun@1.2.14",
"homepage": "https://github.com/mangs/bun-utils#readme",
"repository": {
"type": "git",
Expand Down Expand Up @@ -62,19 +62,19 @@
"reinstall:use-lock-file": "bun run --silent delete:node-modules && bun install --frozen-lockfile"
},
"dependencies": {
"type-fest": "4.35.0"
"type-fest": "4.41.0"
},
"devDependencies": {
"@babbel/eslint-config": "2.2.0",
"@types/bun": "1.1.14",
"@babbel/eslint-config": "2.4.0",
"@types/bun": "1.2.14",
"eslint": "8.57.1",
"eslint-config-prettier": "10.0.1",
"marked": "15.0.7",
"prettier": "3.5.2",
"sharp": "0.33.5",
"typedoc": "0.27.9",
"eslint-config-prettier": "10.1.5",
"marked": "15.0.12",
"prettier": "3.5.3",
"sharp": "0.34.2",
"typedoc": "0.28.4",
"typedoc-github-wiki-theme": "2.1.0",
"typedoc-plugin-markdown": "4.4.2",
"typescript": "5.7.3"
"typedoc-plugin-markdown": "4.6.3",
"typescript": "5.8.3"
}
}
4 changes: 2 additions & 2 deletions scripts/bun/optimizeImages.mts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ async function main() {
throw new Error(`Invalid image conversion format: ${conversionFormat}`);
}

const rootPath = values['root-path']!;
const rootPath = values['root-path'];
const glob = new Glob('**/*.{avif,jpeg,jpg,png,webp}');
let fileCount = 0;
for await (const filePath of glob.scan(rootPath)) {
Expand All @@ -68,7 +68,7 @@ async function main() {
const imageMetadata = await sharp(fullFilePath).metadata();
const { format } = imageMetadata;
if (!format) {
throw new TypeError(`Invalid image format encountered: ${format}`, { cause: { filePath } });
throw new TypeError('Invalid image format encountered', { cause: { filePath, format } });
}
const formatKeyed =
(conversionFormat as keyof typeof compressionOptions) ??
Expand Down
4 changes: 2 additions & 2 deletions scripts/bun/startDevelopmentServer.mts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ type CodeModule = Record<string, { fetch: FetchFunction }>;
* @param option The specific value to extract from the command line object.
* @returns The option value parsed from the command line.
*/
function getOption<T>(parsedValues: Record<keyof T, T[keyof T]>, option: keyof T) {
function getOption<T>(parsedValues: T, option: keyof T) {
const optionValue = parsedValues[option];
if (optionValue) {
return optionValue;
Expand All @@ -50,7 +50,7 @@ async function main() {
},
});

const entrypointPath = getOption<typeof values>(values, 'entrypoint-path');
const entrypointPath = getOption(values, 'entrypoint-path');
const namedExport = values['named-export'] ?? 'default';
const entrypoint = ((await import(nodePath.resolve(entrypointPath))) as CodeModule)[namedExport];
if (!entrypoint) {
Expand Down
1 change: 0 additions & 1 deletion src/buildUtils.mts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ async function buildAndShowMetadata(buildConfiguration: BuildConfiguration, mute

if (!muteMetadata) {
console.log();
// eslint-disable-next-line @typescript-eslint/no-use-before-define -- functions get hoisted
printBuildMetadata(buildOutput, buildConfiguration.outdir);
}
printSuccess(`Build success ${performanceLabel}`);
Expand Down
2 changes: 1 addition & 1 deletion src/networkUtils.mts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ declare global {

// Local Types
// eslint-disable-next-line no-undef -- not sure why FetchRequestInit invisible to ESLint
interface FetchRetryOptions extends FetchRequestInit {
interface FetchRetryOptions extends BunFetchRequestInit {
/**
* Function allowing arbitrary status codes to bypass the retry process.
* @param statusCode Response status code.
Expand Down
30 changes: 15 additions & 15 deletions src/routerUtils.mts
Original file line number Diff line number Diff line change
Expand Up @@ -82,21 +82,6 @@ class Router {
// });
}

/**
* Register a route handler for the specified HTTP request method.
* @param path A path-like string that will be used to match against the incoming request's path.
* @param routeHandler The function that will execute if this route handler is matched. Eagerly-loaded route handlers pass functions in directly; lazy-loaded ones pass in an object whose key corresponds to a module's named export or `'default'` for default export.
* @param method A valid HTTP method.
* @returns A reference to the instantiated instance (`this`) so route handler definitions can be chained.
*/
#handleMethod(path: string, routeHandler: RouteHandler, method: HttpRequestMethod) {
if (!httpRequestMethods.includes(method)) {
throw new TypeError(`"${method}" is not a valid HTTP method`);
}
this.#routes.push([method, [path, routeHandler]]);
return this;
}

/**
* Register a route handler that matches all HTTP request methods.
* @param path A path-like string that will be used to match against the incoming request's path.
Expand Down Expand Up @@ -267,6 +252,21 @@ class Router {
put(path: string, routeHandler: RouteHandler) {
return this.#handleMethod(path, routeHandler, 'PUT');
}

/**
* Register a route handler for the specified HTTP request method.
* @param path A path-like string that will be used to match against the incoming request's path.
* @param routeHandler The function that will execute if this route handler is matched. Eagerly-loaded route handlers pass functions in directly; lazy-loaded ones pass in an object whose key corresponds to a module's named export or `'default'` for default export.
* @param method A valid HTTP method.
* @returns A reference to the instantiated instance (`this`) so route handler definitions can be chained.
*/
#handleMethod(path: string, routeHandler: RouteHandler, method: HttpRequestMethod) {
if (!httpRequestMethods.includes(method)) {
throw new TypeError(`"${method}" is not a valid HTTP method`);
}
this.#routes.push([method, [path, routeHandler]]);
return this;
}
}

// Module Exports
Expand Down