Manual Installation
This guide will walk you through installing and configuring Lunaria in your existing project manually.
1. Add the @lunariajs/core package
Section titled “1. Add the @lunariajs/core package”Lunaria is published through the @lunariajs/core package in the npm registry. Add it to your project by running the following command in the project’s root directory:
npm install @lunariajs/corepnpm install @lunariajs/coreyarn add @lunariajs/coreThen, add the following lunaria commands as part of your package.json’s scripts field:
"scripts": { "dev": "astro dev", "build": "astro build", "preview": "astro preview", "lunaria:build": "lunaria build", "lunaria:preview": "lunaria preview",}2. Create lunaria.config.mjs
Section titled “2. Create lunaria.config.mjs”Lunaria is configured using a lunaria.config.mjs file. This file is required so Lunaria knows about your repository structure and what should be tracked.
import { defineConfig } from '@lunariajs/core/config';
export default defineConfig({});3. Configure the package
Section titled “3. Configure the package”Before generating your first localization dashboard, you have to set up the repository, sourceLocale, locales, and files fields of your lunaria.config.mjs file.
The following example sets up Lunaria to track Markdown content for both English and Portuguese in a sample project, hosted on https://github.com/me/cool-docs/:
import { defineConfig } from '@lunariajs/core/config';
export default defineConfig({ repository: { name: 'me/cool-docs', }, sourceLocale: { label: 'English', lang: 'en', }, locales: [ { label: 'Português', lang: 'pt', }, ], files: [ { include: ['content/en/**/*.md'], pattern: 'content/@lang/@path', type: 'universal', }, ],});Learn more about all the available options in the Configuration Reference guide.
4. Next Steps
Section titled “4. Next Steps”Success, you’re now ready to start using Lunaria in your project!
If you followed this guide completely, you can jump to Build your first dashboard to learn how to generate your localization dashboard, see it in your browser, and our recommended next steps.