Skip to content

Commit ffa0d2c

Browse files
committed
Update scripts and docs to no longer use aliases
1 parent 73eed1e commit ffa0d2c

26 files changed

Lines changed: 159 additions & 273 deletions

.vscode/settings.json

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,7 @@
77
"codeberg",
88
"crossplatform",
99
"crossruntime",
10-
"fkadd",
11-
"fkaudit",
12-
"fkbuild",
13-
"fkclean",
14-
"fkcommit",
15-
"fklaunch",
16-
"fklist",
17-
"fkmigrate",
1810
"fknode",
19-
"fkrelease",
20-
"fkrem",
21-
"fksetup",
22-
"fkstart",
23-
"fkstats",
24-
"fksurrender",
25-
"fkuncommit",
2611
"fontawesome",
2712
"framagit",
2813
"fuckingnode",

docs/about/why.md

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,42 +22,40 @@ FuckingNode exists because it fixes all of the issues mentioned above.
2222

2323
### Bored of manually updating dependencies, linting code, or prettifying code? Of committing all of that? Of removing built output / artifacts?
2424

25-
- [X] `fuckingnode clean -- -- --lint --pretty --commit --destroy --update`
26-
- Shorthand: `fkclean -- -- -l -p -c -d -u`.
27-
- Assuming [flagless features](../manual/fknode-yaml.md#flagless) are enabled, it can be shortened to just `fkclean`.
25+
- [X] `fkn clean -- -- --lint --pretty --commit --destroy --update`
26+
- Shorthand: `fkn clean -- -- -l -p -c -d -u`.
27+
- Assuming [flagless features](../manual/fknode-yaml.md#flagless) are enabled, it can be shortened to just `fkn clean`.
2828

2929
### Bored of finding and pasting or writing your own `tsconfig.json`?
3030

31-
- [X] `fuckingnode setup ts-strictest`
32-
- `ts-strictest` is an example, there are more setups available. Run `fuckingnode setup` to see them all.
31+
- [X] `fkn setup ts-strictest`
32+
- `ts-strictest` is an example, there are more setups available. Run `fkn setup` to see them all.
3333

3434
### Bored of manually cloning, installing, and launching?
3535

36-
- [X] `fuckingnode kickstart <git-url> [path] [manager]`
37-
- Shorthand: `fkstart <git-url> [path] [manager]`
36+
- [X] `fkn kickstart <git-url> [path] [manager]`
3837
- `<git-url>` can be not just a Git URL, but also a shorthand (e.g., `gh:Owner/Repo` for GitHub, or `gl:*` for GitLab).
3938
- `[path]` is optional and specifies a custom path to clone to.
4039
- `[manager]` is optional and overrides the package manager to use for this project.
4140

4241
### Bored of manually writing a deprecation notice?
4342

44-
- [X] `fuckingnode surrender <path> [message] [alternatives] [learn-more]`
43+
- [X] `fkn surrender <path> [message] [alternatives] [learn-more]`
4544
- `<path>` is the path to the project, or `.` to use the CWD.
4645
- `[message]` is optional and adds a custom message.
4746
- `[alternatives]` is optional and lets you write about alternatives to what is going to be deprecated.
4847
- `[learn-more]` is optional and lets you write a text or link about where the user can learn more about this deprecation.
4948

5049
### Scared of the pain of making a commit forgetting your tests?
5150

52-
- [X] `fuckingnode commit <message> <...files> [--branch=x] [--push]`
53-
- Shorthand: `fkcommit <message> <...files> [--branch=x] [--push]`
51+
- [X] `fkn commit <message> <...files> [--branch=x] [--push]`
5452
- `<message>` is your commit message.
5553
- `--branch=*` is optional and specifies the branch to commit to. If unspecified, current active branch is used.
5654
- `--push` is optional and if passed the commit (and any previous local commit) will be pushed.
5755

5856
### Tired of the annoyance of npm or jsr package releases?
5957

60-
- [X] `fuckingnode release <version> [--push] [--dry]`
58+
- [X] `fkn release <version> [--push] [--dry]`
6159
- `<version>` is the version to be released, we'll auto bump your package file's version field and create a Git tag with this version code. Must be SemVer parsable.
6260
- `--push` is optional and if passed, changes will be pushed to Git.
6361
- `--dry` is optional and if passed, changes will be done (and pushed if specified), but not published to npm / jsr.

docs/index.html

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -725,7 +725,7 @@ <h3>FAQ</h3>
725725
</summary>
726726
<p>
727727
You just need to add all your projects to the FuckingNode list,
728-
using <code>fuckingnode add</code>. If you have a single folder with
728+
using <code>fkn add</code>. If you have a single folder with
729729
all of your projects (like most people do), you'll enjoy the fact
730730
that glob patterns like /* do work.<br /><br />Once added,
731731
<code>clean</code> will take care of all added projects one by one.
@@ -737,7 +737,7 @@ <h3>FAQ</h3>
737737
that?
738738
</summary>
739739
<p>
740-
<code>fuckingnode commit</code>, besides preventing the "oh i forgot
740+
<code>fkn commit</code>, besides preventing the "oh i forgot
741741
the test suite" headache, also prevents commits that include .env or
742742
node_modules/ even if not in the .gitignore. You're welcome.
743743
</p>
@@ -747,7 +747,7 @@ <h3>FAQ</h3>
747747
Needing to hotfix a commit is also a headache. What about that?
748748
</summary>
749749
<p>
750-
<code>fuckingnode uncommit</code> undoes the last commit and lets
750+
<code>fkn uncommit</code> undoes the last commit and lets
751751
you modify its files, then automatically commits them
752752
back.<br /><br />If a commitCmd exists (like your test suite), it'll
753753
run it again, to stop you if the code doesn't pass tests (note: if
@@ -769,8 +769,8 @@ <h3>FAQ</h3>
769769
<details>
770770
<summary>How to "add a project"? Is it needed?</summary>
771771
<p>
772-
Just run <code>fkadd</code> from its root (or
773-
<code>fkadd [filepath]</code>) and it'll be auto-added. If it's a
772+
Just run <code>fkn add</code> from its root (or
773+
<code>fkn add [filepath]</code>) and it'll be auto-added. If it's a
774774
monorepo it'll ask what to do with its workspaces.<br /><br />It's
775775
not <i>needed</i>, since most features are either runtime agnostic
776776
or can detect the current-working-directory as a project, but it is
@@ -785,7 +785,7 @@ <h3>FAQ</h3>
785785
</summary>
786786
<p>
787787
Actually, yes.<br /><br />FuckingNode provides an automation (<code
788-
>fuckingnode surrender</code>) to deprecate projects. It'll generate
788+
>fkn surrender</code>) to deprecate projects. It'll generate
789789
a deprecation notice in the README for you, push that to Git, then
790790
remove the code (and consequently node_modules) from your local
791791
system so you don't waste storage to an abandoned project.
@@ -797,7 +797,7 @@ <h3>FAQ</h3>
797797
that...?
798798
</summary>
799799
<p>
800-
Actually...<br /><br /><code>fuckingnode terminate</code> entirely
800+
Actually...<br /><br /><code>fkn terminate</code> entirely
801801
uninstalls a language and removes package manager caches from it, as
802802
well as typical installation leftovers. For NodeJS, it removes all
803803
three package managers if installed. It works for any runtime/stack

docs/install.ps1

Lines changed: 5 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
$ErrorActionPreference = "Stop"
22

3-
$APP_NAME = @{
4-
CASED = "FuckingNode"
5-
CLI = "fuckingnode"
6-
}
7-
$INSTALL_DIR = "C:\$($APP_NAME.CASED)"
8-
$EXE_PATH = Join-Path -Path $INSTALL_DIR -ChildPath "$($APP_NAME.CLI).exe"
3+
$INSTALL_DIR = "C:\FuckingNode"
4+
$EXE_PATH = Join-Path -Path $INSTALL_DIR -ChildPath "fkn.exe"
95

106
# DETACH PROCESS
117
$IsIex = -not $PSCommandPath
@@ -32,7 +28,7 @@ Function Remove-IfNeeded {
3228
$procId = $args[0] -as [int]
3329
}
3430
else {
35-
$proc = Get-Process -Name $APP_NAME.CLI -ErrorAction SilentlyContinue | Select-Object -First 1
31+
$proc = Get-Process -Name "fkn" -ErrorAction SilentlyContinue | Select-Object -First 1
3632
if ($proc) { $procId = $proc.Id }
3733
}
3834

@@ -75,55 +71,6 @@ Function Get-LatestReleaseUrl {
7571
}
7672
}
7773

78-
# creates a .bat shortcut to allow for fknode to exist alongside fuckingnode in the CLI
79-
Function New-Shortcuts {
80-
try {
81-
Write-Output "Creating shortcuts for CLI..."
82-
83-
# all aliases should be
84-
# (appName).exe <a command> [ANY ARGS PASSED]
85-
# so e.g. fkclean "b" = (appName).exe <command> "b"
86-
87-
$appName = $APP_NAME.CLI
88-
89-
if (-not (Test-Path $INSTALL_DIR -PathType Container)) {
90-
Throw "Error: Install directory '$INSTALL_DIR' does not exist."
91-
}
92-
93-
$commands = @{
94-
"fknode" = ""
95-
"fkn" = ""
96-
"fkclean" = "clean"
97-
"fkstart" = "kickstart"
98-
"fklaunch" = "launch"
99-
"fkcommit" = "commit"
100-
"fkuncommit" = "uncommit"
101-
"fkbuild" = "build"
102-
"fkrelease" = "release"
103-
"fksurrender" = "surrender"
104-
"fkadd" = "add"
105-
"fkrem" = "remove"
106-
"fklist" = "list"
107-
"fkaudit" = "audit"
108-
"fkstats" = "stats"
109-
"fksetup" = "setup"
110-
"fkmigrate" = "migrate"
111-
}
112-
113-
foreach ($name in $commands.Keys) {
114-
$cmd = $commands[$name]
115-
$batContent = "@echo off`n%~dp0$($appName).exe $cmd %*"
116-
$batPath = Join-Path -Path $INSTALL_DIR -ChildPath "$name.bat"
117-
Set-Content -Path $batPath -Value $batContent -Encoding ASCII
118-
Write-Output "Shortcut created successfully at $batPath"
119-
}
120-
}
121-
catch {
122-
Write-Error "Failed to create .bat shortcuts for the CLI: $_"
123-
Throw $_
124-
}
125-
}
126-
12774
# download the app
12875
Function Install-App {
12976
param (
@@ -140,7 +87,7 @@ Function Install-App {
14087
Write-Output "Downloaded successfully to $EXE_PATH"
14188
}
14289
catch {
143-
Throw "Failed to download fuckingnode.exe: $_"
90+
Throw "Failed to download fkn.exe: $_"
14491
}
14592
}
14693

@@ -232,14 +179,10 @@ Function Add-AppToPath {
232179

233180
Function Installer {
234181
try {
235-
Write-Output "Hi! We'll install $($APP_NAME.CASED) for you. Just a sec!"
182+
Write-Output "Hi! We'll install FuckingNode for you. Just a sec!"
236183
Remove-IfNeeded
237184
Install-App -url (Get-LatestReleaseUrl)
238185
Add-AppToPath
239-
Write-Output "You may have seen our documentation mention shortcuts like 'fknode', 'fkn', 'fkclean'..."
240-
Write-Output "These are made by creating a bunch of scripts (fknode.bat, fkn.bat...) next to the main installation."
241-
Write-Output "We will create a bunch of shell scripts next to the main installation for these to work."
242-
New-Shortcuts
243186
Write-Output "Installed successfully! Restart your terminal for it to work."
244187
}
245188
catch {

docs/install.sh

Lines changed: 0 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -105,50 +105,6 @@ install_app() {
105105
echo "Downloaded successfully to $EXE_PATH"
106106
}
107107

108-
# make shortcuts
109-
create_shortcuts() {
110-
111-
echo "Creating shortcuts for CLI..."
112-
113-
# all aliases should be
114-
# (appName).exe <a command> [ANY ARGS PASSED]
115-
# so e.g. fkclean "b" = (appName) <command> "b"
116-
117-
declare -A commands=(
118-
["fknode"]=""
119-
["fkn"]=""
120-
["fkclean"]="clean"
121-
["fkstart"]="kickstart"
122-
["fklaunch"]="launch"
123-
["fkcommit"]="commit"
124-
["fkuncommit"]="uncommit"
125-
["fkbuild"]="build"
126-
["fkrelease"]="release"
127-
["fksurrender"]="surrender"
128-
["fkadd"]="add"
129-
["fkrem"]="remove"
130-
["fklist"]="list"
131-
["fkaudit"]="audit"
132-
["fkstats"]="stats"
133-
["fksetup"]="setup"
134-
["fkmigrate"]="migrate"
135-
)
136-
137-
for name in "${!commands[@]}"; do
138-
cmd=${commands[$name]}
139-
script_path="$BIN_DIR/$name"
140-
141-
sudo tee "$script_path" >/dev/null <<EOF
142-
#!/usr/bin/env bash
143-
$EXE_NAME $cmd "\$@"
144-
EOF
145-
146-
sudo chmod +x "$script_path"
147-
148-
echo "Shortcut created successfully at $script_path"
149-
done
150-
}
151-
152108
# installer itself
153109
installer() {
154110
echo "Hi! We'll install FuckingNode ($ARCH edition) for you. Just a sec!"
@@ -163,10 +119,6 @@ installer() {
163119
migrate_old_install
164120
remove_if_needed
165121
install_app
166-
echo "You may have seen our documentation mention shortcuts like 'fknode', 'fkn', 'fkclean'..."
167-
echo "We will create a bunch of shell scripts next to the main installation for these to work."
168-
echo ""
169-
create_shortcuts
170122
echo ""
171123
echo "Installed successfully!"
172124
}

docs/learn/audit.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ However, as a mobile app that never interacted with cookies and very rarely used
1212

1313
### TL;DR
1414

15-
`fuckingnode audit` analyzes vulnerabilities and helps you tell if they really affect your project or if they can be left alone without too much risk.
15+
`fkn audit` analyzes vulnerabilities and helps you tell if they really affect your project or if they can be left alone without too much risk.
1616

1717
## How it works
1818

@@ -29,7 +29,7 @@ Due to where nowadays society is heading, it _is_ worth noting questions are not
2929

3030
```mermaid
3131
graph TD
32-
A[fkaudit] -->|Command execution| B[Runs platform-specific audit command]
32+
A[fkn audit] -->|Command execution| B[Runs platform-specific audit command]
3333
B -->|Parse JSON output| C[Stores text in a SV_KEYWORDS object]
3434
B -->|Parse JSON output| G[Stores severities separately]
3535
C -->|Analyzed| D[Questions asked to the user]

docs/learn/clean.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,11 @@ This workflow can be simplified into the following:
4242

4343
```mermaid
4444
graph TD
45-
A["fkadd ../project1"]
46-
B["fkadd ../project2"]
47-
C["fkadd /home/Zaka/Code/some-app"]
45+
A["fkn add ../project1"]
46+
B["fkn add ../project2"]
47+
C["fkn add /home/Zaka/Code/some-app"]
4848
49-
D["fkclean -- -- -u -l -d -p -"]
49+
D["fkn clean -- -- -u -l -d -p -"]
5050
5151
A --> D
5252
B --> D
@@ -59,13 +59,13 @@ We reduce your workflow to a one-time bunch of commands for initial setup, and t
5959

6060
### TL;DR
6161

62-
`fuckingnode clean` gets into each project's root directory and executes all the maintenance commands you need, automatically.
62+
`fkn clean` gets into each project's root directory and executes all the maintenance commands you need, automatically.
6363

6464
## How it works
6565

6666
### Finding your projects
6767

68-
You need to manually add a project, via the `fuckingnode add` command. When you add a project, it's stored in either:
68+
You need to manually add a project, via the `fkn 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
@@ -80,15 +80,15 @@ C:\Users\Zaka\projects\Vuelto
8080
C:\Users\Zaka\projects\FuckingNode
8181
```
8282

83-
Whenever you run the `fuckingnode clean` command, first thing we do is reading this file.
83+
Whenever you run the `fkn clean` command, first thing we do is reading this file.
8484

8585
### Cleaning a project
8686

8787
Cleaning a project involves the following steps:
8888

8989
```mermaid
9090
graph TD
91-
CLI["fuckingnode clean [...flags]"]
91+
CLI["fkn clean [...flags]"]
9292
9393
CLI -->|chdir into| A["C:\Users\Zaka\projects\Sokora"]
9494
@@ -107,11 +107,11 @@ graph TD
107107
I -->|Validates| B
108108
```
109109

110-
Inside the terminal you're running `fuckingnode` from, we'll change directories to each added project's path. From the inside, we proceed as follows:
110+
Inside the terminal you're running `fkn` from, we'll change directories to each added project's path. From the inside, we proceed as follows:
111111

112112
First, we basically do some basic validations before touching each project (is the lockfile present? are node modules installed? etc...), so we know what to do and we're sure all commands will work out of the box. Some validations, like the absence of `node_modules`, will result in that project being skipped into the next one. Other validations, like a `deno.lock` lockfile, will change our behavior (in this example, we'd skip some features as Deno doesn't support all cleaning features, [as noted here](./cross-runtime-support.md)).
113113

114-
Then, we seek a `fknode.yaml` config file - if present, we parse it and validate it. If not present, or invalid, **we run each CLI command from the open terminal**. When using `fuckingnode clean` you'll notice we don't add a loader whatsoever, but instead show you the raw output of each command as if you executed it yourself. That's because we did the same, each command is ran from the terminal you're on.
114+
Then, we seek a `fknode.yaml` config file - if present, we parse it and validate it. If not present, or invalid, **we run each CLI command from the open terminal**. When using `fkn clean` you'll notice we don't add a loader whatsoever, but instead show you the raw output of each command as if you executed it yourself. That's because we did the same, each command is ran from the terminal you're on.
115115

116116
If settings _are_ present, we take them into account before doing anything, so if you added a `divineProtection` value we skip certain actions.
117117

docs/learn/cross-runtime-support.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Cross-runtime compatibility
22

3-
> `fuckingnode compat [item]`
3+
> `fkn compat [item]`
44
55
!!! note "What we mean by _Cross-runtime_" While we always use the term
66
"cross-runtime", we also include _cross-platform_ (Golang and Rust) support

docs/learn/errors.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,9 +158,9 @@ All errors in this category are `Task__[TASK TYPE]`, which can be `Release`, `Co
158158

159159
## Parameter [Param]
160160

161-
All errors in this category are `Param__[PARAM TYPE]Invalid`, which can be `Target`, `CIntensity`, `Setup`, `Ver`, `GitTarget`, `GitTargetAlias`, or `Whatever` for anything else. When running a command that requires parameters (`fkstart <GIT TARGET>`, `fksetup <SETUP>`, and so on...), any missing or invalid parameter will trigger a Task category error.
161+
All errors in this category are `Param__[PARAM TYPE]Invalid`, which can be `Target`, `CIntensity`, `Setup`, `Ver`, `GitTarget`, `GitTargetAlias`, or `Whatever` for anything else. When running a command that requires parameters (`fkn kickstart <GIT TARGET>`, `fkn setup <SETUP>`, and so on...), any missing or invalid parameter will trigger a Task category error.
162162

163-
If unclear, `Ver` refers to "version" (for the `fkrelease` command), `CIntensity` refers to "cleaner intensity", and both `GitTarget` and `GitTargetAlias` refer to the kickstart parameter, respectively referring to Git URLs and Git aliases.
163+
If unclear, `Ver` refers to "version" (for the `fkn release` command), `CIntensity` refers to "cleaner intensity", and both `GitTarget` and `GitTargetAlias` refer to the kickstart parameter, respectively referring to Git URLs and Git aliases.
164164

165165
## Interop [Interop]
166166

0 commit comments

Comments
 (0)