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)
Create valimport { 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
- persist test results in sqlite
- Improve styling (help welcome ❤️)
- View logs in a modal
- Batch http requests
SQLite Admin
This is a lightweight SQLite Admin interface to view and debug your SQLite data.
It's currently super limited (no pagination, editing data, data-type specific viewers), and is just a couple dozens lines of code over a couple different vals. Forks encouraged! Just comment on the val if you add any features that you want to share.
To use it on your own Val Town SQLite database, fork it to your account.
It uses basic authentication with your Val Town API Token as the password (leave the username field blank).
Blob Admin
This is a lightweight Blob Admin interface to view and debug your Blob data.
Use this button to install the val:
It uses basic authentication with your Val Town API Token as the password (leave the username field blank).
TODO
-
/new
- render a page to write a new blob key and value -
/edit/:blob
- render a page to edit a blob (prefilled with the existing content) -
/delete/:blob
- delete a blob and render success - add upload/download buttons
- Use modals for create/upload/edit/view/delete page (htmx ?)
- handle non-textual blobs properly
- use codemirror instead of a textarea for editing text blobs
SQLite Explorer
View and interact with your Val Town SQLite data. It's based off Steve's excellent SQLite Admin val, adding the ability to run SQLite queries directly in the interface. This new version has a revised UI and that's heavily inspired by LibSQL Studio by invisal. This is now more an SPA, with tables, queries and results showing up on the same page.
Install
Install the latest stable version (v81) by forking this val:
Authentication
Login to your SQLite Explorer with password authentication with your Val Town API Token as the password.
Todos / Plans
- improve error handling
- improve table formatting
- sticky table headers
- add codemirror
- add loading indication to the run button (initial version shipped)
- add ability to favorite queries
- add saving of last query run for a table (started)
- add visible output for non-query statements
- add schema viewing
- add refresh to table list sidebar after
CREATE/DROP/ALTER
statements - add automatic execution of initial select query on double click
- add views to the sidebar
- add triggers to sidebar
- add upload from SQL, CSV and JSON
- add ability to connect to a non-val town Turso database
- fix wonky sidebar separator height problem (thanks to @stevekrouse)
- make result tables scrollable
- add export to CSV, and JSON (CSV and JSON helper functions written in this val. Thanks to @pomdtr for merging the initial version!)
- add listener for cmd+enter to submit query
Blob Admin
This is a lightweight Blob Admin interface to view and debug your Blob data.
Use this button to install the val:
It uses basic authentication with your Val Town API Token as the password (leave the username field blank).
TODO
-
/new
- render a page to write a new blob key and value -
/edit/:blob
- render a page to edit a blob (prefilled with the existing content) -
/delete/:blob
- delete a blob and render success - add upload/download buttons
- Use modals for create/upload/edit/view/delete page (htmx ?)
- handle non-textual blobs properly
- use codemirror instead of a textarea for editing text blobs
Static Vals
Serve static content from val.town
Usage
First, fork this val to get your own http endpoint.
Then create a val that uses a string as it's default export, or a single string export. The val must be either public or unlisted.
export default `<static content>`
You can then fetch the exported string from outside val.town using:
curl 'https://<owner>-static.web.val.run/<val>.<extension>'
The Content-Type
will be dynamically set depending on the provided extension.
Example
SQLite Admin
This is a lightweight SQLite Admin interface to view and debug your SQLite data.
It's currently super limited (no pagination, editing data, data-type specific viewers), and is just a couple dozens lines of code over a couple different vals. Forks encouraged! Just comment on the val if you add any features that you want to share.
To use it on your own Val Town SQLite database, fork it to your account.
It uses basic authentication with your Val Town API Token as the password (leave the username field blank).
SQLite Explorer
View and interact with your Val Town SQLite data. It's based off Steve's excellent SQLite Admin val, adding the ability to run SQLite queries directly in the interface. This new version has a revised UI and that's heavily inspired by LibSQL Studio by invisal. This is now more an SPA, with tables, queries and results showing up on the same page.
Install
Install the latest stable version (v64) by forking this val that imports & exports it in your account:
Authentication
Login to your SQLite Explorer with password authentication with your Val Town API Token as the password.
Todos / Plans
- fix wonky sidebar separator height problem (thanks to @stevekrouse)
- improve error handling
- improve table formatting
- make result tables scrollable
- sticky table headers
- add codemirror
- add loading indication to the run button (initial version shipped)
- add ability to favorite queries
- add saving of last query run for a table (started)
- add visible output for non-query statements
- add schema viewing
- add export to CSV, and JSON (CSV and JSON helper functions written in this val. Thanks to @pomdtr for merging the initial version!)
- add refresh to table list sidebar after
CREATE/DROP/ALTER
statements - add automatic execution of initial select query on double click
- add listener for cmd+enter to submit query
- add views to the sidebar
- add triggers to sidebar
- add upload from SQL, CSV and JSON
- add ability to connect to a non-val town Turso database
SQLite Explorer
View and interact with your Val Town SQLite data. It's based off Steve's excellent SQLite Admin val, adding the ability to run SQLite queries directly in the interface. This new version has a revised UI and that's heavily inspired by LibSQL Studio by invisal. This is now more an SPA, with tables, queries and results showing up on the same page.
Install
Install the latest stable version (v37) by forking this val that imports & exports it in your account:
Authentication
SQLite Explorer basic authentication with your Val Town API Token as the password (leave the username field blank).
Todos / Plans
- fix wonky sidebar separator height problem
- improve error handling
- improve table formatting
- make result tables scrollable
- add codemirror
- add loading indication to the run button (initial version shipped)
- add ability to favorite queries
- add saving of last query run for a table (started)
- add visible output for non-query statements
- add schema viewing
- add export to CSV, and JSON (CSV and JSON helper functions written in this val)
- add export to sqlite
- add refresh to table list sidebar after
CREATE/DROP/ALTER
statements - add automatic execution of initial select query on double click
- add listener for cmd+enter to submit query
- add views to the sidebar
SQLite Admin
This is a lightweight SQLite Admin interface to view and debug your SQLite data.
It's currently super limited (no pagination, editing data, data-type specific viewers), and is just a couple dozens lines of code over a couple different vals. Forks encouraged! Just comment on the val if you add any features that you want to share.
To use it on your own Val Town SQLite database, fork it to your account.
It uses basic authentication with your Val Town API Token as the password (leave the username field blank).
Blob Admin
This is a lightweight Blob Admin interface to view and debug your Blob data.
To use it on your own Val Town Blob Storage, fork it to your account.
It uses basic authentication with your Val Town API Token as the password (leave the username field blank).
TODO
-
/new
- render a page to write a new blob key and value- or new blob by file upload
-
/edit/:blob
- render a page to edit a blob (prefilled with the existing content)- json validation when the existing content is json
- checkbox to disable that
- json validation when the existing content is json
-
/delete/:blob
- delete a blob and render success
SQLite Admin
This is a lightweight SQLite Admin interface to view and debug your SQLite data.
It's currently super limited (no pagination, editing data, data-type specific viewers), and is just a couple dozens lines of code over a couple different vals. Forks encouraged! Just comment on the val if you add any features that you want to share.
To use it on your own Val Town SQLite database, fork it to your account.
It uses basic authentication with your Val Town API Token as the password (leave the username field blank).
Blob Admin
This is a lightweight Blob Admin interface to view and debug your Blob data.
To use it on your own Val Town Blob Storage, fork it to your account.
It uses basic authentication with your Val Town API Token as the password (leave the username field blank).
TODO
-
/new
- render a page to write a new blob key and value- or new blob by file upload
-
/edit/:blob
- render a page to edit a blob (prefilled with the existing content)- json validation when the existing content is json
- checkbox to disable that
- json validation when the existing content is json
-
/delete/:blob
- delete a blob and render success