Skip to content

Commit

Permalink
Merge pull request #63 from zama-ai/feat/revamp
Browse files Browse the repository at this point in the history
Implement input mechanism and reencryption
  • Loading branch information
immortal-tofu authored Jun 13, 2024
2 parents b45babb + 3935569 commit 875159a
Show file tree
Hide file tree
Showing 38 changed files with 6,458 additions and 1,203 deletions.
2 changes: 2 additions & 0 deletions config/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ const plugins = [
replace({
preventAssignment: true,
'node-tfhe': 'tfhe',
'kms/node/': 'kms/web/',
}),
typescript({
tsconfig: './tsconfig.rollup.json',
Expand Down Expand Up @@ -45,6 +46,7 @@ export default [
format: 'cjs',
},
plugins: [
commonjs(),
typescript({
tsconfig: './tsconfig.rollup.json',
}),
Expand Down
50 changes: 26 additions & 24 deletions config/webpack.config.cjs
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
"use strict";
const webpack = require("webpack");
const path = require("path");
const PATHS = require("./paths.cjs");
'use strict';
const webpack = require('webpack');
const path = require('path');
const PATHS = require('./paths.cjs');

const web = {
entry: {
"fhevm.min": PATHS.web,
'fhevm.min': PATHS.web,
},
output: {
path: PATHS.build,
filename: "[name].js",
chunkFilename: "[name].js",
globalObject: "this",
filename: '[name].js',
chunkFilename: '[name].js',
globalObject: 'this',
library: {
name: "fhevm",
type: "umd2",
name: 'fhevm',
type: 'umd2',
},
},
optimization: {
splitChunks: {
chunks: "all",
chunks: 'all',
minRemainingSize: 0,
minChunks: 1,
cacheGroups: {
Expand All @@ -42,34 +42,36 @@ const web = {
{
test: /\.tsx?$/,
exclude: [/node_modules/],
use: ["ts-loader"],
use: ['ts-loader'],
generator: {
filename: "[name][ext]",
filename: '[name][ext]',
},
},
],
},
resolve: {
extensions: [".tsx", ".ts", ".js"],
extensions: ['.tsx', '.ts', '.js'],
extensionAlias: {
".js": [".ts", ".tsx", ".js"],
".mjs": [".mts", ".mjs"],
'.js': ['.ts', '.tsx', '.js'],
'.mjs': ['.mts', '.mjs'],
},
alias: {
"node-tfhe": "tfhe/tfhe",
'node-tfhe': 'tfhe/tfhe',
},
fallback: {
"tfhe_bg.wasm": require.resolve("tfhe/tfhe_bg.wasm"),
"node-tfhe": require.resolve("tfhe/tfhe"),
buffer: require.resolve("buffer/"),
crypto: require.resolve("crypto-browserify"),
stream: require.resolve("stream-browserify"),
path: require.resolve("path-browserify"),
'tfhe_bg.wasm': require.resolve('tfhe/tfhe_bg.wasm'),
'node-tfhe': require.resolve('tfhe/tfhe'),
'kms_lib_bg.wasm': require.resolve('../src/kms/web/kms_lib_bg.wasm'),
'node-kms': require.resolve('../src/kms/web/kms_lib.js'),
buffer: require.resolve('buffer/'),
crypto: require.resolve('crypto-browserify'),
stream: require.resolve('stream-browserify'),
path: require.resolve('path-browserify'),
},
},
plugins: [
new webpack.ProvidePlugin({
Buffer: ["buffer", "Buffer"],
Buffer: ['buffer', 'Buffer'],
}),
new webpack.optimize.LimitChunkCountPlugin({
maxChunks: 1,
Expand Down
41 changes: 23 additions & 18 deletions jest.config.cjs
Original file line number Diff line number Diff line change
@@ -1,32 +1,37 @@
module.exports = {
preset: "ts-jest",
preset: 'ts-jest',
transform: {
"^.+\\.tsx?$": [
"ts-jest",
'^.+\\.tsx?$': [
'ts-jest',
{
tsconfig: "tsconfig.json",
tsconfig: 'tsconfig.json',
},
],
"^.+\\.jsx?$": [
"ts-jest",
'^.+\\.jsx?$': [
'ts-jest',
{
tsconfig: "tsconfig.json",
tsconfig: 'tsconfig.json',
},
],
"^.+\\.bin$": ["<rootDir>config/rawLoader.cjs"],
'^.+\\.bin$': ['<rootDir>config/rawLoader.cjs'],
},
testEnvironment: 'node',
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
moduleNameMapper: {
'^node-kms$': '<rootDir>/src/kms/node',
},
testEnvironment: "node",
moduleFileExtensions: ["ts", "tsx", "js", "jsx", "json", "node"],
collectCoverageFrom: [
"src/**/*.ts",
"!src/**/*.d.ts",
"src/**/*.tsx",
"!src/**/*.story.**",
'src/**/*.ts',
'src/**/*.tsx',
'!src/**/*.d.ts',
'!src/kms/*',
'!src/init.ts',
'!src/node.ts',
'!src/web.ts',
],
testRegex: "\\.test\\.tsx?$",
coverageReporters: ["lcov", "text-summary", "json"],
transformIgnorePatterns: ["/node_modules/"],
coveragePathIgnorePatterns: [],
testRegex: '\\.test\\.tsx?$',
coverageReporters: ['lcov', 'text-summary', 'json'],
transformIgnorePatterns: ['/node_modules/'],
coverageThreshold: {
global: {
branches: 80,
Expand Down
Loading

0 comments on commit 875159a

Please sign in to comment.