Skip to content

Commit

Permalink
Copy simplewebauthn code into assets directory for easier bundling.
Browse files Browse the repository at this point in the history
  • Loading branch information
evert committed Dec 6, 2024
1 parent 98ce843 commit a7e322d
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 4 deletions.
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,7 @@ inspect-brk: build

src/db-types.js:
./bin/generate-db-types.mjs

assets/simplewebauthn-browser.min.js: node_modules/@simplewebauthn/browser/dist/bundle/index.umd.min.js
cp node_modules/@simplewebauthn/browser/dist/bundle/index.umd.min.js assets/simplewebauthn-browser.min.js

2 changes: 2 additions & 0 deletions assets/simplewebauthn-browser.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
Changelog
=========

0.27.3 (????-??-??)
-------------------

* Copy simplewebauthn browser bundle into assets directory for easier
distribution.


0.27.2 (2024-12-06)
-------------------

Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@
"@curveball/session": "^1.0.0",
"@curveball/session-redis": "^1.0.0",
"@curveball/validator": "^1.0.0",
"@simplewebauthn/browser": "^10.0.0",
"@simplewebauthn/server": "^10.0.0",
"bcrypt": "^5.0.1",
"csv-stringify": "^6.0.5",
Expand Down Expand Up @@ -98,7 +97,8 @@
"tsc-watch": "^6.0.4",
"tsx": "^4.16.2",
"typescript": "^5.2.2",
"typescript-eslint": "^8.13.0"
"typescript-eslint": "^8.13.0",
"@simplewebauthn/browser": "^10.0.0"
},
"engines": {
"node": ">= 18"
Expand Down
3 changes: 1 addition & 2 deletions src/blob/controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { readFileSync } from 'node:fs';

const dir = dirname(fileURLToPath(import.meta.url));
const assetPath = dir + '/../../assets';
const webauthnPath = dir + '/../../node_modules/@simplewebauthn/browser/dist/bundle';

function readSync(basePath: string, filename: string) {
return readFileSync(join(basePath, filename));
Expand All @@ -24,7 +23,7 @@ const files: Record<string, {data: Buffer; type: string}> = {
},
'simplewebauthn-browser.min.js': {
type: 'text/javascript',
data: readSync(webauthnPath, 'index.umd.min.js'),
data: readSync(assetPath, 'simplewebauthn-browser.min.js'),
},
'webauthn.js': {
type: 'text/javascript',
Expand Down

0 comments on commit a7e322d

Please sign in to comment.