Initial commit

main
Guus van Meerveld 2 years ago
commit ec9ccdba66

@ -0,0 +1,8 @@
**
!next.config.js
!tsconfig.json
!package.json
!yarn.lock
!public
!src

@ -0,0 +1,67 @@
{
"root": true,
"env": {
"node": true,
"es6": true
},
"parserOptions": {
"ecmaVersion": 8
},
"plugins": [
"prettier",
"css-modules"
],
"ignorePatterns": [
"node_modules/*",
".next/*",
".out/*"
],
"extends": [
"eslint:recommended",
"plugin:css-modules/recommended"
],
"overrides": [
{
"files": [
"**/*.ts",
"**/*.tsx"
],
"parser": "@typescript-eslint/parser",
"settings": {
"react": {
"version": "detect"
}
},
"env": {
"browser": true,
"node": true,
"es6": true
},
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:react/recommended",
"plugin:react-hooks/recommended",
"plugin:jsx-a11y/recommended"
],
"rules": {
"prettier/prettier": "error",
"react/prop-types": "off",
"react/react-in-jsx-scope": "off",
"jsx-a11y/anchor-is-valid": "off",
"jsx-a11y/no-autofocus": "off",
"@typescript-eslint/no-unused-vars": [
"error"
],
"@typescript-eslint/explicit-function-return-type": [
"warn",
{
"allowExpressions": true,
"allowConciseArrowFunctionExpressionsStartingWithVoid": true,
"allowTypedFunctionExpressions": true
}
]
}
}
]
}

@ -0,0 +1,47 @@
name: deploy
on:
push:
branches:
- master
jobs:
typescript:
runs-on: ubuntu-latest
steps:
- name: Setup checkout
uses: actions/checkout@v2
- name: Setup NodeJS v12
uses: actions/setup-node@v1
with:
node-version: 12
- name: Install Dependencies
run: yarn install
- name: Check for syntax errors
run: yarn test-build
- name: ESlint check
run: yarn lint
### Uncomment this if you want Docker hub integration
# docker:
# runs-on: ubuntu-latest
# needs: typescript
# steps:
# - name: Set up QEMU
# uses: docker/setup-qemu-action@v1
# - name: Set up Docker Buildx
# uses: docker/setup-buildx-action@v1
# - name: Login to DockerHub
# uses: docker/login-action@v1
# with:
# username: ${{ secrets.DOCKERHUB_USERNAME }}
# password: ${{ secrets.DOCKERHUB_TOKEN }}
# - name: Build Dockerfile and push
# id: docker_build
# uses: docker/build-push-action@v2
# with:
# push: true
# # Replace this with your Docker hub tag and repository name.
# tags: user/repo:latest
# - name: Image digest
# run: echo ${{ steps.docker_build.outputs.digest }}

3
.gitignore vendored

@ -0,0 +1,3 @@
node_modules
.env.local
.next

@ -0,0 +1,7 @@
{
"trailingComma": "none",
"useTabs": true,
"semi": true,
"printWidth": 80,
"arrowParens": "always"
}

@ -0,0 +1,9 @@
{
"extends": [
"stylelint-config-standard",
"stylelint-config-idiomatic-order"
],
"rules": {
"indentation": "tab"
}
}

@ -0,0 +1,32 @@
FROM node:alpine AS deps
WORKDIR /app
COPY package.json yarn.lock ./
RUN yarn install --frozen-lockfile
FROM node:alpine AS builder
WORKDIR /app
COPY . .
COPY --from=deps /app/node_modules ./node_modules
ENV NEXT_TELEMETRY_DISABLED 1;
RUN yarn build && yarn install --production --ignore-scripts --prefer-offline
FROM node:alpine AS runner
WORKDIR /app
ENV NODE_ENV production
RUN addgroup -g 1001 -S nodejs
RUN adduser -S nextjs -u 1001
COPY --from=builder /app/next.config.js ./
COPY --from=builder /app/public ./public
COPY --from=builder --chown=nextjs:nodejs /app/.next ./.next
COPY --from=builder /app/node_modules ./node_modules
COPY --from=builder /app/package.json ./package.json
USER nextjs
EXPOSE 3000
CMD ["yarn", "start"]

