limiting utils.ts size for cloudflare

This commit is contained in:
2023-07-08 18:23:06 -04:00
parent f044093b8a
commit 16b9a8e584
4 changed files with 17 additions and 10 deletions

8
src/app.d.ts vendored
View File

@@ -1,7 +1,13 @@
// See https://kit.svelte.dev/docs/types#app
// for information about these interfaces
declare global {
namespace App {}
namespace App {
interface Platform {
env: { COUNTER: DurableObjectNamespace };
context: { waitUntil(promise: Promise<any>): void };
caches: CacheStorage & { default: Cache };
}
}
}
export {};

6
src/lib/prover.ts Normal file
View File

@@ -0,0 +1,6 @@
import { RLNProver } from 'rlnjs';
const wasmPath = '/rln/circuit.wasm';
const zkeyPath = '/rln/final.zkey';
const prover: RLNProver = new RLNProver(wasmPath, zkeyPath);
export default prover;

View File

@@ -1,14 +1,11 @@
import type { Identity } from '@semaphore-protocol/identity';
import type { MessageI, RoomI, ServerI } from 'discreetly-interfaces';
import { randomBigInt, genId, str2BigInt } from 'discreetly-interfaces';
import { RLNProver, type RLNFullProof, type MerkleProof } from 'rlnjs';
import { poseidon1 } from 'poseidon-lite/poseidon1';
import { type RLNFullProof, type MerkleProof } from 'rlnjs';
import { Group } from '@semaphore-protocol/group';
import { poseidon1 } from 'poseidon-lite/poseidon1';
import { poseidon2 } from 'poseidon-lite/poseidon2';
const wasmPath = '/rln/circuit.wasm';
const zkeyPath = '/rln/final.zkey';
const prover: RLNProver = new RLNProver(wasmPath, zkeyPath);
import prover from './prover';
interface proofInputsI {
rlnIdentifier: bigint;

View File

@@ -1,4 +1,5 @@
import adapter from '@sveltejs/adapter-cloudflare';
import { vitePreprocess } from '@sveltejs/kit/vite';
/** @type {import('@sveltejs/kit').Config} */
@@ -19,9 +20,6 @@ const config = {
}
})
},
build: {
sourcemap: true // Config vite to generate sourcemap when bundling.
},
};
export default config;