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

202-feature-upgrade-all-dependencies #208

Open
wants to merge 26 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
b79598c
Updated react
tombeckenham Nov 22, 2024
3000de3
Merge remote-tracking branch 'origin/dev' into 202-feature-upgrade-al…
tombeckenham Nov 22, 2024
dc79ede
Basic mui update
tombeckenham Nov 22, 2024
16c8d74
Updated onflow and web3
tombeckenham Nov 22, 2024
64218a8
Upgraded typescript
tombeckenham Nov 22, 2024
1549abf
Updated svg imports and typescript issues. Load of files
tombeckenham Nov 22, 2024
e1d58d8
Corrected tsconfig, eslint and removed old firebase imports
tombeckenham Nov 24, 2024
d3099ed
Revert "Updated svg imports and typescript issues. Load of files"
tombeckenham Nov 24, 2024
db0148c
Merge branch '202-revert-svg-import' into 202-feature-upgrade-all-dep…
tombeckenham Nov 24, 2024
d743529
Moved confetti to it's own component. Needs react upgrade
tombeckenham Nov 24, 2024
ac42daf
Updated react. About to refactor ThemeProvider
tombeckenham Nov 24, 2024
fa968b0
Removed wrongly included ThemeProvider and refactored
tombeckenham Nov 24, 2024
5d3b7df
HashRouter ignores history
tombeckenham Nov 24, 2024
4a19653
Updated walletconnect packages
tombeckenham Nov 24, 2024
e554154
Updated particles
tombeckenham Nov 24, 2024
d6ac5c6
Removed react-router-transition
tombeckenham Nov 24, 2024
3a73a2d
Moved to mui transitions
tombeckenham Nov 24, 2024
b3ceb52
Removed defaultProps
tombeckenham Nov 24, 2024
dd0d325
Fixed nesting
tombeckenham Nov 24, 2024
f487b9e
Support react-devtools
tombeckenham Nov 25, 2024
0ffcc76
Wrapped functions in useCallback
tombeckenham Nov 25, 2024
8becc49
Added emotion dep for mui
tombeckenham Nov 25, 2024
dfaf5d1
Including pnpm settings for complex dependencies
tombeckenham Nov 25, 2024
553bd43
Corrected Fade issue
tombeckenham Nov 25, 2024
203c104
fixed: case during import
zzggo Nov 25, 2024
91ac9f4
Fixed addwelcome layout and iconfont addressbook
tombeckenham Nov 26, 2024
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: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ yarn.lock
.env.pro
dist.zip
_raw/manifest.json
_raw/react-devtools.js
yarn-error.log
dist2
src/background/utils/firebase.config.json
Expand Down
2 changes: 1 addition & 1 deletion build/plugins/AssetReplacePlugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class AssetReplacePlugin {

for (const chunk of compilation.chunks.values()) {
const fileName = chunk.files.values().next().value;
if (!replaceArr.includes(([, assetName]) => assetName === fileName)) {
if (!replaceArr.some(([, assetName]) => assetName === fileName)) {
compilation.updateAsset(fileName, (content) => {
const result = replaceFn(content.source());

Expand Down
8 changes: 8 additions & 0 deletions build/plugins/FirebaseFixPlugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,15 @@ class FirebaseFixPlugin {
for (const asset in compilation.assets) {
if (/\.(js|jsx)$/.test(asset)) {
let content = compilation.assets[asset].source();
// Convert Buffer to string if needed
if (Buffer.isBuffer(content)) {
content = content.toString('utf-8');
}

// Convert other types to string if needed
if (typeof content !== 'string') {
content = content.toString();
}
// Replace the _loadJS function
content = content.replace(
/function\s*\w*\s*_loadJS\([\w\s,]*\)\s*{([\w\W]*?)}$/gim,
Expand Down
45 changes: 44 additions & 1 deletion build/prepareManifest.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const path = require('path');
const fs = require('fs-extra');
const http = require('http');
// require('dotenv').config();

const PROJECT_ROOT = path.resolve(__dirname, '..');
Expand All @@ -8,6 +9,35 @@ const mode = args[0];

require('dotenv').config({ path: `.env.${mode}` });

const OAUTH2_SCOPES = process.env.OAUTH2_SCOPES || '';

const DEVTOOLS_URL = 'http://localhost:8097';

async function fetchDevTools() {
return new Promise((resolve, reject) => {
const request = http.get(DEVTOOLS_URL, (response) => {
if (response.statusCode !== 200) {
reject(new Error(`Failed to fetch: ${response.statusCode}`));
return;
}

let data = '';
response.on('data', (chunk) => (data += chunk));
response.on('end', () => {
const modifiedScript = `
// React DevTools for Chrome Extension
(function() {
${data}
})();
`;
resolve(modifiedScript);
});
});

request.on('error', reject);
});
}

async function prepare() {
console.log(process.env.NODE_ENV);
console.log(process.env.OAUTH2_CLIENT_ID);
Expand All @@ -17,12 +47,25 @@ async function prepare() {

manifest.oauth2 = {
client_id: process.env.OAUTH2_CLIENT_ID,
scopes: process.env.OAUTH2_SCOPES.split(','),
scopes: OAUTH2_SCOPES.split(','),
};

if (mode == 'dev') {
manifest.key = process.env.MANIFEST_KEY;
try {
const devToolsScript = await fetchDevTools();
fs.writeFileSync(path.resolve(__dirname, '../_raw/react-devtools.js'), devToolsScript);
console.log('✅ React DevTools source fetched successfully');
} catch (error) {
console.warn('⚠️ Failed to fetch React DevTools. Run the devtools server first');
// Write empty file if fetch fails
fs.writeFileSync(
path.resolve(__dirname, '../_raw/react-devtools.js'),
'// React DevTools not available'
);
}
}

fs.writeJSONSync(manifestPath, manifest, { spaces: 2 });

return '';
Expand Down
4 changes: 2 additions & 2 deletions build/release.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
const path = require('path');
const { prompt } = require('enquirer');
const { prompt: enquirerPrompt } = require('enquirer');
const fs = require('fs-extra');
const shell = require('shelljs');
const zipdir = require('zip-dir');

const PROJECT_ROOT = path.resolve(__dirname, '..');

async function release() {
const input = await prompt({
const input = await enquirerPrompt({
type: 'input',
name: 'version',
message: '[Flow Wallet] Please input the release version:',
Expand Down
Loading