Tool for checking if the YAML config files are alphabetically sorted
Converts JavaScript errors to alerts, so you won't miss them if you don't have the browser console open.
Custom PHPStan Rules for Consistence library (https://github.com/phpstan/phpstan and https://github.com/consistence/consistence/)
add blogpost link to README
Anki AI - Add example sentences to Anki notes with ChatGPT
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);
This is related to https://github.com/cloudflare/miniflare/issues/504
save past pomodoros to localStorage so they persist after page reload
custom icon
custom icon
custom icon
update dependencies
rewrite to useReducer
@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
.
Pomazánka ze sušených rajčat - fix URL
Rybičková pomazánka
Wrangler
Wrangler
are you using?2.8.1
Windows
vitest
watch mode does not work for changes in the worker files, only for the changes in test files.
npm test
- vitest starts in watch mode!
to the expected message in index.test.ts
(expect(text).toMatchInlineSnapshot("Hello World!!");
), the vitest notices this change and reruns the tests which now failindex.ts
to also include the extra !
, the tests are not re-ranTests are re-ran even after changes in the source code, not just after changes to the tests
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