version: "3" dotenv: [".env"] includes: web: taskfile: ./apps/web tasks: py:init: POETRY_VIRTUALENVS_IN_PROJECT=true poetry install --no-cache --no-interaction --all-extras py:run: poetry run python3 {{.CLI_ARGS}} stripe: cmds: - stripe listen --print-secret | tr -d '\r\n' | (echo -n 'STRIPE_WEBHOOK_SECRET="'; cat; echo '"') > .env.stripe - stripe listen --skip-verify --forward-to http://localhost:8788/webhook/stripe bacon: bacon {{.CLI_ARGS}} stat: btop -f anarlog -u 500 --preset 1 clean-plugins: cmds: - find plugins -mindepth 1 -maxdepth 1 -type d ! -exec test -f {}/Cargo.toml \; -exec rm -rf {} \; diff: vars: DIFF_FROM: "desktop_v0.0.79" DIFF_TO: "desktop_v0.0.80" PATHS: "apps/desktop/src-tauri plugins crates" cmds: - git diff {{.DIFF_FROM}} {{.DIFF_TO}} -- {{.PATHS}} | diff2html -i stdin jsonschema: cmds: - | jsonschema validate ./plugins/db/seed/schema.json ./plugins/db/seed/onboarding.json jsonschema validate ./plugins/db/seed/schema.json ./plugins/db/seed/dev.json i18n: cmds: - | pnpm -F desktop lingui:extract | awk -F '│' '($2 ~ /[^ ]/ && $3 ~ /[0-9-]/) { gsub(/^ *| *$/, "", $2); gsub(/[^0-9-]/, "", $3); gsub(/^ *| *$/, "", $4); printf "{\"language\":\"%s\",\"total\":%d,\"missing\":%d}\n", $2, ($3 == "-" ? 0: $3), ($4 == "-" ? 0: $4) }' stt: cmds: - chmod +x ./apps/desktop/src-tauri/resources/stt-aarch64-apple-darwin - chmod +x ./apps/desktop/src-tauri/resources/passthrough-aarch64-apple-darwin db: env: DB: /Users/yujonglee/Library/Application Support/hyprnote/db.sqlite cmds: - | sqlite3 -json "$DB" 'SELECT store FROM main LIMIT 1;' | jq -r '.[0].store' | jless env-sample: vars: INPUT_ENV: '{{.INPUT_ENV | default ".env"}}' OUTPUT_ENV: '{{.OUTPUT_ENV | default ".env.sample"}}' cmds: - sed -E '/^[A-Z_][A-Z0-9_]*=/s/=.*/=""/' {{.INPUT_ENV}} > {{.OUTPUT_ENV}} supabase: cmds: - pnpm exec supabase {{.CLI_ARGS}} supabase-stop: cmds: - pnpm exec supabase stop - task: supabase-tunnel-stop supabase-tunnel-start: platforms: [darwin] cmds: - bash scripts/supabase-tunnel-start.sh supabase-expose: platforms: [darwin] cmds: - task: supabase-tunnel-stop - task: supabase-env - task: supabase-tunnel-start supabase-no-expose: platforms: [darwin] cmds: - task: supabase-tunnel-stop - task: supabase-env supabase-tunnel-stop: platforms: [darwin] cmds: - bash scripts/supabase-tunnel-stop.sh supabase-env: internal: true cmds: - | pnpm exec supabase status --output=env | awk -F= ' /^ANON_KEY=/ { print "SUPABASE_ANON_KEY=" $2; print "VITE_SUPABASE_ANON_KEY=" $2 } /^API_URL=/ { print "SUPABASE_URL=" $2; print "VITE_SUPABASE_URL=" $2 } /^DB_URL=/ { print "DATABASE_URL=" $2 } /^FUNCTIONS_URL=/ { print "SUPABASE_FUNCTIONS_URL=" $2; print "VITE_SUPABASE_FUNCTIONS_URL=" $2 } /^GRAPHQL_URL=/ { print "SUPABASE_GRAPHQL_URL=" $2; print "VITE_SUPABASE_GRAPHQL_URL=" $2 } /^INBUCKET_URL=/ { print "SUPABASE_INBUCKET_URL=" $2 } /^JWT_SECRET=/ { print "SUPABASE_JWT_SECRET=" $2 } /^MAILPIT_URL=/ { print "SUPABASE_MAILPIT_URL=" $2 } /^MCP_URL=/ { print "SUPABASE_MCP_URL=" $2 } /^PUBLISHABLE_KEY=/ { print "SUPABASE_PUBLISHABLE_KEY=" $2; print "VITE_SUPABASE_PUBLISHABLE_KEY=" $2 } /^REST_URL=/ { print "SUPABASE_REST_URL=" $2; print "VITE_SUPABASE_REST_URL=" $2 } /^SECRET_KEY=/ { print "SUPABASE_SECRET_KEY=" $2 } /^SERVICE_ROLE_KEY=/ { print "SUPABASE_SERVICE_ROLE_KEY=" $2 } /^STUDIO_URL=/ { print "SUPABASE_STUDIO_URL=" $2 } ' > .env.supabase supabase-storage-seed-config: internal: true vars: SUPABASE_STORAGE_ASSETS_DIR: '{{.SUPABASE_STORAGE_ASSETS_DIR | default "./.seed/storage/assets"}}' SUPABASE_STORAGE_ASSETS_BUCKET: '{{.SUPABASE_STORAGE_ASSETS_BUCKET | default "assets"}}' SUPABASE_STORAGE_MODELS_DIR: '{{.SUPABASE_STORAGE_MODELS_DIR | default "./.seed/storage/models"}}' SUPABASE_STORAGE_MODELS_BUCKET: '{{.SUPABASE_STORAGE_MODELS_BUCKET | default "models"}}' SUPABASE_STORAGE_AUDIO_FILES_DIR: '{{.SUPABASE_STORAGE_AUDIO_FILES_DIR | default "./.seed/storage/audio-files"}}' SUPABASE_STORAGE_AUDIO_FILES_BUCKET: '{{.SUPABASE_STORAGE_AUDIO_FILES_BUCKET | default "audio-files"}}' cmds: - mkdir -p supabase/{{.SUPABASE_STORAGE_ASSETS_DIR}} supabase/{{.SUPABASE_STORAGE_MODELS_DIR}} supabase/{{.SUPABASE_STORAGE_AUDIO_FILES_DIR}} - | cargo xtask toml-set supabase/config.toml \ storage.buckets.{{.SUPABASE_STORAGE_ASSETS_BUCKET}}.public true \ storage.buckets.{{.SUPABASE_STORAGE_ASSETS_BUCKET}}.file_size_limit '"5GiB"' \ storage.buckets.{{.SUPABASE_STORAGE_ASSETS_BUCKET}}.allowed_mime_types '[]' \ storage.buckets.{{.SUPABASE_STORAGE_ASSETS_BUCKET}}.objects_path '"{{.SUPABASE_STORAGE_ASSETS_DIR}}"' \ storage.buckets.{{.SUPABASE_STORAGE_MODELS_BUCKET}}.public true \ storage.buckets.{{.SUPABASE_STORAGE_MODELS_BUCKET}}.file_size_limit '"5GiB"' \ storage.buckets.{{.SUPABASE_STORAGE_MODELS_BUCKET}}.allowed_mime_types '[]' \ storage.buckets.{{.SUPABASE_STORAGE_MODELS_BUCKET}}.objects_path '"{{.SUPABASE_STORAGE_MODELS_DIR}}"' \ storage.buckets.{{.SUPABASE_STORAGE_AUDIO_FILES_BUCKET}}.public true \ storage.buckets.{{.SUPABASE_STORAGE_AUDIO_FILES_BUCKET}}.file_size_limit '"5GiB"' \ storage.buckets.{{.SUPABASE_STORAGE_AUDIO_FILES_BUCKET}}.allowed_mime_types '[]' \ storage.buckets.{{.SUPABASE_STORAGE_AUDIO_FILES_BUCKET}}.objects_path '"{{.SUPABASE_STORAGE_AUDIO_FILES_DIR}}"' # infisical run --env=dev --projectId=87dad7b5-72a6-4791-9228-b3b86b169db1 --path="/supabase" -- task supabase-start supabase-start: cmds: - cp supabase/config.default.toml supabase/config.toml - cargo xtask supabase-patch # - task: supabase-storage-seed-config # - '[ ! -f supabase/signing_keys.json ] && pnpm exec supabase gen signing-key --algorithm ES256 | jq -s ''.'' > supabase/signing_keys.json || true' # - cargo xtask toml-set supabase/config.toml auth.signing_keys_path '"./signing_keys.json"' - pnpm exec dprint fmt supabase/config.toml - pnpm exec supabase start -x realtime,logflare - task: supabase-env - pnpm exec supabase migration up --local nango-dev-connection: silent: true requires: vars: [DEV_NANGO_CONNECTION_ID] vars: USER_ID: '{{.USER_ID | default ""}}' INTEGRATION_ID: '{{.INTEGRATION_ID | default "google-calendar"}}' PROVIDER: '{{.PROVIDER | default "google-calendar"}}' cmds: - | DB_URL=$(pnpm exec supabase status --output=env 2>/dev/null | awk -F= '/^DB_URL=/{gsub(/^"|"$/, "", $2); print $2}') if [ -z "$DB_URL" ]; then echo "DB_URL not found. Start local Supabase first (e.g. task supabase-start)." >&2 exit 1 fi USER_ID="{{.USER_ID}}" if [ -z "$USER_ID" ]; then USER_ID=$(psql "$DB_URL" -tAc "SELECT id::text FROM auth.users ORDER BY created_at DESC LIMIT 1") fi if [ -z "$USER_ID" ]; then echo "No user found in auth.users. Sign in once, or pass USER_ID explicitly." >&2 exit 1 fi psql "$DB_URL" \ -v ON_ERROR_STOP=1 \ -c "INSERT INTO nango_connections (user_id, integration_id, connection_id, provider) VALUES ('$USER_ID'::uuid, '{{.INTEGRATION_ID}}', '{{.DEV_NANGO_CONNECTION_ID}}', '{{.PROVIDER}}') ON CONFLICT (user_id, integration_id) DO UPDATE SET connection_id = EXCLUDED.connection_id, provider = EXCLUDED.provider, updated_at = now(), status = 'connected', last_error_type = NULL, last_error_description = NULL, last_error_at = NULL;" \ >/dev/null printf 'ok user_id=%s integration_id=%s connection_id=%s\n' "$USER_ID" "{{.INTEGRATION_ID}}" "{{.DEV_NANGO_CONNECTION_ID}}" nango-dev-user-id: silent: true internal: true cmds: - | DB_URL=$(pnpm exec supabase status --output=env 2>/dev/null | awk -F= '/^DB_URL=/{gsub(/^"|"$/, "", $2); print $2}') if [ -z "$DB_URL" ]; then echo "DB_URL not found. Start local Supabase first (e.g. task supabase-start)." >&2 exit 1 fi USER_ID=$(psql "$DB_URL" -tAc "SELECT id::text FROM auth.users ORDER BY created_at DESC LIMIT 1") if [ -z "$USER_ID" ]; then echo "No user found in auth.users. Sign in once first." >&2 exit 1 fi printf 'user_id=%s\n' "$USER_ID"