Skip to content

Commit 4ab385a

Browse files
committed
Update to V4.1 + Fixes + Document migrate (it never was 😭)
1 parent a781fbc commit 4ab385a

9 files changed

Lines changed: 71 additions & 28 deletions

File tree

docs/learn/notifications.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# System notifications
2+
3+
By default, `clean`, `migrate`, and `kickstart`, which are considered features that _can_ take a long time, will send a system UI notification if they _do_ take long. Unless you're on DND it should sound - which is the point of it. They're sent so you can safely move away from the terminal and know when we're done, so you can get back to whatever's next as soon as possible.
4+
5+
These notifications are fired if the running task took more than 30 seconds to complete. This threshold can be disabled, so they're shown even if it takes 1 second. In future versions you'll be able to customize the threshold.
6+
7+
Notifications are enabled by default, but can be disabled if you don't like them.
8+
9+
!!! warning Support for Linux
10+
On Linux, it's assumed that `notify-send` is installed. If not, notifications simply won't be sent, without a warning.

docs/manual/build.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ There's nothing more to configure. It's a relatively simple automation.
4040

4141
### What to expect
4242

43-
Progress with all commands will be printed step by step.
43+
Progress with all commands will be printed step by step. Note that output is not shown live, it gets printed all at once the moment the command finishes execution.
4444

4545
```bash
4646
✔ There we go, time to build <project name here>

docs/manual/configuration.md

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -107,35 +107,39 @@ As most apps, we offer settings you can tweak. We use default values that should
107107

108108
Currently supported settings are the following them. Change them with `settings change <KEY> <value>`
109109

110-
| KEY | Value Type | Description | Notes |
111-
| :--- | ---: | :--- | ---: |
112-
| `defaultIntensity` | `normal`, `hard`, `hard-only`, `maxim`, or `maxim-only` | Changes the default intensity for the `clean` command. | / |
113-
| `updateFreq` | A fixed number | Changes how frequently (in DAYS) the CLI sends an HTTP request for updates. | We recommend setting it to a high value as we don't frequently update, so you can save up those HTTP requests. |
114-
| `flushFreq` | A fixed number | Changes how frequently (in DAYS) the CLI removes the `.log` file to save up space. | Cannot be disabled, setting it to `0` will make it auto-flush each time. |
115-
| `favEditor` | `vscode`, `sublime`, `emacs`, `atom`, `vscodium`, `notepad++` | Your favorite code editor. Used by `kickstart`. | / |
110+
| KEY | Value Type | Description |
111+
| :--- | :--- | ---: |
112+
| `defaultIntensity` | `normal`, `hard`, `hard-only`, `maxim`, or `maxim-only` | Changes the default intensity for the `clean` command. |
113+
| `updateFreq` | A fixed number | Changes how frequently (in DAYS) the CLI sends an HTTP request for updates. We recommend setting it to a high value as we don't frequently update. |
114+
| `flushFreq` | A fixed number | Changes how frequently (in DAYS) the CLI removes the `.log` file to save up space. Cannot be disabled, setting it to `0` will make it auto-flush each time. |
115+
| `favEditor` | `vscode`, `sublime`, `emacs`, `atom`, `vscodium`, `notepad++` | Your favorite code editor. Used by `kickstart` and `launch`. |
116+
| `showNotifications` | `true`, `false` | Whether to [use system notifications](../learn/notifications.md). Highly recommended |
117+
| `thresholdNotifications` | `true`, `false` | Enabled by default, makes system notifications only fire up if the task to be notified about takes less than 30 seconds. |
116118

117119
### View current settings
118120

119121
To view your current settings, run `fuckingnode settings` with no args. You should see something like this:
120122

121-
```bash
123+
```txt
122124
💡 Your current settings are:
123125
---
124-
Update frequency: Each 69 days. updateFreq
125-
Default cleaner intensity: hard. defaultIntensity
126-
Favorite editor: vscodium. favEditor
127-
Auto-flush log file frequency: Each 13 days. flushFreq
126+
Check for updates | Every 5 days. updateFreq
127+
Default cleaner intensity | normal. defaultIntensity
128+
Favorite code editor | vscode. favEditor
129+
Auto-flush log file | Every 14 days. flushFreq
130+
Send system notifications | Enabled. showNotifications
131+
Threshold notifications (30") | Disabled. thresholdNotifications
128132
```
129133

130-
As you can see, you're shown at the end the key used to change a setting.
134+
As you can see, you're shown at the end the key used to change a setting (it appears _italic_ in your terminal, if supported).
131135

132136
### Change settings
133137

134-
To change them, execute `fuckingnode settings change (SETTING) (VALUE)`, for example:
138+
To change them, execute `fuckingnode settings change (KEY) (VALUE)`, for example:
135139

136140
```bash
137-
fuckingnode settings change default-int "hard"
138-
fuckingnode settings change update-freq 15
141+
fuckingnode settings change defaultIntensity "hard"
142+
fuckingnode settings change updateFreq 15
139143
```
140144

141145
### Additional settings commands

docs/manual/index.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,10 @@ These are links to individual pages. For the full manual, click the first one, t
1212
- [Individual project config (fknode.yaml)](fknode-yaml.md)
1313
- [Feature - Kickstart](kickstart.md)
1414
- [Feature - Commit](commit.md)
15+
- [Feature - Build](build.md)
1516
- [Feature - Release](release.md)
1617
- [Feature - Launch](launch.md)
18+
- [Feature - Migrate](migrate.md)
1719
- [Feature - Setup](setup.md)
1820
- [Feature - Stats](stats.md)
1921
- [Feature - Surrender](surrender.md)

docs/manual/kickstart.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ The `kickstart` command is an extra command that increases your productivity by
99
- Launches your favorite code editor (as defined by your user settings).
1010
- Adds the project to the FuckingNode list.
1111

