Skip to content

Commit 9ad17c8

Browse files
committed
Update docs for V4
1 parent 3f78b3a commit 9ad17c8

23 files changed

Lines changed: 429 additions & 86 deletions

.vscode/settings.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,27 @@
77
"crossruntime",
88
"fkadd",
99
"fkaudit",
10+
"fkbuild",
1011
"fkclean",
1112
"fkcommit",
1213
"fklaunch",
1314
"fklist",
15+
"fkmigrate",
1416
"fknode",
1517
"fkrelease",
1618
"fkrem",
1719
"fksetup",
1820
"fkstart",
21+
"fkstats",
1922
"fksurrender",
2023
"fontawesome",
2124
"fuckingnode",
2225
"gigachad",
2326
"gluefix",
2427
"googlecloudstorage",
2528
"HKCU",
29+
"kickstarting",
30+
"konbini",
2631
"linenums",
2732
"lockfiles",
2833
"personaplus",

docs/about/roadmap.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,21 @@ We'll expand (and rarely, but not impossibly, shrink) this roadmap as we make pr
88

99
This page also lists all minor and major releases since 2.X. Patches aren't listed, and most bugfixes aren't included (as we don't "plan" to fix bugs).
1010

11-
## Upcoming major release
11+
## 4.X
1212

13-
These are early plans; however we're already working on 4.0 [from this branch](https://github.com/FuckingNode/FuckingNode/tree/v4). Expect this list to change over time and/or get removals.
13+
### Version 4.0 (Released)
1414

15-
- [ ] New features
16-
- [ ] `build`, to automate building. Especially useful in JavaScript. This would have a text-config file to define what tasks to run for building a project. It could be used in combination with `release`.
15+
- [x] New features
16+
- [x] `build`, to automate building. Especially useful in JavaScript. This would have a text-config file to define what tasks to run for building a project. It could be used in combination with `release`.
1717
- [x] `release` support for Cargo.
18-
- [ ] Dual release support: using the `FnCPF` from the interop layer to allow publishing the same JavaScript package to both npm and jsr. This would be really helpful as jsr downloads do not always work well with npm projects.
18+
- [ ] Dual release support: using the `FnCPF` from the interop layer to allow publishing the same JavaScript package to both npm and jsr. This would be really helpful as jsr downloads do not always work well with npm projects. (_Not done, rescheduled for v4.1_)
1919
- [x] Rebuild `commit`, so you tell it what files to commit and it:
2020
- [x] Un-stages anything else to avoid committing randomly staged files.
2121
- [x] Doesn't require you to stage the files _before_ (making it useless, as `git commit -a -m` is also just one command), and lets you stage files from the own command.
2222
- [x] Runs pre-commit tasks _before_ staging, making them actually useful.
2323
- [X] Allow for DIR-based running; in simpler terms, compute things like `fkn stats` to `fkn stats --self` or `fkadd` to `fkadd --self`, so the `--self` flag isn't necessary (except for commands like `fkclean` where it does make sense to have it).
2424
- [X] Add Bun support for `audit`.
25+
- [x] Support glob patterns for adding projects.
2526

2627
---
2728

docs/about/social.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333

3434
---
3535

36-
This isn't really _our own YouTube_, it's the creator's personal channel and has unrelated stuff. Still, major release trailers will be here (and a trailer for V3 is work in progress).
36+
The creator's personal channel*. Major release trailers will be here. (\*as such, unrelated stuff also hangs in there).
3737

3838
[:octicons-arrow-right-24: Watch us](https://youtube.com/watch?v=_lppvGYUXNk)
3939

docs/install.ps1

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
$ErrorActionPreference = "Stop"
22

3+
# todo: check usage of Write-Host (just prints) and Write-Output (prints and is considered readable output)
4+
35
# Constants
46
$APP_NAME = @{
5-
CASED = "FuckingNode"
6-
CLI = "fuckingnode"
7+
CASED = "FuckingNode"
8+
CLI = "fuckingnode"
79
}
810
$installDir = "C:\$($APP_NAME.CASED)"
911
$exePath = Join-Path -Path $installDir -ChildPath "$($APP_NAME.CLI).exe"
@@ -62,12 +64,16 @@ Function New-Shortcuts {
6264
"fkstart" = "kickstart"
6365
"fklaunch" = "launch"
6466
"fkcommit" = "commit"
67+
"fkbuild" = "build"
6568
"fkrelease" = "release"
6669
"fksurrender" = "surrender"
67-
"fkadd" = "manager add"
68-
"fkrem" = "manager remove"
69-
"fklist" = "manager list"
70+
"fkadd" = "add"
71+
"fkrem" = "remove"
72+
"fklist" = "list"
7073
"fkaudit" = "audit"
74+
"fkstats" = "stats"
75+
"fksetup" = "setup"
76+
"fkmigrate" = "migrate"
7177
}
7278

7379
foreach ($name in $commands.Keys) {
@@ -195,7 +201,18 @@ Function Installer {
195201
$url = Get-LatestReleaseUrl
196202
Install-App -url $url
197203
Add-AppToPath
198-
New-Shortcuts
204+
Write-Output "You may have seen our documentation mention shortcuts like 'fknode', 'fkn', 'fkclean'..."
205+
Write-Output "These are made by creating a bunch of scripts (fknode.bat, fkn.bat...) next to the main installation."
206+
Write-Output "We highly recommend them, but JUST IN CASE they conflicted with any other local command, we let you choose."
207+
208+
$response = Read-Host "Do you wish to create these shortcuts? [Y/N]"
209+
210+
if ($response -match '^[Yy]$') {
211+
New-Shortcuts
212+
}
213+
else {
214+
Write-Output "Okay, we WON'T create shortcuts. Beware, as documentation and help menus might still use them to refer to commands."
215+
}
199216
Write-Host "Installed successfully! Restart your terminal for it to work."
200217
}
201218
catch {

docs/install.sh

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,12 +99,16 @@ create_shortcuts() {
9999
["fkstart"]="kickstart"
100100
["fklaunch"]="launch"
101101
["fkcommit"]="commit"
102+
["fkbuild"]="build"
102103
["fkrelease"]="release"
103104
["fksurrender"]="surrender"
104-
["fkadd"]="manager add"
105-
["fkrem"]="manager remove"
106-
["fklist"]="manager list"
105+
["fkadd"]="add"
106+
["fkrem"]="remove"
107+
["fklist"]="list"
107108
["fkaudit"]="audit"
109+
["fkstats"]="stats"
110+
["fksetup"]="setup"
111+
["fkmigrate"]="migrate"
108112
)
109113

110114
for name in "${!commands[@]}"; do
@@ -167,7 +171,17 @@ installer() {
167171
echo "Please note we'll use sudo a lot (many files to be created)"
168172
echo "They're all found at $INSTALL_DIR."
169173
install_app
170-
create_shortcuts
174+
echo "You may have seen our documentation mention shortcuts like 'fknode', 'fkn', 'fkclean'..."
175+
echo "These are made by creating a bunch of scripts (fknode.sh, fkn.sh...) next to the main installation."
176+
echo "We highly recommend them, but JUST IN CASE they conflicted with any other local command, we let you choose."
177+
178+
read -p "Do you wish to create these shortcuts? [Y/N] " response
179+
180+
if [[ "$response" =~ ^[Yy]$ ]]; then
181+
create_shortcuts
182+
else
183+
echo "Okay, we WON'T create shortcuts. Beware, as documentation and help menus might still use them to refer to commands."
184+
fi
171185
add_app_to_path
172186
echo "Installed successfully! Restart your terminal for it to work."
173187
}

docs/learn/audit.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ Where `EXP` indicates only experimental support, and `YES` and `NO` indicate the
122122

123123
| Support | NodeJS npm | NodeJS pnpm | NodeJS yarn | Deno | Bun | Go | Cargo |
124124
| :--------- | ---------- | ----------- | ----------- | ---- | --- | -- | ----- |
125+
| **v4.0.0** | YES | YES | YES | NO | YES | NO | NO |
125126
| v3.3.0 | YES | YES | YES | NO | NO | NO | NO |
126127
| v3.0.0 | EXP | EXP | EXP | NO | NO | NO | NO |
127128
| v2.1.0 | EXP | NO | NO | NO | NO | NO | NO |

docs/learn/clean.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ This workflow can be simplified into the following:
4444
graph TD
4545
A["fkadd ../project1"]
4646
B["fkadd ../project2"]
47-
C["fkadd /home/me/work/some-app"]
47+
C["fkadd /home/Zaka/Code/some-app"]
4848
4949
D["fkclean -- -- -u -l -d -p -"]
5050
@@ -65,7 +65,7 @@ We reduce your workflow to a one-time bunch of commands for initial setup, and t
6565

6666
### Finding your projects
6767

68-
You need to manually add a project, via the `fuckingnode manager add` command. When you add a project, it's stored in either:
68+
You need to manually add a project, via the `fuckingnode add` command. When you add a project, it's stored in either:
6969

7070
- `C:\Users\YOUR_USER\AppData\Roaming\FuckingNode\` on :fontawesome-brands-windows: Windows
7171
- `/home/.config/FuckingNode/` on :simple-apple: macOS and :simple-linux: Linux
@@ -75,9 +75,9 @@ Concretely, a plain `.txt` file called `fuckingnode-motherfuckers.txt` is used t
7575
For example:
7676

7777
```txt title="fuckingnode-motherfuckers.txt" linenums="1"
78-
C:\Users\JohnDoe\projects\Sokora
79-
C:\Users\JohnDoe\projects\Vuelto
80-
C:\Users\JohnDoe\projects\another-project-ig
78+
C:\Users\Zaka\projects\Sokora
79+
C:\Users\Zaka\projects\Vuelto
80+
C:\Users\Zaka\projects\FuckingNode
8181
```
8282

8383
Whenever you run the `fuckingnode clean` command, first thing we do is reading this file.
@@ -90,7 +90,7 @@ Cleaning a project involves the following steps:
9090
graph TD
9191
CLI["fuckingnode clean [...flags]"]
9292
93-
CLI -->|chdir into| A["C:\Users\JohnDoe\projects\Sokora"]
93+
CLI -->|chdir into| A["C:\Users\Zaka\projects\Sokora"]
9494
9595
A -->|Validates| B["Is it valid?"]
9696
B -->|No| Skip
@@ -103,7 +103,7 @@ graph TD
103103
D --> G
104104
H --> G
105105
G["Repeat"]
106-
G -->|chdir into| I["C:\Users\JohnDoe\AnotherProject"]
106+
G -->|chdir into| I["C:\Users\Zaka\projects\AnotherProject"]
107107
I -->|Validates| B
108108
```
109109

@@ -131,7 +131,7 @@ Where `EXP` indicates experimental, `CAVEAT` indicates partial support / support
131131

132132
| Support | NodeJS npm | NodeJS pnpm | NodeJS yarn | Deno | Bun | Go | Cargo |
133133
| :--------- | ---------- | ----------- | ----------- | ------ | ------ | ------ | ------ |
134-
| **v3.0.0** | YES | YES | YES | CAVEAT | CAVEAT | CAVEAT | CAVEAT |
134+
| **v4.0.0** | YES | YES | YES | CAVEAT | CAVEAT | CAVEAT | CAVEAT |
135135
| v2.0.0 | YES | YES | YES | CAVEAT | CAVEAT | NO | NO |
136136
| v1.0.0 | YES | YES | YES | NO | NO | NO | NO |
137137

docs/learn/cross-runtime-support.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,18 @@
77

88
While FuckingNode can be a very powerful automation tool if properly used, in the end it's just an executable that _automates_ tasks; it doesn't do much on its own. Thus, **features that aren't supported by a runtime itself, won't work with us**. (Adding "polyfills" or "glue fixes" is not discarded as an idea, but not planned short-term anyway).
99

10-
You can run `compat` anytime from the CLI to see a table showing what works and what doesn't. **NodeJS is the only environment with 100% platform support.** As of version 3.3.1, that table looks like this:
10+
You can run `compat` anytime from the CLI to see a table showing what works and what doesn't. **NodeJS is the only environment with 100% platform support.** As of version 4.0.0, that table looks like this:
1111

1212
| Feature | NodeJS | Deno | Bun | Go | Cargo |
1313
|------------|--------|----------|----------|----------|----------|
1414
| Cleanup | Yes | Partial | Partial | Partial | Partial |
1515
| Kickstart | Yes | Yes | Yes | Yes | Yes |
1616
| Commit | Yes | Yes | Yes | Partial | Partial |
17-
| Release | npm | jsr | npm | No | No |
17+
| Release | npm | jsr | npm | No | Yes |
1818
| Stats | Yes | Yes | Yes | Partial | Yes |
1919
| Surrender | Yes | Yes | Yes | Yes | Yes |
2020
| Setup | Yes | Yes | Yes | Yes | Yes |
21-
| Audit | Yes | No | No | No | No |
21+
| Audit | Yes | No | Yes | No | No |
2222
| Launch | Yes | Yes | Yes | Yes | Yes |
2323

2424
Reasons for not supporting a feature are the following.
@@ -33,9 +33,9 @@ In all these runtimes, the kind of cleanup commands we'd use (`prune`, `dedupe`.
3333

3434
FuckingNode itself is written in Deno, thus we're disallowed by the runtime from cleaning its cache. While a "gluefix" exists, it doesn't work most of the time.
3535

36-
## No Cargo & Go support for release
36+
## No Golang support for release
3737

38-
We might add them in the future, for now they're not supported because they're harder to implement (as more steps are required).
38+
We might add it in the future, for now it's not supported because it're harder to implement (as more steps are required).
3939

4040
## Partial Cargo & Go support for commit
4141

@@ -49,6 +49,6 @@ Golang _do_ support it but doesn't support the Recommended Community Standards p
4949

5050
There's a single package manager for these platforms, `migrate` is useless.
5151

52-
## No audit support anywhere non NodeJS
52+
## No audit support for Deno, Cargo, or Go
5353

54-
Deno and Bun do not offer an `audit` command, neither do Go nor Cargo.
54+
Neither Deno, nor Golang, nor Cargo, offer an `audit` command.

docs/manual/build.md

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
# Using FuckingNode: Automate builds
2+
3+
> `fuckingnode build <project>`, or `fkbuild <project>`
4+
5+
The `build` command in FuckingNode allows you to run all the commands of your project's building / compilation process (which are usually several) from a single command. It'll show progress, and halt execution if any command fails. It makes your workflow slightly faster since it's just one command that you have to run.
6+
7+
## Usage
8+
9+
To build your project, first define all the commands that should run in your `fknode.yaml` by setting the `buildCmd` key. This uses a "peculiar" notation; it's a single string where commands are separated by the `^` character:
10+
11+
```yaml
12+
# imagine a 3 step build process:
13+
# some prerelease code, then locally building your project, then deploying it
14+
buildCmd: "node prerelease.js^npm run build^cd dist^vercel --prod"
15+
```
16+
17+
The above example would result in this:
18+
19+
```bash
20+
node prerelease.js
21+
npm run build
22+
cd dist
23+
vercel --prod
24+
```
25+
26+
Once defined, just run `build` and it'll build the project in the current working directory. You can also explicitly specify a path.
27+
28+
```bash
29+
fuckingnode build # builds here
30+
fuckingnode build ./projects/some-project # builds there
31+
```
32+
33+
---
34+
35+
A cool thing is that you can link it to `release` (feature explained in the [next page](./release.md)), by setting `buildForRelease` to `true` in your `fknode.yaml` (see [fknode.yaml](./fknode-yaml.md#buildforrelease)). If set, these commands will auto run whenever you run the `release` command, so we automatically build your project before releasing it.
36+
37+
---
38+
39+
There's nothing more to configure. It's a relatively simple automation.
40+
41+
### What to expect
42+
43+
Progress with all commands will be printed step by step.
44+
45+
```bash
46+
✔ There we go, time to build <project name here>
47+
Running command 1/5
48+
*output of 1st command*
49+
Done!
50+
Running command 2/5
51+
*output of 2nd command*
52+
Done!
53+
(...)
54+
Running command 5/5
55+
*output of 5th command*
56+
Done!
57+
✅ That worked out! Your project should be built now.
58+
```
59+
60+
If an error happened, it'd show it and stop execution.
61+
62+
And that's pretty much it.
63+
64+
---
65+
66+
You've now learnt how to speed up project builds.
67+
68+
Next: Release - How to speed up project releases.

docs/manual/commit.md

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,16 @@ The `commit` command in FuckingNode allows you to run maintenance tasks and any
99
To commit changes to your project, use the following command:
1010

1111
```bash
12-
fuckingnode commit <message> [branch] [--push]
12+
fuckingnode commit <message> <files> [--branch branch] [--push] [--keep-staged] [--yes]
1313
```
1414

15-
`message` is obvious and mandatory, `branch` is optional is the branch to commit to. If not given, the branch you were currently on will be used. `--push` is optional too, and if passed, the commit will be pushed to the remote repository.
15+
`message` and `files` are obvious and mandatory. Anything after the message (which must be quoted) is considered a file until a `--`flag appears. All flags are optional.
16+
17+
Flag `--branch [branch-name]` indicates the branch to commit to. If not given, the branch you're currently on will be used. `--push` can be passed to push the commit to the remote repository. `--keep-staged` can be passed to include files you had in the stage area before running this command (if not passed, the default behavior is to unstage all files, then stage the ones you provide to the command).
1618

1719
### Configuring the task to be executed
1820

19-
As said, you can add a task (for example your test suite) and have it run before committing. The commit will only be made if this task succeeds (exits with code 0). Specify the task by setting the `commitCmd` key in your `fknode.yaml` to a script to be executed (see [fknode.yaml docs](fknode-yaml.md)).
21+
As said, you can add a task (e.g., your test suite) and have it run before committing. The commit will only be made if this task succeeds (exits with code 0). Specify the task by setting the `commitCmd` key in your `fknode.yaml` to a script to be executed (see [fknode.yaml docs](fknode-yaml.md)).
2022

2123
```yaml
2224
commitCmd: "test" # "npm run test" / "deno task test" / ...
@@ -29,17 +31,20 @@ If absent, no custom task will be executed.
2931
You'll see a confirmation like this one, showing what will be made:
3032
3133
```txt
32-
🚨 Heads up! We're about to take the following actions:
33-
Run deno task test
34-
If everything above went alright, commit 0 file(s) to branch v3 with message "test"
34+
✅ Staged all files for commit (4).
35+
❓ Heads up! We're about to take the following actions:
36+
37+
Run deno task precommit
38+
If everything above went alright, commit 4 files to branch v4 with message "minor fixes"
39+
40+
- all of this at @zakahacecosas/fuckingnode@4.0.0 C:\Users\Zaka\projects\FuckingNode
3541

36-
- all of this at @zakahacecosas/fuckingnode@3.2.0 C:\Users\Zaka\FuckingNode
3742
Confirm? [y/N]
3843
```
3944

4045
If you input `y`, all tasks will run, and unless they fail, a commit will be made (and pushed if enabled, which would have shown up in the shown above list).
4146

42-
No files are added to Git, so just as you would normally do, run `git add (whatever)` before running our commit command.
47+
You can also run the command with the `--yes` flag to skip this - though we don't really recommend it.
4348

4449
---
4550

0 commit comments

Comments
 (0)