verify any file with signatures from people you trust. built using typescript, lit, and vite+.
vite+ is used to develop, test, lint, and build the site. see their docs for specifics not covered here.
-
the global
vpcli, which picks the node.js and pnpm versions indevEnginesinpackage.jsonautomatically:curl -fsSL https://vite.plus | bash -
nak, whose built-in relay is used for local development and testing.
install dependencies:
vp installconfiguration is done through environment variables. see vite's guide for full details.
.env.development is under version control to quickly bootstrap your
development environment.
start a local relay with sample data:
vp run dev:relaythen, in another terminal, start the development server:
vp devvitest runs the unit tests, which sit next to the modules they test
(file.ts → file.test.ts). to run them once:
vp testor to rerun them as files change:
vp test watchto see how much of src/services they cover, with an html report in coverage:
vp test --coverageci adds the coverage table to each run's summary. components aren't counted, since the end-to-end tests cover them.
playwright runs the end-to-end tests in e2e against chromium,
firefox, and webkit. it starts its own nak relay and development
server on separate ports, so nak needs to be installed, but nothing needs to be running. install
the browsers once:
vp exec playwright installthen run the tests:
vp run test:e2ea slower test that hashes a file over 512 mb only runs when asked for:
E2E_LARGE_FILE=1 vp run test:e2eoxfmt enforces a consistent code style, and
oxlint enforces a level of code quality and checks
types, both configured in vite.config.ts. stylelint is
setup with the standard config to enforce
css rules. it's recommended to install the
vite+ extension pack
and a stylelint integration for your
editor, which format and fix on save.
to run all via the command line:
vp run checkor to fix what can be fixed automatically:
vp run check:fixa pre-commit hook also fixes what it can in staged files. it's installed by vp install, and can be
turned off in your clone:
vp hooks disablewhen the development branch is ready for release,
release it! is used to orchestrate the release process:
vp run releaseonce the release process is complete, merge the development branch into the main branch, which
should always reflect the latest release.
to generate a production build via the command line:
vp buildthis creates a dist directory with the files to be deployed.
a Dockerfile is included that builds and serves the site:
-
make sure you have docker installed and running. docker desktop is an easy way to get started on your own machine.
-
build an image named
hasheusfrom theDockerfile:docker build --tag hasheus .this generates a production build of the site using
.env.production. docker-static-website is used to serve the site. -
start a new container using the image, which serves the site on port
3000:docker run --interactive --tty --rm --init --publish 3000:3000 hasheus
if you're just looking to build the site, but not serve it, you can change the docker build
command to export the dist directory from the docker image to your host machine:
docker build --target=export --output=dist --tag hasheus .