ProloguePackages

Marmeon 1.2.3 — the documentation of the 1.x line. The newest version of this page: /docs/packages

I · Prologue

Packages

On this page

Introduction

Marmeon is a set of packages that are released together. A new app depends on most of them already, and you add the others when you need what they bring. Each installed package registers itself through discovery, so adding one is a single command, in the version your app already has:

pnpm marmeon add redis

Without marmeon add (yarn, bun, a workspace), install it yourself: pnpm add -E @marmeon/redis@<version of your app>.

Every package has the same version as every other: upgrade them together. Each pins the others exactly, so one in another version (pnpm add @marmeon/redis takes latest, which an app on a release candidate is not) brings a second copy of @marmeon/core, and the package manager's only sign is a warning about peers. -E saves the version exactly. A new app saves exactly by itself (saveExact: true in pnpm-workspace.yaml, save-exact=true in .npmrc for npm); an app that is older can set it too. marmeon check finds a package in another version, and marmeon dev warns about it at the start. The release policy explains why.

What a new app has

pnpm create marmeon installs these packages:

PackageWhat it bringsRead more
@marmeon/coreThe application, modules, service providers, the container, configuration, events and the clock.Modules, container, providers, configuration, events
marmeonThe command: dev, build, start, the generators and tinker.Console, deployment
@marmeon/routerRoutes, invokable controllers, requests with schemas, route model binding and middleware.Routing, controllers, requests, middleware
@marmeon/httpControllers, pages and their props, redirects, signed URLs, cookies, and the browser's side of every visit.Responses, pages, URL generation
@marmeon/serverThe HTTP server, server rendering, health checks and the graceful stop.Request lifecycle, health checks
@marmeon/sessionSessions with their drivers, flash data and CSRF protection.Session, CSRF protection
@marmeon/encryptionEncryption with APP_KEY and key rotation, behind every cookie and session.Encryption
@marmeon/validationThe validation rules, with messages in the request's language.Validation
@marmeon/i18nTranslations, the request's language and formatting.Localization
@marmeon/databaseConnections, migrations, table types, repositories, factories, transactions and pagination.Database, repositories, migrations
@marmeon/cacheThe cache, atomic locks and rate limits.Cache, rate limiting
@marmeon/authSign-in, password hashing and reset, the confirmation of an address, API tokens, policies and make:auth.Authentication, authorization, starter kit
@marmeon/mailMails as classes, queued sending and previews.Mail
@marmeon/queueJobs, workers, retries and failed jobs.Queues
@marmeon/schedulerScheduled tasks.Task scheduling
@marmeon/storageDisks on the local file system or S3, signed URLs and uploads.File storage
@marmeon/liveLive updates: pages reload their data when the server hints a change.Real-time updates
@marmeon/notificationsNotifications over mail, the database and live updates.Notifications
@marmeon/fetchOutgoing HTTP requests that refuse addresses that are not public, with a fake for tests.HTTP client
@marmeon/logThe logger: readable in development, JSON in production.Logging
@marmeon/reactThe React side: pages, layouts, <Link>, forms, islands and dialogs.Pages, navigation, forms

As dev dependencies, a new app has three more:

PackageWhat it bringsRead more
@marmeon/viteThe Vite plugin: the entries, the injection lists and the check that keeps server code out of the browser.Asset bundling
@marmeon/testingcreateTestApp(), requests and assertions, the database refresh and the fakes.Testing, fakes
@marmeon/devtoolsWhat the app did while you develop: requests, queries, jobs and mails. Development only.Devtools

Packages you add

PackageWhat it bringsRead more
@marmeon/redisRedis connections for the cache, sessions, the queue and live updates.Redis
@marmeon/tableData tables driven by the server: columns, sorting, filters, actions and CSV export.Data tables
@marmeon/chat-notificationsChat messages to Slack, Discord and Teams through incoming webhooks, now or queued, with a fake for tests.Chat notifications
@marmeon/oauthSocial login: OAuth 2.0 and OpenID Connect providers you register by name, linked accounts and make:oauth.Social login
@marmeon/otelOpenTelemetry traces of requests, queries, jobs and mails.Observability

Add one with marmeon add, which installs it at the version of your app:

pnpm marmeon add redis

The command takes the short name (redis) or the full one (@marmeon/redis), and no version. It does four things:

  1. It installs the package with your package manager (pnpm or npm, by your lockfile) at exactly the version of your app, as a development dependency for devtools, testing and vite.
  2. It runs marmeon discover, so the app finds the package's provider.
  3. It copies the migrations of a package that ships some (auth, cache, live, notifications, oauth, queue, session, storage) with marmeon publish. That boots the app, so it needs a .env the app boots with.
  4. It prints the next step: marmeon migrate after a publish, and the marmeon docs page of each package.

marmeon add redis --dry-run prints the commands and changes nothing. If the install fails or you press Ctrl-C, package.json and the lockfile are put back as they were; run pnpm install to bring node_modules back. A pnpm that stops because a dependency's build script is not approved (ERR_PNPM_IGNORED_BUILDS) needs pnpm approve-builds first.

Once the install has finished, its files stay as it left them, even when a later step fails: when the package manager installed another version than your app's (a release the package manager holds back for its first day, for example), or when discover or publish fails. The command then says what to run.

marmeon add refuses when it cannot be sure of the result: your framework packages are not all in one version, one comes from a workspace, a path or a patch rather than the registry, the package is listed only under peerDependencies, the app is part of a workspace, it has no lockfile or one of another package manager, package.json cannot be read, or anything else the command names. It then says what to change. With yarn or bun, or in a workspace, install the package yourself at the version of your app (pnpm add -E @marmeon/redis@<version of your app>) and run marmeon discover, and marmeon publish <package> for a package with migrations.

A package that needs a library of its own names the exact install command when the library is missing. The deployment page lists them.

The creator

create-marmeon is the package behind pnpm create marmeon. It writes a new app and is not a dependency of it. The installation page covers its questions and options.