diff --git a/.mise/config.toml b/.mise/config.toml index cd94614c..14955d62 100644 --- a/.mise/config.toml +++ b/.mise/config.toml @@ -42,6 +42,39 @@ dir = "{{cwd}}" run = "mise run tf destroy" dir = "{{cwd}}" +[tasks.dev] +description = "Run a dev server" +usage = ''' +arg "" help="Target app" { + choices "api" "awesome" "buy" "datasets" "get" "my" "root" "ui" + default "root" +} +''' +run = [ + "pnpm --filter @immich/ui --filter @immich/svelte-markdown-preprocess build", + { task = "watch-and-open", args = ["{{usage.app}}"] } +] + +[tasks."watch-and-open"] +description = "Run watch and open in parallel" +usage = ''' +arg "" help="Target app" +''' +depends = [ { task = "watch" }, { task = "open", args = ["{{usage.app}}"] } ] + +[tasks.watch] +run = "pnpm --filter @immich/ui --filter @immich/svelte-markdown-preprocess --parallel run watch" + +[tasks.open] +usage = ''' +arg "" help="Target app" +''' +run = [ + "sleep 3", + 'echo "Launching apps/{{usage.app}}.immich.app..."', + 'pnpm --filter "{{usage.app}}.immich.app" start --open' +] + [settings] experimental = true idiomatic_version_file_enable_tools = [] diff --git a/README.md b/README.md index f9495b2c..89706f51 100644 --- a/README.md +++ b/README.md @@ -1 +1,33 @@ # Static sites + +## Structure + +This repository structure is as follows + +``` +apps/ <-- web apps +packages/ <-- npm packages +``` + +## Setup + +Install [Mise](https://mise.jdx.dev/installing-mise.html) and then activate it via `mise install`. + +## Mise commands + +This `mise dev` command watches both `packages/ui` and `packages/svelte-markdown-preprocess` for changes and rebuilds them automatically. It also launches a svelte-kit development server for the selected app, or `root.immich.app` if unspecified. + +``` +mise dev # launches root.immich.app +mise dev # launches .immich.app + +# examples +mise dev api +mise dev awesome +mise dev buy +mise dev get +mise dev my +mise dev root +mise dev ui +## +``` diff --git a/packages/svelte-markdown-preprocess/package.json b/packages/svelte-markdown-preprocess/package.json index 8871836d..0de6c43f 100644 --- a/packages/svelte-markdown-preprocess/package.json +++ b/packages/svelte-markdown-preprocess/package.json @@ -11,7 +11,7 @@ "start": "npm run start:dev", "build": "tsc --project ./tsconfig.json", "test": "vitest", - "watch": "tsc --project ./tsconfig.json --watch" + "watch": "tsc --project ./tsconfig.json --watch --preserveWatchOutput" }, "files": [ "dist",