Skip to content

Commit c94926a

Browse files
author
Dong Nguyen
authored
Merge pull request #424 from extractus/8.1.0
v8.1.0
2 parents 9fa9d66 + d4c5309 commit c94926a

28 files changed

Lines changed: 611 additions & 178 deletions

.aiignore

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
node_modules
2+
coverage
3+
coverage.lcov
4+
5+
package-lock.json
6+
pnpm-lock.yaml
7+
bun.lock
8+
9+
.env
10+
11+
dist
12+
storage
13+
14+
# AI Session Files (Private Context)
15+
.sessions

.github/workflows/ci-test.yml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,27 +12,25 @@ jobs:
1212

1313
strategy:
1414
matrix:
15-
node_version: [20.x, 22.x, 24.x]
15+
node_version: [22.x, 24.x, 25.x]
1616

1717
steps:
18-
- uses: actions/checkout@v4
18+
- uses: actions/checkout@v6
1919

2020
- name: setup Node.js v${{ matrix.node_version }}
21-
uses: actions/setup-node@v4
21+
uses: actions/setup-node@v6
2222
with:
2323
node-version: ${{ matrix.node_version }}
2424

2525
- name: run npm scripts
26-
env:
27-
PROXY_SERVER: ${{ secrets.PROXY_SERVER }}
2826
run: |
2927
npm install
3028
npm run lint
31-
npm run build --if-present
29+
#npm run build --if-present
3230
npm run test
3331
3432
- name: cache node modules
35-
uses: actions/cache@v4
33+
uses: actions/cache@v5
3634
with:
3735
path: ~/.npm
3836
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}

.github/workflows/codeql-analysis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838

3939
steps:
4040
- name: Checkout repository
41-
uses: actions/checkout@v4
41+
uses: actions/checkout@v6
4242

4343
# Initializes the CodeQL tools for scanning.
4444
- name: Initialize CodeQL

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ yarn.lock
1616
coverage.lcov
1717
pnpm-lock.yaml
1818
lcov.info
19-
19+
bun.lock
2020
deno.lock
2121

2222
evaluation
23+
24+
.sessions

.npmignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,6 @@ pnpm-lock.yaml
55
examples
66
test-data
77
lcov.info
8+
9+
.aiignore
10+
.sessions

AGENTS.md

Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
# AI Agent Instructions
2+
3+
Coding guidelines for AI agents working in this project.
4+
5+
## Philosophy
6+
7+
- Minimalism. Simple is better. KISS (Keep It Simple, Stupid).
8+
- Clean code, easy to read, easy to delete.
9+
- Functional Programming — pure functions, immutability, no side effects.
10+
- MVP mindset — deliver the smallest thing that works, then iterate.
11+
12+
## Security Rules (CRITICAL — no exceptions)
13+
14+
- NEVER output or request .env and example.env file contents
15+
- NEVER hardcode API credentials, secret tokens, private keys or passwords in source code
16+
- NEVER send sensitive data to external AI services
17+
- Follow `.aiignore` and `.gitignore` for excluded files — do not read or reference them
18+
- When asking for help, sanitize data (replace real IDs, emails, tokens with placeholders)
19+
- Do not log sensitive information
20+
21+
## Coding Standards (Strict)
22+
- Language: JavaScript (ESM syntax). No TypeScript.
23+
- Style: No semicolons, single quotes, 2-space indentation.
24+
- Respect `eslint.config.js` — do not suggest rule changes
25+
- Patterns:
26+
- Functional Programming only. No Classes or OOP.
27+
- Arrow functions are preferred.
28+
- Maximum 3 parameters per function. Use objects for more.
29+
- Naming: camelCase for variables/functions, SNAKE_CASE for constants.
30+
- Documentation:
31+
- Add JSDocs before all functions and exported variables.
32+
- Language: Use American English for all comments and JSDocs.
33+
- Constraint: NEVER use Vietnamese or other languages in the source code.
34+
35+
### Error Handling
36+
37+
- Handle errors explicitly — never swallow silently
38+
- Use try/catch with proper logging
39+
- Return null or throw meaningful errors
40+
41+
```javascript
42+
export const send = async (params) => {
43+
try {
44+
const response = await ai.ask(params)
45+
logger.info(`send() -> success: ${response.id}`)
46+
return response
47+
} catch (err) {
48+
logger.error(`send() -> failed: ${err.message}`)
49+
console.error(err)
50+
return null
51+
}
52+
}
53+
```
54+
55+
## Testing Standards
56+
57+
- Write tests for critical business logic, all error cases
58+
- Use simple test runners (node:test, bun:test, vitest)
59+
- No complex mocking frameworks unless necessary
60+
- Tests live alongside source: `[module].test.js` next to `[module].js`
61+
62+
## Dependency Rules
63+
64+
- Prefer built-in APIs over external packages
65+
- Before adding dependency, explain:
66+
- Why it is needed
67+
- Alternatives considered
68+
- Bundle size impact
69+
- Never add dependency for trivial utilities
70+
- Avoid packages with large dependency trees
71+
72+
## Architecture Rules
73+
74+
- Do NOT change existing project architecture without explicit approval
75+
- Do NOT move or rename core modules unless requested
76+
- Respect module boundaries
77+
- Avoid cross-module coupling
78+
- New modules must follow existing folder structure
79+
80+
## When Making Changes
81+
82+
1. Read existing patterns first
83+
2. Follow current coding style strictly
84+
3. Keep dependencies minimal
85+
4. Handle errors explicitly
86+
5. Add JSDoc comments for new functions
87+
6. Run `npm run lint` before committing
88+
7. Do NOT refactor unrelated code
89+
8. Do NOT modify working code outside task scope
90+
9. Prefer minimal diff changes
91+
10. Preserve existing behavior unless explicitly requested
92+
93+
## When in Doubt
94+
95+
- Ask for clarification before generating code
96+
- State your assumption explicitly if proceeding without confirmation
97+
- Prefer doing less and asking over doing more and guessing
98+
99+
## Git Workflow
100+
101+
- Work only inside the current branch
102+
- Do NOT create or delete branches
103+
- Do NOT rewrite git history
104+
- Do NOT modify commit messages
105+
- Changes must correspond to the current issue
106+
107+
## Agent References
108+
109+
Reference these URLs when working on related topics:
110+
111+
- Bun: https://bun.sh/llms-full.txt
112+
113+
---

README.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,22 @@ Extract main article, main image and meta data from URL.
1010

1111
## Demo
1212

13-
- [Give it a try!](https://extractus-demo.vercel.app/article)
13+
- [Give it a try!](https://extractus.pwshub.com/article)
1414

1515
## Install
1616

1717
```bash
18-
# npm, pnpm, yarn
19-
npm i @extractus/article-extractor
20-
2118
# bun
2219
bun add @extractus/article-extractor
20+
21+
# npm
22+
npm i @extractus/article-extractor
23+
24+
# pnpm
25+
pnpm install @extractus/article-extractor
26+
27+
# yarn
28+
yarn add @extractus/article-extractor
2329
```
2430

2531
## Usage

0 commit comments

Comments
 (0)