-
-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #415 from schoero/v4
* New features * SwissQRBill can now be attached to any PDFDocument instance from PDFKit. * New SwissQRCode class to create the standalone Swiss QR Code to attach to an existing PDFKit document. * New Table class to create a table to attach to an existing PDFKit document. * It is now possible to change the font of the QR Bill. The allowed fonts are `"Arial"` | `"Frutiger"` | `"Helvetica"` | `"Liberation Sans"` * Additional options for SVG renderings. * Breaking changes * The entrypoints have changed. Please read the [importing documentation](docs/importing.md) for more information. * SwissQRBill no longer extends PDFKit. * The table method has been extracted into it's own class. * Events have been removed from SwissQRBill. * Properties and options have been renamed. * Now requires Node.js >= 18.0.0 * Fixes * Some slight rendering improvements. * Other improvements * Better examples. The examples are now automatically hosted on StackBlitz. Everyone can now easily try out the library in the browser without having to install anything. * Automated documentation. SwissQRBill now uses [unwritten](https://github.com/schoero/unwritten) to automatically generate the documentation. This makes it easier to keep the documentation up to date. * Automated testing for even more stability.
- Loading branch information
Showing
177 changed files
with
103,649 additions
and
8,341 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
{ | ||
"import": [ | ||
"@schoero/cspell-config", | ||
"@cspell/dict-fr-fr/cspell-ext.json", | ||
"@cspell/dict-it-it/cspell-ext.json" | ||
], | ||
"overrides": [ | ||
{ | ||
"filename": "**/translations.ts", | ||
"language": "en, de, fr, it", | ||
"caseSensitive": false | ||
} | ||
], | ||
"words": [ | ||
"brfs", | ||
"debitor", | ||
"fontkit", | ||
"Frutiger", | ||
"Grosse", | ||
"iban", | ||
"italian", | ||
"linebreak", | ||
"linebreaker", | ||
"pdfdocument", | ||
"pdfkit", | ||
"postgenerate", | ||
"qrcodegen", | ||
"qriban", | ||
"QRIBAN", | ||
"QRIID", | ||
"QRR", | ||
"SCOR", | ||
"swiss", | ||
"swissqrbill", | ||
"swissqrcode", | ||
"twint", | ||
"Twint", | ||
"TWINT", | ||
"undash" | ||
], | ||
"ignorePaths": [ | ||
"node_modules/**", | ||
"lib/**", | ||
"tests/output/**", | ||
"src/shared/qr-code-generator.ts" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
node_modules | ||
lib | ||
src/shared/qr-code-generator.ts | ||
!/.vscode | ||
!/.github |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,43 @@ | ||
{ | ||
"extends": "@schoero" | ||
} | ||
"extends": "@schoero", | ||
"overrides": [ | ||
{ | ||
"files": ["*.ts"], | ||
"rules": { | ||
"@typescript-eslint/no-unnecessary-condition": "off" | ||
} | ||
}, | ||
{ | ||
"files": ["examples/**/*.js", "examples/**/*.ts"], | ||
"rules": { | ||
"no-undef": "off" | ||
} | ||
}, | ||
{ | ||
"files": ["vite.config.ts", "vite.config.bundle.ts"], | ||
"parser": "@typescript-eslint/parser", | ||
"parserOptions": { | ||
"ecmaVersion": "latest", | ||
"project": ["tsconfig.vite.json"], | ||
"sourceType": "module" | ||
} | ||
}, | ||
{ | ||
"files": ["examples/**/*.js", "examples/**/*.ts"], | ||
"rules": { | ||
"unicorn/prefer-node-protocol": "off" | ||
} | ||
}, | ||
{ | ||
"env": { | ||
"browser": true, | ||
"es6": true, | ||
"node": false | ||
}, | ||
"files": ["src/browser/**/*.ts"], | ||
"parserOptions": { | ||
"createDefaultProgram": true | ||
} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,62 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
pull_request: | ||
branches: [ master ] | ||
- pull_request | ||
- push | ||
|
||
jobs: | ||
build: | ||
lint: | ||
if: | ||
github.event_name != 'pull_request' || | ||
github.event.pull_request.head.repo.full_name != | ||
github.event.pull_request.base.repo.full_name | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: '16' | ||
- name: Run a one-line script | ||
run: | | ||
npm ci | ||
npm test | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
cache: npm | ||
node-version: 20 | ||
|
||
- name: Install dependencies | ||
run: npm ci | ||
|
||
- name: Lint | ||
run: npm run lint:ci | ||
|
||
- name: Typecheck | ||
run: npm run typecheck | ||
|
||
- name: Spellcheck | ||
run: npm run spellcheck:ci | ||
|
||
test: | ||
if: | ||
github.event_name != 'pull_request' || | ||
github.event.pull_request.head.repo.full_name != | ||
github.event.pull_request.base.repo.full_name | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
cache: npm | ||
node-version: ${{ matrix.node }} | ||
|
||
- name: Install dependencies | ||
run: npm ci | ||
|
||
- name: Run tests | ||
run: npm test | ||
|
||
strategy: | ||
fail-fast: true | ||
matrix: | ||
node: | ||
- 18 | ||
- 20 | ||
- 21 | ||
os: | ||
- ubuntu-latest | ||
- windows-latest | ||
- macos-latest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,6 @@ node_modules | |
tests/output | ||
examples/output | ||
lib | ||
.DS_Store | ||
local | ||
.DS_Store | ||
.env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"extends": "@schoero/markdownlint-config" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
message="chore(release): v%s" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"$schema": "../unwritten/schemas/renderer/config.json", | ||
"extends": "@schoero/unwritten-config", | ||
"renderConfig": { | ||
"markdown": { | ||
"sectionSeparator": "<br/>" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"recommendations": [ | ||
"dbaeumer.vscode-eslint", | ||
"DavidAnson.vscode-markdownlint" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
{ | ||
"configurations": [ | ||
{ | ||
"args": ["run", "${relativeFileDirname}/${fileBasenameNoExtension}"], | ||
"autoAttachChildProcesses": true, | ||
"console": "integratedTerminal", | ||
"name": "debug current test file", | ||
"program": "${workspaceRoot}/node_modules/vitest/vitest.mjs", | ||
"request": "launch", | ||
"skipFiles": ["<node_internals>/**", "**/node_modules/**"], | ||
"smartStep": true, | ||
"type": "node" | ||
}, | ||
{ | ||
"args": ["run", "${relativeFileDirname}/${fileBasenameNoExtension}"], | ||
"autoAttachChildProcesses": true, | ||
"console": "integratedTerminal", | ||
"env": { | ||
"VISUAL": "true" | ||
}, | ||
"name": "visually debug current test file", | ||
"program": "${workspaceRoot}/node_modules/vitest/vitest.mjs", | ||
"request": "launch", | ||
"skipFiles": ["<node_internals>/**", "**/node_modules/**"], | ||
"smartStep": true, | ||
"type": "node" | ||
}, | ||
{ | ||
"args": ["run", "${relativeFileDirname}/${fileBasenameNoExtension}"], | ||
"autoAttachChildProcesses": true, | ||
"console": "integratedTerminal", | ||
"name": "debug current test file with node internals", | ||
"program": "${workspaceRoot}/node_modules/vitest/vitest.mjs", | ||
"request": "launch", | ||
"skipFiles": [], | ||
"smartStep": true, | ||
"type": "node" | ||
} | ||
], | ||
"version": "0.2.0" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,65 @@ | ||
{ | ||
|
||
// ESLint | ||
"[javascript]": { | ||
"editor.defaultFormatter": "dbaeumer.vscode-eslint" | ||
}, | ||
"[json]": { | ||
"editor.defaultFormatter": "dbaeumer.vscode-eslint" | ||
}, | ||
"[json5]": { | ||
"editor.defaultFormatter": "dbaeumer.vscode-eslint" | ||
}, | ||
"[jsonc]": { | ||
"editor.defaultFormatter": "dbaeumer.vscode-eslint" | ||
}, | ||
"[typescript]": { | ||
"editor.defaultFormatter": "dbaeumer.vscode-eslint" | ||
}, | ||
"eslint.validate": ["javascript", "typescript", "json", "jsonc", "json5", "yaml"], | ||
"editor.formatOnSave": false, | ||
|
||
// Prettier | ||
"prettier.enable": false, | ||
|
||
// File nesting | ||
"explorer.fileNesting.enabled": true, | ||
"explorer.fileNesting.expand": false, | ||
"explorer.fileNesting.patterns": { | ||
"*.ts": "${basename}.${extname},${basename}.test.${extname},${basename}.test.snap,${basename}.test-d.${extname}", | ||
"*.js": "${basename}.${extname},${basename}.mjs,${basename}.cjs,${basename}.d.ts" | ||
}, | ||
|
||
// Hide JSDoc comments | ||
"foldOnOpen.targets": ["AllBlockComments"], | ||
|
||
// ES module import | ||
"typescript.preferences.importModuleSpecifier": "non-relative", | ||
"typescript.preferences.importModuleSpecifierEnding": "minimal", | ||
"typescript.preferences.useAliasesForRenames": true, | ||
"typescript.preferences.autoImportFileExcludePatterns": [ | ||
"@types/node/test.d.ts" | ||
], | ||
|
||
// Markdown | ||
"[markdown]": { | ||
"editor.defaultFormatter": "DavidAnson.vscode-markdownlint", | ||
"editor.formatOnSave": true, | ||
"editor.wordWrapColumn": 119 | ||
}, | ||
|
||
// VSCode | ||
"editor.codeActionsOnSave": { | ||
"source.fixAll.eslint": true, | ||
"source.fixAll.markdownlint": true, | ||
"source.organizeImports": false | ||
}, | ||
"foldOnOpen.targets": ["AllBlockComments"], | ||
"javascript.preferences.importModuleSpecifierEnding": "js", | ||
"typescript.preferences.importModuleSpecifierEnding": "js", | ||
} | ||
|
||
"editor.rulers": [ | ||
119 | ||
], | ||
|
||
"search.exclude": { | ||
"lib": true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
github: | ||
- schoero |
Oops, something went wrong.