This commit is contained in:
Pavel Murygin 2023-01-18 02:02:21 +04:00
parent 407efb494b
commit fdaa824637
5 changed files with 41 additions and 43 deletions

View File

@ -9,7 +9,8 @@
"pnpm": ">=3"
},
"scripts": {
"build": "webpack"
"build": "webpack",
"_build": "webpack --mode=production --node-env=production"
},
"repository": "https://github.com/fluencelabs/fluence-js",
"author": "Fluence Labs",

View File

@ -8,11 +8,11 @@ export const makeDefaultPeer = () => {
const workerLoader = new InlinedWorkerLoader();
const controlModuleLoader = new InlinedWasmLoader('__marine__');
const avmModuleLoader = new InlinedWasmLoader('__avm__');
const marine = new MarineBackgroundRunner(workerLoader, controlModuleLoader, marineLogFunction);
const avm = new MarineBasedAvmRunner(marine, avmModuleLoader, undefined);
return new FluencePeer(marine, avm);
// return new FluencePeer(marine, avm);
return 1;
};
// @ts-ignore
// @ts-ignore
globalThis.defaultPeer = makeDefaultPeer();

View File

@ -1,21 +1,23 @@
{
"compilerOptions": {
"outDir": "./dist/",
"allowJs": true,
"baseUrl": ".",
"downlevelIteration": true,
"sourceMap": true,
"inlineSources": true,
"allowSyntheticDefaultImports": true,
"resolveJsonModule": true,
"target": "ES5",
"module": "commonjs",
"sourceMap": false,
"inlineSources": false,
"pretty": true,
"target": "esnext",
"module": "esnext",
"moduleResolution": "node",
"declaration": true,
"declaration": false,
"esModuleInterop": true,
"declarationMap": true,
"declarationMap": false,
"strict": true,
"skipLibCheck": true
"noImplicitAny": false,
"alwaysStrict": true,
"noImplicitThis": true,
"strictNullChecks": false
},
"exclude": ["node_modules", "dist", "bundle"],
"include": ["src/**/*"]
"exclude": ["node_modules", "dist"],
"include": ["src"]
}

View File

