Эх сурвалжийг харах

replace CRA with Parcel in material-ui-starter

Jordan Sexton 3 жил өмнө
parent
commit
848bda5a8a
27 өөрчлөгдсөн 316 нэмэгдсэн , 350 устгасан
  1. 9 0
      packages/starter/material-ui-starter/.editorconfig
  2. 4 0
      packages/starter/material-ui-starter/.eslintignore
  3. 25 0
      packages/starter/material-ui-starter/.eslintrc.json
  4. 4 23
      packages/starter/material-ui-starter/.gitignore
  5. 5 1
      packages/starter/material-ui-starter/.prettierignore
  6. 7 0
      packages/starter/material-ui-starter/.prettierrc
  7. 0 52
      packages/starter/material-ui-starter/README.md
  8. 0 1
      packages/starter/material-ui-starter/craco.config.js
  9. 40 43
      packages/starter/material-ui-starter/package.json
  10. BIN
      packages/starter/material-ui-starter/public/favicon.ico
  11. 0 43
      packages/starter/material-ui-starter/public/index.html
  12. BIN
      packages/starter/material-ui-starter/public/logo192.png
  13. BIN
      packages/starter/material-ui-starter/public/logo512.png
  14. 0 25
      packages/starter/material-ui-starter/public/manifest.json
  15. 0 3
      packages/starter/material-ui-starter/public/robots.txt
  16. 0 3
      packages/starter/material-ui-starter/src/App.css
  17. 68 48
      packages/starter/material-ui-starter/src/App.tsx
  18. 0 19
      packages/starter/material-ui-starter/src/Navigation.tsx
  19. 46 0
      packages/starter/material-ui-starter/src/Theme.tsx
  20. 0 59
      packages/starter/material-ui-starter/src/Wallet.tsx
  21. 11 12
      packages/starter/material-ui-starter/src/index.css
  22. 13 0
      packages/starter/material-ui-starter/src/index.html
  23. 2 5
      packages/starter/material-ui-starter/src/index.tsx
  24. 0 0
      packages/starter/material-ui-starter/src/logo.svg
  25. 0 1
      packages/starter/material-ui-starter/src/react-app-env.d.ts
  26. 74 0
      packages/starter/material-ui-starter/src/reset.css
  27. 8 12
      packages/starter/material-ui-starter/tsconfig.json

+ 9 - 0
packages/starter/material-ui-starter/.editorconfig

@@ -0,0 +1,9 @@
+root = true
+
+[*]
+charset = utf-8
+indent_style = space
+indent_size = 4
+end_of_line = lf
+insert_final_newline = true
+trim_trailing_whitespace = true

+ 4 - 0
packages/starter/material-ui-starter/.eslintignore

@@ -0,0 +1,4 @@
+.parcel-cache
+dist
+docs
+node_modules

+ 25 - 0
packages/starter/material-ui-starter/.eslintrc.json

@@ -0,0 +1,25 @@
+{
+    "root": true,
+    "env": {
+        "browser": true
+    },
+    "extends": [
+        "eslint:recommended",
+        "plugin:@typescript-eslint/recommended",
+        "plugin:react/recommended",
+        "plugin:react-hooks/recommended"
+    ],
+    "parser": "@typescript-eslint/parser",
+    "plugins": ["@typescript-eslint", "prettier", "react", "react-hooks"],
+    "settings": {
+        "react": {
+            "version": "detect"
+        }
+    },
+    "rules": {
+        "@typescript-eslint/ban-ts-comment": "off",
+        "@typescript-eslint/no-explicit-any": "off",
+        "@typescript-eslint/no-unused-vars": "off",
+        "react/no-unescaped-entities": ["error", { "forbid": [">"] }]
+    }
+}

+ 4 - 23
packages/starter/material-ui-starter/.gitignore

@@ -1,23 +1,4 @@
-# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
-
-# dependencies
-/node_modules
-/.pnp
-.pnp.js
-
-# testing
-/coverage
-
-# production
-/build
-
-# misc
-.DS_Store
-.env.local
-.env.development.local
-.env.test.local
-.env.production.local
-
-npm-debug.log*
-yarn-debug.log*
-yarn-error.log*
+.parcel-cache
+dist
+docs
+node_modules

+ 5 - 1
packages/starter/material-ui-starter/.prettierignore

@@ -1 +1,5 @@
-build
+.parcel-cache
+dist
+docs
+node_modules
+

+ 7 - 0
packages/starter/material-ui-starter/.prettierrc

