forked from deriv-com/deriv-app
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Arshad/ Ako / FEQ-1721 / Accounts-v2 Module Packages (deriv-com#14026)
* feat: seperate package for account v2 modules * fix: fix the import path for the external modules * build: add mini extract plugin * build: update postcss config * build: add purge conf to tailwind config * feat: add module css file in cashier-v2 * build: improve the tsconf for the lib * build: use minicss extract on module webpack conf * build: use auto generated entry file for webpack * build: auto generate webpack entries file on prebuild * build: update tailwind config * feat: update barrel file * build: use MiniCssExtractPlugin loader * feat: add autogenerated entries file * feat: fix tailwind config for account-v2 modules, refactor * fix: resolve conflicts and types * fix: reduce build size, refactor * fix: unit tests * fix: sort lines * fix: removed duplicated dependencies * fix: Added index files to components folders changed the exports * fix: fix AddressField path * fix: fix AddressFields path in test * fix: updated path, added index file * fix: added webpack-entries.json to gitignore * fix: resolve conflicts * fix: fixed types * fix: remove unnecessary formatting * refactor: removed unnecessary changes from cashier --------- Co-authored-by: Ali(Ako) Hosseini <[email protected]>
- Loading branch information
1 parent
223daba
commit 35f5980
Showing
51 changed files
with
425 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{ | ||
"version": "independent", | ||
"npmClient": "npm", | ||
"packages": ["packages/*"] | ||
"packages": ["packages/*", "packages/account-v2/src/modules"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
export * from './AppOverlay'; | ||
export * from './Card'; | ||
export * from './CountrySelector'; | ||
export * from './DatePicker'; | ||
export * from './DemoMessage'; | ||
export * from './Dropzone'; | ||
export * from './ErrorMessage'; | ||
export * from './FormFields'; | ||
export * from './FormSubHeader'; | ||
export * from './IconButton'; | ||
export * from './IconWithMessage'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
{ | ||
"name": "@deriv-lib/account-v2-lib", | ||
"version": "1.0.0", | ||
"main": "dist/js/index.js", | ||
"sideEffects": ["*.css"], | ||
"types": "dist/types/index.d.ts", | ||
"engines": { | ||
"node": "18.x" | ||
}, | ||
"scripts": { | ||
"prebuild": "node scripts/webpack-entries.js", | ||
"build": "NODE_ENV=production rimraf dist && NODE_OPTIONS='-r ts-node/register' webpack --progress --config \"./webpack.config.ts\"", | ||
"prepublishOnly": "npm run build" | ||
}, | ||
"dependencies": { | ||
"class-variance-authority": "^0.7.0", | ||
"clsx": "^2.0.0", | ||
"i18n-iso-countries": "^6.8.0", | ||
"i18next": "^22.4.6", | ||
"usehooks-ts": "^2.7.0" | ||
}, | ||
"files": [ | ||
"dist", | ||
"README.md" | ||
], | ||
"peerDependencies": { | ||
"@deriv-com/ui": "1.11.2", | ||
"@deriv/quill-icons": "^1.18.3", | ||
"@deriv/api-v2": "1.0.0", | ||
"yup": "^0.32.11", | ||
"formik": "^2.1.4", | ||
"react-calendar": "^4.7.0", | ||
"react": "^17.0.2", | ||
"react-dom": "^17.0.2", | ||
"react-dropzone": "11.0.1", | ||
"react-i18next": "^11.11.0", | ||
"react-router-dom": "^5.2.0", | ||
"tailwind-merge": "^1.14.0" | ||
}, | ||
"devDependencies": { | ||
"@testing-library/react": "^12.0.0", | ||
"@testing-library/user-event": "^13.5.0", | ||
"@types/copy-webpack-plugin": "^10.1.0", | ||
"@types/css-modules": "^1.0.2", | ||
"@types/react-dom": "^18.0.0", | ||
"@types/react-modal": "^3.16.3", | ||
"@types/react-router-dom": "^5.1.6", | ||
"@types/webpack": "^5.28.5", | ||
"@typescript-eslint/eslint-plugin": "5.45.0", | ||
"@typescript-eslint/parser": "5.45.0", | ||
"autoprefixer": "^10.4.16", | ||
"copy-webpack-plugin": "^9.0.1", | ||
"css-loader": "^5.0.1", | ||
"eslint-plugin-local-rules": "2.0.0", | ||
"eslint-plugin-react": "^7.22.0", | ||
"eslint-plugin-react-hooks": "^4.2.0", | ||
"eslint-plugin-simple-import-sort": "^10.0.0", | ||
"eslint-plugin-sonarjs": "^0.23.0", | ||
"eslint-plugin-sort-destructure-keys": "^1.5.0", | ||
"eslint-plugin-typescript-sort-keys": "^2.3.0", | ||
"postcss": "^8.4.24", | ||
"postcss-import": "^16.0.1", | ||
"style-loader": "^1.2.1", | ||
"tailwindcss": "^3.3.6", | ||
"tailwind-merge": "^1.14.0", | ||
"typescript": "^4.6.3", | ||
"webpack": "^5.81.0", | ||
"webpack-bundle-analyzer": "^4.3.0", | ||
"webpack-cli": "^4.7.2" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
module.exports = { | ||
plugins: { | ||
tailwindcss: {}, | ||
autoprefixer: {}, | ||
}, | ||
}; |
17 changes: 17 additions & 0 deletions
17
packages/account-v2/src/modules/scripts/webpack-entries.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
const fs = require('fs'); | ||
const glob = require('glob'); | ||
const path = require('path'); | ||
|
||
const entries = { index: './src/index.ts' }; | ||
const basePath = './src'; | ||
|
||
glob.sync(`${basePath}/**/*.tsx`, { ignore: [`${basePath}/**/__tests__/**`, `${basePath}/**/*.d.ts`] }).forEach( | ||
item => { | ||
// Configure Webpack entry | ||
const splitPath = item.split('/'); | ||
const entryName = splitPath[2]; // Adjust based on your directory structure | ||
entries[entryName] = item; | ||
} | ||
); | ||
|
||
fs.writeFileSync(path.join(__dirname, 'webpack-entries.json'), JSON.stringify(entries, null, 2), 'utf8'); |
6 changes: 3 additions & 3 deletions
6
...c/modules/AddressFields/AddressFields.tsx → ...dules/src/AddressFields/AddressFields.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
12 changes: 6 additions & 6 deletions
12
...ialAssessment/FinancialAssessmentForm.tsx → ...ialAssessment/FinancialAssessmentForm.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
..._tests__/FinancialAssessmentForm.spec.tsx → ..._tests__/FinancialAssessmentForm.spec.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
packages/account-v2/src/modules/src/FinancialAssessment/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { FinancialAssessmentForm } from './FinancialAssessmentForm'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 4 additions & 4 deletions
8
...ccount-v2/src/modules/IDVForm/IDVForm.tsx → ...nt-v2/src/modules/src/IDVForm/IDVForm.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
8 changes: 4 additions & 4 deletions
8
...-v2/src/modules/IDVService/IDVService.tsx → ...src/modules/src/IDVService/IDVService.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { IDVService } from './IDVService'; |
4 changes: 2 additions & 2 deletions
4
...src/modules/ManualUpload/ManualUpload.tsx → ...modules/src/ManualUpload/ManualUpload.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
...ualUpload/__tests__/ManualUpload.spec.tsx → ...ualUpload/__tests__/ManualUpload.spec.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { ManualUpload } from './ManualUpload'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.