Skip to content

Commit 09d81ac

Browse files
authored
remove the ui/app and ui/lib folders (#10911)
1 parent f1fc516 commit 09d81ac

1,174 files changed

Lines changed: 587 additions & 381 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.eslintrc.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ module.exports = {
108108
},
109109
{
110110
files: ['**/*.test.js'],
111-
excludedFiles: ['ui/**/*.test.js', 'ui/app/__mocks__/*.js'],
111+
excludedFiles: ['ui/**/*.test.js', 'ui/__mocks__/*.js'],
112112
extends: ['@metamask/eslint-config-mocha'],
113113
rules: {
114114
'mocha/no-setup-in-describe': 'off',
@@ -125,7 +125,7 @@ module.exports = {
125125
},
126126
},
127127
{
128-
files: ['ui/**/*.test.js', 'ui/app/__mocks__/*.js'],
128+
files: ['ui/**/*.test.js', 'ui/__mocks__/*.js'],
129129
extends: ['@metamask/eslint-config-jest'],
130130
rules: {
131131
'jest/no-restricted-matchers': 'off',

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ test-builds
3939
build-artifacts
4040

4141
#ignore css output and sourcemaps
42-
ui/app/css/output/
42+
ui/css/output/
4343

4444
notes.txt
4545

.storybook/i18n.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import React, { Component, createContext, useMemo } from 'react';
22
import PropTypes from 'prop-types';
3-
import { getMessage } from '../ui/app/helpers/utils/i18n-helper';
4-
import { I18nContext } from '../ui/app/contexts/i18n';
3+
import { getMessage } from '../ui/helpers/utils/i18n-helper';
4+
import { I18nContext } from '../ui/contexts/i18n';
55

6-
export { I18nContext }
6+
export { I18nContext };
77

88
export const I18nProvider = (props) => {
9-
const { currentLocale, current, en } = props
9+
const { currentLocale, current, en } = props;
1010

1111
const t = useMemo(() => {
1212
return (key, ...args) =>

.storybook/main.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
const path = require('path')
1+
const path = require('path');
22

3-
const CopyWebpackPlugin = require('copy-webpack-plugin')
3+
const CopyWebpackPlugin = require('copy-webpack-plugin');
44

55
module.exports = {
6-
stories: ['../ui/app/**/*.stories.js'],
6+
stories: ['../ui/**/*.stories.js'],
77
addons: [
88
'@storybook/addon-knobs',
99
'@storybook/addon-actions',
@@ -12,7 +12,7 @@ module.exports = {
1212
'./i18n-party-addon/register.js',
1313
],
1414
webpackFinal: async (config) => {
15-
config.module.strictExportPresence = true
15+
config.module.strictExportPresence = true;
1616
config.module.rules.push({
1717
test: /\.scss$/,
1818
loaders: [
@@ -31,12 +31,12 @@ module.exports = {
3131
sourceMap: true,
3232
implementation: require('sass'),
3333
sassOptions: {
34-
includePaths: ['ui/app/css/'],
34+
includePaths: ['ui/css/'],
3535
},
3636
},
3737
},
3838
],
39-
})
39+
});
4040
config.plugins.push(
4141
new CopyWebpackPlugin({
4242
patterns: [
@@ -51,7 +51,7 @@ module.exports = {
5151
},
5252
],
5353
}),
54-
)
55-
return config
54+
);
55+
return config;
5656
},
57-
}
57+
};

.storybook/preview.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ import { addDecorator, addParameters } from '@storybook/react';
33
import { useGlobals } from '@storybook/api';
44
import { withKnobs } from '@storybook/addon-knobs';
55
import { Provider } from 'react-redux';
6-
import configureStore from '../ui/app/store/store';
7-
import '../ui/app/css/index.scss';
6+
import configureStore from '../ui/store/store';
7+
import '../ui/css/index.scss';
88
import localeList from '../app/_locales/index.json';
99
import * as allLocales from './locales';
1010
import { I18nProvider, LegacyI18nProvider } from './i18n';
11-
import testData from './test-data.js'
11+
import testData from './test-data.js';
1212

1313
addParameters({
1414
backgrounds: {
@@ -41,7 +41,7 @@ const styles = {
4141
alignItems: 'center',
4242
};
4343

44-
const store = configureStore(testData)
44+
const store = configureStore(testData);
4545

4646
const metamaskDecorator = (story, context) => {
4747
const currentLocale = context.globals.locale;

app/scripts/controllers/swaps.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ import BigNumber from 'bignumber.js';
44
import { ObservableStore } from '@metamask/obs-store';
55
import { mapValues, cloneDeep } from 'lodash';
66
import abi from 'human-standard-token-abi';
7-
import { calcTokenAmount } from '../../../ui/app/helpers/utils/token-util';
8-
import { calcGasTotal } from '../../../ui/app/pages/send/send.utils';
9-
import { conversionUtil } from '../../../ui/app/helpers/utils/conversion-util';
7+
import { calcTokenAmount } from '../../../ui/helpers/utils/token-util';
8+
import { calcGasTotal } from '../../../ui/pages/send/send.utils';
9+
import { conversionUtil } from '../../../ui/helpers/utils/conversion-util';
1010
import {
1111
DEFAULT_ERC20_APPROVE_GAS,
1212
QUOTES_EXPIRED_ERROR,
@@ -20,7 +20,7 @@ import {
2020
fetchTradesInfo as defaultFetchTradesInfo,
2121
fetchSwapsFeatureLiveness as defaultFetchSwapsFeatureLiveness,
2222
fetchSwapsQuoteRefreshTime as defaultFetchSwapsQuoteRefreshTime,
23-
} from '../../../ui/app/pages/swaps/swaps.util';
23+
} from '../../../ui/pages/swaps/swaps.util';
2424
import { NETWORK_EVENTS } from './network';
2525

2626
// The MAX_GAS_LIMIT is a number that is higher than the maximum gas costs we have observed on any aggregator

app/scripts/controllers/transactions/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ import {
1616
BnMultiplyByFraction,
1717
addHexPrefix,
1818
} from '../../lib/util';
19-
import { TRANSACTION_NO_CONTRACT_ERROR_KEY } from '../../../../ui/app/helpers/constants/error-keys';
20-
import { getSwapsTokensReceivedFromTxMeta } from '../../../../ui/app/pages/swaps/swaps.util';
19+
import { TRANSACTION_NO_CONTRACT_ERROR_KEY } from '../../../../ui/helpers/constants/error-keys';
20+
import { getSwapsTokensReceivedFromTxMeta } from '../../../../ui/pages/swaps/swaps.util';
2121
import {
2222
TRANSACTION_STATUSES,
2323
TRANSACTION_TYPES,

development/build/static.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ const copyTargets = [
3535
dest: `fonts/fontawesome`,
3636
},
3737
{
38-
src: `./ui/app/css/output/`,
38+
src: `./ui/css/output/`,
3939
pattern: `*.css`,
4040
dest: ``,
4141
},

development/build/styles.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,24 +18,24 @@ function createStyleTasks({ livereload }) {
1818
const prod = createTask(
1919
'styles:prod',
2020
createScssBuildTask({
21-
src: 'ui/app/css/index.scss',
22-
dest: 'ui/app/css/output',
21+
src: 'ui/css/index.scss',
22+
dest: 'ui/css/output',
2323
devMode: false,
2424
}),
2525
);
2626

2727
const dev = createTask(
2828
'styles:dev',
2929
createScssBuildTask({
30-
src: 'ui/app/css/index.scss',
31-
dest: 'ui/app/css/output',
30+
src: 'ui/css/index.scss',
31+
dest: 'ui/css/output',
3232
devMode: true,
33-
pattern: 'ui/app/**/*.scss',
33+
pattern: 'ui/**/*.scss',
3434
}),
3535
);
3636

3737
const lint = createTask('lint-scss', function () {
38-
return gulp.src('ui/app/css/itcss/**/*.scss').pipe(
38+
return gulp.src('ui/css/itcss/**/*.scss').pipe(
3939
gulpStylelint({
4040
reporters: [{ formatter: 'string', console: true }],
4141
fix: true,

development/verify-locale-strings.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,8 @@ async function verifyEnglishLocale() {
171171
// In the meantime we'll use glob to specify which paths can be strict searched
172172
// and gradually phase out the key based search
173173
const globsToStrictSearch = [
174-
'ui/app/components/app/metamask-translation/*.js',
175-
'ui/app/pages/confirmation/templates/*.js',
174+
'ui/components/app/metamask-translation/*.js',
175+
'ui/pages/confirmation/templates/*.js',
176176
];
177177
const testGlob = '**/*.test.js';
178178
const javascriptFiles = await glob(['ui/**/*.js', 'shared/**/*.js'], {

0 commit comments

Comments
 (0)