Initial commit
This commit is contained in:
104
Taskfile.yml
Normal file
104
Taskfile.yml
Normal file
@@ -0,0 +1,104 @@
|
||||
version: '3'
|
||||
|
||||
dotenv: ['.env.test']
|
||||
|
||||
vars:
|
||||
MAX: '20'
|
||||
CAT: ''
|
||||
FORMAT: 'pretty'
|
||||
CONTINUATION: ''
|
||||
|
||||
tasks:
|
||||
|
||||
# ── Build ──────────────────────────────────────────────────────────────────
|
||||
|
||||
build:
|
||||
desc: Compile TypeScript to dist/
|
||||
cmds:
|
||||
- npm run build
|
||||
|
||||
dev:
|
||||
desc: Watch mode — recompile on change
|
||||
cmds:
|
||||
- npm run dev
|
||||
|
||||
# ── Code quality ───────────────────────────────────────────────────────────
|
||||
|
||||
lint:
|
||||
desc: Run ESLint
|
||||
cmds:
|
||||
- npm run lint
|
||||
|
||||
format:
|
||||
desc: Format source with Prettier
|
||||
cmds:
|
||||
- npm run format
|
||||
|
||||
# ── Tests ──────────────────────────────────────────────────────────────────
|
||||
|
||||
test:
|
||||
desc: Run all unit tests
|
||||
cmds:
|
||||
- npm test
|
||||
|
||||
test:watch:
|
||||
desc: Run tests in watch mode
|
||||
cmds:
|
||||
- npm run test:watch
|
||||
|
||||
test:coverage:
|
||||
desc: Run tests with coverage report
|
||||
cmds:
|
||||
- npm run test:coverage
|
||||
|
||||
# ── FreshRSS CLI runner ────────────────────────────────────────────────────
|
||||
|
||||
categories:
|
||||
desc: List all FreshRSS categories
|
||||
cmds:
|
||||
- npx ts-node scripts/freshrss-run.ts categories --format {{.FORMAT}}
|
||||
|
||||
unread:
|
||||
desc: "Fetch unread articles [MAX=20] [FORMAT=pretty|json] [CONTINUATION=<token>]"
|
||||
cmds:
|
||||
- >
|
||||
npx ts-node scripts/freshrss-run.ts unread
|
||||
--max {{.MAX}}
|
||||
--format {{.FORMAT}}
|
||||
{{if .CONTINUATION}}--continuation {{.CONTINUATION}}{{end}}
|
||||
|
||||
unread-by-category:
|
||||
desc: "Fetch unread articles by category CAT=<name> [MAX=20] [FORMAT=pretty|json]"
|
||||
cmds:
|
||||
- >
|
||||
npx ts-node scripts/freshrss-run.ts unread-by-category
|
||||
--category "{{.CAT}}"
|
||||
--max {{.MAX}}
|
||||
--format {{.FORMAT}}
|
||||
{{if .CONTINUATION}}--continuation {{.CONTINUATION}}{{end}}
|
||||
|
||||
unread-json:
|
||||
desc: "Fetch unread articles as raw JSON (pipe to jq) [MAX=20]"
|
||||
cmds:
|
||||
- >
|
||||
npx ts-node scripts/freshrss-run.ts unread
|
||||
--max {{.MAX}}
|
||||
--format json
|
||||
|
||||
# ── Composite ─────────────────────────────────────────────────────────────
|
||||
|
||||
check:
|
||||
desc: Lint + test (pre-push safety check)
|
||||
cmds:
|
||||
- task: lint
|
||||
- task: test
|
||||
|
||||
setup:
|
||||
desc: Install dependencies and copy .env.test.example if .env.test is missing
|
||||
cmds:
|
||||
- npm install
|
||||
- |
|
||||
if [ ! -f .env.test ]; then
|
||||
cp .env.test.example .env.test
|
||||
echo ".env.test created — fill in your credentials"
|
||||
fi
|
||||
Reference in New Issue
Block a user