Closed MasterKale closed 3 years ago
I've been having trouble pulling this off - the best I've been able to manage is an exported helpers
object out of @simplewebauthn/server, but what I really want is to export everything in src/helpers/index.ts as @simplewebauthn/server/helpers.
@akanass Do you have any bundling advice on how to accomplish this?
@MasterKale thank you to involve me on this PR.
I am currently on holidays so I will check it ASAP and I hope to find something good to help you.
Cheers
I think I figured it out: a combination of "exports"
and "typesVersions"
in packages/server/package.json allowed me to create two files within the example/ project that had no problems importing from both @simplewebauthn/server
and @simplewebauthn/server/helpers
:
helpersTest.ts
import { generateChallenge } from '@simplewebauthn/server/helpers';
import { SettingsService } from '@simplewebauthn/server';
console.log(generateChallenge());
console.log(SettingsService.getRootCertificates({ identifier: 'mds' }));
helpersTest.js
const { generateChallenge } = require('@simplewebauthn/server/helpers');
const { SettingsService } = require('@simplewebauthn/server');
console.log(generateChallenge());
console.log(SettingsService.getRootCertificates({ identifier: 'mds' }));
I'm leaving a couple of links here that helped me get to this solution:
"exports"
"typesVersions"
This PR exports of all current helpers for piecemeal use by those looking to leverage some of the conveniences hidden within the server library.
Addresses #140.