An example/template project for a simple AlpineJS development environment using Deno.
This example/template project contains a simple web-development environment:
The dependencies are:
Objective is that the development environment is straightforward, understandable and adaptable to new requirements.
The typescript components from NxtLvLSoftware/alpine-typescript project are used, to allow typescript checks for the component code as much as possible (instead of using inline-javascript code inside the html file(s), which is the most common and straightforward way of using AlpineJS presented in many tutorials and examples, but it makes use of typescript checks very complicated).
In addition to using typescript components, this project presents an idea to assemble also html code based on components. This is based on an idea, that the html code is generated by a script, in which the individual components are appended to html code by calling a specific function which prints out the component html code.
This brings kind-of "single-file-components" feature to AlpineJS; it is helpful (in design-, development- and maintenance-wise) to have the html code and the related typescript/javascript code contained in the same file. Also this concept can be easily applied to situations where components are composed of sub-components, nested as deeply as needed.
I'm using bash shell scripts for the development tasks:
src/_genHTML_index.ts
about html code generation).deno --version
to test your Deno install).example1_multigreet
directory../_check.sh
to run typescript checks../_bundle.sh
to build html and js files into wwwroot
directory../_test.sh
to start a Deno test www-server on localhost port 8888.http://localhost:8888
.There probably exists more advanced development environments already, with features like hot-module-replacement etc.
However, my own experience is that it may be difficult to handle these advanced tools, to combine them with other tools, and then/eventually to keep them all functional in the long run.
This is a safe and simple "old-school" development environment, easy to understand, maintain and develop further.