mhujer
Repos
122
Followers
76
Following
42

Tool for checking if the YAML config files are alphabetically sorted

22
10

Converts JavaScript errors to alerts, so you won't miss them if you don't have the browser console open.

1
2

Custom PHPStan Rules for Consistence library (https://github.com/phpstan/phpstan and https://github.com/consistence/consistence/)

7
0

Nebudete tomu věřit, ale sepisuju si recepty :-)

0
0

PHP implementation of Fio Bank API

30
20

Events

add blogpost link to README

Created at 6 days ago

Anki AI - Add example sentences to Anki notes with ChatGPT

Created at 6 days ago
issue comment
HTTP Headers on IRequest

My workaround to get the missing things from Request back is to add & Request to the handler, so I get proper autocompletion:

async function handleCreateComment(request: IRequest & Request, env: Env) {
     const requestData = await request.json<CreateCommentRequest>(); // this works again

The only downside so far is that I had to add ignore to the route definition because of incompatible types:

// @ts-expect-error eslint-disable-line @typescript-eslint/ban-ts-comment
router.post('/:siteId', handleCreateComment);
Created at 1 week ago
mhujer delete branch eleventy
Created at 1 week ago

rebuild using eleventy

Created at 1 week ago

rebuild using eleventy

Created at 1 week ago
pull request closed
rebuild using eleventy
Created at 1 week ago
pull request opened
rebuild using eleventy
Created at 1 week ago
mhujer create branch eleventy
Created at 1 week ago
Created at 1 week ago
issue comment
🐛 BUG: Wrangler failed on d1 parameter bindings with `?NNN`

This is related to https://github.com/cloudflare/miniflare/issues/504

Created at 1 week ago
Created at 1 week ago
Created at 1 week ago
Created at 3 weeks ago

save past pomodoros to localStorage so they persist after page reload

Created at 3 weeks ago

custom icon

Created at 3 weeks ago

custom icon

Created at 3 weeks ago

custom icon

Created at 3 weeks ago

update dependencies

rewrite to useReducer

Created at 3 weeks ago
Created at 3 weeks ago

Tofu s kari omáčkou

Created at 1 month ago
issue comment
🐛 BUG: vitest watch mode does not work for changes in non-test files

@mrbbot Thank for the answer! I tried the approach you suggested, but it seems that adding src/index.ts to forceRerunTriggers is not enough. In my testing it works if all the worker code is located in src/index.ts, but ignores changes in other included files, so probably the vitest dependencies graph resolution is not applied to it.

// generateResponse.ts
export function generateResponse() {
    return new Response("Hello World!!"); // <--- changes to this line are ignored.
}

//index.ts
import { generateResponse } from "./generateResponse";

export default {
	async fetch(
		request: Request,
		env: Env,
		ctx: ExecutionContext
	): Promise<Response> {
		return generateResponse();
	},
};

Therefor fix for the default project generated with wrangler init should be different -maybe something like src/*.ts in forceRerunTriggers.

For my setup I simplified the workaround just to adding import './index'; to the top of the index.test.ts. This way the vitest dependencies resolution works fine for changes in other files than index.ts.

Created at 1 month ago

Pomazánka ze sušených rajčat - fix URL

Rybičková pomazánka

Created at 1 month ago

Domácí tyčky update

Created at 1 month ago
opened issue
🐛 BUG: vitest watch mode does not work for changes in non-test files

Which Cloudflare product(s) does this pertain to?

Wrangler

What version of Wrangler are you using?

2.8.1

What operating system are you using?

Windows

Describe the Bug

vitest watch mode does not work for changes in the worker files, only for the changes in test files.

Steps to reproduce

  1. create a new project with Wrangler (with TS and tests)
  2. run npm test - vitest starts in watch mode
  3. add extra ! to the expected message in index.test.ts (expect(text).toMatchInlineSnapshot("Hello World!!");), the vitest notices this change and reruns the tests which now fail
  4. fix the code in index.ts to also include the extra !, the tests are not re-ran

Expected outcome

Tests are re-ran even after changes in the source code, not just after changes to the tests

Workaround

I guess that's because vitest has some smart way of determining the dependencies of the tests, so it watches just the specific files and worker = await unstable_dev("src/index.ts" is not enough to let it know that src/index.ts should be also watched.

If I add import * as workerFile from './index'; and console.log(workerFile); to the index.test.ts so the dependency between files is defined in a JS-way, test are re-ran also after changes to index.ts

Created at 1 month ago
Created at 2 months ago