Skip to content

Commit

Permalink
chore(#57): migrate the project to Next.js
Browse files Browse the repository at this point in the history
For now, this is a simple empty shell but with the following elements
already configured:
- CircleCI
- DevContainers
- Taskfile
  • Loading branch information
damien-carcel committed Nov 11, 2023
1 parent 1b93a0a commit dc4b2c2
Show file tree
Hide file tree
Showing 61 changed files with 3,952 additions and 10,743 deletions.
109 changes: 69 additions & 40 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,45 +1,74 @@
version: 2.1

workflows:
pull_request:
jobs:
- tests:
context:
- docker-hub-credentials
filters:
branches:
ignore:
- index
pull_request:
jobs:
- tests:
context:
- docker-hub-credentials
filters:
branches:
ignore:
- main

jobs:
tests:
docker:
- image: node:18
steps:
- checkout
- run:
name: Create Yarn cache and configuration directories and files
command: ./.devcontainer/setup.sh
- run:
name: Install the latest Task binary
command: npm install -g @go-task/cli
- restore_cache:
keys:
- yarn-{{ .Environment.CACHE_VERSION }}-{{ checksum "yarn.lock" }}
- yarn-{{ .Environment.CACHE_VERSION }}-
- run:
name: Install dependencies
command: task dependencies:install
- save_cache:
key: yarn-{{ .Environment.CACHE_VERSION }}-{{ checksum "yarn.lock" }}
paths:
- ~/.cache/yarn
- run:
name: Lint the stylesheets
command: task tests:stylelint:check
- run:
name: Check the code style
command: task tests:prettier:check
- run:
name: Lint the TS code
command: task tests:eslint:check
tests:
machine:
image: ubuntu-2204:2023.07.2
steps:
- checkout
- run:
name: Install the latest Task binary
command: npm install -g @go-task/cli
- run:
name: Pull Docker images
command: task docker:pull
- run:
name: Create cache and configuration directories for the front-end dependencies
command: task setup:yarn
- restore_cache:
keys:
- yarn-{{ .Environment.CACHE_VERSION }}-{{ checksum "yarn.lock" }}
- yarn-{{ .Environment.CACHE_VERSION }}-
- run:
name: Ensure write permissions for Docker containers
command: sudo chown -R 1000:1000 ../project ~/.yarnrc ~/.config/yarn ~/.cache/yarn ~/.cache/Cypress
- run:
name: Install dependencies
command: |
task dependencies:install
task dependencies:cypress
- save_cache:
key: yarn-{{ .Environment.CACHE_VERSION }}-{{ checksum "yarn.lock" }}
paths:
- ./node_modules
- ./.next/cache
- run:
name: Check the code style
command: task tests:check-code-style
- run:
name: Lint the stylesheets
command: task tests:lint-css
- run:
name: Lint the application code
command: task tests:lint-ts -- --format junit -o test_results/eslint.xml
- run:
name: Check the code typing
command: task tests:check-types
- run:
name: Run unit tests
environment:
JEST_JUNIT_OUTPUT_DIR: test_results
JEST_JUNIT_OUTPUT_NAME: unit.xml
command: task tests:unit-tests -- --reporters=default --reporters=jest-junit
- run:
name: Run component tests
command: task tests:component-tests-headless
- run:
name: Run end-to-end tests
command: |
task run:database
task run:migrate
task tests:e2e-tests-headless
- store_test_results:
path: test_results
3 changes: 0 additions & 3 deletions .devcontainer/Dockerfile

This file was deleted.

13 changes: 0 additions & 13 deletions .devcontainer/compose.yaml

This file was deleted.

45 changes: 22 additions & 23 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,25 +1,24 @@
{
"dockerComposeFile": ["../compose.yaml", "./compose.yaml"],
"customizations": {
"vscode": {
"extensions": [
"CircleCI.circleci",
"dbaeumer.vscode-eslint",
"eamodio.gitlens",
"esbenp.prettier-vscode",
"github.vscode-github-actions",
"ms-azuretools.vscode-docker",
"redhat.vscode-yaml",
"task.vscode-task",
"yzhang.markdown-all-in-one"
]
}
},
"initializeCommand": "./.devcontainer/setup.sh",
"name": "carcel.dev",
"postCreateCommand": "task dependencies:install",
"runServices": ["dev", "prod"],
"remoteUser": "node",
"service": "devcontainer",
"workspaceFolder": "/srv/app"
"dockerComposeFile": ["../compose.yaml"],
"customizations": {
"vscode": {
"extensions": [
"CircleCI.circleci",
"dbaeumer.vscode-eslint",
"eamodio.gitlens",
"esbenp.prettier-vscode",
"github.vscode-github-actions",
"ms-azuretools.vscode-docker",
"redhat.vscode-yaml",
"task.vscode-task",
"yzhang.markdown-all-in-one"
]
}
},
"initializeCommand": "task dependencies:install",
"name": "carcel.dev",
"runServices": ["dev", "prod"],
"remoteUser": "node",
"service": "node",
"workspaceFolder": "/srv/app"
}
12 changes: 0 additions & 12 deletions .devcontainer/setup.sh

This file was deleted.

6 changes: 4 additions & 2 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
.cache
.netlify
node_modules
public/build
.next
/netlify/
/node_modules
/public
3 changes: 1 addition & 2 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
{
"extends": ["@remix-run/eslint-config", "@remix-run/eslint-config/node"],
"root": true
"extends": ["next/core-web-vitals", "prettier"]
}
44 changes: 39 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,40 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/public/build
/.cache
/.idea
/.netlify
.env
/.pnp
.pnp.js

# testing
/coverage
/test_results

# next.js
/.next/
/out/

# production
/build

# misc
.DS_Store
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# local env files
.env*.local

# vercel
.vercel

# typescript
*.tsbuildinfo
next-env.d.ts

# cypress
/cypress/screenshots
/cypress/videos
11 changes: 11 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
.cache
.netlify
.next
/netlify
/node_modules
/public

.env
preferences.arc
sam.json
sam.yaml
5 changes: 2 additions & 3 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{
"printWidth": 120,
"singleQuote": true,
"tabWidth": 4
"printWidth": 120,
"singleQuote": true
}
6 changes: 4 additions & 2 deletions .stylelintignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
.cache
.netlify
node_modules
public/build
.next
/netlify/
/node_modules
/public
2 changes: 1 addition & 1 deletion .stylelintrc.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"extends": ["stylelint-config-standard"]
"extends": ["stylelint-config-standard", "stylelint-config-prettier"]
}
20 changes: 13 additions & 7 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
{
"editor.rulers": [120],
"files.insertFinalNewline": true,
"files.trimFinalNewlines": true,
"files.trimTrailingWhitespace": true,
"yaml.schemas": {
"https://taskfile.dev/schema.json": ["taskfiles/dependencies.yaml", "taskfiles/tests.yaml"]
}
"editor.rulers": [120],
"files.insertFinalNewline": true,
"files.trimFinalNewlines": true,
"files.trimTrailingWhitespace": true,
"yaml.schemas": {
"https://taskfile.dev/schema.json": [
"taskfiles/dependencies.yaml",
"taskfiles/docker.yaml",
"taskfiles/run.yaml",
"taskfiles/setup.yaml",
"taskfiles/tests.yaml"
]
}
}
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2020 Damien Carcel
Copyright (c) 2023 Damien Carcel

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,20 @@