12+
Plus, **if it takes long, you'll receive a [system notification](../learn/notifications.md) once done,** so if it's a large repo you can just switch tabs and focus on something else, and get notified once ready so you can get to coding.
13+
1214
## Usage
1315

1416
Just run the following:

docs/manual/launch.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Using FuckingNode: Launch a project
22

3-
> `fuckingnode launcher <project>`, or `fklaunch <project>`
3+
> `fuckingnode launch <project>`, or `fklaunch <project>`
44
55
The `launch` command is a command that automatically launches your favorite editor with a project open, and automatically runs a "launch task", e.g. `npm run start`. It can also auto-update your dependencies on launch. It can take a project's name from the `package.json` / `deno.json` / `Cargo.toml`, so it's as simple as doing `fklaunch my-project`.
66

@@ -20,4 +20,4 @@ By default it just launches your favorite editor with your project opened. For u
2020

2121
You've now learnt how to speed up launching your projects.
2222

23-
Next: Setup - How to quickly get text-config files ready.
23+
Next: Migrate - How to escape npm.

docs/manual/migrate.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Using FuckingNode: Migrate a project
2+
3+
> `fuckingnode migrate <project> <target>`, or `fklaunch <project> <target>`
4+
5+
The `migrate` command automatically migrates your project from one JS stack to another. For example, from npm to Bun, or from npm to pnpm, or from npm to anything better.
6+
7+
It doesn't do any migration _per se_, it relies on package managers knowing how to manage that (which is usually the case). Its purpose is to automate the process, since a migration involves several steps (updating lockfiles, removing node_modules, installing, removing old lockfile...).
8+
9+
As this can take time, **if it takes long, you'll receive a [system notification](../learn/notifications.md) once done,** so you can just switch tabs and focus on something else, and get notified once ready so you can get back to coding.
10+
11+
## Usage
12+
13+
Just run the following:
14+
15+
```bash
16+
fuckingnode migrate <TARGET> <PROJECT>
17+
```
18+
19+
`TARGET` is the target package manager (the one to migrate to), can be either npm or pnpm or yarn or deno or bun. `PROJECT` is optional, specifies what project to be migrated, if not provided the CWD is used.
20+
21+
We'll tell you step by step what are we doing. Previous lockfile will be copied to a `.bak` file.
22+
23+
---
24+
25+
You've now learnt how to escape npm.
26+
27+
Next: Setup - How to quickly get text-config files ready.

docs/manual/usage.md

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,13 @@ The core idea of FuckingNode is to automate cleanup of your NodeJS projects. On
1111
The `fuckingnode clean` command is the base utility of the app. It accepts the following (all optional) arguments:
1212

1313
```bash
14-
fuckingnode clean <PROJECT | --> <INTENSITY | --> [--update] [--lint] [--pretty] [--destroy] [--verbose] [--commit]
14+
fuckingnode clean <PROJECT | --> <INTENSITY | --> [--update] [--lint] [--pretty] [--destroy] [--commit]
1515
```
1616

1717
When executed with no arguments, it'll do a cleanup using the default intensity (which is `normal` and can be changed from the [settings](configuration.md#settings)) across all of your projects.
1818

19+
It'll iterate through all of your projects and clean them, showing status updates one by one in the terminal. Once it ends, a report is shown, telling how much time did it take us to clean each individual project. **You'll receive a [system notification](../learn/notifications.md) once done,** so you can switch tabs and focus on something else - you'll know when to come back.
20+
1921
## Cleaner intensities, explained
2022

2123
There are five (well, three in reality) intensities available:
@@ -133,7 +135,7 @@ Some of these features depend on `fknode.yaml` configuration, [as noted above](#
133135

134136
!!! info "About errors"
135137

136-
Any error from additional tasks will fail silently; this means they won't stop the execution flow and no logs will be made. However, since the CLI shows command output live, errors will likely be shown in there.
138+
Any error from additional tasks will fail silently; this means they won't stop the execution flow and no logs will be made. Error logs are dumped into a log file; you're shown the path whenever an error of this kind happens.
137139

138140
### Linting your code: `--lint`
139141

@@ -239,12 +241,6 @@ To override it, do the same as with the linter and prettifier, but setting the `
239241
updateCmdOverride: "update"
240242
```
241243

242-
## Additional info
243-
244-
### Show additional info during cleanup
245-
246-
There's a `--verbose` flag that can be passed to `fuckingnode clean`. It'll show the real output of all commands that are being executed, begin and end timestamps for the cleanup process, plus a report showing how much time did it take us to clean each individual project.
247-
248244
---
249245

250246
You've now learnt how to use the base cleaner.

mkdocs.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ nav:
2727
- Feature - Build: "manual/build.md"
2828
- Feature - Release: "manual/release.md"
2929
- Feature - Launch: "manual/launch.md"
30+
- Feature - Migrate: "manual/migrate.md"
3031
- Feature - Setup: "manual/setup.md"
3132
- Feature - Stats: "manual/stats.md"
3233
- Feature - Surrender: "manual/surrender.md"
@@ -37,8 +38,9 @@ nav:
3738
- Learn: "learn/index.md"
3839
- Cross-runtime support: "learn/cross-runtime-support.md"
3940
- Error codes: "learn/errors.md"
40-
- How does cleanup work under the hood: "learn/clean.md"
41-
- How does audit work under the hood: "learn/audit.md"
41+
- System notifications: "learn/notifications.md"
42+
- How cleanup works under the hood: "learn/clean.md"
43+
- How audit works under the hood: "learn/audit.md"
4244

4345
- Roadmap: "about/roadmap.md"
4446
- Brand guidelines: "about/branding.md"

0 commit comments

Comments
 (0)