Move source files to src/

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
agent
2026-03-24 09:26:46 -04:00
parent 634bf3353f
commit d2f2e32978
9 changed files with 10 additions and 9 deletions

1
.gitignore vendored
View File

@@ -1,2 +1,3 @@
node_modules/ node_modules/
.env .env
.git-credential-helper.sh

View File

@@ -49,12 +49,12 @@ The scripts in this repo should collectively cover:
### Shared modules ### Shared modules
- **`lib/auth.ts`** — exports the `Session` interface and `createSession()`, which launches headless Chromium, logs in, handles forced password changes, and returns `{ browser, page }`. Throws if login fails. - **`src/lib/auth.ts`** — exports the `Session` interface and `createSession()`, which launches headless Chromium, logs in, handles forced password changes, and returns `{ browser, page }`. Throws if login fails.
- **`lib/gitea.ts`** — All Gitea operations, each typed with explicit return interfaces. Functions take a `Session` plus operation-specific args, navigate to the relevant Gitea page, and return scraped data. - **`src/lib/gitea.ts`** — All Gitea operations, each typed with explicit return interfaces. Functions take a `Session` plus operation-specific args, navigate to the relevant Gitea page, and return scraped data.
Each tool call in `server.ts` creates a fresh session via `withSession<T>()` and closes the browser when done. Each tool call in `src/server.ts` creates a fresh session via `withSession<T>()` and closes the browser when done.
### Standalone scripts ### Standalone scripts
- **`login.ts`** — Standalone login smoke test. - **`src/login.ts`** — Standalone login smoke test.
- **`inspect.ts`** — Dumps form element metadata from the login page as JSON; useful for updating Playwright selectors when Gitea's HTML changes. - **`src/inspect.ts`** — Dumps form element metadata from the login page as JSON; useful for updating Playwright selectors when Gitea's HTML changes.

View File

@@ -5,9 +5,9 @@
"main": "index.js", "main": "index.js",
"type": "module", "type": "module",
"scripts": { "scripts": {
"start": "tsx server.ts", "start": "tsx src/server.ts",
"login": "tsx login.ts", "login": "tsx src/login.ts",
"inspect": "tsx inspect.ts", "inspect": "tsx src/inspect.ts",
"typecheck": "tsc --noEmit" "typecheck": "tsc --noEmit"
}, },
"keywords": [], "keywords": [],

View File

@@ -8,6 +8,6 @@
"skipLibCheck": true, "skipLibCheck": true,
"types": ["node"] "types": ["node"]
}, },
"include": ["**/*.ts"], "include": ["src/**/*.ts"],
"exclude": ["node_modules"] "exclude": ["node_modules"]
} }