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

feat: added configuration for account package migration #6419

Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
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
5 changes: 4 additions & 1 deletion packages/account/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,7 @@ module.exports = {
webpack: { config: webpackConfig({}) },
},
},
};
rules: {
'import/no-extraneous-dependencies': ['off', { devDependencies: ['**/*.spec.*'] }],
},
};
51 changes: 26 additions & 25 deletions packages/account/build/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,24 +30,25 @@ const ALIASES = {
Services: path.resolve(__dirname, '../src/Services'),
Stores: path.resolve(__dirname, '../src/Stores'),
Styles: path.resolve(__dirname, '../src/Styles'),
Types: path.resolve(__dirname, '../src/Types'),
};

const rules = (is_test_env = false, is_mocha_only = false) => [
...(is_test_env && !is_mocha_only
? [
{
test: /\.(js|jsx|ts|tsx)$/,
exclude: /node_modules|__tests__|(build\/.*\.js$)|(_common\/lib)/,
include: /src/,
loader: 'eslint-loader',
enforce: 'pre',
options: {
formatter: require('eslint-formatter-pretty'),
configFile: path.resolve(__dirname, '../.eslintrc.js'),
ignorePath: path.resolve(__dirname, '../.eslintignore'),
},
},
]
{
test: /\.(js|jsx|ts|tsx)$/,
exclude: /node_modules|__tests__|(build\/.*\.js$)|(_common\/lib)/,
include: /src/,
loader: 'eslint-loader',
enforce: 'pre',
options: {
formatter: require('eslint-formatter-pretty'),
configFile: path.resolve(__dirname, '../.eslintrc.js'),
ignorePath: path.resolve(__dirname, '../.eslintignore'),
},
},
]
: []),
{
test: /\.(js|jsx|ts|tsx)$/,
Expand Down Expand Up @@ -78,24 +79,24 @@ const rules = (is_test_env = false, is_mocha_only = false) => [
},
is_test_env
? {
test: /\.(sc|sa|c)ss$/,
loaders: 'null-loader',
}
test: /\.(sc|sa|c)ss$/,
loaders: 'null-loader',
}
: {
test: /\.(sc|sa|c)ss$/,
use: css_loaders,
},
test: /\.(sc|sa|c)ss$/,
use: css_loaders,
},
];

const MINIMIZERS = !IS_RELEASE
? []
: [
new TerserPlugin({
test: /\.js$/,
parallel: 2,
}),
new CssMinimizerPlugin(),
];
new TerserPlugin({
test: /\.js$/,
parallel: 2,
}),
new CssMinimizerPlugin(),
];

const plugins = () => [
new CleanWebpackPlugin(),
Expand Down
1 change: 1 addition & 0 deletions packages/account/global.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
declare module '@binary-com/binary-document-uploader';
1 change: 1 addition & 0 deletions packages/account/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
},
"dependencies": {
"@binary-com/binary-document-uploader": "^2.4.7",
"@deriv/api-types": "1.0.48",
"@deriv/components": "^1.0.0",
"@deriv/shared": "^1.0.0",
"@deriv/translations": "^1.0.0",
Expand Down
11 changes: 11 additions & 0 deletions packages/account/src/Types/common-prop.type.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
export type TFormValidation = {
warnings: { [key: string]: string };
errors: { [key: string]: string };
};

export type TToken = {
display_name: string;
last_used: string;
scopes: string[];
token: string;
};
18 changes: 18 additions & 0 deletions packages/account/src/Types/context.type.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { TToken } from './common-prop.type';

export type TPlatformContext = {
is_appstore: boolean;
displayName: string;
};

export type TApiContext = {
api_tokens: NonNullable<TToken[]> | undefined;
deleteToken: (token: string) => Promise<void>;
footer_ref: Element | DocumentFragment | undefined;
overlay_ref:
| ((...args: unknown[]) => unknown)
| import('prop-types').InferProps<{
current: import('prop-types').Requireable<unknown>;
}>;
toggleOverlay: () => void;
};
2 changes: 2 additions & 0 deletions packages/account/src/Types/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export * from './common-prop.type';
export * from './context.type';
10 changes: 4 additions & 6 deletions packages/account/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,13 @@
"Containers/*": ["src/Containers/*"],
"Constants/*": ["src/Constants/*"],
"Configs/*": ["src/Configs/*"],
"Duplicated/*": ["src/Duplicated/*"],
"Helpers/*": ["src/Helpers/*"],
"Layout/*": ["src/Layout/*"],
"Modules/*": ["src/Modules/*"],
"Sections/*": ["src/Sections/*"],
"Stores/*": ["src/Stores/*"],
"Styles/*": ["src/Styles/*"],
"@deriv/*": ["../*/src"]
"Types": ["src/Types"],
"@deriv/*": ["../*/src"],
}
},
"include": ["src"]
}
"include": ["src","globals.d.ts"]
}