defineConfig
Name the modules that export your app's luna types, in the app's luna.config.ts.
defineConfig names the modules whose exports are your app’s luna types. It is the default export of luna.config.ts.
import { defineConfig } from "luna";
export default defineConfig({ lunas: "./lunas/list.ts" });
Reference
defineConfig(config)
import { defineConfig } from "luna";
PropType
configLunaConfig
Where the app's luna types are exported from.
Type
LunaConfigReturns the same LunaConfig. It throws if lunas names no module.
LunaConfig
PropType
lunasstring | string[]
The module whose exports are the app's luna types, relative to the config file, or one module for each language.
Type
string | string[]Good to know
- The file is called
luna.config.tsand must haveexport default defineConfig({...}). It stays TypeScript when your lunas are written in Python. luna devandluna deploylook forluna.config.tsin the folder given by--dir, the current folder by default. If it is not there, they look in that folder’slunafolder.- Each module must be inside the folder that holds the config.
- A module ending in
.pyis read by the Python SDK. Every other module is loaded with Node.js. - Every export of a module that is a luna type is deployed. Other exports are ignored. A module that exports no luna type fails the deploy, and so do two luna types with the same name.
- The config does not say where the app deploys. The project and environment come from
.env.local, whichluna projects useandluna env usewrite. A config that still names aprojectloads, andluna deploywarns you to take the field out.
Examples
Export luna types from several files
Point the config at one module that re-exports the others.
import { defineConfig } from "luna";
export default defineConfig({ lunas: "./lunas/index.ts" });
export { List } from "./list.ts";
export { Board } from "./board.ts";
Mix TypeScript and Python
Name one module for each language. Each language’s lunas can call the other’s, as Write lunas in Python shows.
import { defineConfig } from "luna";
export default defineConfig({ lunas: ["./lunas/index.ts", "./lunas/wallet.py"] });