Skip to content

Commit

Permalink
chore; upgrade packages
Browse files Browse the repository at this point in the history
  • Loading branch information
mmarifat committed Sep 20, 2024
1 parent 0574b9d commit 1cdf4a4
Show file tree
Hide file tree
Showing 12 changed files with 1,924 additions and 1,557 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ yarn add @module-federation/nextjs-mf [email protected]
#or
npm i @module-federation/nextjs-mf [email protected]

2. Add to next.config.js
2. Add to next.config.mjs
module.exports = {
webpack(config, options) {
const { isServer } = options;
Expand Down
8 changes: 4 additions & 4 deletions components/eb-builder/index.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import React, { CSSProperties } from 'react';
import EmailEditor, { AppearanceConfig, ToolsConfig, UnlayerOptions } from 'react-email-editor';
import EmailEditor from 'react-email-editor';
import EbTitle from '@components/shared/eb-title';

type Props = {
readonly editorId?: string | undefined;
readonly style?: CSSProperties | undefined;
readonly minHeight?: number | string | undefined;
readonly options?: UnlayerOptions | undefined;
readonly tools?: ToolsConfig | undefined;
readonly appearance?: AppearanceConfig | undefined;
readonly options?: Parameters<typeof EmailEditor>[number]['options'] | undefined;
readonly tools?: Parameters<typeof EmailEditor>[number]['tools'] | undefined;
readonly appearance?: Parameters<typeof EmailEditor>[number]['appearance'] | undefined;
readonly projectId?: number | undefined;
readonly scriptUrl?: string | undefined;
/** @deprecated Use **onReady** instead */
Expand Down
26 changes: 3 additions & 23 deletions components/shared/eb-button/index.tsx
Original file line number Diff line number Diff line change
@@ -1,30 +1,10 @@
import { Button } from 'antd';
import React from 'react';
import { CommonInterface } from '@library/interfaces';
import CaptureButtonInterface = CommonInterface.CaptureButtonInterface;
import { Button } from 'antd';
import { TEbButton } from '@library/interfaces';

const EbButton: React.FC<CaptureButtonInterface> = ({
size,
disabled,
label,
htmlType,
buttonType,
className,
onClick,
style,
icon,
loading,
...rest
}) => (
const EbButton: React.FC<TEbButton> = ({ label, htmlType, className, ...rest }) => (
<Button
disabled={disabled}
size={size}
icon={icon}
type={buttonType}
htmlType={!!htmlType ? htmlType : 'button'}
onClick={onClick}
loading={loading}
style={style || {}}
className={`border border-transparent hover:text-primary hover:border-primary hover:border focus:border-transparent focus:text-primary ${className}`}
{...rest}>
{label}
Expand Down
22 changes: 4 additions & 18 deletions library/interfaces.ts
Original file line number Diff line number Diff line change
@@ -1,23 +1,9 @@
import React from 'react';
import { SizeType } from 'antd/lib/config-provider/SizeContext';
import { ButtonType } from 'antd/es/button';
import { ButtonProps } from 'antd/lib';

export type EmailBuilderResponse = { design: any; html: any; [x: string]: any };

export type ExportType = 'html' | 'design';

export namespace CommonInterface {
export interface CaptureButtonInterface {
size?: SizeType;
disabled?: boolean;
label: string;
loading?: boolean;
icon?: React.ReactElement;
buttonType?: ButtonType;
htmlType?: 'button' | 'reset' | 'submit' | undefined;
className?: string;
style?: any;
onClick?: (e: any) => void;
[x: string]: any;
}
}
export type TEbButton = ButtonProps & {
label: string;
};
2 changes: 1 addition & 1 deletion next-env.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
/// <reference types="next/image-types/global" />

// NOTE: This file should not be edited
// see https://nextjs.org/docs/basic-features/typescript for more information.
// see https://nextjs.org/docs/pages/building-your-application/configuring/typescript for more information.
12 changes: 5 additions & 7 deletions next.config.js → next.config.mjs
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
const path = require('path');
const { NextFederationPlugin } = require('@module-federation/nextjs-mf');
import { join, resolve } from 'path';
import { NextFederationPlugin } from '@module-federation/nextjs-mf';

/** @type {import("next").NextConfig} */
const nextConfig = {
export default {
reactStrictMode: process.env.NODE_ENV !== 'development',
sassOptions: {
includePaths: [path.join(__dirname, 'styles')],
includePaths: [join(resolve(), 'styles')],
},
webpack(config, { isServer }) {
webpack(config) {
// NextFederationPlugin configuration
config.plugins.push(
new NextFederationPlugin({
Expand All @@ -26,5 +26,3 @@ const nextConfig = {
return config;
},
};

module.exports = nextConfig;
70 changes: 35 additions & 35 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,51 +9,51 @@
"url": "github.com/mmarifat"
},
"scripts": {
"dev": "cross-env NODE_ENV=development next dev -p 7100",
"build": "next build",
"dev": "cross-env NODE_ENV=development NEXT_PRIVATE_LOCAL_WEBPACK=TRUE next dev -p 7100",
"build": "cross-env NODE_ENV=production NEXT_PRIVATE_LOCAL_WEBPACK=TRUE next build",
"start": "next start -p 7100",
"lint": "next lint",
"format": "prettier --write components/**/*.tsx pages/**/*.ts pages/**/*.tsx styles/**/*.scss",
"prepare": "husky install"
},
"dependencies": {
"@module-federation/nextjs-mf": "6.0.1",
"antd": "5.1.7",
"@module-federation/nextjs-mf": "8.5.5",
"antd": "5.20.6",
"cross-env": "7.0.3",
"googleapis": "114.0.0",
"mongoose": "7.0.2",
"next": "12.3.4",
"nextjs-cors": "2.1.2",
"nodemailer": "6.8.0",
"react": "18.2.0",
"googleapis": "144.0.0",
"mongoose": "8.6.3",
"next": "14.2.13",
"nextjs-cors": "2.2.0",
"nodemailer": "6.9.15",
"react": "18.3.1",
"react-copy-to-clipboard": "5.1.0",
"react-dom": "18.2.0",
"react-email-editor": "1.6.3",
"react-router-dom": "6.8.0",
"sass": "1.57.1",
"webpack": "5.75.0",
"yarn": "1.22.19"
"react-dom": "18.3.1",
"react-email-editor": "1.7.11",
"react-router-dom": "6.26.2",
"sass": "1.79.2",
"webpack": "5.94.0",
"yarn": "1.22.22"
},
"devDependencies": {
"@types/node": "18.11.18",
"@types/nodemailer": "6.4.6",
"@types/nprogress": "0.2.0",
"@types/react": "18.0.27",
"@types/react-copy-to-clipboard": "5.0.4",
"@types/react-dom": "18.0.10",
"@types/react-email-editor": "1.5.1",
"@typescript-eslint/eslint-plugin": "5.50.0",
"@typescript-eslint/parser": "5.50.0",
"autoprefixer": "10.4.13",
"eslint": "8.33.0",
"eslint-config-next": "13.1.6",
"eslint-config-prettier": "8.6.0",
"eslint-plugin-prettier": "4.2.1",
"husky": "8.0.3",
"postcss": "8.4.21",
"prettier": "2.8.3",
"tailwindcss": "3.2.4",
"typescript": "5.3.3"
"@types/node": "22.5.5",
"@types/nodemailer": "6.4.16",
"@types/nprogress": "0.2.3",
"@types/react": "18.3.8",
"@types/react-copy-to-clipboard": "5.0.7",
"@types/react-dom": "18.3.0",
"@types/react-email-editor": "1.5.6",
"@typescript-eslint/eslint-plugin": "8.6.0",
"@typescript-eslint/parser": "8.6.0",
"autoprefixer": "10.4.20",
"eslint": "8.57.1",
"eslint-config-next": "14.2.13",
"eslint-config-prettier": "9.1.0",
"eslint-plugin-prettier": "5.2.1",
"husky": "9.1.6",
"postcss": "8.4.47",
"prettier": "3.3.3",
"tailwindcss": "3.4.12",
"typescript": "5.6.2"
},
"peerDependencies": {
"webpack": "*"
Expand Down
2 changes: 1 addition & 1 deletion pages/_app.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import '@module-federation/nextjs-mf/src/include-defaults';
// import '@module-federation/nextjs-mf/src/include-defaults';
import type { AppProps } from 'next/app';
import { useRouter } from 'next/router';
import { ConfigProvider } from 'antd';
Expand Down
3 changes: 1 addition & 2 deletions pages/email-builder.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import type { NextPage } from 'next';
import { Divider, Modal, Tabs, Tooltip } from 'antd';
import { CloseOutlined, CopyOutlined, SaveOutlined } from '@ant-design/icons';
import { CopyToClipboard } from 'react-copy-to-clipboard';
import EbTitle from '@components/shared/eb-title';
import EbButton from '@components/shared/eb-button';
import EbBuilderComponent from '@components/eb-builder';
import EbMessageAlert from '@components/shared/eb-message-alert';
Expand Down Expand Up @@ -45,7 +44,7 @@ const EmailBuilder: NextPage = (): JSX.Element => {
<div className="h-14 w-auto px-5 bg-primary flex items-center justify-center md:justify-end gap-4">
<EbButton
label="Export"
buttonType="ghost"
type="primary"
htmlType="button"
className="bg-black hover:bg-white text-white hover:text-black"
onClick={onGenerate}
Expand Down
4 changes: 2 additions & 2 deletions pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ const App: NextPage = (): JSX.Element => {
<p className="text-center pb-2 text-primary text-4xl">Welcome to Content Builder</p>
<Card title={<span className="flex justify-center items-center">What platform you want to use?</span>}>
<Card.Grid className="!w-[50%] text-center">
<Button type="ghost">
<Button type="primary">
<Link href="/email-builder">Email Builder</Link>
</Button>
</Card.Grid>
<Card.Grid className="!w-[50%] text-center">
<Button type="ghost">
<Button type="primary">
<Link href={{ pathname: '/contact-us', query: { key: 'developer-public-key' } }}>Contact Us</Link>
</Button>
</Card.Grid>
Expand Down
1 change: 1 addition & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"incremental": true,
"baseUrl": ".",
"paths": {
"react": ["node_modules/@types/react"],
"@components/*": ["components/*"],
"@library/*": ["library/*"],
"@styles/*": ["styles/*"]
Expand Down
Loading

0 comments on commit 1cdf4a4

Please sign in to comment.