feat(cli): allow all sync options to be passable from wmill.yaml directly

This commit is contained in:
Ruben Fiszel
2024-01-27 16:19:10 +01:00
parent 28a196657f
commit 2a80df4a80
5 changed files with 71 additions and 59 deletions
+6 -4
View File
@@ -3,18 +3,20 @@ import { Application, Command, Router, log, open, path } from "./deps.ts";
import { GlobalOptions } from "./types.ts";
import { ignoreF } from "./sync.ts";
import { requireLogin, resolveWorkspace } from "./context.ts";
import { SyncOptions, mergeConfigWithConfigFile } from "./conf.ts";
const PORT = 3001;
async function dev(opts: GlobalOptions & { filter?: string }) {
async function dev(opts: GlobalOptions & SyncOptions) {
const workspace = await resolveWorkspace(opts);
await requireLogin(opts);
log.info("Started dev mode");
let currentLastEdit: LastEdit | undefined = undefined;
const watcher = Deno.watchFs(opts.filter ?? ".");
const watcher = Deno.watchFs(".");
const base = await Deno.realPath(".");
const ignore = await ignoreF();
opts = await mergeConfigWithConfigFile(opts);
const ignore = await ignoreF(opts);
async function watchChanges() {
for await (const event of watcher) {
@@ -159,7 +161,7 @@ async function dev(opts: GlobalOptions & { filter?: string }) {
const command = new Command()
.description("Launch a dev server that will spawn a webserver with HMR")
.option(
"--filter <filter:string>",
"--includes <pattern...:string>",
"Filter paths givena glob pattern or path"
)
// deno-lint-ignore no-explicit-any