Skip to content

Commit

Permalink
refactor: update tsconfig.json files
Browse files Browse the repository at this point in the history
  • Loading branch information
yrjkqq committed Oct 28, 2024
1 parent 989a967 commit 2df09bd
Show file tree
Hide file tree
Showing 48 changed files with 556 additions and 366 deletions.
5 changes: 3 additions & 2 deletions packages/doc/src/stories/widgets/MiningCreate.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@ export const Primary = (props: any) => {
return (
<Widget {...config} {...other} apikey={apiKey}>
<MiningCreate
handleGotoMiningList={() => window.alert('view create page')}
handleGotoCreatePool={() => window.alert('view detail page')}
handleGotoMiningList={() => window.alert('handleGotoMiningList')}
handleGotoCreatePool={() => window.alert('handleGotoCreatePool')}
handleGoBack={() => window.alert('handleGoBack')}
/>
</Widget>
);
Expand Down
12 changes: 12 additions & 0 deletions packages/doc/src/stories/widgets/MiningDetail.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,18 @@ export const Primary = (props: any) => {
address: '0xE9a586152879f4817cb6c599E32e8f8e96BFba4c',
chainId: 11155111,
}}
handleGotoMiningList={function (): void {
throw new Error('Function not implemented.');
}}
handleGotoPoolDetail={function ({
pool,
chainId,
}: {
pool: string;
chainId: number;
}): void {
window.alert(`view detail page, ${pool}, ${chainId}`);
}}
/>
</Widget>
);
Expand Down
13 changes: 12 additions & 1 deletion packages/doc/src/stories/widgets/MiningList.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,18 @@ export const Primary = (props: any) => {
<Widget {...config} {...other} apikey={apiKey}>
<MiningList
handleGotoCreate={() => window.alert('view create page')}
handleGotoDetail={() => window.alert('view detail page')}
handleGotoDetail={({ mining, pool, chainId }) =>
window.alert(`view detail page, ${mining}, ${pool}, ${chainId}`)
}
handleGotoPoolDetail={function ({
pool,
chainId,
}: {
pool: string;
chainId: number;
}): void {
window.alert(`view detail page, ${pool}, ${chainId}`);
}}
/>
</Widget>
);
Expand Down
16 changes: 9 additions & 7 deletions packages/dodoex-api/package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"name": "@dodoex/api",
"version": "3.0.0-taiko.13",
"version": "3.0.0-taiko.14",
"description": "DODO API Kit",
"source": "src/index.ts",
"types": "dist/index.d.ts",
"main": "dist/cjs/index.cjs",
"types": "dist/types/index.d.ts",
"main": "dist/index.cjs",
"module": "dist/index.js",
"license": "GPL-3.0-or-later",
"homepage": "https://github.com/DODOEX/widgets#readme",
Expand All @@ -19,7 +19,8 @@
"schema:watch": "export $(cat .env | xargs) && env graphql-codegen -w",
"prerelease": "yarn run build",
"release": "semantic-release",
"release:local": "np --any-branch --no-cleanup --no-tests"
"release:local": "np --any-branch --no-cleanup --no-tests",
"release.npm-publish-beta": "npm publish --tag beta"
},
"author": "",
"publishConfig": {
Expand All @@ -28,9 +29,9 @@
},
"exports": {
".": {
"types": "./dist/index.d.ts",
"types": "./dist/types/index.d.ts",
"import": "./dist/index.js",
"require": "./dist/cjs/index.cjs"
"require": "./dist/index.cjs"
}
},
"keywords": [
Expand Down Expand Up @@ -79,6 +80,7 @@
"@rollup/plugin-json": "^6.1.0",
"@rollup/plugin-replace": "^5.0.7",
"@rollup/plugin-terser": "^0.4.4",
"@rollup/plugin-typescript": "^12.1.1",
"@rollup/plugin-url": "^8.0.2",
"@svgr/rollup": "^6.2.1",
"@testing-library/jest-dom": "^5.16.5",
Expand All @@ -93,8 +95,8 @@
"jest-environment-jsdom": "^29.0.3",
"np": "^7.6.1",
"rollup": "^4.18.0",
"rollup-plugin-clear": "^2.0.7",
"rollup-plugin-dynamic-import-variables": "^1.1.0",
"rollup-plugin-typescript2": "^0.36.0",
"svg-jest": "^1.0.1",
"ts-jest": "^29.0.1",
"typescript": "^5.6.3"
Expand Down
15 changes: 10 additions & 5 deletions packages/dodoex-api/rollup.config.mjs
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import { babel } from '@rollup/plugin-babel';
import typescript from 'rollup-plugin-typescript2';
import typescript from '@rollup/plugin-typescript';
import json from '@rollup/plugin-json';
import commonjs from '@rollup/plugin-commonjs';
import url from '@rollup/plugin-url';
import terser from '@rollup/plugin-terser';
import { nodeResolve } from '@rollup/plugin-node-resolve';
import dynamicImportVariables from 'rollup-plugin-dynamic-import-variables';
import clear from 'rollup-plugin-clear';
import pkg from './package.json' with { type: 'json' };

const extensions = ['.js', '.ts', '.jsx', '.tsx'];
Expand All @@ -23,9 +24,7 @@ const config = {
}),
url(),
json(),
typescript({
clean: true,
}),
typescript(),
commonjs({
sourceMap: false,
}),
Expand All @@ -34,6 +33,12 @@ const config = {
extensions,
babelHelpers: 'bundled',
}),
clear({
// required, point out which directories should be clear.
targets: ['dist'],
// optional, whether clear the directores when rollup recompile on --watch mode.
watch: true, // default: false
}),
],
external: [...Object.keys(pkg.peerDependencies || {})],
};
Expand All @@ -48,7 +53,7 @@ export default [
plugins: [terser()],
},
{
dir: 'dist/cjs',
dir: 'dist',
entryFileNames: '[name].cjs',
chunkFileNames: '[name]-[hash].cjs',
format: 'cjs',
Expand Down
2 changes: 1 addition & 1 deletion packages/dodoex-api/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"extends": "../../tsconfig",
"compilerOptions": {
"declarationDir": "./types",
"declarationDir": "./dist/types",
"jsx": "preserve",
"target": "es2016"
},
Expand Down
14 changes: 8 additions & 6 deletions packages/dodoex-components/package.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
{
"name": "@dodoex/components",
"version": "3.0.0-taiko.5",
"version": "3.0.0-taiko.6",
"description": "UI component library",
"source": "src/index.ts",
"types": "dist/index.d.ts",
"main": "dist/cjs/index.cjs",
"types": "dist/types/index.d.ts",
"main": "dist/index.cjs",
"module": "dist/index.js",
"scripts": {
"typescript": "tsc --project tsconfig.json --emitDeclarationOnly",
"build": "rollup -c",
"watch": "yarn run rollup -c --watch",
"publish-sample": "npm publish --access public",
"prerelease": "yarn run build",
"release": "np --any-branch --no-cleanup --no-tests"
"release": "np --any-branch --no-cleanup --no-tests",
"release.npm-publish-beta": "npm publish --tag beta"
},
"author": "",
"publishConfig": {
Expand Down Expand Up @@ -55,17 +56,18 @@
"react-dom": ">=17.0.1"
},
"devDependencies": {
"@rollup/plugin-node-resolve": "^15.2.3",
"@rollup/plugin-babel": "^6.0.4",
"@rollup/plugin-commonjs": "^26.0.1",
"@rollup/plugin-json": "^6.1.0",
"@rollup/plugin-node-resolve": "^15.2.3",
"@rollup/plugin-replace": "^5.0.7",
"@rollup/plugin-terser": "^0.4.4",
"@rollup/plugin-typescript": "^12.1.1",
"@rollup/plugin-url": "^8.0.2",
"@svgr/rollup": "^6.2.1",
"np": "^7.6.1",
"rollup": "^4.18.0",
"rollup-plugin-typescript2": "^0.36.0",
"rollup-plugin-clear": "^2.0.7",
"tslib": "^2.4.0",
"typescript": "^5.6.3"
}
Expand Down
12 changes: 10 additions & 2 deletions packages/dodoex-components/rollup.config.mjs
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import { babel } from '@rollup/plugin-babel';
import typescript from 'rollup-plugin-typescript2';
import typescript from '@rollup/plugin-typescript';
import json from '@rollup/plugin-json';
import commonjs from '@rollup/plugin-commonjs';
import url from '@rollup/plugin-url';
import svgr from '@svgr/rollup';
import terser from '@rollup/plugin-terser';
import { nodeResolve } from '@rollup/plugin-node-resolve';
import clear from 'rollup-plugin-clear';
import pkg from './package.json' with { type: 'json' };

const extensions = ['.js', '.ts', '.jsx', '.tsx'];
Expand Down Expand Up @@ -41,6 +42,12 @@ const config = {
extensions,
babelHelpers: 'bundled',
}),
clear({
// required, point out which directories should be clear.
targets: ['dist'],
// optional, whether clear the directores when rollup recompile on --watch mode.
watch: true, // default: false
}),
],
external: [...Object.keys(pkg.peerDependencies || {}), '@floating-ui/dom'],
};
Expand All @@ -52,10 +59,11 @@ export default [
{
dir: 'dist',
format: 'es',
// plugins: [terser()],
plugins: [terser()],
},
{
dir: 'dist/cjs',
dir: 'dist',
entryFileNames: '[name].cjs',
chunkFileNames: '[name]-[hash].cjs',
format: 'cjs',
Expand Down
3 changes: 3 additions & 0 deletions packages/dodoex-components/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
{
"extends": "../../tsconfig",
"compilerOptions": {
"declarationDir": "./dist/types"
},
"exclude": ["node_modules", "**/*.d.mts"],
"include": ["src/**/*.d.ts", "src/**/*.ts", "src/**/*.tsx"]
}
18 changes: 10 additions & 8 deletions packages/dodoex-widgets/package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"name": "@dodoex/widgets",
"version": "3.0.0-taiko.29",
"version": "3.0.0-taiko.33",
"description": "DODO Widgets",
"source": "src/index.tsx",
"types": "dist/index.d.ts",
"main": "dist/cjs/index.cjs",
"types": "dist/types/index.d.ts",
"main": "dist/index.cjs",
"module": "dist/index.js",
"license": "GPL-3.0-or-later",
"homepage": "https://github.com/DODOEX/widgets#readme",
Expand All @@ -23,6 +23,7 @@
"release": "semantic-release",
"release:local": "np --any-branch --no-cleanup --no-tests",
"release.npm-publish": "npm publish --access public",
"release.npm-publish-beta": "npm publish --tag beta",
"test": "jest src",
"test:e2e": "jest e2e"
},
Expand All @@ -33,9 +34,9 @@
},
"exports": {
".": {
"types": "./dist/index.d.ts",
"types": "./dist/types/index.d.ts",
"import": "./dist/index.js",
"require": "./dist/cjs/index.cjs"
"require": "./dist/index.cjs"
}
},
"keywords": [
Expand All @@ -57,8 +58,8 @@
},
"dependencies": {
"@babel/runtime": "^7.17.0",
"@dodoex/api": ">=3.0.0-taiko.13",
"@dodoex/components": ">=3.0.0-taiko.5",
"@dodoex/api": ">=3.0.0-taiko.14",
"@dodoex/components": ">=3.0.0-taiko.6",
"@dodoex/icons": "^2.0.1",
"@emotion/react": "^11.10.0",
"@emotion/styled": "^11.10.0",
Expand Down Expand Up @@ -116,6 +117,7 @@
"@rollup/plugin-multi-entry": "^6.0.1",
"@rollup/plugin-replace": "^5.0.7",
"@rollup/plugin-terser": "^0.4.4",
"@rollup/plugin-typescript": "^12.1.1",
"@rollup/plugin-url": "^8.0.2",
"@svgr/rollup": "^6.2.1",
"@testing-library/jest-dom": "^5.16.5",
Expand All @@ -139,8 +141,8 @@
"jest-environment-jsdom": "^29.0.3",
"np": "^7.6.1",
"rollup": "^4.18.0",
"rollup-plugin-clear": "^2.0.7",
"rollup-plugin-import-css": "^3.5.5",
"rollup-plugin-typescript2": "^0.36.0",
"svg-jest": "^1.0.1",
"ts-jest": "^29.0.1",
"typescript": "^5.6.3"
Expand Down
13 changes: 10 additions & 3 deletions packages/dodoex-widgets/rollup.config.mjs
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
import { babel } from '@rollup/plugin-babel';
import commonjs from '@rollup/plugin-commonjs';
import json from '@rollup/plugin-json';
import typescript from 'rollup-plugin-typescript2';
import typescript from '@rollup/plugin-typescript';
import terser from '@rollup/plugin-terser';
import url from '@rollup/plugin-url';
import replace from '@rollup/plugin-replace';
import resolve from '@rollup/plugin-node-resolve';
import svgr from '@svgr/rollup';
import pkg from './package.json' with { type: 'json' };
import globby from 'globby';
import css from "rollup-plugin-import-css";
import css from 'rollup-plugin-import-css';
import clear from 'rollup-plugin-clear';

const extensions = ['.js', '.jsx', '.ts', '.tsx'];
const baseConfig = {
Expand Down Expand Up @@ -40,6 +41,12 @@ const baseConfig = {
babelHelpers: 'bundled',
}),
css(),
clear({
// required, point out which directories should be clear.
targets: ['dist'],
// optional, whether clear the directores when rollup recompile on --watch mode.
watch: true, // default: false
}),
],
external: [
...Object.keys(pkg.dependencies || {}).filter(
Expand Down Expand Up @@ -73,7 +80,7 @@ export default [
plugins: [terser()],
},
{
dir: 'dist/cjs',
dir: 'dist',
entryFileNames: '[name].cjs',
chunkFileNames: '[name]-[hash].cjs',
format: 'cjs',
Expand Down
2 changes: 1 addition & 1 deletion packages/dodoex-widgets/src/components/Swap/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@ export function Swap({
</Box>
</Box>
);
}, [displayPriceImpact]);
}, [displayPriceImpact, theme.palette.error.main]);

const tokenPairPrice = useMemo(() => {
return (
Expand Down
8 changes: 7 additions & 1 deletion packages/dodoex-widgets/src/components/TokenLogoSimple.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
import { Box, BoxProps } from '@dodoex/components';
import React from 'react';
import Identicon from 'identicon.js';
import React from 'react';

/**
*
* @param param0
* @returns
* @deprecated
*/
export default function TokenLogoSimple({
address,
url,
Expand Down
Loading

0 comments on commit 2df09bd

Please sign in to comment.