@@ -0,0 +1,7 @@
+{
+    "printWidth": 120,
+    "trailingComma": "es5",
+    "tabWidth": 4,
+    "semi": true,
+    "singleQuote": true
+}

+ 0 - 52
packages/starter/material-ui-starter/README.md

@@ -1,52 +0,0 @@
-# `@solana/wallet-adapter-material-ui-starter`
-
-<!-- @TODO -->
-
-Coming soon.
-
-# Getting Started with Create React App
-
-This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
-
-## Available Scripts
-
-In the project directory, you can run:
-
-### `yarn start`
-
-Runs the app in the development mode.\
-Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
-
-The page will reload if you make edits.\
-You will also see any lint errors in the console.
-
-### `yarn test`
-
-Launches the test runner in the interactive watch mode.\
-See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
-
-### `yarn build`
-
-Builds the app for production to the `build` folder.\
-It correctly bundles React in production mode and optimizes the build for the best performance.
-
-The build is minified and the filenames include the hashes.\
-Your app is ready to be deployed!
-
-See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
-
-### `yarn eject`
-
-**Note: this is a one-way operation. Once you `eject`, you can’t go back!**
-
-If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.
-
-Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.
-
-You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.
-
-## Learn More
-
-You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
-
-To learn React, check out the [React documentation](https://reactjs.org/).

+ 0 - 1
packages/starter/material-ui-starter/craco.config.js

@@ -1 +0,0 @@
-module.exports = {};

+ 40 - 43
packages/starter/material-ui-starter/package.json

@@ -1,68 +1,65 @@
 {
     "name": "@solana/wallet-adapter-material-ui-starter",
-    "version": "0.12.1",
+    "version": "0.13.0",
     "author": "Solana Maintainers <maintainers@solana.foundation>",
     "repository": "https://github.com/solana-labs/wallet-adapter",
     "license": "Apache-2.0",
+    "publishConfig": {
+        "access": "public"
+    },
     "files": [
-        "public",
         "src",
-        "craco.config.js",
+        ".editorconfig",
+        ".eslintignore",
+        ".eslintrc.json",
+        ".gitignore",
+        ".prettierignore",
+        ".prettierrc",
         "LICENSE",
-        "README.md",
+        "package.json",
         "tsconfig.json"
     ],
-    "publishConfig": {
-        "access": "public"
-    },
     "scripts": {
-        "clean": "shx rm -rf build/*",
-        "start": "craco start",
-        "build": "yarn clean && craco build",
-        "test": "craco test",
-        "analyze": "source-map-explorer 'build/static/js/*.js'"
+        "clean": "shx rm -rf dist .parcel-cache",
+        "build": "yarn clean && parcel build src/index.html",
+        "start": "yarn clean && parcel src/index.html",
+        "fmt": "prettier --write '{*,**/*}.{js,ts,jsx,tsx,json}'",
+        "lint": "eslint . && prettier --check '{*,**/*}.{js,ts,jsx,tsx,json}'",
+        "lint:fix": "eslint --fix . && yarn fmt",
+        "nuke": "shx rm -rf node_modules yarn.lock"
     },
     "dependencies": {
         "@emotion/react": "^11.0.0",
         "@emotion/styled": "^11.0.0",
         "@mui/icons-material": "^5.0.0",
         "@mui/material": "^5.0.0",
-        "@solana/wallet-adapter-base": "^0.9.1",
+        "@solana/wallet-adapter-base": "^0.9.2",
+        "@solana/wallet-adapter-react": "^0.15.2",
         "@solana/wallet-adapter-material-ui": "^0.16.0",
-        "@solana/wallet-adapter-react": "^0.15.1",
-        "@solana/wallet-adapter-wallets": "^0.14.1",
-        "@solana/web3.js": "^1.20.0",
+        "@solana/wallet-adapter-wallets": "^0.14.2",
+        "@solana/web3.js": "^1.31.0",
         "notistack": "^2.0.0",
         "react": "^17.0.0",
         "react-dom": "^17.0.0"
     },
     "devDependencies": {
-        "@craco/craco": "^6.0.0",
-        "@types/node": "^12.0.0",
-        "@types/react": "^17.0.0",
-        "@types/react-dom": "^17.0.0",
-        "eslint-config-react-app": "^6.0.0",
-        "react-scripts": "^4.0.0",
-        "source-map-explorer": "^2.5.2",
-        "typescript": "~4.4.4",
-        "yarn": "^1.22.0"
-    },
-    "eslintConfig": {
-        "extends": [
-            "react-app",
-            "react-app/jest"
-        ]
-    },
-    "browserslist": {
-        "production": [
-            ">0.2%",
-            "not dead",
-            "not op_mini all"
-        ],
-        "development": [
-            "last 1 chrome version",
-            "last 1 firefox version",
-            "last 1 safari version"
-        ]
+        "@types/eslint": "^8.2.2",
+        "@types/eslint-plugin-prettier": "^3.1.0",
+        "@types/node": "^16.11.14",
+        "@types/prettier": "^2.4.3",
+        "@types/react": "^17.0.38",
+        "@types/react-dom": "^17.0.11",
+        "@typescript-eslint/eslint-plugin": "^5.9.1",
+        "@typescript-eslint/parser": "^5.9.1",
+        "eslint": "^8.6.0",
+        "eslint-config-prettier": "^8.3.0",
+        "eslint-plugin-prettier": "^4.0.0",
+        "eslint-plugin-react": "^7.28.0",
+        "eslint-plugin-react-hooks": "^4.3.0",
+        "parcel": "^2.2.0",
+        "prettier": "^2.5.1",
+        "shx": "^0.3.4",
+        "tslib": "^2.3.1",
+        "typescript": "^4.5.4"
     }
 }

BIN
packages/starter/material-ui-starter/public/favicon.ico


+ 0 - 43
packages/starter/material-ui-starter/public/index.html

@@ -1,43 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-  <head>
-    <meta charset="utf-8" />
-    <link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
-    <meta name="viewport" content="width=device-width, initial-scale=1" />
-    <meta name="theme-color" content="#000000" />
-    <meta
-      name="description"
-      content="Web site created using create-react-app"
-    />
-    <link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
-    <!--
-      manifest.json provides metadata used when your web app is installed on a
-      user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
-    -->
-    <link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
-    <!--
-      Notice the use of %PUBLIC_URL% in the tags above.
-      It will be replaced with the URL of the `public` folder during the build.
-      Only files inside the `public` folder can be referenced from the HTML.
-
-      Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
-      work correctly both with client-side routing and a non-root public URL.
-      Learn how to configure a non-root public URL by running `npm run build`.
-    -->
-    <title>React App</title>
-  </head>
-  <body>
-    <noscript>You need to enable JavaScript to run this app.</noscript>
-    <div id="root"></div>
-    <!--
-      This HTML file is a template.
-      If you open it directly in the browser, you will see an empty page.
-
-      You can add webfonts, meta tags, or analytics to this file.
-      The build step will place the bundled scripts into the <body> tag.
-
-      To begin the development, run `npm start` or `yarn start`.
-      To create a production bundle, use `npm run build` or `yarn build`.
-    -->
-  </body>
-</html>

BIN
packages/starter/material-ui-starter/public/logo192.png


BIN
packages/starter/material-ui-starter/public/logo512.png


+ 0 - 25
packages/starter/material-ui-starter/public/manifest.json

@@ -1,25 +0,0 @@
-{
-    "short_name": "React App",
-    "name": "Create React App Sample",
-    "icons": [
-        {
-            "src": "favicon.ico",
-            "sizes": "64x64 32x32 24x24 16x16",
-            "type": "image/x-icon"
-        },
-        {
-            "src": "logo192.png",
-            "type": "image/png",
-            "sizes": "192x192"
-        },
-        {
-            "src": "logo512.png",
-            "type": "image/png",
-            "sizes": "512x512"
-        }
-    ],
-    "start_url": ".",
-    "display": "standalone",
-    "theme_color": "#000000",
-    "background_color": "#ffffff"
-}

+ 0 - 3
packages/starter/material-ui-starter/public/robots.txt

@@ -1,3 +0,0 @@
-# https://www.robotstxt.org/robotstxt.html
-User-agent: *
-Disallow:

+ 0 - 3
packages/starter/material-ui-starter/src/App.css

@@ -1,3 +0,0 @@
-.App {
-  text-align: center;
-}

+ 68 - 48
packages/starter/material-ui-starter/src/App.tsx

@@ -1,54 +1,74 @@
-import { createTheme, StyledEngineProvider, ThemeProvider } from '@mui/material';
-import { deepPurple } from '@mui/material/colors';
-import { SnackbarProvider } from 'notistack';
-import React, { FC } from 'react';
-import { Wallet } from './Wallet';
-
-// Use require instead of import, and order matters
-require('./App.css');
-
-const theme = createTheme({
-    palette: {
-        mode: 'dark',
-        primary: {
-            main: deepPurple[700],
-        },
-    },
-    components: {
-        MuiButtonBase: {
-            styleOverrides: {
-                root: {
-                    justifyContent: 'flex-start',
-                },
-            },
-        },
-        MuiButton: {
-            styleOverrides: {
-                root: {
-                    textTransform: 'none',
-                    padding: '12px 16px',
-                },
-                startIcon: {
-                    marginRight: 8,
-                },
-                endIcon: {
-                    marginLeft: 8,
-                },
-            },
+import { WalletAdapterNetwork, WalletError } from '@solana/wallet-adapter-base';
+import { ConnectionProvider, WalletProvider } from '@solana/wallet-adapter-react';
+import { WalletDialogProvider, WalletMultiButton } from '@solana/wallet-adapter-material-ui';
+import {
+    LedgerWalletAdapter,
+    PhantomWalletAdapter,
+    SlopeWalletAdapter,
+    SolflareWalletAdapter,
+    SolletExtensionWalletAdapter,
+    SolletWalletAdapter,
+    TorusWalletAdapter,
+} from '@solana/wallet-adapter-wallets';
+import { clusterApiUrl } from '@solana/web3.js';
+import { useSnackbar } from 'notistack';
+import React, { FC, ReactNode, useCallback, useMemo } from 'react';
+import { Theme } from './Theme';
+
+// Default styles that can be overridden by your app
+require('@solana/wallet-adapter-react-ui/styles.css');
+
+export const App: FC = () => {
+    return (
+        <Theme>
+            <Context>
+                <Content />
+            </Context>
+        </Theme>
+    );
+};
+
+const Context: FC<{ children: ReactNode }> = ({ children }) => {
+    // The network can be set to 'devnet', 'testnet', or 'mainnet-beta'.
+    const network = WalletAdapterNetwork.Devnet;
+
+    // You can also provide a custom RPC endpoint.
+    const endpoint = useMemo(() => clusterApiUrl(network), [network]);
+
+    // @solana/wallet-adapter-wallets includes all the adapters but supports tree shaking and lazy loading --
+    // Only the wallets you configure here will be compiled into your application, and only the dependencies
+    // of wallets that your users connect to will be loaded.
+    const wallets = useMemo(
+        () => [
+            new PhantomWalletAdapter(),
+            new SlopeWalletAdapter(),
+            new SolflareWalletAdapter(),
+            new TorusWalletAdapter(),
+            new LedgerWalletAdapter(),
+            new SolletWalletAdapter({ network }),
+            new SolletExtensionWalletAdapter({ network }),
+        ],
+        [network]
+    );
+
+    const { enqueueSnackbar } = useSnackbar();
+    const onError = useCallback(
+        (error: WalletError) => {
+            enqueueSnackbar(error.message ? `${error.name}: ${error.message}` : error.name, { variant: 'error' });
+            console.error(error);
         },
-    },
-});
+        [enqueueSnackbar]
+    );
 
-const App: FC = () => {
     return (
-        <StyledEngineProvider injectFirst>
-            <ThemeProvider theme={theme}>
-                <SnackbarProvider>
-                    <Wallet />
-                </SnackbarProvider>
-            </ThemeProvider>
-        </StyledEngineProvider>
+        <ConnectionProvider endpoint={endpoint}>
+            <WalletProvider wallets={wallets} onError={onError} autoConnect>
+                <WalletDialogProvider>{children}</WalletDialogProvider>
+            </WalletProvider>
+        </ConnectionProvider>
     );
 };
 
-export default App;
+const Content: FC = () => {
+    return <WalletMultiButton />;
+};

+ 0 - 19
packages/starter/material-ui-starter/src/Navigation.tsx

@@ -1,19 +0,0 @@
-import DisconnectIcon from '@mui/icons-material/LinkOff';
-import { Toolbar, Typography } from '@mui/material';
-import { WalletDisconnectButton, WalletMultiButton } from '@solana/wallet-adapter-material-ui';
-import { useWallet } from '@solana/wallet-adapter-react';
-import React, { FC } from 'react';
-
-export const Navigation: FC = () => {
-    const { wallet } = useWallet();
-
-    return (
-        <Toolbar style={{ display: 'flex' }}>
-            <Typography component="h1" variant="h6" style={{ flexGrow: 1 }}>
-                Solana Starter App
-            </Typography>
-            <WalletMultiButton />
-            {wallet && <WalletDisconnectButton startIcon={<DisconnectIcon />} style={{ marginLeft: 8 }} />}
-        </Toolbar>
-    );
-};

+ 46 - 0
packages/starter/material-ui-starter/src/Theme.tsx

@@ -0,0 +1,46 @@
+import { createTheme, StyledEngineProvider, ThemeProvider } from '@mui/material';
+import { deepPurple } from '@mui/material/colors';
+import { SnackbarProvider } from 'notistack';
+import React, { FC, ReactNode } from 'react';
+
+const theme = createTheme({
+    palette: {
+        mode: 'dark',
+        primary: {
+            main: deepPurple[700],
+        },
+    },
+    components: {
+        MuiButtonBase: {
+            styleOverrides: {
+                root: {
+                    justifyContent: 'flex-start',
+                },
+            },
+        },
+        MuiButton: {
+            styleOverrides: {
+                root: {
+                    textTransform: 'none',
+                    padding: '12px 16px',
+                },
+                startIcon: {
+                    marginRight: 8,
+                },
+                endIcon: {
+                    marginLeft: 8,
+                },
+            },
+        },
+    },
+});
+
+export const Theme: FC<{ children: ReactNode }> = ({ children }) => {
+    return (
+        <StyledEngineProvider injectFirst>
+            <ThemeProvider theme={theme}>
+                <SnackbarProvider>{children}</SnackbarProvider>
+            </ThemeProvider>
+        </StyledEngineProvider>
+    );
+};

+ 0 - 59
packages/starter/material-ui-starter/src/Wallet.tsx

@@ -1,59 +0,0 @@
-import { WalletAdapterNetwork, WalletError } from '@solana/wallet-adapter-base';
-import { WalletDialogProvider } from '@solana/wallet-adapter-material-ui';
-import { ConnectionProvider, WalletProvider } from '@solana/wallet-adapter-react';
-import {
-    LedgerWalletAdapter,
-    PhantomWalletAdapter,
-    SlopeWalletAdapter,
-    SolflareWalletAdapter,
-    SolletExtensionWalletAdapter,
-    SolletWalletAdapter,
-    TorusWalletAdapter,
-} from '@solana/wallet-adapter-wallets';
-import { clusterApiUrl } from '@solana/web3.js';
-import { useSnackbar } from 'notistack';
-import React, { FC, useCallback, useMemo } from 'react';
-import { Navigation } from './Navigation';
-
-export const Wallet: FC = () => {
-    // Can be set to 'devnet', 'testnet', or 'mainnet-beta'
-    const network = WalletAdapterNetwork.Devnet;
-
-    // You can also provide a custom RPC endpoint
-    const endpoint = useMemo(() => clusterApiUrl(network), [network]);
-
-    // @solana/wallet-adapter-wallets includes all the adapters but supports tree shaking and lazy loading --
-    // Only the wallets you configure here will be compiled into your application, and only the dependencies
-    // of wallets that your users connect to will be loaded
-    const wallets = useMemo(
-        () => [
-            new PhantomWalletAdapter(),
-            new SlopeWalletAdapter(),
-            new SolflareWalletAdapter(),
-            new TorusWalletAdapter(),
-            new LedgerWalletAdapter(),
-            new SolletWalletAdapter({ network }),
-            new SolletExtensionWalletAdapter({ network }),
-        ],
-        [network]
-    );
-
-    const { enqueueSnackbar } = useSnackbar();
-    const onError = useCallback(
-        (error: WalletError) => {
-            enqueueSnackbar(error.message ? `${error.name}: ${error.message}` : error.name, { variant: 'error' });
-            console.error(error);
-        },
-        [enqueueSnackbar]
-    );
-
-    return (
-        <ConnectionProvider endpoint={endpoint}>
-            <WalletProvider wallets={wallets} onError={onError} autoConnect>
-                <WalletDialogProvider>
-                    <Navigation />
-                </WalletDialogProvider>
-            </WalletProvider>
-        </ConnectionProvider>
-    );
-};

+ 11 - 12
packages/starter/material-ui-starter/src/index.css

@@ -1,15 +1,14 @@
-body {
-  margin: 0;
-  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
-    'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
-    sans-serif;
-  -webkit-font-smoothing: antialiased;
-  -moz-osx-font-smoothing: grayscale;
-  background-color: #303030;
-  color: #FFFFFF;
+@import './reset.css';
+
+html, body {
+    background-color: #303030;
+    color: #FFFFFF;
 }
 
-code {
-  font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
-    monospace;
+#app {
+    width: 100vw;
+    height: 100vh;
+    display: flex;
+    justify-content: center;
+    align-items: center;
 }

+ 13 - 0
packages/starter/material-ui-starter/src/index.html

@@ -0,0 +1,13 @@
+<!DOCTYPE html>
+<html lang="en">
+    <head>
+        <meta charset="utf-8" />
+        <meta name="viewport" content="width=device-width, initial-scale=1.0">
+        <title>WalletAdapter Starter</title>
+        <link rel="stylesheet" href="index.css" />
+    </head>
+    <body>
+        <div id="app"></div>
+        <script type="module" src="index.tsx"></script>
+    </body>
+</html>

+ 2 - 5
packages/starter/material-ui-starter/src/index.tsx

@@ -1,13 +1,10 @@
 import React, { StrictMode } from 'react';
 import ReactDOM from 'react-dom';
-import App from './App';
-
-// Use require instead of import, and order matters
-require('./index.css');
+import { App } from './App';
 
 ReactDOM.render(
     <StrictMode>
         <App />
     </StrictMode>,
-    document.getElementById('root')
+    document.getElementById('app')
 );

Файлын зөрүү хэтэрхий том тул дарагдсан байна
+ 0 - 0
packages/starter/material-ui-starter/src/logo.svg


+ 0 - 1
packages/starter/material-ui-starter/src/react-app-env.d.ts

@@ -1 +0,0 @@
-/// <reference types="react-scripts" />

+ 74 - 0
packages/starter/material-ui-starter/src/reset.css

@@ -0,0 +1,74 @@
+/* Box sizing rules */
+*,
+*::before,
+*::after {
+    box-sizing: border-box;
+}
+
+/* Remove default margin */
+body,
+h1,
+h2,
+h3,
+h4,
+p,
+figure,
+blockquote,
+dl,
+dd {
+    margin: 0;
+}
+
+/* Remove list styles on ul, ol elements with a list role, which suggests default styling will be removed */
+ul[role='list'],
+ol[role='list'] {
+    list-style: none;
+}
+
+/* Set core root defaults */
+html:focus-within {
+    scroll-behavior: smooth;
+}
+
+/* Set core body defaults */
+body {
+    min-height: 100vh;
+    text-rendering: optimizeSpeed;
+    line-height: 1.5;
+}
+
+/* A elements that don't have a class get default styles */
+a:not([class]) {
+    text-decoration-skip-ink: auto;
+}
+
+/* Make images easier to work with */
+img,
+picture {
+    max-width: 100%;
+    display: block;
+}
+
+/* Inherit fonts for inputs and buttons */
+input,
+button,
+textarea,
+select {
+    font: inherit;
+}
+
+/* Remove all animations, transitions and smooth scroll for people that prefer not to see them */
+@media (prefers-reduced-motion: reduce) {
+    html:focus-within {
+        scroll-behavior: auto;
+    }
+
+    *,
+    *::before,
+    *::after {
+        animation-duration: 0.01ms !important;
+        animation-iteration-count: 1 !important;
+        transition-duration: 0.01ms !important;
+        scroll-behavior: auto !important;
+    }
+}

+ 8 - 12
packages/starter/material-ui-starter/tsconfig.json

@@ -1,20 +1,16 @@
 {
-    "include": ["src"],
+    "include": ["src", "types"],
+    "exclude": ["node_modules"],
     "compilerOptions": {
-        "target": "es6",
-        "lib": ["dom", "dom.iterable", "esnext"],
-        "allowJs": true,
-        "skipLibCheck": true,
-        "esModuleInterop": true,
-        "allowSyntheticDefaultImports": true,
-        "strict": true,
-        "forceConsistentCasingInFileNames": true,
-        "noFallthroughCasesInSwitch": true,
+        "noEmit": true,
+        "target": "esnext",
         "module": "esnext",
         "moduleResolution": "node",
+        "jsx": "react",
+        "strict": true,
+        "esModuleInterop": true,
         "resolveJsonModule": true,
         "isolatedModules": true,
-        "noEmit": true,
-        "jsx": "react-jsx"
+        "typeRoots": ["node_modules/@types"]
     }
 }

Энэ ялгаанд хэт олон файл өөрчлөгдсөн тул зарим файлыг харуулаагүй болно