@ -3,9 +3,10 @@
const path = require('path');
const ReplacePlugin = require('webpack-plugin-replace');
const mode = 'production';
// const mode = 'production';
const mode = 'development';
const config = () => ({
const config = {
mode: mode,
entry: './src/index.ts',
output: {
@ -15,11 +16,7 @@ const config = () => ({
rules: [
{
test: /\.(js|ts|tsx)$/i,
use: [
{
loader: 'ts-loader',
},
],
loader: 'ts-loader',
exclude: ['/node_modules/'],
},
],
@ -30,13 +27,13 @@ const config = () => ({
plugins: [
new ReplacePlugin({
values: {
__marine__: '10',
__avm__: '20',
'__marine__': '__marine__10',
'__avm__': '__avm__10',
},
}),
],
});
};
module.exports = () => {
return config();
return config;
};

30
pnpm-lock.yaml generated
View File

@ -39,7 +39,7 @@ importers:
typescript: 4.9.4
web-vitals: 2.1.4
devDependencies:
'@fluencelabs/aqua': 0.8.0-368_6ufwt3jpv5t55s2rz2aorqe75e
'@fluencelabs/aqua': 0.8.0-368_l5q2xyvau5skfpd35wtvp5s4jq
'@fluencelabs/aqua-lib': 0.6.0
'@fluencelabs/tools': link:../../../client/tools
@ -235,7 +235,6 @@ importers:
js-base64: 3.7.3
ts-jest: 28.0.2
ts-loader: 9.4.2
ts-node: 10.9.1
typescript: 4.6.4
webpack: 5.75.0
webpack-cli: 5.0.1
@ -246,11 +245,10 @@ importers:
'@fluencelabs/marine.deps-loader.web': link:../../marine/deps-loader.web
'@types/jest': 28.1.0
'@types/node': 16.11.59
jest: 28.1.0_4echt27za7uk6ezjshmbxcfmgy
jest: 28.1.0_@types+node@16.11.59
js-base64: 3.7.3
ts-jest: 28.0.2_vibqa5hxa5biq5fwuxzv5iobty
ts-loader: 9.4.2_ot4tevpsagasia5fdh7emkeuyq
ts-node: 10.9.1_f4s53rsdbgkmxc2oaa23drhnsy
typescript: 4.6.4
webpack: 5.75.0_webpack-cli@5.0.1
webpack-cli: 5.0.1_webpack@5.75.0
@ -370,7 +368,7 @@ importers:
ts-pattern: 3.3.3
uuid: 8.3.2
devDependencies:
'@fluencelabs/aqua': 0.7.7-362_i3yjj2scigfcyyfwxdhvpsnmxe
'@fluencelabs/aqua': 0.7.7-362_vibqa5hxa5biq5fwuxzv5iobty
'@fluencelabs/aqua-api': 0.9.1-373
'@fluencelabs/aqua-lib': 0.6.0
'@fluencelabs/fluence-network-environment': 1.0.13
@ -382,7 +380,7 @@ importers:
jest: 28.1.0_gsb7asu77en4txj3es3i65pxci
jest-each: 28.1.3
js-base64: 3.7.2
multiaddr: 10.0.1_node-fetch@3.2.10
multiaddr: 10.0.1
ts-jest: 28.0.2_vibqa5hxa5biq5fwuxzv5iobty
ts-node: 10.9.1_apbkdfxvcdmborgupeskcsfbo4
typescript: 4.6.4
@ -2093,15 +2091,15 @@ packages:
resolution: {integrity: sha512-ifjtCM93KO3LhzPkMxqmXhwLmrg/scjOiyTihEVg7ns5N+BVzaK1eWzdOdqGdl9ZVoah43pdlQUepEo7VdRmsw==}
dev: true
/@fluencelabs/aqua/0.7.7-362_i3yjj2scigfcyyfwxdhvpsnmxe:
/@fluencelabs/aqua/0.7.7-362_vibqa5hxa5biq5fwuxzv5iobty:
resolution: {integrity: sha512-CwvBc3wKQdvnDM4Zxj6yFE5MR2oeh+EZ++m2hLvENt7OWl3cnZVR4cJQkRxMMLVT0MxRwLiy97UIBwGsPqlSCA==}
hasBin: true
dependencies:
'@fluencelabs/aqua-ipfs': 0.5.5
'@fluencelabs/aqua-lib': 0.5.2
'@fluencelabs/fluence': 0.26.3-snapshot-4_i3yjj2scigfcyyfwxdhvpsnmxe
'@fluencelabs/fluence': 0.26.3-snapshot-4_vibqa5hxa5biq5fwuxzv5iobty
'@fluencelabs/fluence-network-environment': 1.0.13
ipfs-http-client: 50.1.2_node-fetch@3.2.10
ipfs-http-client: 50.1.2
transitivePeerDependencies:
- '@babel/core'
- '@types/jest'
@ -2115,15 +2113,15 @@ packages:
- utf-8-validate
dev: true
/@fluencelabs/aqua/0.8.0-368_6ufwt3jpv5t55s2rz2aorqe75e:
/@fluencelabs/aqua/0.8.0-368_l5q2xyvau5skfpd35wtvp5s4jq:
resolution: {integrity: sha512-vnqgjwJWa2XvNqGUCITvkhIiF7ps9WhZL4GfvtuSwVAsdpDaYGtxPH63wcYcG9TwRCr7nGgjOhJGXhkmGhUE2w==}
hasBin: true
dependencies:
'@fluencelabs/aqua-ipfs': 0.5.8
'@fluencelabs/aqua-lib': 0.6.0
'@fluencelabs/fluence': 0.27.4_6ufwt3jpv5t55s2rz2aorqe75e
'@fluencelabs/fluence': 0.27.4_l5q2xyvau5skfpd35wtvp5s4jq
'@fluencelabs/fluence-network-environment': 1.0.13
ipfs-http-client: 50.1.2
ipfs-http-client: 50.1.2_node-fetch@3.2.10
transitivePeerDependencies:
- '@babel/core'
- '@types/jest'
@ -2204,13 +2202,13 @@ packages:
/@fluencelabs/fluence-network-environment/1.0.13:
resolution: {integrity: sha512-2pci3T0sUHE08jwEs1r/vHKVT4XUh/A3j/QJ0eIhddsxyIjEksjdn05X7DF6STD14CF8GgBVOJEPgav8qaUMpA==}
/@fluencelabs/fluence/0.26.3-snapshot-4_i3yjj2scigfcyyfwxdhvpsnmxe:
/@fluencelabs/fluence/0.26.3-snapshot-4_vibqa5hxa5biq5fwuxzv5iobty:
resolution: {integrity: sha512-M/iQhnViXfMaATj3gFPQXrZe9zSVcyN9F9A9hfJBUn0VLamhmbfeIoSZeheK8VGBxYbRGcrtoqLPTy1vJQVgVw==}
engines: {node: '>=10', pnpm: '>=3'}
hasBin: true
dependencies:
'@fluencelabs/avm': 0.31.4
'@fluencelabs/connection': 0.2.0_node-fetch@3.2.10
'@fluencelabs/connection': 0.2.0
'@fluencelabs/interfaces': 0.1.0
'@fluencelabs/keypair': 0.2.0
'@fluencelabs/marine-js': 0.3.18_vibqa5hxa5biq5fwuxzv5iobty
@ -2240,13 +2238,13 @@ packages:
- utf-8-validate
dev: true
/@fluencelabs/fluence/0.27.4_6ufwt3jpv5t55s2rz2aorqe75e:
/@fluencelabs/fluence/0.27.4_l5q2xyvau5skfpd35wtvp5s4jq:
resolution: {integrity: sha512-f85q8ZdmPlUd6uIgmS0CDTvSsb+TGvTqOljw0b161lfEuqPIXrjxJSt0/2Lyh2eEZ1P3slOka1tbVw01nVrt5w==}
engines: {node: '>=10', pnpm: '>=3'}
hasBin: true
dependencies:
'@fluencelabs/avm': 0.31.10
'@fluencelabs/connection': 0.2.0
'@fluencelabs/connection': 0.2.0_node-fetch@3.2.10
'@fluencelabs/interfaces': 0.1.0
'@fluencelabs/keypair': 0.2.0
'@fluencelabs/marine-js': 0.3.37_6ufwt3jpv5t55s2rz2aorqe75e