@ -0,0 +1,8 @@
version: "3"
services:
app:
build: .
container_name: app
ports:
- 3000:3000

2
next-env.d.ts vendored

@ -0,0 +1,2 @@
/// <reference types="next" />
/// <reference types="next/types/global" />

@ -0,0 +1,7 @@
// @ts-check
/**
* @type {import('next/dist/next-server/server/config').NextConfig}
**/
module.exports = {
reactStrictMode: true,
}

@ -0,0 +1,38 @@
{
"license": "MIT",
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start",
"export": "next build && next export",
"test-build": "tsc",
"lint": "eslint src",
"stylelint": "npx stylelint **/*.scss",
"full-test": "yarn test-build && yarn lint && yarn stylelint"
},
"dependencies": {
"next": "^10.2.3",
"next-seo": "^4.24.0",
"react": "^17.0.2",
"react-dom": "^17.0.2"
},
"devDependencies": {
"@types/node": "^15.12.1",
"@types/react": "^17.0.9",
"@types/react-dom": "^17.0.6",
"@typescript-eslint/eslint-plugin": "^4.26.0",
"@typescript-eslint/parser": "^4.26.0",
"eslint": "^7.28.0",
"eslint-plugin-css-modules": "^2.11.0",
"eslint-plugin-jsx-a11y": "^6.4.1",
"eslint-plugin-prettier": "^3.4.0",
"eslint-plugin-react": "^7.24.0",
"eslint-plugin-react-hooks": "^4.2.0",
"prettier": "^2.3.1",
"sass": "^1.34.1",
"stylelint": "^13.13.1",
"stylelint-config-idiomatic-order": "^8.1.0",
"stylelint-config-standard": "^22.0.0",
"typescript": "^4.3.2"
}
}

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

@ -0,0 +1,7 @@
import styles from "./Title.module.scss";
import { FC } from "react";
const Title: FC = () => <h1 className={styles.title}>Hello World</h1>;
export default Title;

@ -0,0 +1,8 @@
import type { DefaultSeoProps } from "next-seo";
const SEO: DefaultSeoProps = {
titleTemplate: "%s | NextJS",
defaultTitle: "NextJS",
description: "This is a NextJS template."
};
export default SEO;

@ -0,0 +1,16 @@
import "@styles/globals.scss";
import SEO from "../next-seo.config";
import { DefaultSeo } from "next-seo";
import type { AppProps } from "next/app";
const App = ({ Component, pageProps }: AppProps): JSX.Element => (
<>
<DefaultSeo {...SEO} />
<Component {...pageProps} />
</>
);
export default App;

@ -0,0 +1,14 @@
import { NextSeo } from "next-seo";
import Title from "@components/Title";
import { NextPage } from "next";
const Index: NextPage = () => (
<>
<NextSeo title="Hello World" />
<Title />
</>
);
export default Index;

@ -0,0 +1,8 @@
$background-color: #222;
$text: #eee;
body {
margin: 0;
background-color: $background-color;
color: $text;
}

@ -0,0 +1,43 @@
{
"compilerOptions": {
"target": "es5",
"lib": [
"dom",
"dom.iterable",
"esnext"
],
"allowJs": true,
"skipLibCheck": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"noEmit": true,
"esModuleInterop": true,
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "preserve",
"incremental": true,
"tsBuildInfoFile": ".next/tsbuildinfo.json",
"baseUrl": "src",
"paths": {
"@styles/*": [
"styles/*"
],
"@components/*": [
"components/*"
],
"@src/*": [
"src/*"
]
}
},
"include": [
"next-env.d.ts",
"**/*.ts",
"**/*.tsx"
],
"exclude": [
"node_modules"
]
}

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save