## Requirements

- Docker 24.0.5 or more recent
- Docker Compose 2.20.3 or more recent
- Docker
- Docker Compose v2
- Task

## How to use it?

Open VS Code, and accept to open the project in Dev Containers when prompted.

The, the full list of actions can be accessed by running the following command in VS Code Dev Containers terminal:
The full list of actions can be accessed by running the following command in your usual terminal:

```bash
$ task
```

Optionally, if using VS Code, accept to open the project in Dev Containers when prompted.

## License

This repository is under the MIT license. See the complete license in the [LICENSE](LICENSE) file.
2 changes: 2 additions & 0 deletions TODO.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Migrate the existing pages to Next
- Run the tasks directly in Dev Containers like before
27 changes: 18 additions & 9 deletions Taskfile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,23 @@ version: '3'
silent: true

includes:
dependencies:
taskfile: ./taskfiles/dependencies.yaml
aliases: [d]
tests:
taskfile: ./taskfiles/tests.yaml
aliases: [t]
setup:
taskfile: ./taskfiles/setup.yaml
aliases: [s]
docker:
taskfile: ./taskfiles/docker.yaml
aliases: [dc]
dependencies:
taskfile: ./taskfiles/dependencies.yaml
aliases: [d]
run:
taskfile: ./taskfiles/run.yaml
aliases: [r]
tests:
taskfile: ./taskfiles/tests.yaml
aliases: [t]

tasks:
default:
cmds:
- task --list
default:
cmds:
- task --list
Loading

0 comments on commit dc4b2c2

Please sign in to comment.