A GreyCat Web application template.
- Backend:
greycat init --root_pass=changeme greycat serve
- Frontend:
pnpm install pnpm dev
- Ensure the versions are updated in
package.json, mainly for@greycat/web - This template application uses
app-as a WebComponent namespace placeholder. Make sure to update it (or not) to whatever makes more sense for you. (For instance, the GreyCat Explorer namespaces its WebComponents toxp-for "xplorer")
- This template is an MPA (Multi Pages Application) that uses HTML/CSS/TypeScript and GreyCat Web.
It gives you the ability to develop your Web components using TSX by providing a custom-made jsx-runtime that transpiles to native DOM elements. (To learn more about
@greycat/webrefer to its documentation) - Make sure to import the Web Component file before using it, as Web Component have to define themselves before being used:
import './app-component'; // this line is important app.main.replaceChildren(<app-component />);
clean: deletes the webapp build directorybuild: build the webapp using Vite.jsdev: starts the webapp dev server using Vite.jslint: lints the webapp & the server appgen: generates the TypeScript bindings fromproject.gclintocommon/projecttest: runs GreyCat's test runner