Skip to content

Commit

Permalink
fix: Fix issues with different platforms and nodejs package types, cj…
Browse files Browse the repository at this point in the history
…s and esm and updating all the demos to reflect it.
  • Loading branch information
elribonazo committed Dec 8, 2023
1 parent 6cb1e4c commit 822a3ef
Show file tree
Hide file tree
Showing 24 changed files with 27,629 additions and 1,393 deletions.
31 changes: 22 additions & 9 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,38 @@
"version": "0.2.0",
"configurations": [
{
"name": "NODE DEMO",
"type": "node",
"name": "CJS DEMO",
"program": "${workspaceRoot}/demos/node-cjs/src/index.js",
"request": "launch",
"skipFiles": [
"<node_internals>/**"
],
"type": "node"
},
{
"name": "ESM DEMO",
"program": "${workspaceRoot}/demos/node-esm/src/index.js",
"request": "launch",
"runtimeExecutable": "${workspaceRoot}/demos/node/node_modules/.bin/ts-node",
"runtimeArgs": ["--transpile-only"],
"program": "${workspaceRoot}/demos/node/src/index.ts",
"skipFiles": ["<node_internals>/**"],
"cwd": "${workspaceRoot}"
"skipFiles": [
"<node_internals>/**"
],
"type": "node"
},
{
"name": "TESTS",
"type": "node",
"request": "launch",
"program": "${workspaceRoot}/node_modules/jest/bin/jest.js",
"args": ["--colors", "--workerThreads", "--maxWorkers", "1"],
"args": [
"--colors",
"--workerThreads",
"--maxWorkers",
"1"
],
"skipFiles": [
"${workspaceRoot}/../../node_modules/**/*",
"<node_internals>/**/*"
]
}
]
}
}
9 changes: 8 additions & 1 deletion demos/browser/craco.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@ module.exports = {
const plutoPath = `${demosPath}/pluto/`;
tsxRule.include = [tsxRule.include, plutoPath];

// Force browser entry
webpackConfig.resolve.alias = {
...webpackConfig.resolve.alias,
'@atala/prism-wallet-sdk': path.resolve(
__dirname,
'node_modules/@atala/prism-wallet-sdk/build/browser/index.js'
),
}
// Wasms - copy to public
webpackConfig.resolve.extensions.push(".wasm");
webpackConfig.plugins = [
Expand Down Expand Up @@ -39,7 +47,6 @@ module.exports = {
// buffer: require.resolve("buffer/"),
stream: require.resolve("stream-browserify"),
path: require.resolve("path-browserify"),
util: false,
};

return webpackConfig;
Expand Down
Loading

0 comments on commit 822a3ef

Please sign in to comment.