Skip to content

Commit

Permalink
Merge pull request #19 from wayofdev/feat/configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
lotyp authored Jan 1, 2023
2 parents 19e9505 + c3db3d5 commit b5d63fc
Show file tree
Hide file tree
Showing 73 changed files with 4,717 additions and 884 deletions.
19 changes: 19 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
"changelog": [
"@changesets/changelog-github",
{
"repo": "wayofdev/next-starter-tpl"
}
],
"privatePackages": {
"version": true,
"tag": true
},
"commit": true,
"linked": [],
"access": "restricted",
"baseBranch": "master",
"updateInternalDependencies": "patch",
"ignore": []
}
46 changes: 46 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# All node_modules directories
node_modules/
# All secrets
**/.env
**/.env.local
**/.env.*.local
# local env files
# By default all git files
.git/
.gitignore
.gitattributes
.github/

# Tools caches
.cache/*
tsconfig.tsbuildinfo
.eslintcache

# Used when building with nextjs (next-eslint)
!.eslintrc.base.json
!.prettierignore
!.prettierrc.js
!.eslintignore

# npm
!.npmrc

# Docker related
.dockerignore
Dockerfile
docker-compose.*.yml
docker-compose.yml
docker/

# Log files
logs/
*.log
.turbo/
**/.turbo/

# Temp files
tmp/
*.tmp

# IDE related
.idea/
24 changes: 24 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,27 @@ PROJECT_SERVICES_NAMESPACE=wod
# With custom namespace provided, it will be used to prefix all services
# in Docker network for current project
COMPOSE_PROJECT_NAME=nextjs-${APP_NAME}

# Sentry Settings
NEXT_DISABLE_SENTRY=true
NEXT_SENTRY_DEBUG=false
NEXT_SENTRY_TRACING=0

# Attempts a dry run (useful for dev environments).
# Defaults to false, but may be automatically set to true in development environments
# by some framework integrations (Next.JS, possibly others).
NEXT_SENTRY_UPLOAD_DRY_RUN=true

# https://forum.sentry.io/t/dsn-private-public/6297
SENTRY_DSN=https://f44385bf9ca94ed2b1426e6d6a0275b3@o4504413512531968.ingest.sentry.io/4504413514039296

SENTRY_URL=https://sentry.io/
SENTRY_ORG=wayofdev
SENTRY_PROJECT=next-starter-tpl
SENTRY_AUTH_TOKEN=

SENTRY_LOG_LEVEL=debug

# Development variables
NEXT_IGNORE_ESLINT=false
NEXT_IGNORE_TYPE_CHECK=false
10 changes: 9 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ node_modules
.pnpm-store

# testing
coverage
coverage/

# cypress
cypress/screenshots/
Expand All @@ -21,6 +21,7 @@ cypress/videos/
out/
build/
local/
dist/

# next-sitemap
public/robots.txt
Expand Down Expand Up @@ -53,4 +54,11 @@ yarn-error.log*

# cache
.eslintcache
**/.eslintcache
.stylelintcache
.cache/*
**/tsconfig.tsbuildinfo

# override files
docker-compose.override.yml

3 changes: 3 additions & 0 deletions .gitpod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
tasks:
- init: pnpm install
command: pnpm run dev
6 changes: 6 additions & 0 deletions .ncurc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# npm-check-updates configuration used by yarn deps:check && yarn deps:update
# convenience scripts.
# @link https://github.com/raineorshine/npm-check-updates

# Add here exclusions on packages if any
reject: [ ]
2 changes: 2 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
strict-peer-dependencies=false
engine-strict=true
6 changes: 4 additions & 2 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
dist/
.next/
**/dist/**
**/.next/**
**/build/**
**/tmp/**
pnpm-lock.yaml
.changeset/*.md
2 changes: 2 additions & 0 deletions .secretlintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
**/.next
.next
10 changes: 10 additions & 0 deletions .stylelintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,14 @@ module.exports = {
extends: '@wayofdev/stylelint-config',
},
],
rules: {
'at-rule-no-unknown': [
true,
{
ignoreAtRules: ['tailwind', 'apply', 'variants', 'responsive', 'screen'],
},
],
'declaration-block-trailing-semicolon': null,
'no-descending-specificity': null,
},
}
1 change: 1 addition & 0 deletions .templatesyncignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
CHANGELOG.md
.github/workflows/codeql-analysis.yml
30 changes: 24 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,11 @@ else
endif
.PHONY: env

install:
i:
$(NPM_RUNNER) i
.PHONY: i

install: i
.PHONY: install

update:
Expand All @@ -109,14 +112,22 @@ build:
.PHONY: build

purge: down
rm -rf .pnpm-store node_modules **/node_modules pnpm-lock.yaml **/.turbo
rm -rf .pnpm-store node_modules **/node_modules pnpm-lock.yaml **/.turbo **/.next
.PHONY: purge

deps-check:
$(NPM_RUNNER) run deps:check
.PHONY: deps-check

deps-update:
$(NPM_RUNNER) run deps:update
.PHONY: deps-update


# Docker Actions
# ------------------------------------------------------------------------------------
up: ## Spin up this project using docker
$(DOCKER_COMPOSE) up --remove-orphans -d
$(DOCKER_COMPOSE) up --remove-orphans
@echo "🚀 Started and available at https://$(APP_NAME).$(PROJECT_SERVICES_NAMESPACE).docker"
.PHONY: up

