Skip to content
This repository was archived by the owner on Mar 6, 2026. It is now read-only.

Commit e549ff3

Browse files
committed
initial commit
0 parents  commit e549ff3

23 files changed

Lines changed: 10858 additions & 0 deletions

.changeset/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Changesets
2+
3+
Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
4+
with multi-package repos, or single-package repos to help you version and publish your code. You can
5+
find the full documentation for it [in our repository](https://github.com/changesets/changesets)
6+
7+
We have a quick list of common questions to get you started engaging with this project in
8+
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)

.changeset/config.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"$schema": "https://unpkg.com/@changesets/config@3.1.1/schema.json",
3+
"changelog": "@changesets/cli/changelog",
4+
"commit": false,
5+
"fixed": [],
6+
"linked": [],
7+
"access": "public",
8+
"baseBranch": "main",
9+
"updateInternalDependencies": "patch",
10+
"ignore": []
11+
}

.changeset/initial-release.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
"@assistant-ui/local-pdf-adapter": minor
3+
---
4+
5+
Add LocalPDFAttachmentAdapter for native PDF text extraction support
6+
7+
Features:
8+
- Cross-platform PDF text extraction (browser & Node.js)
9+
- Configurable file size limits and worker sources
10+
- Comprehensive error handling
11+
- TypeScript support with full definitions
12+
- Security-conscious design with self-hosting support

.eslintrc.cjs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
module.exports = {
2+
root: true,
3+
env: {
4+
browser: true,
5+
es2020: true,
6+
node: true,
7+
},
8+
extends: [
9+
'eslint:recommended',
10+
'@typescript-eslint/recommended',
11+
],
12+
ignorePatterns: ['dist', '.eslintrc.cjs'],
13+
parser: '@typescript-eslint/parser',
14+
plugins: ['@typescript-eslint'],
15+
rules: {
16+
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
17+
'@typescript-eslint/no-explicit-any': 'warn',
18+
},
19+
};

.github/workflows/ci.yml

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
test:
11+
name: Test
12+
runs-on: ubuntu-latest
13+
14+
strategy:
15+
matrix:
16+
node-version: [18, 20]
17+
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v4
21+
22+
- name: Setup pnpm
23+
uses: pnpm/action-setup@v3
24+
with:
25+
version: 8
26+
27+
- name: Setup Node.js ${{ matrix.node-version }}
28+
uses: actions/setup-node@v4
29+
with:
30+
node-version: ${{ matrix.node-version }}
31+
cache: 'pnpm'
32+
33+
- name: Install dependencies
34+
run: pnpm install --frozen-lockfile
35+
36+
- name: Run type check
37+
run: pnpm run typecheck
38+
39+
- name: Run linter
40+
run: pnpm run lint
41+
42+
- name: Run tests
43+
run: pnpm run test:run
44+
45+
- name: Build package
46+
run: pnpm run build
47+
48+
- name: Check bundle size
49+
run: pnpm run size
50+
51+
release:
52+
name: Release
53+
needs: test
54+
runs-on: ubuntu-latest
55+
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
56+
57+
steps:
58+
- name: Checkout
59+
uses: actions/checkout@v4
60+
with:
61+
fetch-depth: 0
62+
token: ${{ secrets.GITHUB_TOKEN }}
63+
64+
- name: Setup pnpm
65+
uses: pnpm/action-setup@v3
66+
with:
67+
version: 8
68+
69+
- name: Setup Node.js
70+
uses: actions/setup-node@v4
71+
with:
72+
node-version: '20'
73+
cache: 'pnpm'
74+
registry-url: 'https://registry.npmjs.org'
75+
76+
- name: Install dependencies
77+
run: pnpm install --frozen-lockfile
78+
79+
- name: Build package
80+
run: pnpm run build
81+
82+
- name: Create Release Pull Request or Publish
83+
id: changesets
84+
uses: changesets/action@v1
85+
with:
86+
publish: pnpm run release
87+
commit: 'chore: release packages'
88+
title: 'chore: release packages'
89+
env:
90+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
91+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
92+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.github/workflows/size-limit.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Size Limit
2+
3+
on:
4+
pull_request:
5+
branches: [main]
6+
7+
jobs:
8+
size:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout
12+
uses: actions/checkout@v4
13+
14+
- name: Setup pnpm
15+
uses: pnpm/action-setup@v3
16+
with:
17+
version: 8
18+
19+
- name: Setup Node.js
20+
uses: actions/setup-node@v4
21+
with:
22+
node-version: '20'
23+
cache: 'pnpm'
24+
25+
- name: Install dependencies
26+
run: pnpm install --frozen-lockfile
27+
28+
- name: Build package
29+
run: pnpm run build
30+
31+
- name: Check bundle size
32+
run: pnpm run size
33+
34+
- name: Size Limit Comment
35+
uses: andresz1/size-limit-action@v1
36+
with:
37+
github_token: ${{ secrets.GITHUB_TOKEN }}
38+
skip_step: install

.gitignore

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
node_modules/
2+
dist/
3+
*.log
4+
.env
5+
.env.local
6+
.env.development.local
7+
.env.test.local
8+
.env.production.local
9+
coverage/
10+
.nyc_output/
11+
.cache/
12+
.vscode/
13+
.idea/
14+
*.tgz
15+
*.tar.gz

.size-limit.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[
2+
{
3+
"name": "LocalPDFAttachmentAdapter (ESM)",
4+
"path": "dist/index.mjs",
5+
"limit": "10 KB",
6+
"import": "{ LocalPDFAttachmentAdapter }",
7+
"ignore": ["pdfjs-dist", "pdf-parse"]
8+
}
9+
]

CHANGELOG.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4+
5+
## [0.0.1] - 2025-11-17
6+
7+
### Added
8+
- LocalPDFAttachmentAdapter for native PDF text extraction support
9+
- Cross-platform PDF processing (browser with pdfjs-dist, Node.js with pdf-parse)
10+
- Configurable file size limits (default 10MB)
11+
- Configurable PDF.js worker source for security-conscious applications
12+
- Comprehensive error handling for corrupted or invalid PDFs
13+
- Full TypeScript definitions and type safety
14+
- Complete test suite with Vitest
15+
- Modern build setup with ESM/CJS output

0 commit comments

Comments
 (0)