v17
April 10, 2024
![pomdtr avatar](https://images.clerk.dev/oauth_github/img_2RCoAITJZH1QencEgtVjh4Qirj4.jpeg)
devtools
@pomdtr
Script
Devtools shortcuts Add useful shortcuts to a val website. Usage /_edit -> go to the val editor /_raw -> view val source /_logs -> view val logs Example import { devtools } from "https://esm.town/v/pomdtr/devtools";
export default devtools((_req: Request) => {
return new Response("hello world");
});
vtWishList
@nbbaier
HTTP
My Val Town Wish List Some things I'd love to see come to val town (some of these are already on the way according to the team) [x] Editing a val's readme through the API [x] A command bar (something like paco's cmdk would be dope ) [ ] The ability or programmatically respond to events (like a val being run) right within Val Town [ ] User defined templates usable right in the val creation flow [ ] Public folders / ability to add readmes to folders [ ] Dynamic folders (ala Tana's search nodes ) [ ] Custom val metadata (such as tags) [ ] A more fully featured markdown editor for readmes
readmeManager
@postpostscript
HTTP
@postpostscript/readmeManager: Edit Val Readmes With Persistent Drafts edit this readme Todo: [ ] Upload images [ ] Autosave/save without reloading page [ ] Ctrl+S [ ] Multiple draft versions [ ] Switch to dark codemirror theme which has markdown styling [ ] Allow for checking checkboxes in preview [ ] View with just the preview [ ] Ability to favorite vals on the Home page
![pomdtr avatar](https://images.clerk.dev/oauth_github/img_2RCoAITJZH1QencEgtVjh4Qirj4.jpeg)
test_explorer
@pomdtr
HTTP
Test Explorer Click on the play button next to list items to run them. Usage Fork this val Create new tests in any of vals (and export them) (see @pomdtr/example_test) import { assertEquals } from "https://deno.land/std@0.216.0/assert/mod.ts";
import { Test } from "https://esm.town/v/<account>/test_explorer";
export const exampleTestSuccess = new Test(() => {
assertEquals(1 + 1, 2);
});
export const exampleTestFailure = new Test(() => {
assertEquals(1 + 1, 3);
}); Go to https://<account>-test_explorer.web.val.run to run your test click on the val name to go to the val the tests are originating from click on the test name to run it âšī¸ You probably want to protect your test explorer behind an authentication middleware like @pomdtr/basicAuth Discovery mechanism In order to define a test, the user need to import the Test class from https://val.town/v/<account>/Test .
So we can use the api to search for vals containing the https://val.town/v/<account>/Test string to locate the vals containing tests. Next, we need to extract the tests from the val exports. We use exported instanceof Test to filter them (at some point we will probably use static analysis for this). TODO [x] persist test results in sqlite [x] Improve styling (help welcome â¤ī¸) [ ] View logs in a modal [ ] Batch http requests
v17
April 10, 2024