mirror of
https://github.com/selfxyz/self.git
synced 2026-01-09 06:38:09 -05:00
* add iOS qrcode opener and aadhaar screen * format * fix test * add Image-picker android (#1077) * add image-picker android * fix validation * feat: implement Aadhaar upload success and error screens, enhance AadhaarNavBar with dynamic progress indication - Added AadhaarUploadedSuccessScreen and AadhaarUploadErrorScreen components for handling upload outcomes. - Updated AadhaarNavBar to reflect current upload step with dynamic progress bar. - Integrated new screens into navigation flow for Aadhaar upload process. - Introduced blue check and warning SVG icons for visual feedback on success and error states. * feat: generate mock aadhar (#1083) * feat: generate mock aadhar * add yarn.lock * update yarn.lock * update protocolStore, update types, start modifying provingMachine * Register mock aadhar (#1093) * Register mock aadhar * fix ofac * temp: generate name * fix dob * Add Aadhaar support to ID card component and screens - Integrated Aadhaar icon and conditional rendering in IdCardLayout. - Updated AadhaarUploadScreen to process QR codes and store Aadhaar data. - Modified navigation and button text in AadhaarUploadedSuccessScreen. - Added mock data generation for Aadhaar in the mobile SDK. - Updated ManageDocumentsScreen to include Aadhaar document type. - Enhanced error handling and validation for Aadhaar QR code processing. - Added utility functions for Aadhaar data extraction and commitment processing. * aadhaar disclose - wip (#1094) * fix: timestamp cal of extractQRDataFields * Feat/aadhar fixes (#1099) * Fix - android aadhar qr scanner * fixes * update text * yarn nice * run prettier * Add mock Aadhaar certificates for development - Introduced hardcoded Aadhaar test certificates for development purposes. - Moved Aadhaar mock private and public keys to a dedicated file for better organization. - Updated the mock ID document generation utility to utilize the new Aadhaar mock certificates. * prettier write * add 'add-aadhaar' button (#1100) * Update .gitleaks.toml to include path for mock certificates in the common/dist directory * yarn nice * Enhance Aadhaar error handling with specific error types - Updated the AadhaarUploadErrorScreen to display different messages based on the error type (general or expired). - Modified the AadhaarUploadScreen to pass the appropriate error type when navigating to the error screen. - Set initial parameters for the home screen to include a default error type. * Update passport handling in proving machine to support Aadhaar document category - Modified the handling of country code in the useProvingStore to return 'IND' for Aadhaar documents. - Ensured that the country code is only fetched from passport metadata for non-Aadhaar documents. * tweak layout, text, change email to support, hide help button * fix ci, remove aadhaar logging, add aadhaar events * remove unused aadhaar tracking events * update globs * fix gitguardian config * don't track id --------- Co-authored-by: Justin Hernandez <justin.hernandez@self.xyz> Co-authored-by: Seshanth.S🐺 <35675963+seshanthS@users.noreply.github.com> Co-authored-by: vishal <vishalkoolkarni0045@gmail.com>
171 lines
6.8 KiB
TypeScript
171 lines
6.8 KiB
TypeScript
import path from 'path';
|
|
import { defineConfig } from 'tsup';
|
|
import { fileURLToPath } from 'url';
|
|
|
|
const __filename = fileURLToPath(import.meta.url);
|
|
const __dirname = path.dirname(__filename);
|
|
|
|
const entry = {
|
|
index: 'index.ts',
|
|
// Existing grouped exports
|
|
'src/constants/index': 'src/constants/index.ts',
|
|
'src/utils/index': 'src/utils/index.ts',
|
|
'src/types/index': 'src/types/index.ts',
|
|
// Granular constants exports
|
|
'src/constants/constants': 'src/constants/constants.ts',
|
|
'src/constants/countries': 'src/constants/countries.ts',
|
|
'src/constants/vkey': 'src/constants/vkey.ts',
|
|
'src/constants/skiPem': 'src/constants/skiPem.ts',
|
|
'src/constants/mockCertificates': 'src/constants/mockCertificates.ts',
|
|
'src/constants/sampleDataHashes': 'src/constants/sampleDataHashes.ts',
|
|
// Granular utils exports
|
|
'src/utils/aadhaar/constants': 'src/utils/aadhaar/constants.ts',
|
|
'src/utils/aadhaar/utils': 'src/utils/aadhaar/utils.ts',
|
|
'src/utils/aadhaar/mockData': 'src/utils/aadhaar/mockData.ts',
|
|
'src/utils/attest': 'src/utils/attest.ts',
|
|
'src/utils/hash': 'src/utils/hash.ts',
|
|
'src/utils/bytes': 'src/utils/bytes.ts',
|
|
'src/utils/trees': 'src/utils/trees.ts',
|
|
'src/utils/proving': 'src/utils/proving.ts',
|
|
'src/utils/scope': 'src/utils/scope.ts',
|
|
'src/utils/appType': 'src/utils/appType.ts',
|
|
'src/utils/date': 'src/utils/date.ts',
|
|
'src/utils/arrays': 'src/utils/arrays.ts',
|
|
'src/utils/types': 'src/utils/types.ts',
|
|
'src/utils/passports/index': 'src/utils/passports/index.ts',
|
|
'src/utils/passports/format': 'src/utils/passports/format.ts',
|
|
'src/utils/passports/mock': 'src/utils/passports/mock.ts',
|
|
'src/utils/passports/validate': 'src/utils/passports/validate.ts',
|
|
'src/utils/passports/dg1': 'src/utils/passports/dg1.ts',
|
|
'src/utils/passports/genMockPassportData': 'src/utils/passports/genMockPassportData.ts',
|
|
'src/utils/passports/genMockIdDoc': 'src/utils/passports/genMockIdDoc.ts',
|
|
'src/utils/passports/passport_parsing/parseDscCertificateData':
|
|
'src/utils/passports/passport_parsing/parseDscCertificateData.ts',
|
|
'src/utils/certificate_parsing/index': 'src/utils/certificate_parsing/index.ts',
|
|
'src/utils/certificate_parsing/elliptic': 'src/utils/certificate_parsing/elliptic.ts',
|
|
'src/utils/certificate_parsing/curves': 'src/utils/certificate_parsing/curves.ts',
|
|
'src/utils/certificate_parsing/oids': 'src/utils/certificate_parsing/oids.ts',
|
|
'src/utils/certificate_parsing/parseCertificateSimple':
|
|
'src/utils/certificate_parsing/parseCertificateSimple.ts',
|
|
'src/utils/circuits/index': 'src/utils/circuits/index.ts',
|
|
'src/utils/circuits/circuitsName': 'src/utils/circuits/circuitsName.ts',
|
|
'src/utils/circuits/formatOutputs': 'src/utils/circuits/formatOutputs.ts',
|
|
'src/utils/circuits/formatInputs': 'src/utils/circuits/formatInputs.ts',
|
|
'src/utils/circuits/uuid': 'src/utils/circuits/uuid.ts',
|
|
'src/utils/contracts/index': 'src/utils/contracts/index.ts',
|
|
'src/utils/contracts/forbiddenCountries': 'src/utils/contracts/forbiddenCountries.ts',
|
|
'src/utils/csca': 'src/utils/csca.ts',
|
|
'src/utils/ofac': 'src/utils/ofac.ts',
|
|
// Level 3 Hash Function Exports
|
|
'src/utils/hash/poseidon': 'src/utils/hash/poseidon.ts',
|
|
'src/utils/hash/sha': 'src/utils/hash/sha.ts',
|
|
'src/utils/hash/custom': 'src/utils/hash/custom.ts',
|
|
// Level 3 Circuit Function Exports
|
|
'src/utils/circuits/dscInputs': 'src/utils/circuits/dscInputs.ts',
|
|
'src/utils/circuits/registerInputs': 'src/utils/circuits/registerInputs.ts',
|
|
'src/utils/circuits/discloseInputs': 'src/utils/circuits/discloseInputs.ts',
|
|
'src/utils/circuits/generateInputs': 'src/utils/circuits/generateInputs.ts',
|
|
'src/utils/circuits/ofacInputs': 'src/utils/circuits/ofacInputs.ts',
|
|
// Level 3 Certificate Function Exports
|
|
'src/utils/certificate_parsing/parseSimple': 'src/utils/certificate_parsing/parseSimple.ts',
|
|
'src/utils/certificate_parsing/parseNode': 'src/utils/certificate_parsing/parseNode.ts',
|
|
'src/utils/certificate_parsing/ellipticInit': 'src/utils/certificate_parsing/ellipticInit.ts',
|
|
'src/utils/certificate_parsing/curveUtils': 'src/utils/certificate_parsing/curveUtils.ts',
|
|
'src/utils/certificate_parsing/oidUtils': 'src/utils/certificate_parsing/oidUtils.ts',
|
|
'src/utils/certificate_parsing/certUtils': 'src/utils/certificate_parsing/certUtils.ts',
|
|
// Level 3 Passport Function Exports
|
|
'src/utils/passports/core': 'src/utils/passports/core.ts',
|
|
'src/utils/passports/commitment': 'src/utils/passports/commitment.ts',
|
|
'src/utils/passports/signature': 'src/utils/passports/signature.ts',
|
|
'src/utils/passports/parsing': 'src/utils/passports/parsing.ts',
|
|
'src/utils/passports/mockGeneration': 'src/utils/passports/mockGeneration.ts',
|
|
'src/utils/passports/mockDsc': 'src/utils/passports/mockDsc.ts',
|
|
'src/utils/passports/passport': 'src/utils/passports/passport.ts',
|
|
// Granular types exports
|
|
'src/types/passport': 'src/types/passport.ts',
|
|
'src/types/app': 'src/types/app.ts',
|
|
'src/types/certificates': 'src/types/certificates.ts',
|
|
'src/types/circuits': 'src/types/circuits.ts',
|
|
};
|
|
|
|
export default defineConfig([
|
|
// ESM build (matches current dist/esm/src structure)
|
|
{
|
|
tsconfig: './tsconfig.json',
|
|
entry: entry,
|
|
format: ['esm'],
|
|
outDir: path.resolve(__dirname, 'dist/esm'),
|
|
outExtension: ({ format }) => ({ js: format === 'cjs' ? '.cjs' : '.js' }),
|
|
dts: false, // Generated separately via build:types script
|
|
splitting: false,
|
|
clean: true, // Clean only on first build
|
|
sourcemap: true,
|
|
target: 'es2020',
|
|
platform: 'neutral',
|
|
external: [
|
|
/^@openpassport/,
|
|
/^@zk-email/,
|
|
/^@anon-aadhaar/,
|
|
/^asn1/,
|
|
/^axios/,
|
|
/^buffer/,
|
|
/^chai/,
|
|
/^child_process/,
|
|
/^country-/,
|
|
/^elliptic/,
|
|
/^ethers/,
|
|
/^fs/,
|
|
/^i18n-/,
|
|
/^js-/,
|
|
/^json-/,
|
|
/^jsrsasign/,
|
|
/^node-forge/,
|
|
/^path/,
|
|
/^pkijs/,
|
|
/^poseidon-/,
|
|
/^snarkjs/,
|
|
/^typescript-/,
|
|
/^uuid/,
|
|
],
|
|
},
|
|
// CJS build (matches current dist/cjs/src structure)
|
|
{
|
|
tsconfig: './tsconfig.cjs.json',
|
|
entry: entry,
|
|
format: ['cjs'],
|
|
outDir: path.resolve(__dirname, 'dist/cjs'),
|
|
outExtension: ({ format }) => ({ js: format === 'cjs' ? '.cjs' : '.js' }),
|
|
dts: false, // Only generate types once (in ESM build)
|
|
splitting: false,
|
|
clean: false, // Don't clean after ESM build
|
|
sourcemap: true,
|
|
target: 'es2020',
|
|
platform: 'neutral',
|
|
external: [
|
|
/^@openpassport/,
|
|
/^@zk-email/,
|
|
/^@anon-aadhaar/,
|
|
/^asn1/,
|
|
/^axios/,
|
|
/^buffer/,
|
|
/^chai/,
|
|
/^child_process/,
|
|
/^country-/,
|
|
/^elliptic/,
|
|
/^ethers/,
|
|
/^fs/,
|
|
/^i18n-/,
|
|
/^js-/,
|
|
/^json-/,
|
|
/^jsrsasign/,
|
|
/^node-forge/,
|
|
/^path/,
|
|
/^pkijs/,
|
|
/^poseidon-/,
|
|
/^snarkjs/,
|
|
/^typescript-/,
|
|
/^uuid/,
|
|
],
|
|
},
|
|
]);
|