https://github.com/drsensor/htmlbuttonelement-in-space
My entry for JS13K 2021
https://github.com/drsensor/htmlbuttonelement-in-space
Last synced: about 2 months ago
JSON representation
My entry for JS13K 2021
- Host: GitHub
- URL: https://github.com/drsensor/htmlbuttonelement-in-space
- Owner: DrSensor
- License: bsd-4-clause
- Created: 2021-09-13T07:53:41.000Z (almost 5 years ago)
- Default Branch: trunk
- Last Pushed: 2022-11-12T11:48:51.000Z (over 3 years ago)
- Last Synced: 2026-01-02T00:56:48.071Z (6 months ago)
- Language: Nix
- Size: 185 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# js13k template
> with parcel (and nix flake)
## Setup
There is 2 (4 if you count pnpm and yarn) way to setup.
### using **npm**
In this approach, no linter or formatter are installed. Only `parcel`.
Install all dependencies via:
```sh
npm install
```
then you can run the project using:
```sh
npx parcel serve index.html
```
or build for production using:
```sh
# for browser bundle
npx parcel build index.html --target {desktop,mobile,xr} # choose one
# build to run in nodejs (server), not browser
npx parcel build server.ts --target server
```
### using **nix** (experimental)
This require [nix flake to be enabled](https://serokell.io/blog/practical-nix-flakes#getting-started-with-nix). This approach will automatically install both project dependencies and all toolchains like linter, formatter, and nodejs.
- linter: [dlint](https://github.com/denoland/deno_lint)
- formatter: [dprint](https://dprint.dev)
> [**TOFU**](https://github.com/msteen/nix-prefetch/#tofu): [Supply all (or one of the platform) sha256](./integrity.nix) first before running any nix command.
#### dev environment
Run this once or twice to enter the development environment.
```sh
nix develop
```
#### TODO: build for production
You can build for all target:
```sh
nix build
```
or specify which target to build:
```sh
nix build '.#desktop' # or '.#mobile' or '.#xr' or '.#server'
```
### cleanup
In case unexpected things happen.
```sh
rm .parcel-cache/ dist/ node_modules/ -fr
rm package-lock.json yarn.lock pnpm-lock.yaml -f
```