upend/Taskfile.yml

177 lines
3.3 KiB
YAML

# https://taskfile.dev
version: "3"
tasks:
default:
cmds:
- task: lint
- task: test
- task: build
lint:
deps: [lint:frontend, lint:backend, lint:jslib, lint:webext]
lint:frontend:
dir: webui
deps: [setup:frontend]
sources:
- ./**/*.ts
- ./**/*.svelte
cmds:
- pnpm check
- pnpm lint
lint:backend:
sources:
- ./**/Cargo.toml
- ./**/*.rs
cmds:
- cargo clippy --workspace
lint:jslib:
deps: [build:jslib]
dir: tools/upend_js
sources:
- ./*.ts
- ./package.lock
cmds:
- pnpm lint
lint:webext:
dir: webext
deps: [setup:webext]
sources:
- ./**/*.ts
- ./**/*.svelte
cmds:
- pnpm lint
test:
deps: [test:backend]
test:backend:
sources:
- ./**/Cargo.toml
- ./**/*.rs
cmds:
- cargo nextest run --workspace
build:
deps: [build:frontend, build:backend, build:webext]
build:backend:
dir: cli
sources:
- ./**/Cargo.toml
- ./**/*.rs
cmds:
- cargo build --release
build:frontend:
dir: webui
deps: [setup:frontend]
sources:
- ./**/*.ts
- ./**/*.svelte
cmds:
- pnpm build
build:jslib:
deps: [build:wasmlib]
dir: tools/upend_js
cmds:
- pnpm install --frozen-lockfile
- pnpm build
build:wasmlib:
dir: tools/upend_wasm
cmds:
- wasm-pack build --target web
setup:frontend:
deps: [build:jslib]
dir: webui
sources:
- ../tools/upend_js/*.js
- package.lock
cmds:
- pnpm install --frozen-lockfile
build:webext:
deps: [setup:webext]
dir: webext
sources:
- ./**/*.ts
- ./**/*.svelte
cmds:
- pnpm build
build:webext:package-sources:
deps: [build:webext]
cmds:
- mkdir -p webext/web-ext-artifacts/tmp/upend/
- git ls-files -z tools/upend_js | xargs -0 cp --parents -t webext/web-ext-artifacts/tmp/upend
- git ls-files -z webext | xargs -0 cp --parents -t webext/web-ext-artifacts/tmp/upend
- cd webext/web-ext-artifacts/tmp/ && zip -vr ../upend-webext-sources.zip upend
setup:webext:
deps: [build:jslib]
dir: webext
sources:
- ../tools/upend_js/*.js
- package.lock
cmds:
- pnpm install --frozen-lockfile
dev:update_tool_deps:
cmds:
- task: build:jslib
- rm -vrf webui/node_modules/.vite/deps
dev:
deps: [dev:backend, dev:frontend]
dev:backend:
dir: cli
cmds:
- cargo run --release -- serve ../example_vault --clean --no-browser --reinitialize
dev:frontend:
deps: [build:jslib]
dir: webui
cmds:
- pnpm dev --open
clean:
deps:
[clean:backend, clean:frontend, clean:webext, clean:tools, clean:vault]
clean:backend:
cmds:
- cargo clean
clean:frontend:
cmds:
- rm -rf webui/node_modules
- rm -vrf webui/dist webui/public/vendor
clean:webext:
cmds:
- rm -rf webext/node_modules
- rm -vrf webext/web-ext-artifacts webext/dist
clean:tools:
cmds:
- rm -vrf tools/upend_js/*.js
clean:vault:
cmds:
- rm -vrf example_vault/.upend
update-schema:
cmds:
- rm -f upend.sqlite3
- diesel migration run --migration-dir migrations/upend/
- diesel print-schema > src/database/inner/schema.rs