Skip to content

Commit 4fe8275

Browse files
authored
Implement mobile view, toolbar and information page (#12)
* Fix sizing issues and mobile view * Fix pre-commit linting * Increase max width slightly * cat lipsum * temporary info content * temporary info content * Run eslint before prettier * Finish toolbar styling * Finish about page with readme and highlights * Fix styling
1 parent 8ff65a1 commit 4fe8275

37 files changed

+1162
-303
lines changed

README.md

Lines changed: 41 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
# Taskfile ([TaskfileGenerator.com](https://taskfilegenerator.com))
1+
# Taskfile ([taskfile.sh](https://taskfile.sh))
22

33
A `./Taskfile` is a task runner in plain and easy [Bash](https://nl.wikipedia.org/wiki/Bash). It adds a list of
44
available tasks to your project.
55

6-
Generate your own Taskfile at [TaskfileGenerator.com](https://taskfilegenerator.com).
6+
Generate your own Taskfile at [taskfile.sh](https://taskfile.sh).
77

8-
[![CLI Taskfile preview](./images/cli-preview.gif)](https://taskfilegenerator.com)
8+
[![CLI Taskfile preview](public/cli-preview.gif)](https://taskfile.sh)
99

1010
## Why
1111

@@ -16,6 +16,44 @@ Generate your own Taskfile at [TaskfileGenerator.com](https://taskfilegenerator.
1616
- Easy to understand and maintain
1717
- Automatically generated list of available task
1818

19+
## How does it work?
20+
21+
Taskfiles are simple bash scripts, but an easy-to-read function format. There are some things that we need to explain
22+
for our Taskfile setup.
23+
24+
### Tasks
25+
26+
A task is defined by creating a function that starts with `task:`. This defines a task that can be triggered by running
27+
the `./Taskfile`. Right next to the task, you should add a task definition with two hashes. This will let the
28+
`task:help` function know that you're writing the task function definition. So an example task will look like the
29+
following:
30+
31+
```shell
32+
function task:example { ## Show some example text
33+
title "Example"
34+
echo "This is an example task."
35+
}
36+
```
37+
38+
In a task you can call other functions, and run all tooling you desire. Now running `./Taskfile example` will execute
39+
the new task.
40+
41+
### Sections
42+
43+
To group multiple tasks, sections can be created in your Taskfile. A section is created by creating a comment line with
44+
a double hashtag like so:
45+
46+
```shell
47+
## Project section
48+
```
49+
50+
Lines with only a single `#` will not appear as section in `task:help` and can be seen as plain comments.
51+
52+
### Help command
53+
54+
Running `./Taskfile help`, the `task:help` function is triggered. This task will list all available sections and tasks
55+
using the double `##` comments you've learned about above. Now it's clear how you can run any other task!
56+
1957
## Credits
2058

2159
This Taskfile setup is based on [Adrian Cooney's Taskfile](https://github.com/adriancooney/Taskfile) and is widely

Taskfile

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ function project:checkout-pr {
3939
then
4040
echo "You need to provide a pull request number to check out."
4141
echo -e "${BLUE}Usage:${RESET} $0 pr ${YELLOW}<number>${RESET}"
42-
exit 422
42+
exit 1
4343
fi
4444
echo "Checking out pull request $1..."
4545
git fetch origin refs/pull/$1/head:refs/remotes/origin/pr/$1
@@ -100,8 +100,8 @@ function task:typescript { ## Check typescript types
100100
# =========================================================
101101

102102
function task:pre-commit { ## Clean up code before committing
103-
task:prettier
104103
task:eslint
104+
task:prettier
105105
task:typescript
106106
title "Committing"
107107
}
@@ -135,15 +135,10 @@ function task:help { ## Show all available tasks
135135

136136
function task:shorthand { ## Create CLI shorthand task instead of ./Taskfile
137137
title "Creating task shorthand"
138-
if [ -f /usr/local/bin/task ]
139-
then
140-
echo "/usr/local/bin/task already exists."
141-
else
142-
echo -e "You are about to create /usr/local/bin/task that requires root permission..."
143-
sudo curl --location --silent --output /usr/local/bin/task https://enri.se/taskfile-bin
144-
sudo chmod +x /usr/local/bin/task
145-
fi
146-
echo -e "${BLUE}You can now use:${RESET} task ${YELLOW}<task>${RESET} <args>"
138+
echo -e "You're about to create ${YELLOW}/usr/local/bin/task${RESET} that requires ${RED}root${RESET} permission..."
139+
sudo curl --location --silent --output /usr/local/bin/task https://enri.se/taskfile-bin
140+
sudo chmod +x /usr/local/bin/task
141+
echo -e "${BLUE}You can now use:${RESET} task ${YELLOW}<task>${RESET} <arguments>"
147142
}
148143

149144
banner

dev/linting/lint-staged.config.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ const config = {
88
// Frontend specific
99
// ==============================
1010
'*.{ts,tsx}': [
11-
// tsc runs for all files instead of only the edited ones
12-
() => 'tsc --noEmit --project . --pretty',
1311
'eslint --config dev/linting/eslint.config.mjs',
1412
prettier,
13+
// tsc runs for all files instead of only the edited ones
14+
() => 'tsc --noEmit --project . --pretty',
1515
],
1616

1717
// ==============================

next.config.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,19 @@
11
import type { NextConfig } from 'next';
2+
import path from 'path';
23

34
const nextConfig: NextConfig = {
45
output: 'export',
56
webpack: (config) => {
67
config.module.rules.push({
7-
test: /\.(txt|sh)$/i,
8+
test: /\.(txt|sh|md)$/i,
89
use: 'raw-loader',
910
});
1011

1112
return config;
1213
},
14+
sassOptions: {
15+
includePaths: [path.join(__dirname, 'src/style')],
16+
},
1317
};
1418

1519
export default nextConfig;

0 commit comments

Comments
 (0)