Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: 18
cache: 'yarn'
cache: 'npm'
env:
NODE_OPTIONS: "--max_old_space_size=4096"
- run: yarn install --frozen-lockfile
- run: yarn check:tsc
- run: yarn lint
- run: yarn format
- run: yarn test
- run: npm ci
- run: npm run check:tsc
- run: npm run lint
- run: npm run format
- run: npm test
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ android/app/google-services.json
#
node_modules/
npm-debug.log
yarn-error.log

# fastlane
#
Expand Down
2 changes: 1 addition & 1 deletion .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

yarn commitlint --edit "$1"
npx --no-install commitlint --edit "$1"
2 changes: 1 addition & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

yarn lint
npm run lint
29 changes: 29 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# AGENTS.md — UDev

React Native 0.73 (RN CLI, not Expo) unofficial dev.to Android client. Entry: `index.js` → `App.tsx` → `src/router/index.tsx` (stack over bottom tabs).

## Commands (npm only, Node >=18)

- `npm ci` — CI install; `postinstall` runs `husky install && patch-package`, keep it working.
- `npm start` / `npm run android` / `npm run ios` — dev server / run. Native deps: `Gemfile` pins `cocoapods >=1.13, <1.15`.
- Verify (same order as CI in `.github/workflows/ci.yml`): `npm run check:tsc` → `npm run lint` → `npm run format` → `npm test`
- `npm run lint` = `biome check ./` (fails on lint+format+import-organize issues); fix with `npm run lint:apply` (`--apply-unsafe`).
- `npm run format` is check-only; fix with `npm run format:apply`.
- `npm run check:tsc` = `tsc --noEmit` (extends `@react-native/typescript-config`).
- Tests: `npm test` (`jest`, preset `react-native`). Only coverage is `src/utils/__tests__/*.spec.ts`; single test: `npx jest src/utils/__tests__/url.spec.ts`.
- Release: `npm run android:release` (clean → bundleRelease → assembleRelease).

## Architecture

- `src/api/` — thin axios wrappers over `https://dev.to/api` (`src/utils/const.ts` for base URL, page size 10, 10s timeout). No auth.
- `src/store/` — zustand (`createWithEqualityFn` + `shallow`); one store per feed slice (`articles/feed.ts`, `articles/article.ts`, `videos/feed.ts`) with `fetch(page)` / `refresh()` / `reset()` pattern and `loading/error/refreshing` via `store/helpers.ts`.
- `src/mmkv/` — local persistence (`react-native-mmkv`): `bookmark.ts` (100 max, JSON blob + per-id boolean keys), `colorScheme.ts`, `searchHistory.ts`.
- `src/screens/` + `src/components/` — per-screen dirs with own `index.tsx`; `Markdown/` has custom tokenizer/renderer over `react-native-marked`.
- `src/theme/` — `react-native-paper` MD3; active palette is `colors/iris.ts` (pine/olive/russet/terracotta are unused alternates). Fonts: Inter in `assets/fonts/` wired via `react-native.config.js`.

## Gotchas

- `babel.config.js`: `react-native-reanimated/plugin` must stay last; `moti/skeleton` alias to `moti/skeleton/react-native-linear-gradient` is required — do not remove.
- Pre-commit hook runs `npm run lint` (blocking); commits must pass commitlint conventional format (`commit-msg` hook, `.commitlintrc.json`).
- Biome ignores `android/ ios/ node_modules vendor coverage` — don't run Biome inside native dirs.
- Android-only behaviors (`ToastAndroid` in stores) — don't replace with cross-platform abstractions unprompted.
Loading
Loading