Concrete
Rulesworkspace

concrete/workspace/template-invalid

`template.ts` does not default-export a `defineTemplate` value.

template.ts does not default-export a defineTemplate value.

Graded by the workspace stage of concrete check, in the tree venue. A violation reports this id and the file it failed at — see every rule and concrete check.

Reason

The workspace loads by reading template.ts's default export and asking whether it is a defineTemplate value; a workspace offers no second route to that declaration. An export of another shape — a plain object with the right keys, a component, a factory nobody called — leaves the loader with no pages, no format and no identity, and it stops there rather than guessing which of them you meant.

Fix

Default-export the defineTemplate call itself, at module scope. An object that merely looks like a template is not one: the parse, the defaults and the identity all happen inside that call.

Before and after

import { type PageComponent, website } from "@homepages/concrete";

declare const Home: PageComponent;

// The right keys, and still not a `defineTemplate` value.
export default {
  key: "meridian",
  name: "Meridian",
  format: website,
  pages: { home: { label: "Home", path: "/", page: Home } },
};
import { defineTemplate, type PageComponent, website } from "@homepages/concrete";
import icon from "./icon.svg";

declare const Home: PageComponent;

export default defineTemplate({
  key: "meridian",
  name: "Meridian",
  format: website,
  icon,
  scope: "global",
  pages: { home: { label: "Home", path: "/", page: Home } },
});

On this page