Skip to content

Commit

Permalink
fix(build): add node polyfills and update test configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
dtfiedler committed Jul 10, 2024
1 parent 0fa0e27 commit 9d245a5
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 14 deletions.
6 changes: 2 additions & 4 deletions jest.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,13 @@
"\\.(css|gif|png)$": "jest-transform-stub",
"\\.svg": "<rootDir>/tests/common/mocks/svg.js",
"^@tests/(.*)$": "<rootDir>/tests/$1",
"^@src/(.*)$": "<rootDir>/src/$1",
"@ar.io/sdk/web": "<rootDir>/node_modules/@ar.io/sdk/lib/cjs/web/index.js",
"warp-contracts": "<rootDir>/node_modules/warp-contracts/lib/cjs/index.js"
"^@src/(.*)$": "<rootDir>/src/$1"
},
"transform": {
"^.+\\.(ts|tsx|js|jsx|mjs)$": ["ts-jest", { "useESM": true }]
},
"transformIgnorePatterns": [
"/node_modules/(?!arbundles|arweave-wallet-connector|@permaweb).+\\.js$"
"/node_modules/(?!arbundles|arweave-wallet-connector|@permaweb|@ar.io).+\\.js$"
],
"moduleDirectories": ["node_modules", "assets"],
"testPathIgnorePatterns": ["tests/common/"],
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,15 +88,15 @@
"prettier-plugin-organize-imports": "^3.2.4",
"prettier-plugin-tailwindcss": "^0.5.14",
"rimraf": "^5.0.5",
"tailwindcss": "^3.4.1",
"tailwind-scrollbar": "^3.1.0",
"tailwindcss": "^3.4.1",
"tailwindcss-animate": "^1.0.7",
"ts-jest": "^29.1.2",
"ts-node": "^10.9.2",
"typescript": "^5.2.2",
"vite": "^5.1.0",
"vite-bundle-visualizer": "^1.0.1",
"vite-plugin-node-polyfills": "^0.21.0",
"vite-plugin-node-polyfills": "^0.22.0",
"vite-plugin-svgr": "^4.2.0"
},
"lint-staged": {
Expand Down
3 changes: 2 additions & 1 deletion vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import react from '@vitejs/plugin-react';
import path from 'path';
import { defineConfig } from 'vite';
import svgr from 'vite-plugin-svgr';
import { nodePolyfills } from 'vite-plugin-node-polyfills';

// https://vitejs.dev/config/
export default defineConfig({
Expand All @@ -15,6 +16,7 @@ export default defineConfig({
plugins: [
svgr(),
react(),
nodePolyfills(),
...(process.env.VITE_NODE_ENV
? [
sentryVitePlugin({
Expand All @@ -35,7 +37,6 @@ export default defineConfig({
],
base: '/',
define: {
'process.env': process.env,
VITE_CONFIG: {
version: JSON.stringify(process.env.npm_package_version),
},
Expand Down
39 changes: 32 additions & 7 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -8993,7 +8993,16 @@ string-length@^4.0.1:
char-regex "^1.0.2"
strip-ansi "^6.0.0"

"string-width-cjs@npm:string-width@^4.2.0", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3:
"string-width-cjs@npm:string-width@^4.2.0":
version "4.2.3"
resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010"
integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
dependencies:
emoji-regex "^8.0.0"
is-fullwidth-code-point "^3.0.0"
strip-ansi "^6.0.1"

string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3:
version "4.2.3"
resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010"
integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
Expand Down Expand Up @@ -9080,7 +9089,14 @@ string_decoder@~1.1.1:
dependencies:
safe-buffer "~5.1.0"

"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1:
"strip-ansi-cjs@npm:strip-ansi@^6.0.1":
version "6.0.1"
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9"
integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==
dependencies:
ansi-regex "^5.0.1"

strip-ansi@^6.0.0, strip-ansi@^6.0.1:
version "6.0.1"
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9"
integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==
Expand Down Expand Up @@ -9659,10 +9675,10 @@ vite-bundle-visualizer@^1.0.1:
rollup-plugin-visualizer "^5.11.0"
tmp "^0.2.1"

vite-plugin-node-polyfills@^0.21.0:
version "0.21.0"
resolved "https://registry.yarnpkg.com/vite-plugin-node-polyfills/-/vite-plugin-node-polyfills-0.21.0.tgz#5566b3a725d4bbc75f4f794b0467e4047c14a58c"
integrity sha512-Sk4DiKnmxN8E0vhgEhzLudfJQfaT8k4/gJ25xvUPG54KjLJ6HAmDKbr4rzDD/QWEY+Lwg80KE85fGYBQihEPQA==
vite-plugin-node-polyfills@^0.22.0:
version "0.22.0"
resolved "https://registry.yarnpkg.com/vite-plugin-node-polyfills/-/vite-plugin-node-polyfills-0.22.0.tgz#d0afcf82eb985fc02244620d7cec1ddd1c6e0864"
integrity sha512-F+G3LjiGbG8QpbH9bZ//GSBr9i1InSTkaulfUHFa9jkLqVGORFBoqc2A/Yu5Mmh1kNAbiAeKeK+6aaQUf3x0JA==
dependencies:
"@rollup/plugin-inject" "^5.0.5"
node-stdlib-browser "^1.2.0"
Expand Down Expand Up @@ -9889,7 +9905,7 @@ word-wrap@^1.2.5:
resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.5.tgz#d2c45c6dd4fbce621a66f136cbe328afd0410b34"
integrity sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==

"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0:
"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0":
version "7.0.0"
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43"
integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==
Expand All @@ -9907,6 +9923,15 @@ wrap-ansi@^6.2.0:
string-width "^4.1.0"
strip-ansi "^6.0.0"

wrap-ansi@^7.0.0:
version "7.0.0"
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43"
integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==
dependencies:
ansi-styles "^4.0.0"
string-width "^4.1.0"
strip-ansi "^6.0.0"

wrap-ansi@^8.1.0:
version "8.1.0"
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-8.1.0.tgz#56dc22368ee570face1b49819975d9b9a5ead214"
Expand Down

0 comments on commit 9d245a5

Please sign in to comment.