Apps
Apps encapsulate all the business logic of the application to be delivered. This includes entities such as Templates, Unions, Events, Mutations, Queries — which are described later in this specification.
prn::<appname>:<entity>/<path>appname is set by the builder app.configure() function. The entry-level app has an appname of root by default. Other than acting as this default, root is a reserved name and cannot be assigned.
In the following example, the App will have the default appname of root.
import type { AppBuilder } from '@alpynejs/builder';
export default (app: AppBuilder) => { // ... calls to app to build the definition ...};In this example, the App will have an appname of todoList.
import type { AppBuilder } from '@alpynejs/builder';
export default (app: AppBuilder) => { app.configure('todoList'); // ... calls to app to build the definition ...};Dependencies
Section titled “Dependencies”A major goal of Alpyne is composing logic. An app may import other apps as libraries, which are then namespaced. To be imported, the app must have an appname. Only the top-level App may use the root default.
import type { AppBuilder } from '@alpynejs/builder';import otherSpec from '@my-app/other';
export default (app: AppBuilder) => { app.configure('todoList'); const other = app.addDependency(otherSpec); // ... calls to app (and other) to build the definition ...};