Skip to content

Commit bf140cf

Browse files
committed
docs: prepare for docs
1 parent 485f958 commit bf140cf

File tree

7 files changed

+127
-2
lines changed

7 files changed

+127
-2
lines changed

.config/typedoc/config.cjs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// thx for @teidesu
2+
const fs = require('node:fs')
3+
const path = require('node:path')
4+
5+
module.exports = {
6+
includeVersion: true,
7+
8+
excludePrivate: true,
9+
excludeExternals: true,
10+
excludeNotDocumented: true,
11+
excludeInternal: true,
12+
exclude: [
13+
'**/*/node_modules',
14+
'**/*.test.ts',
15+
],
16+
externalPattern: ['**/dist/**'],
17+
name: 'tsemrtd',
18+
out: '../../docs',
19+
entryPoints: fs.readdirSync(path.join(__dirname, '../../src')).map(it => `../../src/${it}`),
20+
entryPointStrategy: "expand"
21+
}

.github/workflows/docs.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# thx for @teidesu
2+
3+
name: Docs
4+
5+
on:
6+
push:
7+
branches:
8+
- main
9+
pull_request:
10+
branches: [ main ]
11+
workflow_dispatch:
12+
13+
permissions:
14+
contents: read
15+
pages: write
16+
id-token: write
17+
18+
concurrency:
19+
group: pages
20+
cancel-in-progress: false
21+
22+
jobs:
23+
build:
24+
runs-on: ubuntu-latest
25+
steps:
26+
- uses: actions/checkout@v4
27+
- uses: oven-sh/setup-bun@v2
28+
- name: Setup Pages
29+
uses: actions/configure-pages@v3
30+
- name: Build
31+
run: |
32+
bun i --frozen-lockfile
33+
bun run build
34+
- name: Build docs
35+
run: |
36+
bun run docs
37+
touch docs/.nojekyll
38+
- name: Upload artifact
39+
uses: actions/upload-pages-artifact@v2
40+
with:
41+
path: docs
42+
# Deployment job
43+
deploy:
44+
# only run on releases
45+
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
46+
environment:
47+
name: github-pages
48+
url: ${{ steps.deployment.outputs.page_url }}
49+
needs: build
50+
runs-on: ubuntu-latest
51+
name: Deploy
52+
steps:
53+
- name: Deploy to GitHub Pages
54+
id: deployment
55+
uses: actions/deploy-pages@v2

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,4 +180,6 @@ dist
180180
# WSQ fingerprint images
181181
*.wsq
182182

183-
/index.ts
183+
/index.ts
184+
185+
docs/

bun.lockb

6.02 KB
Binary file not shown.

package.json

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,25 @@
33
"module": "index.ts",
44
"version": "0.1.1",
55
"type": "module",
6+
"author": "li0ard",
7+
"repository": {
8+
"type": "git",
9+
"url": "git+https://github.com/li0ard/tsemrtd.git"
10+
},
11+
"bugs": {
12+
"url": "https://github.com/li0ard/tsemrtd/issues"
13+
},
14+
"homepage": "https://github.com/li0ard/tsemrtd#readme",
15+
"description": "simple library for eMRTD. supports browsers, node, bun and more!",
16+
"license": "MIT",
17+
"scripts": {
18+
"build": "rm -rf dist/ && tsc --project tsconfig.build.json",
19+
"docs": "typedoc --options .config/typedoc/config.cjs"
20+
},
621
"devDependencies": {
722
"@types/bun": "latest",
8-
"@types/node-tlv": "^1.5.4"
23+
"@types/node-tlv": "^1.5.4",
24+
"typedoc": "^0.26.6"
925
},
1026
"peerDependencies": {
1127
"typescript": "^5.0.0"

src/consts/interfaces.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,14 @@ interface AbstractBioTemplate {
1818
imageData: Buffer
1919
}
2020

21+
/** Decoded EF.COM datagroup */
2122
export interface DecodedCom {
2223
ldsVersion: string,
2324
unicodeVersion: string,
2425
tags: Buffer
2526
}
2627

28+
/** Decoded EF.DG2 datagroup */
2729
export interface DecodedImage extends AbstractBioTemplate {
2830
/** Number of facial images */
2931
numberOfFacialImages: number,
@@ -55,6 +57,7 @@ export interface DecodedImage extends AbstractBioTemplate {
5557
deviceType: number
5658
}
5759

60+
/** Decoded EF.DG3 datagroup */
5861
export interface DecodedFingerprint extends AbstractBioTemplate {
5962
/** ID of the biometric scanner */
6063
captureDeviceId: number,

tsconfig.build.json

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"compilerOptions": {
3+
// Enable latest features
4+
"lib": ["ESNext", "DOM"],
5+
"target": "ESNext",
6+
"module": "ESNext",
7+
"moduleDetection": "force",
8+
"jsx": "react-jsx",
9+
"allowJs": true,
10+
"declaration": true,
11+
12+
// Bundler mode
13+
"moduleResolution": "bundler",
14+
"verbatimModuleSyntax": true,
15+
16+
// Best practices
17+
"strict": true,
18+
"skipLibCheck": true,
19+
"noFallthroughCasesInSwitch": true,
20+
21+
// Some stricter flags (disabled by default)
22+
"noUnusedLocals": false,
23+
"noUnusedParameters": false,
24+
"noPropertyAccessFromIndexSignature": false,
25+
"outDir": "dist",
26+
},
27+
"include": ["src/index.ts"]
28+
}

0 commit comments

Comments
 (0)