Skip to content

Commit

Permalink
fix for web-ui (#219)
Browse files Browse the repository at this point in the history
Co-authored-by: Edward Alvarado <[email protected]>
  • Loading branch information
acedward and Edward Alvarado authored Sep 16, 2023
1 parent f42d321 commit 838a277
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 105 deletions.
118 changes: 30 additions & 88 deletions engine/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 2 additions & 10 deletions engine/paima-mw-core/esbuildconfig.cjs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
/* eslint-disable @typescript-eslint/no-var-requires */
const esbuild = require('esbuild');
const g = require('@esbuild-plugins/node-globals-polyfill');
const m = require('@esbuild-plugins/node-modules-polyfill');
const modules = m.NodeModulesPolyfillPlugin();
const { polyfillNode } = require('esbuild-plugin-polyfill-node');

const define = { global: 'window' };

Expand All @@ -21,20 +19,14 @@ if (
throw new Error('Please ensure you have filled out your .env file');
}

const global = g.NodeGlobalsPolyfillPlugin({
process: true,
buffer: true,
define: { 'process.env.var': '"hello"' }, // inject will override define, to keep env vars you must also pass define here https://github.com/evanw/esbuild/issues/660
});

const config = {
entryPoints: ['build/index.js'],
bundle: true,
format: 'iife',
globalName: 'middleware',
define,
outfile: 'web/middleware.js',
plugins: [global, modules],
plugins: [polyfillNode({})],
external: ['pg-native'],
};

Expand Down
13 changes: 6 additions & 7 deletions engine/paima-mw-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,25 +17,24 @@
},
"author": "",
"devDependencies": {
"@esbuild-plugins/node-globals-polyfill": "^0.2.3",
"@esbuild-plugins/node-modules-polyfill": "^0.2.2",
"dotenv": "^16.0.3",
"esbuild": "^0.17.14",
"esbuild-plugin-d.ts": "^1.1.0",
"esbuild-plugin-polyfill-node": "^0.3.0",
"prettier": "^3.0.3",
"prettier-plugin-organize-imports": "^3.2.3",
"typescript": "^4.7.4"
},
"dependencies": {
"@metamask/providers": "^10.2.1",
"@paima/concise": "1.0.0",
"@paima/crypto": "1.0.0",
"@paima/prando": "1.0.0",
"@paima/providers": "1.0.0",
"@perawallet/connect": "^1.2.3",
"@polkadot/extension-dapp": "^0.44.9",
"@truffle/hdwallet-provider": "^2.1.14",
"algosdk": "^2.3.0",
"bech32": "^2.0.0",
"@paima/concise": "1.0.0",
"@paima/crypto": "1.0.0",
"@paima/prando": "1.0.0",
"@paima/providers": "1.0.0"
"bech32": "^2.0.0"
}
}

0 comments on commit 838a277

Please sign in to comment.