Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Luizoamorim/integration #624

Closed
wants to merge 392 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
392 commits
Select commit Hold shift + click to select a range
4b1baf0
chore: npm audit fix
IlyasRidhuan Feb 9, 2022
eda41db
fix: field assignment
IlyasRidhuan Feb 9, 2022
f6eeb07
fix: update optimist url, catch location bridge errors
IlyasRidhuan Feb 10, 2022
4dd7d85
fix: move to npm ci
IlyasRidhuan Feb 10, 2022
6eacbe9
fix: balance checks
IlyasRidhuan Feb 10, 2022
45b02ba
fix: update zokrates js
IlyasRidhuan Feb 18, 2022
cb5cc87
feat: add update socket
IlyasRidhuan Feb 20, 2022
e916abb
feat: offchain and ws fix
IlyasRidhuan Feb 22, 2022
461e5d3
feat: created a web component for the bridge deposit and withdraw com…
luizoamorim Feb 14, 2022
972d6ec
feat: generating a web component which will wrap our whole application
luizoamorim Mar 2, 2022
ff49dc3
feat: ui/ux updated for bridge component and bridge page
luizoamorim Mar 4, 2022
80aeb80
fix: eslint
luizoamorim Mar 4, 2022
5b7e6e1
feat: modal for the list of tokens on bridge component
luizoamorim Mar 5, 2022
ed56d74
fix: eslint
luizoamorim Mar 5, 2022
0625e2f
fix: remove token list modal from Routes
luizoamorim Mar 5, 2022
79598bb
fix: eslint
luizoamorim Mar 5, 2022
6bb458d
refactor: responsive scss and modal search
luizoamorim Mar 6, 2022
0b561cf
feat: update balances based on token choosed
luizoamorim Mar 9, 2022
2945f02
fix: problem in craco and the correct use of useAccount hooks in init…
luizoamorim Mar 9, 2022
9570b99
fix: eslint
luizoamorim Mar 9, 2022
5f90a78
fix: eslint
luizoamorim Mar 9, 2022
214f45e
feat: handling input values and formatting balances
luizoamorim Mar 11, 2022
a8187db
fix: show the l2 balances correctly
luizoamorim Mar 11, 2022
f195aeb
fix: balance presentation in transfer modal
luizoamorim Mar 11, 2022
895134a
fix: wasm loader added to react app
LijuJoseJJ Nov 25, 2021
72e2e73
feat: nf3 circuits in zkjs browser
dwebchapey Nov 26, 2021
db2838f
feat: zok js compile and genproof
dwebchapey Nov 26, 2021
6fde337
feat: zokjs nf browser
dwebchapey Nov 26, 2021
1068641
feat: zkjs in browser
dwebchapey Nov 26, 2021
93be732
feat: zkjs in browser
dwebchapey Nov 26, 2021
6920cc9
feat: zkjs in browser
dwebchapey Nov 26, 2021
003470b
fix: binary files added for compile out and pk binary
LijuJoseJJ Dec 3, 2021
8eda793
fix: not in modules removed
LijuJoseJJ Dec 3, 2021
e8bca84
fix: deposit work in progress
LijuJoseJJ Dec 8, 2021
edf5fe2
fix: eslint fixes
LijuJoseJJ Dec 9, 2021
fc13733
fix: console.log removed
LijuJoseJJ Dec 9, 2021
e0ed7ae
fix: successfully rebased
LijuJoseJJ Dec 12, 2021
db1a8fe
fix: eslint fixes
LijuJoseJJ Dec 12, 2021
f7523ab
fix: ignore big files
IlyasRidhuan Jan 9, 2022
7e43fc0
fix: ignore big files
IlyasRidhuan Jan 9, 2022
c8e086e
feat: update deposit calls
IlyasRidhuan Dec 16, 2021
1942f11
feat: update transfer to use zokrates js
IlyasRidhuan Dec 17, 2021
8730cce
feat: update withdraw to use zokrates js
IlyasRidhuan Dec 17, 2021
d950b6b
fix: update gitignore
IlyasRidhuan Jan 9, 2022
b70d7c1
fix: update zzokrates test view files
IlyasRidhuan Jan 9, 2022
f6eafca
fix: bug resolved for deposit
LijuJoseJJ Jan 12, 2022
cd23381
fix: eslint fixes
LijuJoseJJ Jan 12, 2022
af7e650
fix: configuration bigInt value deserialized
LijuJoseJJ Jan 17, 2022
5813d86
fix: wasm loader added to react app
LijuJoseJJ Nov 25, 2021
0d7e8a1
feat: nf3 circuits in zkjs browser
dwebchapey Nov 26, 2021
8b17a77
feat: zok js compile and genproof
dwebchapey Nov 26, 2021
ec76ac3
feat: zokjs nf browser
dwebchapey Nov 26, 2021
8e4236a
feat: zkjs in browser
dwebchapey Nov 26, 2021
94e55e9
feat: zkjs in browser
dwebchapey Nov 26, 2021
9f452ab
feat: zkjs in browser
dwebchapey Nov 26, 2021
a6620dc
fix: binary files added for compile out and pk binary
LijuJoseJJ Dec 3, 2021
b3181ea
fix: not in modules removed
LijuJoseJJ Dec 3, 2021
f4708e9
fix: deposit work in progress
LijuJoseJJ Dec 8, 2021
6cefe10
fix: eslint fixes
LijuJoseJJ Dec 9, 2021
e5f7149
fix: console.log removed
LijuJoseJJ Dec 9, 2021
60fb859
fix: successfully rebased
LijuJoseJJ Dec 12, 2021
9809fce
fix: eslint fixes
LijuJoseJJ Dec 12, 2021
f0de41d
fix: update zzokrates test view files
IlyasRidhuan Jan 9, 2022
10d480e
fix: bug resolved for deposit
LijuJoseJJ Jan 12, 2022
603fcad
fix: eslint fixes
LijuJoseJJ Jan 12, 2022
bf3245d
fix: update use of compressed pkds
IlyasRidhuan Jan 16, 2022
282011d
fix: eslint errors
IlyasRidhuan Jan 17, 2022
81612f2
feat: browser side transfer
IlyasRidhuan Jan 17, 2022
04c17ff
feat: add blockProposed Ws
IlyasRidhuan Jan 18, 2022
88a7a4e
feat: update bpHandler to use ws
IlyasRidhuan Jan 18, 2022
9e5b2a0
fix: fix indexdb calls
IlyasRidhuan Jan 18, 2022
2410b36
feat: update transfer op
IlyasRidhuan Jan 18, 2022
2edf3e7
fix: small config errors
IlyasRidhuan Jan 18, 2022
7b0fcea
feat: single transfer and double transfer working
IlyasRidhuan Jan 18, 2022
4e5d65f
feat: withdraw working
IlyasRidhuan Jan 18, 2022
44e0b1f
chore: cleanup logging
IlyasRidhuan Jan 18, 2022
1a4ac2e
fix: small fixups
IlyasRidhuan Jan 18, 2022
0d59847
fix: nightfall-browser config refactor import config module removed
LijuJoseJJ Jan 19, 2022
388482e
fix: eslint fixes
LijuJoseJJ Jan 21, 2022
1204092
fix: approve and submitTransaction implemented in wallet for deposit …
LijuJoseJJ Jan 24, 2022
389c263
chore: images for the main page like polygon web wallet
luizoamorim Jan 19, 2022
6ce245e
test: trying to fix the error in the tests
luizoamorim Jan 19, 2022
d967ef8
chore: adding wallet.svg icon and creating a new folder for icons
luizoamorim Jan 19, 2022
6c28215
style(scss): adding to scss files. one for the initial page and other…
luizoamorim Jan 19, 2022
2a021ed
feat(main page): a main page like in the polygon website
luizoamorim Jan 19, 2022
02d0665
fix: remove e2e test from check PRs (#411)
daveroga Jan 17, 2022
c541ab2
fix: #318 hosted geth config configured
LijuJoseJJ Nov 29, 2021
e8c2f8c
fix: testing 1
LijuJoseJJ Dec 12, 2021
8ab86d2
fix: testing 2
LijuJoseJJ Dec 12, 2021
be70b96
test: testing 4
LijuJoseJJ Dec 13, 2021
6bd3556
test: testing 5
LijuJoseJJ Dec 13, 2021
ef6a5cc
test: testing 6
LijuJoseJJ Dec 13, 2021
2f5827c
test: 8
LijuJoseJJ Dec 14, 2021
912cf22
test: 9
LijuJoseJJ Jan 3, 2022
1381485
test: 10
LijuJoseJJ Jan 3, 2022
070d314
fix: removed testing workflow
LijuJoseJJ Jan 3, 2022
0a41e26
fix: github workflow to run cron job on hosted ropsten geth instead i…
LijuJoseJJ Jan 5, 2022
88a9534
fix: hosted geth added to secret
LijuJoseJJ Jan 13, 2022
cfaabed
test: 1
LijuJoseJJ Jan 13, 2022
19a6ab8
test: 3
LijuJoseJJ Jan 13, 2022
5fed2d2
fix: github workflow used for testing changes for hosted geth node re…
LijuJoseJJ Jan 14, 2022
299a6ca
fix: variable name corrected and readme.md file updated
LijuJoseJJ Jan 18, 2022
7bbcd68
test: 1
LijuJoseJJ Jan 18, 2022
1d44b11
test: 2
LijuJoseJJ Jan 18, 2022
1cedb61
fix: github workflow used for testing changes for hosted geth node re…
LijuJoseJJ Jan 18, 2022
b12c5ab
fix: term hosted removed from code
LijuJoseJJ Jan 18, 2022
a41c72f
test: 3
LijuJoseJJ Jan 18, 2022
a22a079
fix: github workflow used for testing changes for hosted geth node re…
LijuJoseJJ Jan 18, 2022
45dc995
test: trying to fix the error in the tests
luizoamorim Jan 19, 2022
d5fdda0
style(scss): adding to scss files. one for the initial page and other…
luizoamorim Jan 19, 2022
26d07a4
fix(eslint): fixing eslint problems
luizoamorim Jan 19, 2022
a5d9083
fix(paths): adding the correct path to zokrates abis
luizoamorim Jan 20, 2022
5e0b831
fix(paths): adding the correct path to zokrates abis
luizoamorim Jan 20, 2022
05fa688
fix: problems with images presentation
luizoamorim Jan 20, 2022
dc81987
fix: problems with page redirections just adding a exec tag on the ma…
luizoamorim Jan 20, 2022
cc05453
chore(styles): adding new scss files to tokens presentation page
luizoamorim Jan 20, 2022
e2d3185
chore(styles): refactoring asses scss
luizoamorim Jan 20, 2022
e621a18
feat(components): new page wallet with the components with new style …
luizoamorim Jan 20, 2022
0e18168
fix(eslint): eslint fixes
luizoamorim Jan 20, 2022
28e6a71
feat: bridge page added
luizoamorim Jan 22, 2022
8745c30
feat: confirm transaction modal
luizoamorim Jan 23, 2022
5942524
feat: send tokens modal
luizoamorim Jan 23, 2022
f878f5c
feat: update balance checks
IlyasRidhuan Jan 20, 2022
3d4d1b6
feat: wallet balance retrieval
IlyasRidhuan Jan 21, 2022
29038e6
feat: web3 and nf3 instantiation
IlyasRidhuan Jan 22, 2022
306cf17
feat: transfer and withdraw in bridge
IlyasRidhuan Jan 23, 2022
f272835
feat: deposit and trfs in bridge with pop up
IlyasRidhuan Jan 24, 2022
557e9d6
feat: send modal
IlyasRidhuan Jan 24, 2022
172f906
feat: send complete and incoming view keys
IlyasRidhuan Jan 24, 2022
429d303
fix: remove dup files
IlyasRidhuan Jan 24, 2022
c61ada5
feat: sidebar and navbar added to the project
luizoamorim Jan 24, 2022
e9e59b7
fix: merge issues
IlyasRidhuan Jan 25, 2022
50a77a8
feat: side bar refactored with icons
luizoamorim Jan 25, 2022
f4119aa
feat: update styling
IlyasRidhuan Jan 25, 2022
34addf2
fix: appling same fix to bridge jsx file too
LijuJoseJJ Jan 28, 2022
e017b9a
fix: eslint fixes
LijuJoseJJ Jan 28, 2022
761bfe7
fix: eslint fixes
LijuJoseJJ Jan 28, 2022
8c70b64
fix: eslint fixes
LijuJoseJJ Jan 28, 2022
3ba8eb2
feat: prepare new wallet for tests
druiz0992 Jan 28, 2022
e17a2d0
feat: increase waiting times
druiz0992 Jan 28, 2022
5ac4301
feat: modal deposit and withdraw flow
luizoamorim Jan 25, 2022
e6450c4
feat: transaction page
IlyasRidhuan Jan 27, 2022
08c9e1e
feat: add login to wallet tests
druiz0992 Jan 31, 2022
2a77565
fix: abi added to nightfall-browser
LijuJoseJJ Jan 30, 2022
7870a9c
fix: web3 instance connected metamask provider
LijuJoseJJ Feb 1, 2022
3d8c8fc
fix: eslint fixes
LijuJoseJJ Feb 1, 2022
283fc94
fix: todo comment corrected
LijuJoseJJ Feb 1, 2022
f9de9ce
fix: bug fix
LijuJoseJJ Feb 1, 2022
14cad1c
feat: add tx tests
druiz0992 Feb 3, 2022
e321f4d
fix: sign transaction
druiz0992 Feb 3, 2022
17973c7
feat: initial page refactored using polygon styles in className react…
luizoamorim Feb 1, 2022
4635288
fix: eslint errors
luizoamorim Feb 2, 2022
5dd629e
fix: refactoring wallet page, side and nav bar styles
luizoamorim Feb 2, 2022
ff4e1a2
fix: eslint
luizoamorim Feb 2, 2022
d49114c
chore: delete unused files (#458)
Feb 3, 2022
86f7c58
fix: sdk nf3 initalisation removed also some refactor
LijuJoseJJ Feb 3, 2022
55af88b
fix: console.log removed
LijuJoseJJ Feb 3, 2022
40a0e42
fix: last reference sdk removed
LijuJoseJJ Feb 4, 2022
4ae61ab
fix: stop mnemonic popup just because metamask is mid-sign
IlyasRidhuan Feb 4, 2022
26a7688
fix: bug fix for wallet page reload
LijuJoseJJ Feb 5, 2022
054ed33
chore: update readme
IlyasRidhuan Feb 3, 2022
3c97fbf
chore: rename keys inline with containers
IlyasRidhuan Feb 4, 2022
54d281d
chore: remove silly logs
IlyasRidhuan Feb 4, 2022
5234d46
chore: update readme and add helper script
IlyasRidhuan Feb 4, 2022
fb39435
fix: update contract address retrieval to be dynamic
IlyasRidhuan Feb 9, 2022
741b458
chore: npm audit fix
IlyasRidhuan Feb 9, 2022
37d4862
fix: field assignment
IlyasRidhuan Feb 9, 2022
b8c92d9
fix: update optimist url, catch location bridge errors
IlyasRidhuan Feb 10, 2022
2d12936
fix: move to npm ci
IlyasRidhuan Feb 10, 2022
3a7da91
fix: balance checks
IlyasRidhuan Feb 10, 2022
f12514f
fix: update zokrates js
IlyasRidhuan Feb 18, 2022
c840d73
feat: add update socket
IlyasRidhuan Feb 20, 2022
8ad5770
feat: offchain and ws fix
IlyasRidhuan Feb 22, 2022
4d86893
feat: created a web component for the bridge deposit and withdraw com…
luizoamorim Feb 14, 2022
f6f48d7
fix: e2e test implemented - but github workflw should fail
LijuJoseJJ Mar 1, 2022
bccf075
fix: workflow fix
LijuJoseJJ Mar 1, 2022
011c8fa
fix: add -d flag with start-nightfall script
LijuJoseJJ Mar 1, 2022
2fd6892
fix: readme.md update for wallet startup instruction
LijuJoseJJ Mar 1, 2022
06f5494
fix: removed old Selenium e2e test code
LijuJoseJJ Mar 1, 2022
21d1f8c
fix: refactor e2e test
LijuJoseJJ Mar 2, 2022
8a8f152
fix: refactor and comment added
LijuJoseJJ Mar 2, 2022
e475f75
fix: line end added
LijuJoseJJ Mar 3, 2022
689f129
fix: env get bg fix
LijuJoseJJ Mar 3, 2022
07a6f85
feat: update syncing to use timber
IlyasRidhuan Feb 27, 2022
98659ad
feat: offchain in browser
IlyasRidhuan Feb 28, 2022
e768642
feat: save pkd in localStorage
IlyasRidhuan Feb 28, 2022
00c26b8
fix: e2e browser test bug fix
LijuJoseJJ Mar 8, 2022
fd59512
fix: remove hosted geth
IlyasRidhuan Mar 11, 2022
e4060ba
fix: remove old wallet setups
IlyasRidhuan Mar 11, 2022
13bd1ab
fix: remove public inputs
IlyasRidhuan Mar 11, 2022
c1688ec
fix: rename optimist endpoints to proposer endpoints
IlyasRidhuan Mar 11, 2022
628a6de
fix: change request to PR 530 done
LijuJoseJJ Mar 11, 2022
bf2bb72
feat: balances presentation with regex
luizoamorim Mar 11, 2022
c9711c3
Merge branch 'wallet/nf-browser-v2' into luizoamorim/558-bridge-page
luizoamorim Mar 11, 2022
84331ab
fix: duplicate key eventWsUrl
luizoamorim Mar 11, 2022
cfa6937
feat: modal for receive
luizoamorim Mar 18, 2022
f005e88
feat: retrieve current pkd and generate qr code from this pkd
luizoamorim Mar 21, 2022
cd57d0b
fix: eslint problems
luizoamorim Mar 21, 2022
00b36f1
refactor: just removing webpack-manifest-plugin
luizoamorim Mar 23, 2022
5b01eae
refactor: ejecting with react-scripts
luizoamorim Mar 23, 2022
4d3a7ff
fix: commit to run eject
luizoamorim Mar 23, 2022
1f17246
fix: commit to eject
luizoamorim Mar 23, 2022
6395a62
fix: commit to eject
luizoamorim Mar 23, 2022
d835df8
fix: commit to eject
luizoamorim Mar 23, 2022
d22fa5b
feat: correct settings to config webpack
luizoamorim Mar 23, 2022
1ce6021
refactor: adding bigint
luizoamorim Mar 23, 2022
25c9b31
fix: fixing the styles to work correctly in webcomponent
luizoamorim Mar 28, 2022
cb68d50
fix: fixing the styles for transfer modal with web components using s…
luizoamorim Mar 29, 2022
3cf64aa
feat: version working well for integration
luizoamorim Mar 30, 2022
ac5b446
Merge remote-tracking branch 'origin/wallet/deployment' into luizoamo…
luizoamorim Apr 4, 2022
4f97248
fix: fixing styles after last merge
luizoamorim Apr 5, 2022
1d9fe31
fix: adding eslint-cypress
luizoamorim Apr 5, 2022
b43ab14
fix: styles after merge between my branch and ilyas
luizoamorim Apr 6, 2022
8554f75
fix: eslint problems in webpack folders that are generated automatic …
luizoamorim Apr 12, 2022
50a826c
fix: eslint fixes
luizoamorim Apr 12, 2022
d7bb7b1
fix: eslint
luizoamorim Apr 12, 2022
6fe8b98
fix: eslint
luizoamorim Apr 12, 2022
8634cba
fix: eslint issues
luizoamorim Apr 12, 2022
18eafd8
fix: eslint issues
luizoamorim Apr 12, 2022
c70b1ad
feat: squash commits luizoamorim/559-assets-send-modal and master
luizoamorim Apr 12, 2022
fc91d46
fix: removing unused files
luizoamorim Apr 12, 2022
09f7cde
fix: setting stubs false in the build comand
luizoamorim Apr 20, 2022
6f1d4fe
fix: removing config folder from .gitignore
luizoamorim Apr 20, 2022
b610b63
fix: removing receive modal that was unused
luizoamorim Apr 20, 2022
dec9eac
fix: removing no-cycle imports from eslint
luizoamorim Apr 20, 2022
a23bc65
fix: removing an import of receive modal that was deleted
luizoamorim Apr 21, 2022
2253e58
fix: removing merge conflicts
luizoamorim Apr 21, 2022
8cca782
fix: removing jest settings from package.json
luizoamorim Apr 21, 2022
7e1a17d
Merge branch 'master' into luizoamorim/559-assets-send-modal
luizoamorim Apr 21, 2022
e136c1c
fix: fixing conflicts
luizoamorim Apr 21, 2022
274d6aa
fix: conflicts and errors
luizoamorim Apr 21, 2022
6c23774
fix: update package-lock.json because of errors in eslint pr
luizoamorim Apr 22, 2022
33d86fd
feat: changing the link of the how it works button
luizoamorim Apr 25, 2022
406a619
Merge branch 'master' into luizoamorim/559-assets-send-modal
luizoamorim Apr 25, 2022
06b5f4e
fix: package-lock conficts
luizoamorim Apr 25, 2022
358929a
fix: removing package-lock
luizoamorim Apr 25, 2022
7feefcb
fix: adding the package-lock using npm install
luizoamorim Apr 25, 2022
22a8879
fix: deleting package-lock
luizoamorim Apr 25, 2022
ebbe1e9
fix: adding package-json
luizoamorim Apr 25, 2022
7fb604e
fix: removing package-lock from wallet
luizoamorim Apr 25, 2022
5c9dbaa
fix: removing duplicates in package.json
luizoamorim Apr 25, 2022
eb9a7ec
fix: just running npm install to try fix conflicts in package-lock
luizoamorim Apr 25, 2022
9584070
fix: fixing the master diff from this branch
luizoamorim Apr 25, 2022
0b5c202
fix: finalizing the difference between master and this branch
luizoamorim Apr 26, 2022
9544b0a
fix: removing inital page and headers for integration
luizoamorim Apr 26, 2022
993423c
fix: removing DTO because it is not used
luizoamorim Apr 26, 2022
ff05268
feat: integration
IlyasRidhuan Apr 22, 2022
6298b64
Merge pull request #629 from EYBlockchain/ilyas/integration-fix
luizoamorim Apr 26, 2022
8f439d4
feat: wallet alignment, resposiviness and show the nightfall address
luizoamorim Apr 26, 2022
47a4b19
fix: problem with link routers bcs now wallet is the main page
luizoamorim Apr 27, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ cli/build
# wallet
wallet/build
wallet/cli
wallet/config
__pycache__
test/adversary/nightfall-adversary
wallet/tests/e2e/videos
Expand Down
6 changes: 6 additions & 0 deletions config/default.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ function configureAWSBucket() {
return `${bucket}-${mode}`;
}

/* eslint-disable no-extend-native */
BigInt.prototype.toJSON = function () {
return `${this.toString()} BigInt`;
};
/* eslint-disable no-extend-native */

module.exports = {
COMMITMENTS_DB: 'nightfall_commitments',
OPTIMIST_DB: 'optimist_data',
Expand Down
79 changes: 18 additions & 61 deletions package-lock.json

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

3 changes: 3 additions & 0 deletions wallet/babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
presets: [['@babel/preset-env', { targets: { node: 'current' } }], '@babel/preset-typescript'],
};
105 changes: 105 additions & 0 deletions wallet/config/env.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
/* eslint-disable no-param-reassign */
const fs = require('fs');
const path = require('path');
const paths = require('./paths');

// Make sure that including paths.js after env.js will read .env variables.
delete require.cache[require.resolve('./paths')];

const { NODE_ENV } = process.env;
if (!NODE_ENV) {
throw new Error('The NODE_ENV environment variable is required but was not specified.');
}

// https://github.com/bkeepers/dotenv#what-other-env-files-can-i-use
const dotenvFiles = [
`${paths.dotenv}.${NODE_ENV}.local`,
// Don't include `.env.local` for `test` environment
// since normally you expect tests to produce the same
// results for everyone
NODE_ENV !== 'test' && `${paths.dotenv}.local`,
`${paths.dotenv}.${NODE_ENV}`,
paths.dotenv,
].filter(Boolean);

// Load environment variables from .env* files. Suppress warnings using silent
// if this file is missing. dotenv will never modify any environment variables
// that have already been set. Variable expansion is supported in .env files.
// https://github.com/motdotla/dotenv
// https://github.com/motdotla/dotenv-expand
/* eslint-disable global-require */
dotenvFiles.forEach(dotenvFile => {
if (fs.existsSync(dotenvFile)) {
require('dotenv-expand')(
require('dotenv').config({
path: dotenvFile,
}),
);
}
});
/* eslint-disable global-require */

// We support resolving modules according to `NODE_PATH`.
// This lets you use absolute paths in imports inside large monorepos:
// https://github.com/facebook/create-react-app/issues/253.
// It works similar to `NODE_PATH` in Node itself:
// https://nodejs.org/api/modules.html#modules_loading_from_the_global_folders
// Note that unlike in Node, only *relative* paths from `NODE_PATH` are honored.
// Otherwise, we risk importing Node.js core modules into an app instead of webpack shims.
// https://github.com/facebook/create-react-app/issues/1023#issuecomment-265344421
// We also resolve them to make sure all tools using them work consistently.
const appDirectory = fs.realpathSync(process.cwd());
process.env.NODE_PATH = (process.env.NODE_PATH || '')
.split(path.delimiter)
.filter(folder => folder && !path.isAbsolute(folder))
.map(folder => path.resolve(appDirectory, folder))
.join(path.delimiter);

// Grab NODE_ENV and REACT_APP_* environment variables and prepare them to be
// injected into the application via DefinePlugin in webpack configuration.
const REACT_APP = /^REACT_APP_/i;

function getClientEnvironment(publicUrl) {
const raw = Object.keys(process.env)
.filter(key => REACT_APP.test(key))
.reduce(
(env, key) => {
env[key] = process.env[key];
return env;
},
{
// Useful for determining whether we’re running in production mode.
// Most importantly, it switches React into the correct mode.
NODE_ENV: process.env.NODE_ENV || 'development',
// Useful for resolving the correct path to static assets in `public`.
// For example, <img src={process.env.PUBLIC_URL + '/img/logo.png'} />.
// This should only be used as an escape hatch. Normally you would put
// images into the `src` and `import` them in code to get their paths.
PUBLIC_URL: publicUrl,
// We support configuring the sockjs pathname during development.
// These settings let a developer run multiple simultaneous projects.
// They are used as the connection `hostname`, `pathname` and `port`
// in webpackHotDevClient. They are used as the `sockHost`, `sockPath`
// and `sockPort` options in webpack-dev-server.
WDS_SOCKET_HOST: process.env.WDS_SOCKET_HOST,
WDS_SOCKET_PATH: process.env.WDS_SOCKET_PATH,
WDS_SOCKET_PORT: process.env.WDS_SOCKET_PORT,
// Whether or not react-refresh is enabled.
// react-refresh is not 100% stable at this time,
// which is why it's disabled by default.
// It is defined here so it is available in the webpackHotDevClient.
FAST_REFRESH: process.env.FAST_REFRESH !== 'false',
},
);
// Stringify all values so we can feed into webpack DefinePlugin
const stringified = {
'process.env': Object.keys(raw).reduce((env, key) => {
env[key] = JSON.stringify(raw[key]);
return env;
}, {}),
};

return { raw, stringified };
}

module.exports = getClientEnvironment;
58 changes: 58 additions & 0 deletions wallet/config/getHttpsConfig.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
const fs = require('fs');
const path = require('path');
const crypto = require('crypto');
const chalk = require('react-dev-utils/chalk');
const paths = require('./paths');

// Ensure the certificate and key provided are valid and if not
// throw an easy to debug error
function validateKeyAndCerts({ cert, key, keyFile, crtFile }) {
let encrypted;
try {
// publicEncrypt will throw an error with an invalid cert
encrypted = crypto.publicEncrypt(cert, Buffer.from('test'));
} catch (err) {
throw new Error(`The certificate "${chalk.yellow(crtFile)}" is invalid.\n${err.message}`);
}

try {
// privateDecrypt will throw an error with an invalid key
crypto.privateDecrypt(key, encrypted);
} catch (err) {
throw new Error(`The certificate key "${chalk.yellow(keyFile)}" is invalid.\n${err.message}`);
}
}

// Read file and throw an error if it doesn't exist
function readEnvFile(file, type) {
if (!fs.existsSync(file)) {
throw new Error(
`You specified ${chalk.cyan(type)} in your env, but the file "${chalk.yellow(
file,
)}" can't be found.`,
);
}
return fs.readFileSync(file);
}

// Get the https config
// Return cert files if provided in env, otherwise just true or false
function getHttpsConfig() {
const { SSL_CRT_FILE, SSL_KEY_FILE, HTTPS } = process.env;
const isHttps = HTTPS === 'true';

if (isHttps && SSL_CRT_FILE && SSL_KEY_FILE) {
const crtFile = path.resolve(paths.appPath, SSL_CRT_FILE);
const keyFile = path.resolve(paths.appPath, SSL_KEY_FILE);
const config = {
cert: readEnvFile(crtFile, 'SSL_CRT_FILE'),
key: readEnvFile(keyFile, 'SSL_KEY_FILE'),
};

validateKeyAndCerts({ ...config, keyFile, crtFile });
return config;
}
return isHttps;
}

module.exports = getHttpsConfig;
27 changes: 27 additions & 0 deletions wallet/config/jest/babelTransform.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
const babelJest = require('babel-jest');

const hasJsxRuntime = (() => {
if (process.env.DISABLE_NEW_JSX_TRANSFORM === 'true') {
return false;
}

try {
require.resolve('react/jsx-runtime');
return true;
} catch (e) {
return false;
}
})();

module.exports = babelJest.createTransformer({
presets: [
[
require.resolve('babel-preset-react-app'),
{
runtime: hasJsxRuntime ? 'automatic' : 'classic',
},
],
],
babelrc: false,
configFile: false,
});
12 changes: 12 additions & 0 deletions wallet/config/jest/cssTransform.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// This is a custom Jest transformer turning style imports into empty objects.
// http://facebook.github.io/jest/docs/en/webpack.html

module.exports = {
process() {
return 'module.exports = {};';
},
getCacheKey() {
// The output is always the same.
return 'cssTransform';
},
};
38 changes: 38 additions & 0 deletions wallet/config/jest/fileTransform.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
const path = require('path');
const camelcase = require('camelcase');

// This is a custom Jest transformer turning file imports into filenames.
// http://facebook.github.io/jest/docs/en/webpack.html

module.exports = {
process(src, filename) {
const assetFilename = JSON.stringify(path.basename(filename));

if (filename.match(/\.svg$/)) {
// Based on how SVGR generates a component name:
// https://github.com/smooth-code/svgr/blob/01b194cf967347d43d4cbe6b434404731b87cf27/packages/core/src/state.js#L6
const pascalCaseFilename = camelcase(path.parse(filename).name, {
pascalCase: true,
});
const componentName = `Svg${pascalCaseFilename}`;
return `const React = require('react');
module.exports = {
__esModule: true,
default: ${assetFilename},
ReactComponent: React.forwardRef(function ${componentName}(props, ref) {
return {
$$typeof: Symbol.for('react.element'),
type: 'svg',
ref: ref,
key: null,
props: Object.assign({}, props, {
children: ${assetFilename}
})
};
}),
};`;
}

return `module.exports = ${assetFilename};`;
},
};
Loading