Spaces:
Runtime error
Runtime error
feat(typescript): transformed app into typescript
Browse files- .gitignore +1 -1
- next.config.js +6 -3
- package-lock.json +0 -0
- package.json +12 -4
- pages/_app.js +0 -7
- pages/index.js +0 -30
- src/pages/_app.tsx +6 -0
- src/pages/_document.tsx +13 -0
- src/pages/index.tsx +65 -0
- {styles β src/styles}/Home.module.css +1 -4
- {styles β src/styles}/globals.css +0 -0
- tsconfig.json +23 -0
.gitignore
CHANGED
|
@@ -32,4 +32,4 @@ yarn-error.log*
|
|
| 32 |
|
| 33 |
# typescript
|
| 34 |
*.tsbuildinfo
|
| 35 |
-
next-env.d.ts
|
|
|
|
| 32 |
|
| 33 |
# typescript
|
| 34 |
*.tsbuildinfo
|
| 35 |
+
next-env.d.ts
|
next.config.js
CHANGED
|
@@ -1,4 +1,7 @@
|
|
| 1 |
/** @type {import('next').NextConfig} */
|
| 2 |
-
|
| 3 |
-
output:
|
| 4 |
-
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
/** @type {import('next').NextConfig} */
|
| 2 |
+
const nextConfig = {
|
| 3 |
+
output: "standalone",
|
| 4 |
+
reactStrictMode: true,
|
| 5 |
+
};
|
| 6 |
+
|
| 7 |
+
module.exports = nextConfig;
|
package-lock.json
CHANGED
|
The diff for this file is too large to render.
See raw diff
|
|
|
package.json
CHANGED
|
@@ -2,11 +2,19 @@
|
|
| 2 |
"private": true,
|
| 3 |
"scripts": {
|
| 4 |
"dev": "next dev",
|
| 5 |
-
"build": "next build"
|
|
|
|
|
|
|
| 6 |
},
|
| 7 |
"dependencies": {
|
| 8 |
-
"
|
| 9 |
-
"react": "
|
| 10 |
-
"react-dom": "
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
}
|
| 12 |
}
|
|
|
|
| 2 |
"private": true,
|
| 3 |
"scripts": {
|
| 4 |
"dev": "next dev",
|
| 5 |
+
"build": "next build",
|
| 6 |
+
"start": "next start",
|
| 7 |
+
"lint": "next lint"
|
| 8 |
},
|
| 9 |
"dependencies": {
|
| 10 |
+
"@types/node": "20.1.4",
|
| 11 |
+
"@types/react": "18.2.6",
|
| 12 |
+
"@types/react-dom": "18.2.4",
|
| 13 |
+
"eslint": "8.40.0",
|
| 14 |
+
"eslint-config-next": "13.4.2",
|
| 15 |
+
"next": "13.4.2",
|
| 16 |
+
"react": "18.2.0",
|
| 17 |
+
"react-dom": "18.2.0",
|
| 18 |
+
"typescript": "5.0.4"
|
| 19 |
}
|
| 20 |
}
|
pages/_app.js
DELETED
|
@@ -1,7 +0,0 @@
|
|
| 1 |
-
import '../styles/globals.css'
|
| 2 |
-
|
| 3 |
-
function MyApp({ Component, pageProps }) {
|
| 4 |
-
return <Component {...pageProps} />
|
| 5 |
-
}
|
| 6 |
-
|
| 7 |
-
export default MyApp
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
pages/index.js
DELETED
|
@@ -1,30 +0,0 @@
|
|
| 1 |
-
import Head from 'next/head'
|
| 2 |
-
import styles from '../styles/Home.module.css'
|
| 3 |
-
|
| 4 |
-
export default function Home() {
|
| 5 |
-
return (
|
| 6 |
-
<div className={styles.container}>
|
| 7 |
-
<Head>
|
| 8 |
-
<title>nextjs-docker-starter</title>
|
| 9 |
-
<link rel="icon" href="/favicon.ico" />
|
| 10 |
-
</Head>
|
| 11 |
-
|
| 12 |
-
<main className={styles.main}>
|
| 13 |
-
<h1 className={styles.title}>
|
| 14 |
-
<a href="https://nextjs.org">Next.js</a> in Docker on π€ Spaces!
|
| 15 |
-
</h1>
|
| 16 |
-
</main>
|
| 17 |
-
|
| 18 |
-
<footer className={styles.footer}>
|
| 19 |
-
<a
|
| 20 |
-
href="https://failfa.st"
|
| 21 |
-
target="_blank"
|
| 22 |
-
rel="noopener noreferrer"
|
| 23 |
-
>
|
| 24 |
-
Powered by{' '}
|
| 25 |
-
<img src="/failfast.svg" alt="failfast Logo" className={styles.logo} />
|
| 26 |
-
</a>
|
| 27 |
-
</footer>
|
| 28 |
-
</div>
|
| 29 |
-
)
|
| 30 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
src/pages/_app.tsx
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import "@/styles/globals.css";
|
| 2 |
+
import type { AppProps } from "next/app";
|
| 3 |
+
|
| 4 |
+
export default function App({ Component, pageProps }: AppProps) {
|
| 5 |
+
return <Component {...pageProps} />;
|
| 6 |
+
}
|
src/pages/_document.tsx
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { Html, Head, Main, NextScript } from 'next/document'
|
| 2 |
+
|
| 3 |
+
export default function Document() {
|
| 4 |
+
return (
|
| 5 |
+
<Html lang="en">
|
| 6 |
+
<Head />
|
| 7 |
+
<body>
|
| 8 |
+
<Main />
|
| 9 |
+
<NextScript />
|
| 10 |
+
</body>
|
| 11 |
+
</Html>
|
| 12 |
+
)
|
| 13 |
+
}
|
src/pages/index.tsx
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import Head from "next/head";
|
| 2 |
+
import styles from "@/styles/Home.module.css";
|
| 3 |
+
|
| 4 |
+
export default function Home() {
|
| 5 |
+
return (
|
| 6 |
+
<>
|
| 7 |
+
<div className={styles.container}>
|
| 8 |
+
<Head>
|
| 9 |
+
<title>nextjs-docker-starter</title>
|
| 10 |
+
<link rel="icon" href="/favicon.ico" />
|
| 11 |
+
<meta name="description" content="Next.js in Docker on π€ Spaces" />
|
| 12 |
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
| 13 |
+
</Head>
|
| 14 |
+
|
| 15 |
+
<main className={styles.main}>
|
| 16 |
+
<h1 className={styles.title}>
|
| 17 |
+
<a
|
| 18 |
+
href="https://nextjs.org"
|
| 19 |
+
target="_blank"
|
| 20 |
+
rel="noopener noreferrer"
|
| 21 |
+
>
|
| 22 |
+
Next.js
|
| 23 |
+
</a>{" "}
|
| 24 |
+
in{" "}
|
| 25 |
+
<a
|
| 26 |
+
href="https://www.docker.com"
|
| 27 |
+
target="_blank"
|
| 28 |
+
rel="noopener noreferrer"
|
| 29 |
+
>
|
| 30 |
+
Docker
|
| 31 |
+
</a>{" "}
|
| 32 |
+
on π€{" "}
|
| 33 |
+
<a
|
| 34 |
+
href="https://huggingface.co/spaces"
|
| 35 |
+
target="_blank"
|
| 36 |
+
rel="noopener noreferrer"
|
| 37 |
+
>
|
| 38 |
+
Spaces
|
| 39 |
+
</a>
|
| 40 |
+
!
|
| 41 |
+
</h1>
|
| 42 |
+
</main>
|
| 43 |
+
|
| 44 |
+
<footer className={styles.footer}>
|
| 45 |
+
<a href="https://failfa.st" target="_blank" rel="noopener noreferrer">
|
| 46 |
+
Powered by{" "}
|
| 47 |
+
<img
|
| 48 |
+
src="/failfast.svg"
|
| 49 |
+
alt="failfast Logo"
|
| 50 |
+
className={styles.logo}
|
| 51 |
+
/>
|
| 52 |
+
</a>
|
| 53 |
+
<a
|
| 54 |
+
href="https://github.com/failfa-st/nextjs-docker-starter"
|
| 55 |
+
target="_blank"
|
| 56 |
+
rel="noopener noreferrer"
|
| 57 |
+
>
|
| 58 |
+
{" "}
|
| 59 |
+
Contribute on GitHub
|
| 60 |
+
</a>
|
| 61 |
+
</footer>
|
| 62 |
+
</div>
|
| 63 |
+
</>
|
| 64 |
+
);
|
| 65 |
+
}
|
{styles β src/styles}/Home.module.css
RENAMED
|
@@ -25,10 +25,6 @@
|
|
| 25 |
align-items: center;
|
| 26 |
}
|
| 27 |
|
| 28 |
-
.footer img {
|
| 29 |
-
margin-left: 0.5rem;
|
| 30 |
-
}
|
| 31 |
-
|
| 32 |
.footer a {
|
| 33 |
display: flex;
|
| 34 |
justify-content: center;
|
|
@@ -68,6 +64,7 @@
|
|
| 68 |
|
| 69 |
.logo {
|
| 70 |
height: 3em;
|
|
|
|
| 71 |
}
|
| 72 |
|
| 73 |
@media (max-width: 600px) {
|
|
|
|
| 25 |
align-items: center;
|
| 26 |
}
|
| 27 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 28 |
.footer a {
|
| 29 |
display: flex;
|
| 30 |
justify-content: center;
|
|
|
|
| 64 |
|
| 65 |
.logo {
|
| 66 |
height: 3em;
|
| 67 |
+
margin: 0 0.5rem;
|
| 68 |
}
|
| 69 |
|
| 70 |
@media (max-width: 600px) {
|
{styles β src/styles}/globals.css
RENAMED
|
File without changes
|
tsconfig.json
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"compilerOptions": {
|
| 3 |
+
"target": "es5",
|
| 4 |
+
"lib": ["dom", "dom.iterable", "esnext"],
|
| 5 |
+
"allowJs": true,
|
| 6 |
+
"skipLibCheck": true,
|
| 7 |
+
"strict": true,
|
| 8 |
+
"forceConsistentCasingInFileNames": true,
|
| 9 |
+
"noEmit": true,
|
| 10 |
+
"esModuleInterop": true,
|
| 11 |
+
"module": "esnext",
|
| 12 |
+
"moduleResolution": "node",
|
| 13 |
+
"resolveJsonModule": true,
|
| 14 |
+
"isolatedModules": true,
|
| 15 |
+
"jsx": "preserve",
|
| 16 |
+
"incremental": true,
|
| 17 |
+
"paths": {
|
| 18 |
+
"@/*": ["./src/*"]
|
| 19 |
+
}
|
| 20 |
+
},
|
| 21 |
+
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"],
|
| 22 |
+
"exclude": ["node_modules"]
|
| 23 |
+
}
|