⚡ Chore: Setup dependencies
This commit is contained in:
parent
6e88841397
commit
f4d3e9f46f
|
@ -0,0 +1,26 @@
|
||||||
|
{
|
||||||
|
"parser": "@typescript-eslint/parser",
|
||||||
|
"extends": [
|
||||||
|
"eslint:recommended",
|
||||||
|
"plugin:@typescript-eslint/recommended",
|
||||||
|
"plugin:react/recommended",
|
||||||
|
"plugin:prettier/recommended",
|
||||||
|
"plugin:import/typescript",
|
||||||
|
"prettier"
|
||||||
|
],
|
||||||
|
"plugins": ["@typescript-eslint", "react", "react-hooks", "import"],
|
||||||
|
"rules": {
|
||||||
|
"@typescript-eslint/explicit-function-return-type": "off",
|
||||||
|
"@typescript-eslint/no-non-null-assertion": "off",
|
||||||
|
"react/prop-types": "off",
|
||||||
|
"react-hooks/rules-of-hooks": "error",
|
||||||
|
"react-hooks/exhaustive-deps": "warn",
|
||||||
|
"import/first": "warn",
|
||||||
|
"import/no-unused-modules": "warn"
|
||||||
|
},
|
||||||
|
"settings": {
|
||||||
|
"react": {
|
||||||
|
"version": "detect"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -4,6 +4,7 @@
|
||||||
/node_modules
|
/node_modules
|
||||||
/.pnp
|
/.pnp
|
||||||
.pnp.js
|
.pnp.js
|
||||||
|
.vscode
|
||||||
|
|
||||||
# testing
|
# testing
|
||||||
/coverage
|
/coverage
|
||||||
|
|
|
@ -0,0 +1,15 @@
|
||||||
|
|
||||||
|
node_modules/
|
||||||
|
.next/
|
||||||
|
.vercel/
|
||||||
|
.vscode/snipsnap.code-snippets
|
||||||
|
public/
|
||||||
|
|
||||||
|
.gitignore
|
||||||
|
.eslintrc
|
||||||
|
package-lock.json
|
||||||
|
yarn.lock
|
||||||
|
.prettierignore
|
||||||
|
.env
|
||||||
|
.env.local
|
||||||
|
LICENSE
|
|
@ -0,0 +1,7 @@
|
||||||
|
import React from "react";
|
||||||
|
|
||||||
|
const EditLink: React.FC = () => {
|
||||||
|
return <div />;
|
||||||
|
};
|
||||||
|
|
||||||
|
export default EditLink;
|
|
@ -0,0 +1,7 @@
|
||||||
|
import React from "react";
|
||||||
|
|
||||||
|
const Link: React.FC = () => {
|
||||||
|
return <div />;
|
||||||
|
};
|
||||||
|
|
||||||
|
export default Link;
|
|
@ -0,0 +1,7 @@
|
||||||
|
import React from "react";
|
||||||
|
|
||||||
|
const Preview: React.FC = () => {
|
||||||
|
return <div />;
|
||||||
|
};
|
||||||
|
|
||||||
|
export default Preview;
|
|
@ -0,0 +1,3 @@
|
||||||
|
export { default as Link } from "./Link";
|
||||||
|
export { default as EditLink } from "./EditLink";
|
||||||
|
export { default as Preview } from "./Preview";
|
|
@ -0,0 +1,2 @@
|
||||||
|
/// <reference types="next" />
|
||||||
|
/// <reference types="next/types/global" />
|
File diff suppressed because it is too large
Load Diff
34
package.json
34
package.json
|
@ -5,11 +5,43 @@
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "next dev",
|
"dev": "next dev",
|
||||||
"build": "next build",
|
"build": "next build",
|
||||||
"start": "next start"
|
"start": "next start",
|
||||||
|
"format": "prettier --write './**/*'",
|
||||||
|
"format:check": "prettier --check './**/*'",
|
||||||
|
"lint": "eslint \"{pages,components}/**/*.{js,ts,tsx,jsx}\" --quiet --fix",
|
||||||
|
"lint:check": "eslint \"{pages,components}/**/*.{js,ts,tsx,jsx}\" --quiet",
|
||||||
|
"check": "npm run format:check && npm run lint:check",
|
||||||
|
"check:fix": "npm run format && npm run lint"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"next": "10.0.7",
|
"next": "10.0.7",
|
||||||
"react": "17.0.1",
|
"react": "17.0.1",
|
||||||
"react-dom": "17.0.1"
|
"react-dom": "17.0.1"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"@types/node": "^14.14.31",
|
||||||
|
"@types/react": "^17.0.2",
|
||||||
|
"@types/react-dom": "^17.0.1",
|
||||||
|
"@typescript-eslint/eslint-plugin": "^4.16.1",
|
||||||
|
"@typescript-eslint/parser": "^4.16.1",
|
||||||
|
"autoprefixer": "^10.2.4",
|
||||||
|
"eslint": "^7.21.0",
|
||||||
|
"eslint-config-prettier": "^8.1.0",
|
||||||
|
"eslint-plugin-import": "^2.22.1",
|
||||||
|
"eslint-plugin-prettier": "^3.3.1",
|
||||||
|
"eslint-plugin-react": "^7.22.0",
|
||||||
|
"eslint-plugin-react-hooks": "^4.2.0",
|
||||||
|
"husky": "^5.1.3",
|
||||||
|
"postcss": "^8.2.6",
|
||||||
|
"prettier": "^2.2.1",
|
||||||
|
"stylelint": "^13.11.0",
|
||||||
|
"stylelint-config-standard": "^20.0.0",
|
||||||
|
"tailwindcss": "^2.0.3",
|
||||||
|
"typescript": "^4.2.2"
|
||||||
|
},
|
||||||
|
"husky": {
|
||||||
|
"hooks": {
|
||||||
|
"pre-push": "git diff HEAD --quiet && npm run check:fix"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +0,0 @@
|
||||||
import '../styles/globals.css'
|
|
||||||
|
|
||||||
function MyApp({ Component, pageProps }) {
|
|
||||||
return <Component {...pageProps} />
|
|
||||||
}
|
|
||||||
|
|
||||||
export default MyApp
|
|
|
@ -0,0 +1,9 @@
|
||||||
|
import type { AppProps } from "next/app";
|
||||||
|
import React from "react";
|
||||||
|
import "styles/globals.css";
|
||||||
|
|
||||||
|
const MyApp: React.FC<AppProps> = ({ Component, pageProps }) => (
|
||||||
|
<Component {...pageProps} />
|
||||||
|
);
|
||||||
|
|
||||||
|
export default MyApp;
|
|
@ -1,5 +0,0 @@
|
||||||
// Next.js API route support: https://nextjs.org/docs/api-routes/introduction
|
|
||||||
|
|
||||||
export default (req, res) => {
|
|
||||||
res.status(200).json({ name: 'John Doe' })
|
|
||||||
}
|
|
|
@ -0,0 +1,88 @@
|
||||||
|
import Head from "next/head";
|
||||||
|
import React from "react";
|
||||||
|
import { GetStaticProps } from "next";
|
||||||
|
import styles from "styles/Home.module.css";
|
||||||
|
|
||||||
|
export const getStaticProps: GetStaticProps = async () => {
|
||||||
|
// TODO: Fetch links here
|
||||||
|
|
||||||
|
return {
|
||||||
|
props: { data: null }, // will be passed to the page component as props
|
||||||
|
// Next.js will attempt to re-generate the page:
|
||||||
|
// - When a request comes in
|
||||||
|
// - At most once every second
|
||||||
|
revalidate: 1,
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
const Editor: React.FC = ({ data }: any) => {
|
||||||
|
console.log({ data });
|
||||||
|
|
||||||
|
return (
|
||||||
|
// TODO: Remove starter code
|
||||||
|
<div className={styles.container}>
|
||||||
|
<Head>
|
||||||
|
<title>Create Next App</title>
|
||||||
|
<link rel="icon" href="/favicon.ico" />
|
||||||
|
</Head>
|
||||||
|
|
||||||
|
<main className={styles.main}>
|
||||||
|
<div className="max-w-md mx-auto text-red-600 hover:text-red-700">
|
||||||
|
<div>
|
||||||
|
<h1 className={styles.title}>
|
||||||
|
Welcome to <a href="https://nextjs.org">Next.js!</a>
|
||||||
|
</h1>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<p className={styles.description}>
|
||||||
|
Get started by editing{" "}
|
||||||
|
<code className={styles.code}>pages/index.js</code>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<div className={styles.grid}>
|
||||||
|
<a href="https://nextjs.org/docs" className={styles.card}>
|
||||||
|
<h3>Documentation →</h3>
|
||||||
|
<p>Find in-depth information about Next.js features and API.</p>
|
||||||
|
</a>
|
||||||
|
|
||||||
|
<a href="https://nextjs.org/learn" className={styles.card}>
|
||||||
|
<h3>Learn →</h3>
|
||||||
|
<p>Learn about Next.js in an interactive course with quizzes!</p>
|
||||||
|
</a>
|
||||||
|
|
||||||
|
<a
|
||||||
|
href="https://github.com/vercel/next.js/tree/master/examples"
|
||||||
|
className={styles.card}
|
||||||
|
>
|
||||||
|
<h3>Examples →</h3>
|
||||||
|
<p>Discover and deploy boilerplate example Next.js projects.</p>
|
||||||
|
</a>
|
||||||
|
|
||||||
|
<a
|
||||||
|
href="https://vercel.com/new?utm_source=create-next-app&utm_medium=default-template&utm_campaign=create-next-app"
|
||||||
|
className={styles.card}
|
||||||
|
>
|
||||||
|
<h3>Deploy →</h3>
|
||||||
|
<p>
|
||||||
|
Instantly deploy your Next.js site to a public URL with Vercel.
|
||||||
|
</p>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</main>
|
||||||
|
|
||||||
|
<footer className={styles.footer}>
|
||||||
|
<a
|
||||||
|
href="https://vercel.com?utm_source=create-next-app&utm_medium=default-template&utm_campaign=create-next-app"
|
||||||
|
target="_blank"
|
||||||
|
rel="noopener noreferrer"
|
||||||
|
>
|
||||||
|
Powered by{" "}
|
||||||
|
<img src="/vercel.svg" alt="Vercel Logo" className={styles.logo} />
|
||||||
|
</a>
|
||||||
|
</footer>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default Editor;
|
|
@ -1,8 +1,10 @@
|
||||||
import Head from 'next/head'
|
import Head from "next/head";
|
||||||
import styles from '../styles/Home.module.css'
|
import React from "react";
|
||||||
|
import styles from "styles/Home.module.css";
|
||||||
|
|
||||||
export default function Home() {
|
const Login: React.FC = () => {
|
||||||
return (
|
return (
|
||||||
|
// TODO: Remove starter code
|
||||||
<div className={styles.container}>
|
<div className={styles.container}>
|
||||||
<Head>
|
<Head>
|
||||||
<title>Create Next App</title>
|
<title>Create Next App</title>
|
||||||
|
@ -10,12 +12,16 @@ export default function Home() {
|
||||||
</Head>
|
</Head>
|
||||||
|
|
||||||
<main className={styles.main}>
|
<main className={styles.main}>
|
||||||
<h1 className={styles.title}>
|
<div className="max-w-md mx-auto text-red-600 hover:text-red-700">
|
||||||
Welcome to <a href="https://nextjs.org">Next.js!</a>
|
<div>
|
||||||
</h1>
|
<h1 className={styles.title}>
|
||||||
|
Welcome to <a href="https://nextjs.org">Next.js!</a>
|
||||||
|
</h1>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<p className={styles.description}>
|
<p className={styles.description}>
|
||||||
Get started by editing{' '}
|
Get started by editing{" "}
|
||||||
<code className={styles.code}>pages/index.js</code>
|
<code className={styles.code}>pages/index.js</code>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
@ -56,10 +62,12 @@ export default function Home() {
|
||||||
target="_blank"
|
target="_blank"
|
||||||
rel="noopener noreferrer"
|
rel="noopener noreferrer"
|
||||||
>
|
>
|
||||||
Powered by{' '}
|
Powered by{" "}
|
||||||
<img src="/vercel.svg" alt="Vercel Logo" className={styles.logo} />
|
<img src="/vercel.svg" alt="Vercel Logo" className={styles.logo} />
|
||||||
</a>
|
</a>
|
||||||
</footer>
|
</footer>
|
||||||
</div>
|
</div>
|
||||||
)
|
);
|
||||||
}
|
};
|
||||||
|
|
||||||
|
export default Login;
|
|
@ -0,0 +1,84 @@
|
||||||
|
import React from "react";
|
||||||
|
import Head from "next/head";
|
||||||
|
import { GetStaticProps } from "next";
|
||||||
|
import styles from "styles/Home.module.css";
|
||||||
|
|
||||||
|
export const getStaticProps: GetStaticProps = async () => {
|
||||||
|
// TODO: Fetch links here
|
||||||
|
|
||||||
|
return {
|
||||||
|
props: { links: [] }, // will be passed to the page component as props
|
||||||
|
// Next.js will attempt to re-generate the page:
|
||||||
|
// - When a request comes in
|
||||||
|
// - At most once every second
|
||||||
|
revalidate: 1,
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
const Home: React.FC = ({ links }: any) => {
|
||||||
|
console.log({ links });
|
||||||
|
|
||||||
|
// TODO: Remove starter code
|
||||||
|
return (
|
||||||
|
<div className={styles.container}>
|
||||||
|
<Head>
|
||||||
|
<title>Create Next App</title>
|
||||||
|
<link rel="icon" href="/favicon.ico" />
|
||||||
|
</Head>
|
||||||
|
|
||||||
|
<main className={styles.main}>
|
||||||
|
<h1 className={styles.title}>
|
||||||
|
Welcome to <a href="https://nextjs.org">Next.js!</a>
|
||||||
|
</h1>
|
||||||
|
|
||||||
|
<p className={styles.description}>
|
||||||
|
Get started by editing{" "}
|
||||||
|
<code className={styles.code}>pages/index.js</code>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<div className={styles.grid}>
|
||||||
|
<a href="https://nextjs.org/docs" className={styles.card}>
|
||||||
|
<h3>Documentation →</h3>
|
||||||
|
<p>Find in-depth information about Next.js features and API.</p>
|
||||||
|
</a>
|
||||||
|
|
||||||
|
<a href="https://nextjs.org/learn" className={styles.card}>
|
||||||
|
<h3>Learn →</h3>
|
||||||
|
<p>Learn about Next.js in an interactive course with quizzes!</p>
|
||||||
|
</a>
|
||||||
|
|
||||||
|
<a
|
||||||
|
href="https://github.com/vercel/next.js/tree/master/examples"
|
||||||
|
className={styles.card}
|
||||||
|
>
|
||||||
|
<h3>Examples →</h3>
|
||||||
|
<p>Discover and deploy boilerplate example Next.js projects.</p>
|
||||||
|
</a>
|
||||||
|
|
||||||
|
<a
|
||||||
|
href="https://vercel.com/new?utm_source=create-next-app&utm_medium=default-template&utm_campaign=create-next-app"
|
||||||
|
className={styles.card}
|
||||||
|
>
|
||||||
|
<h3>Deploy →</h3>
|
||||||
|
<p>
|
||||||
|
Instantly deploy your Next.js site to a public URL with Vercel.
|
||||||
|
</p>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</main>
|
||||||
|
|
||||||
|
<footer className={styles.footer}>
|
||||||
|
<a
|
||||||
|
href="https://vercel.com?utm_source=create-next-app&utm_medium=default-template&utm_campaign=create-next-app"
|
||||||
|
target="_blank"
|
||||||
|
rel="noopener noreferrer"
|
||||||
|
>
|
||||||
|
Powered by{" "}
|
||||||
|
<img src="/vercel.svg" alt="Vercel Logo" className={styles.logo} />
|
||||||
|
</a>
|
||||||
|
</footer>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default Home;
|
|
@ -0,0 +1,7 @@
|
||||||
|
// postcss.config.js
|
||||||
|
module.exports = {
|
||||||
|
plugins: {
|
||||||
|
tailwindcss: {},
|
||||||
|
autoprefixer: {},
|
||||||
|
},
|
||||||
|
};
|
|
@ -0,0 +1,19 @@
|
||||||
|
module.exports = {
|
||||||
|
extends: ["stylelint-config-standard"],
|
||||||
|
rules: {
|
||||||
|
"at-rule-no-unknown": [
|
||||||
|
true,
|
||||||
|
{
|
||||||
|
ignoreAtRules: [
|
||||||
|
"tailwind",
|
||||||
|
"apply",
|
||||||
|
"variants",
|
||||||
|
"responsive",
|
||||||
|
"screen",
|
||||||
|
],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
"declaration-block-trailing-semicolon": null,
|
||||||
|
"no-descending-specificity": null,
|
||||||
|
},
|
||||||
|
};
|
|
@ -1,16 +1,4 @@
|
||||||
html,
|
/* ./your-css-folder/styles.css */
|
||||||
body {
|
@tailwind base;
|
||||||
padding: 0;
|
@tailwind components;
|
||||||
margin: 0;
|
@tailwind utilities;
|
||||||
font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen,
|
|
||||||
Ubuntu, Cantarell, Fira Sans, Droid Sans, Helvetica Neue, sans-serif;
|
|
||||||
}
|
|
||||||
|
|
||||||
a {
|
|
||||||
color: inherit;
|
|
||||||
text-decoration: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
* {
|
|
||||||
box-sizing: border-box;
|
|
||||||
}
|
|
||||||
|
|
|
@ -0,0 +1,21 @@
|
||||||
|
module.exports = {
|
||||||
|
purge: {
|
||||||
|
content: [
|
||||||
|
"./pages/**/*.{js,ts,jsx,tsx}",
|
||||||
|
"./components/**/*.{js,ts,jsx,tsx}",
|
||||||
|
],
|
||||||
|
// These options are passed through directly to PurgeCSS
|
||||||
|
options: {
|
||||||
|
keyframes: true,
|
||||||
|
fontFace: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
darkMode: false, // or 'media' or 'class'
|
||||||
|
theme: {
|
||||||
|
extend: {},
|
||||||
|
},
|
||||||
|
variants: {
|
||||||
|
extend: {},
|
||||||
|
},
|
||||||
|
plugins: [],
|
||||||
|
};
|
|
@ -0,0 +1,23 @@
|
||||||
|
{
|
||||||
|
"compilerOptions": {
|
||||||
|
/* Basic Options */
|
||||||
|
"target": "es5" /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'. */,
|
||||||
|
"module": "commonjs" /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */,
|
||||||
|
"allowJs": false /* Allow javascript files to be compiled. */,
|
||||||
|
"resolveJsonModule": true,
|
||||||
|
"jsx": "preserve" /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */,
|
||||||
|
"baseUrl": ".",
|
||||||
|
/* Strict Type-Checking Options */
|
||||||
|
"strict": true /* Enable all strict type-checking options. */,
|
||||||
|
"strictNullChecks": true /* Enable strict null checks. */,
|
||||||
|
"skipLibCheck": true,
|
||||||
|
"esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */,
|
||||||
|
"lib": ["dom", "dom.iterable", "esnext"],
|
||||||
|
"forceConsistentCasingInFileNames": true,
|
||||||
|
"noEmit": true,
|
||||||
|
"moduleResolution": "node",
|
||||||
|
"isolatedModules": true
|
||||||
|
},
|
||||||
|
"exclude": ["node_modules", "public", ".cache", ".vscode", ".next"],
|
||||||
|
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"]
|
||||||
|
}
|
Loading…
Reference in New Issue