Move source files to src/
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,2 +1,3 @@
|
||||
node_modules/
|
||||
.env
|
||||
.git-credential-helper.sh
|
||||
|
||||
10
CLAUDE.md
10
CLAUDE.md
@@ -49,12 +49,12 @@ The scripts in this repo should collectively cover:
|
||||
|
||||
### 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.
|
||||
- **`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/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/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
|
||||
|
||||
- **`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/login.ts`** — Standalone login smoke test.
|
||||
- **`src/inspect.ts`** — Dumps form element metadata from the login page as JSON; useful for updating Playwright selectors when Gitea's HTML changes.
|
||||
|
||||
@@ -5,9 +5,9 @@
|
||||
"main": "index.js",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"start": "tsx server.ts",
|
||||
"login": "tsx login.ts",
|
||||
"inspect": "tsx inspect.ts",
|
||||
"start": "tsx src/server.ts",
|
||||
"login": "tsx src/login.ts",
|
||||
"inspect": "tsx src/inspect.ts",
|
||||
"typecheck": "tsc --noEmit"
|
||||
},
|
||||
"keywords": [],
|
||||
|
||||
@@ -8,6 +8,6 @@
|
||||
"skipLibCheck": true,
|
||||
"types": ["node"]
|
||||
},
|
||||
"include": ["**/*.ts"],
|
||||
"include": ["src/**/*.ts"],
|
||||
"exclude": ["node_modules"]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user