-
Notifications
You must be signed in to change notification settings - Fork 0
[PB-5714] Split tsdown #27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
8317d18
load modules separately
TamaraFinogina 0c5b5d4
Merge remote-tracking branch 'origin/master' into split_imports
TamaraFinogina 7f0e661
remove email-service
TamaraFinogina b93f5c6
Merge remote-tracking branch 'origin/master' into split_imports
TamaraFinogina 24de4fa
Merge remote-tracking branch 'origin/master' into split_imports
TamaraFinogina 908fa3c
adjust exports
TamaraFinogina 554528f
Merge remote-tracking branch 'origin/master' into split_imports
TamaraFinogina 2c8d786
migrate to tsdown
TamaraFinogina 8e1a2d0
add missing file, up version
TamaraFinogina 2824cdd
remove unused dependencies
TamaraFinogina ebd9788
merge master, upgrade dependencies
TamaraFinogina 5fff0df
use wild card export
TamaraFinogina File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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,13 +1,93 @@ | ||
| export * as asymmetric from './asymmetric-crypto'; | ||
| export * as deriveKey from './derive-key'; | ||
| export * as emailCrypto from './email-crypto'; | ||
| export * as emailSearch from './email-search'; | ||
| export * as hash from './hash'; | ||
| export * as keyWrapper from './key-wrapper'; | ||
| export * as keystoreCrypto from './keystore-crypto'; | ||
| export * as pq from './post-quantum-crypto'; | ||
| export * as storage from './storage-service'; | ||
| export * as symmetric from './symmetric-crypto'; | ||
| export * as utils from './utils'; | ||
| export { | ||
| deriveSecretKey, | ||
| generateEccKeys, | ||
| exportPublicKey, | ||
| importPublicKey, | ||
| exportPrivateKey, | ||
| importPrivateKey, | ||
| } from './asymmetric-crypto'; | ||
| export { | ||
| deriveSymmetricKeyFromTwoKeys, | ||
| deriveSymmetricCryptoKeyFromTwoKeys, | ||
| deriveSymmetricKeyFromTwoKeysAndContext, | ||
| deriveSymmetricKeyFromContext, | ||
| deriveSymmetricCryptoKeyFromContext, | ||
| getKeyFromPassword, | ||
| getKeyFromPasswordAndSalt, | ||
| getKeyFromPasswordHex, | ||
| getKeyFromPasswordAndSaltHex, | ||
| verifyKeyFromPasswordHex, | ||
| } from './derive-key'; | ||
| export { | ||
| encryptEmailHybrid, | ||
| encryptEmailHybridForMultipleRecipients, | ||
| decryptEmailHybrid, | ||
| createPwdProtectedEmail, | ||
| decryptPwdProtectedEmail, | ||
| generateEmailKeys, | ||
| } from './email-crypto'; | ||
| export { | ||
| openDatabase, | ||
| closeDatabase, | ||
| deriveIndexKey, | ||
| encryptAndStoreEmail, | ||
| encryptAndStoreManyEmail, | ||
| getAndDecryptEmail, | ||
| getAndDecryptAllEmails, | ||
| deleteEmail, | ||
| getEmailCount, | ||
| deleteOldestEmails, | ||
| enforceMaxEmailNumber, | ||
| getAllEmailsSortedNewestFirst, | ||
| getAllEmailsSortedOldestFirst, | ||
| getEmailBatch, | ||
| createCacheFromDB, | ||
| getEmailFromCache, | ||
| deleteEmailFromCache, | ||
| addEmailsToCache, | ||
| addEmailToCache, | ||
| addEmailToSearchIndex, | ||
| removeEmailFromSearchIndex, | ||
| buildSearchIndexFromCache, | ||
| searchEmails, | ||
| } from './email-search'; | ||
| export { | ||
| hashDataArray, | ||
| hashDataArrayWithKey, | ||
| hashDataArrayHex, | ||
| hashDataArrayWithKeyHex, | ||
| getBytesFromData, | ||
| getBytesFromDataHex, | ||
| getBytesFromDataArrayHex, | ||
| computeMac, | ||
| } from './hash'; | ||
| export { unwrapKey, wrapKey } from './key-wrapper'; | ||
| export { createEncryptionAndRecoveryKeystores, openEncryptionKeystore, openRecoveryKeystore } from './keystore-crypto'; | ||
| export { generateKyberKeys, encapsulateKyber, decapsulateKyber } from './post-quantum-crypto/kyber768'; | ||
| export { | ||
| encryptSymmetrically, | ||
| decryptSymmetrically, | ||
| importSymmetricCryptoKey, | ||
| exportSymmetricCryptoKey, | ||
| genSymmetricCryptoKey, | ||
| genSymmetricKey, | ||
| deriveSymmetricCryptoKey, | ||
| } from './symmetric-crypto'; | ||
| export { | ||
| uint8ArrayToHex, | ||
| UTF8ToUint8, | ||
| uint8ToUTF8, | ||
| hexToUint8Array, | ||
| uint8ArrayToBase64, | ||
| base64ToUint8Array, | ||
| genMnemonic, | ||
| base64ToPublicKey, | ||
| publicKeyToBase64, | ||
| generateUuid, | ||
| uuidToBytes, | ||
| bytesToUuid, | ||
| mnemonicToBytes, | ||
| bytesToMnemonic, | ||
| } from './utils'; | ||
| export * from './types'; | ||
| export * from './constants'; |
This file contains hidden or 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 was deleted.
Oops, something went wrong.
This file contains hidden or 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,28 +1,16 @@ | ||
| { | ||
| "compilerOptions": { | ||
| "baseUrl": "./src", | ||
| "emitDeclarationOnly": true, | ||
| "target": "ES2022", | ||
| "module": "nodenext", | ||
| "declaration": true, | ||
| "declarationMap": true, | ||
| "emitDeclarationOnly": true, | ||
| "outDir": "dist", | ||
| "target": "es5", | ||
| "lib": ["dom", "dom.iterable", "esnext"], | ||
| "allowJs": true, | ||
| "skipLibCheck": true, | ||
| "esModuleInterop": true, | ||
| "allowSyntheticDefaultImports": true, | ||
| "strict": true, | ||
| "forceConsistentCasingInFileNames": true, | ||
| "noFallthroughCasesInSwitch": true, | ||
| "module": "esnext", | ||
| "moduleResolution": "node", | ||
| "resolveJsonModule": true, | ||
| "isolatedModules": true, | ||
| "jsx": "react-jsx", | ||
| "noImplicitAny": false, | ||
| "downlevelIteration": true, | ||
| "esModuleInterop": true, | ||
| "moduleResolution": "nodenext", | ||
| "incremental": true, | ||
| "types": ["vite/client"] | ||
| "tsBuildInfoFile": "./dist/.tsbuildinfo" | ||
| }, | ||
| "types": ["filesystem", "@types/react"], | ||
| "include": ["src", "vite-env.d.ts"] | ||
| } | ||
| "include": ["src"] | ||
| } |
This file contains hidden or 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,28 @@ | ||
| import { defineConfig } from 'tsdown'; | ||
|
|
||
| export default defineConfig({ | ||
| entry: { | ||
| index: 'src/index.ts', | ||
| 'asymmetric-crypto': 'src/asymmetric-crypto/index.ts', | ||
| 'symmetric-crypto': 'src/symmetric-crypto/index.ts', | ||
| 'post-quantum-crypto': 'src/post-quantum-crypto/index.ts', | ||
| hash: 'src/hash/index.ts', | ||
| 'derive-key': 'src/derive-key/index.ts', | ||
| 'email-crypto': 'src/email-crypto/index.ts', | ||
| 'keystore-crypto': 'src/keystore-crypto/index.ts', | ||
| 'email-search': 'src/email-search/index.ts', | ||
| 'storage-service': 'src/storage-service/index.ts', | ||
| utils: 'src/utils/index.ts', | ||
| types: 'src/types.ts', | ||
| constants: 'src/constants.ts', | ||
| }, | ||
| platform: 'browser', | ||
| format: ['esm', 'cjs'], | ||
| sourcemap: true, | ||
| clean: true, | ||
| treeshake: true, | ||
| outDir: 'dist', | ||
| dts: true, | ||
| noExternal: ['hash-wasm'], | ||
| target: false, | ||
| }); |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Im still not sure about having to define this on every 'class'/'service' of the project
But if its the only way, maybe it could be a good idea to add to the Readme.md some instructions so its clear how to implement a new functionality (like where we should add it -> package.json, tsdown.config.ts, src/index.ts, etc)
wdyt? @TamaraFinogina
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Defining exports is the only way it worked. Not sure if it's because I'm importing this library in commonjs projects and they need some help or not. I'll add read.me
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe could use wildcard exports :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@CandelR Seems to be working. Thanks!!!