1
0
Fork 0

refactor: drop everything and start again

- too many packages
- packages were too general
- the repo was hard to work with
- sites were too connected to packages - difficult to do stuff after a while
This commit is contained in:
Vojtěch Mareš 2023-06-06 20:25:44 +02:00
parent 358e6e59e3
commit ada7eb3cdd
Signed by: vojtech.mares
GPG key ID: C6827B976F17240D
54 changed files with 1066 additions and 1011 deletions

View file

@ -0,0 +1,4 @@
module.exports = {
root: true,
extends: ["custom"],
};

View file

@ -0,0 +1,30 @@
## Getting Started
First, run the development server:
```bash
yarn dev
```
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
You can start editing the page by modifying `pages/index.js`. The page auto-updates as you edit the file.
[API routes](https://nextjs.org/docs/api-routes/introduction) can be accessed on [http://localhost:3000/api/hello](http://localhost:3000/api/hello). This endpoint can be edited in `pages/api/hello.js`.
The `pages/api` directory is mapped to `/api/*`. Files in this directory are treated as [API routes](https://nextjs.org/docs/api-routes/introduction) instead of React pages.
## Learn More
To learn more about Next.js, take a look at the following resources:
- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome!
## Deploy on Vercel
The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_source=github.com&utm_medium=referral&utm_campaign=turborepo-readme) from the creators of Next.js.
Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.

View file

@ -0,0 +1,25 @@
import '/styles/global.css';
import { Metadata } from 'next';
export const metadata: Metadata = {
title: {
default: 'Terraform školení - Vojtěch Mareš',
template: '%s | Next.js App Router',
},
description:
'Terraform školení pro začátečníky i pokročilé | Školí Vojtěch Mareš - DevOps konzultant, lektor a mentor',
};
export default function RootLayout({
children,
}: {
children: React.ReactNode;
}) {
return (
<html lang="en" className="[color-scheme:dark]">
<body className="bg-gray-1100 overflow-y-scroll bg-[url('/grid.svg')] pb-36">
<h1>Terraform Školení</h1>
</body>
</html>
);
}

View file

@ -0,0 +1,13 @@
import { Boundary } from '../components/Boundary';
export default function NotFound() {
return (
<Boundary labels={['not-found.tsx']} color="pink">
<div className="space-y-4 text-vercel-pink">
<h2 className="text-lg font-bold">Not Found</h2>
<p className="text-sm">Could not find requested resource</p>
</div>
</Boundary>
);
}

View file

@ -0,0 +1,5 @@
export default function Page() {
return (
<>Hello</>
);
}

View file

@ -0,0 +1,82 @@
import clsx from 'clsx';
import React from 'react';
const Label = ({
children,
animateRerendering,
color,
}: {
children: React.ReactNode;
animateRerendering?: boolean;
color?: 'default' | 'pink' | 'blue' | 'violet' | 'cyan' | 'orange';
}) => {
return (
<div
className={clsx('rounded-full px-1.5 shadow-[0_0_1px_3px_black]', {
'bg-gray-800 text-gray-300': color === 'default',
'bg-vercel-pink text-white': color === 'pink',
'bg-vercel-blue text-white': color === 'blue',
'bg-vercel-cyan text-white': color === 'cyan',
'bg-vercel-violet text-violet-100': color === 'violet',
'bg-vercel-orange text-white': color === 'orange',
'animate-[highlight_1s_ease-in-out_1]': animateRerendering,
})}
>
{children}
</div>
);
};
export const Boundary = ({
children,
labels = ['children'],
size = 'default',
color = 'default',
animateRerendering = true,
}: {
children: React.ReactNode;
labels?: string[];
size?: 'small' | 'default';
color?: 'default' | 'pink' | 'blue' | 'violet' | 'cyan' | 'orange';
animateRerendering?: boolean;
}) => {
return (
<div
className={clsx('relative rounded-lg border border-dashed', {
'p-3 lg:p-5': size === 'small',
'p-4 lg:p-9': size === 'default',
'border-gray-700': color === 'default',
'border-vercel-pink': color === 'pink',
'border-vercel-blue': color === 'blue',
'border-vercel-cyan': color === 'cyan',
'border-vercel-violet': color === 'violet',
'border-vercel-orange': color === 'orange',
'animate-[rerender_1s_ease-in-out_1] text-vercel-pink':
animateRerendering,
})}
>
<div
className={clsx(
'absolute -top-2.5 flex gap-x-1 text-[9px] uppercase leading-4 tracking-widest',
{
'left-3 lg:left-5': size === 'small',
'left-4 lg:left-9': size === 'default',
},
)}
>
{labels.map((label) => {
return (
<Label
key={label}
color={color}
animateRerendering={animateRerendering}
>
{label}
</Label>
);
})}
</div>
{children}
</div>
);
};

View file

@ -0,0 +1,5 @@
/// <reference types="next" />
/// <reference types="next/image-types/global" />
// NOTE: This file should not be edited
// see https://nextjs.org/docs/basic-features/typescript for more information.

View file

@ -0,0 +1,6 @@
const nextConfig = {
transpilePackages: ['ui'],
reactStrictMode: true,
};
module.exports = nextConfig;

View file

@ -0,0 +1,28 @@
{
"name": "terraform-skoleni.cz",
"version": "0.0.0",
"private": true,
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "next lint"
},
"dependencies": {
"clsx": "^1.2.1",
"next": "13.4.4",
"react": "18.2.0",
"react-dom": "18.2.0"
},
"devDependencies": {
"@babel/core": "^7.22.1",
"@types/node": "^18.16.16",
"@types/react": "18.2.7",
"autoprefixer": "^10.4.14",
"eslint": "8.41.0",
"eslint-config-next": "^13.0.0",
"postcss": "^8.4.24",
"tailwindcss": "^3.3.2",
"typescript": "5.1.3"
}
}

View file

@ -0,0 +1,8 @@
// If you want to use other PostCSS plugins, see the following:
// https://tailwindcss.com/docs/using-with-preprocessors
module.exports = {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
}

View file

@ -0,0 +1,3 @@
@tailwind base;
@tailwind components;
@tailwind utilities;

View file

@ -0,0 +1,10 @@
module.exports = {
content: [
'./components/**/*.{ts,tsx}',
'./app/**/*.{ts,tsx}',
],
theme: {
extend: {}
},
plugins: []
}

View file

@ -0,0 +1,44 @@
{
"compilerOptions": {
"baseUrl": ".",
"composite": false,
"declaration": true,
"declarationMap": true,
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"inlineSources": false,
"isolatedModules": true,
"moduleResolution": "node",
"noUnusedLocals": false,
"noUnusedParameters": false,
"preserveWatchOutput": true,
"skipLibCheck": true,
"strict": true,
"target": "es5",
"lib": [
"dom",
"dom.iterable",
"esnext"
],
"allowJs": true,
"noEmit": true,
"module": "esnext",
"resolveJsonModule": true,
"jsx": "preserve",
"incremental": true,
"plugins": [
{
"name": "next"
}
]
},
"include": [
"next-env.d.ts",
"**/*.ts",
"**/*.tsx",
".next/types/**/*.ts"
],
"exclude": [
"node_modules"
]
}