A template for applications using preact
, htm
, and typescript. Uses tape-run
for tests in a browser environment. See template-ts-preact-htm for something similar but for dependency modules.
-
Use the template button in github. Or clone this then
rm -rf .git && git init
. Thennpm i && npm init
. -
Edit the source code in
src/
.
preversion
npm hook -- lint viastandardx
.postversion
npm hook --git push && git push --tags
- eslint via standardx --
npm run lint
- test in a browser environment via
tape-run
-- seenpm test
. Includestap
testing tools -- tapzero and tap-arc - CI via github actions
- routing via route-event and @bicycle-codes/routes
See this article for more details about application architecture.
We create application state and logic in the file ./src/state.ts. This exports static functions, creates a state object, and sets up URL routing.
In the view code, you would call the functions exposed here with a state object, in response to application events.