Expand All @@ -139,15 +150,18 @@ logs: ## Show all project docker logs
$(DOCKER_COMPOSE) logs -f
.PHONY: logs

ssh:
ssh: ## Login into running app container
$(DOCKER_COMPOSE) run --rm -it app sh
.PHONY: ssh

recreate:
rm -rf .pnpm-store node_modules
recreate: purge ## Delete dependencies and re-create docker container
$(DOCKER_COMPOSE) build app
.PHONY: recreate

pull: ## Pull latest docker image for app container
$(DOCKER_COMPOSE) pull app
.PHONY: pull


# Testing and Code Quality
# ------------------------------------------------------------------------------------
Expand All @@ -172,6 +186,10 @@ format: ## Run prettier formatting
$(DOCKER_COMPOSE) exec -T app $(NPM_BIN) run format
.PHONY: format

sort: ## Sort package.json across project
$(DOCKER_COMPOSE) exec -T app $(NPM_BIN) run lint:package-json
.PHONY: sort


# Yaml Actions
# ------------------------------------------------------------------------------------
Expand Down
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ This turborepo uses [pnpm](https://pnpm.io) as a package manager. It includes th

This repository has some additional tools already setup for you:

- Supporting [NextJS 13.x](https://nextjs.org/blog/next-13)
- Supporting [NextJS 13.1.1+](https://nextjs.org/blog/next-13)
- [TypeScript](https://www.typescriptlang.org/) support for static type checking
- Strict Mode for TypeScript and React 18
- [ESLint](https://eslint.org/) for code linting and configured presets: NextJS Recommended, NextJS Core Web Vitals and [Airbnb Style Guide](https://www.npmjs.com/package/eslint-config-airbnb)
Expand All @@ -59,12 +59,15 @@ This repository has some additional tools already setup for you:
- [Bundler Analyzer](https://www.npmjs.com/package/@next/bundle-analyzer) — Visualize size of webpack output files with an interactive zoomable treemap
- Optimized [Lighthouse](https://web.dev/performance-scoring/) performance score
- End-2-end testing with [cypress](https://www.cypress.io/) and [JestJS](https://jestjs.io/) support for writing unit tests
- Package autoupdate in all workspace projects using [npm-check-updates](https://www.npmjs.com/package/npm-check-updates)
- Keep package.json sorted using [sort-package-json](https://www.npmjs.com/package/sort-package-json)
- Client and server side [error reporting](https://sentry.io/) supported by [@sentry/nextjs](https://www.npmjs.com/package/@sentry/nextjs)

<br>

## 📑 Requirements

- **macOS** Monterey or **Linux**
- **macOS** Monterey+ or **Linux**
- **Docker** 20.10 or newer
- [How To Install and Use Docker on Ubuntu 22.04](https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-on-ubuntu-22-04)
- **Cloned, configured and running** [docker-shared-services](https://github.com/wayofdev/docker-shared-services), to support system wide DNS, Routing and TLS support via Traefik.
Expand Down
25 changes: 12 additions & 13 deletions apps/docs/package.json
Original file line number Diff line number Diff line change
@@ -1,29 +1,28 @@
{
"name": "docs",
"version": "0.0.0",
"version": "1.0.0",
"private": true,
"scripts": {
"dev": "next dev --port 3001",
"build": "next build",
"start": "next start",
"lint": "next lint"
"dev": "next dev --port 3001",
"lint": "next lint",
"start": "next start"
},
"dependencies": {
"next": "^13.0.7",
"@wayofdev/ui": "workspace:*",
"next": "^13.1.1",
"nextra": "^2.0.2",
"nextra-theme-docs": "^2.0.2",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"ui": "workspace:*",
"nextra": "^2.0.1",
"nextra-theme-docs": "^2.0.1"
"react-dom": "^18.2.0"
},
"devDependencies": {
"@types/node": "^18.11.17",
"@types/node": "^18.11.18",
"@types/react": "^18.0.26",
"@types/react-dom": "^18.0.9",
"@types/react-dom": "^18.0.10",
"@wayofdev/browserslist-config": "^1.1.0",
"@wayofdev/eslint-config-custom": "workspace:*",
"eslint": "^8.30.0",
"eslint-config-custom": "workspace:*",
"tsconfig-config": "workspace:*",
"typescript": "^4.9.4"
}
}
27 changes: 18 additions & 9 deletions apps/docs/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,24 @@
{
"extends": "tsconfig-config/next.json",
"exclude": ["node_modules", "dist", "coverage"],
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"],
"$schema": "https://json.schemastore.org/tsconfig",
"extends": "../../tsconfig.base.json",
"exclude": [
"node_modules",
"dist",
"coverage"
],
"include": [
"next-env.d.ts",
"**/*.ts",
"**/*.tsx"
],
"compilerOptions": {
"lib": [
"dom",
"dom.iterable",
"esnext"
],
"outDir": "dist",
"baseUrl": "./",
// "paths": {
// "@/*": [
// "src/*"
// ]
// }
"moduleResolution": "node"
"module": "esnext"
}
}
2 changes: 1 addition & 1 deletion apps/web/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module.exports = {
root: true,
extends: ['custom'],
extends: ['@wayofdev/custom'],
plugins: ['import'],
parserOptions: {
project: ['tsconfig.json'],
Expand Down
2 changes: 2 additions & 0 deletions apps/web/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Sentry
.sentryclirc
6 changes: 0 additions & 6 deletions apps/web/next.config.js

This file was deleted.

Loading

0 comments on commit b5d63fc

Please sign in to comment.