Skip to content

Commit

Permalink
wallet-ext: integrate mnemonics functionality & other libs
Browse files Browse the repository at this point in the history
* also fixes webpack eslint plugin to check all the files
  • Loading branch information
pchrysochoidis committed May 17, 2022
1 parent 505518c commit c8505b4
Show file tree
Hide file tree
Showing 10 changed files with 437 additions and 38 deletions.
12 changes: 12 additions & 0 deletions wallet/configs/webpack/webpack.config.common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import CopyPlugin from 'copy-webpack-plugin';
import HtmlWebpackPlugin from 'html-webpack-plugin';
import MiniCssExtractPlugin from 'mini-css-extract-plugin';
import { resolve } from 'path';
import { DefinePlugin, ProvidePlugin } from 'webpack';

import packageJson from '../../package.json';

Expand Down Expand Up @@ -90,6 +91,11 @@ const commonConfig: () => Promise<Configuration> = async () => {
resolve: {
extensions: ['.ts', '.tsx', '.js'],
alias,
fallback: {
crypto: false,
stream: require.resolve('stream-browserify'),
buffer: require.resolve('buffer/'),
},
},
module: {
rules: [
Expand Down Expand Up @@ -144,6 +150,12 @@ const commonConfig: () => Promise<Configuration> = async () => {
},
],
}),
new DefinePlugin({
'typeof window': JSON.stringify(typeof {}),
}),
new ProvidePlugin({
Buffer: ['buffer', 'Buffer'],
}),
],
};
};
Expand Down
5 changes: 4 additions & 1 deletion wallet/configs/webpack/webpack.config.dev.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ import type { Configuration } from 'webpack';
const configDev: Configuration = {
mode: 'development',
devtool: 'cheap-source-map',
plugins: [new ESLintPlugin(), new StyleLintPlugin()],
plugins: [
new ESLintPlugin({ extensions: ['ts', 'tsx', 'js', 'jsx'] }),
new StyleLintPlugin(),
],
watchOptions: {
aggregateTimeout: 600,
},
Expand Down
8 changes: 0 additions & 8 deletions wallet/jest.config.js

This file was deleted.

12 changes: 12 additions & 0 deletions wallet/jest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// Copyright (c) 2022, Mysten Labs, Inc.
// SPDX-License-Identifier: Apache-2.0

import type { Config } from '@jest/types';

const config: Config.InitialOptions = {
preset: 'ts-jest',
testEnvironment: 'node',
testPathIgnorePatterns: ['/node_modules/', '/dist/'],
};

export default config;
Loading

0 comments on commit c8505b4

Please sign in to comment.