Sync โ
Since the Host and Remote live in separate repositories, there is a small helper library called mono-utils that handles syncing between them.
The templates Mono Host and Mono Remote already ship with mono-utils installed.
Sync flows both ways through GitHub โ a Remote pulls in shell updates from the Host, and the Host pulls in each Remote's new modules:
Setup Sync โ
Both Mono Host and Mono Remote use these files to handle the syncing process:
mono-vue-remote/
โโโ .apps/
โโโ mono.config.ts
โโโ package.json
โโโ .env.dev
โโโ .envmono.config.ts โ
Points to the apps you want to sync. If you're on a Remote, list your Host here:
ts
import { defineConfig, JWTCompleteTokenTypes } from "mono-utils/runtime";
export default defineConfig({
name: 'mono-remote',
apps: [
{
name: 'mono-host',
url: 'https://github.com/EJI-ICT/mono-vue-host',
envToken: 'MONO_TOKEN'
}
]
});The url carries the ref (branch / tag / commit) directly, GitHub-style:
https://github.com/EJI-ICT/mono-vue-hostโ defaults to themainbranchhttps://github.com/EJI-ICT/mono-vue-host/tree/v4.0.7โ a taghttps://github.com/EJI-ICT/mono-vue-host/tree/feat/layout-programโ a branch (slashes are fine)https://github.com/EJI-ICT/mono-vue-host/tree/deac44a955ac63981e6bae705f5df3f2d61dcf0fโ a commit SHA
.env and .env.dev โ
The envToken above (MONO_TOKEN) lives in .env or .env.dev โ just a normal GitHub token.
MONO_TOKEN=YOUR_GITHUB_TOKENpackage.json โ
The sync script:
json
{
"name": "mono-vue",
"private": true,
"version": "1.0.0",
"type": "module",
"scripts": {
"mono:sync": "mono sync",
...
},
"dependencies": {
...
},
"devDependencies": {
...
}
}Run Sync โ
Then run:
pnpm mono:syncIt will download each app listed in mono.config.ts using the GitHub token from .env.dev or .env, and place them into your .apps/ folder.