Skip to content

Using FuckingNode: The fknode.yaml file

The fknode.yaml file is used to configure extra settings for individual projects. It is completely opt-in and not required whatsoever. Some settings do however require specific config from here.

Below is a detailed explanation of each configuration option available in the file. They are all optional.

Get autocomplete for VSCode

You can download our Visual Studio Code extension for FuckingNode here, to get autocomplete (as well as some other features).

divineProtection

Divine protection is what we call ignorance. Basically, if you run a global cleanup with the --update flag (so all projects get their dependencies updated) but don't want a specific project to get its dependencies updated, you'd add "updater" to the divineProtection option.

It can either be an array of feature-er strings (updater, linter, etc...), or "*" to ignore everything. "disabled" is also valid and equals the default configuration.

  • Type: ("updater" | "cleaner" | "linter" | "prettifier" | "destroyer")[] | "*" | "disabled"
  • Example:
divineProtection: ["updater", "cleaner"] # ignore cleanup & dependency updates

lintCmd

Specifies a script (from your package file > scripts {}) to be used for linting when --lint is passed to clean, overriding the default (ESLint).

  • Type: string
  • Example:
lintCmd: "lint" # so FuckingNode will run "npm run lint"

prettyCmd

Specifies a script (from your package file > scripts {}) script to be used for prettifying when --pretty is passed to clean, overriding the default (Prettier).

  • Type: string
  • Example:
prettyCmd: "prettify" # so FuckingNode will run "npm run prettify"

destroy

Configuration for the destroyer, which removes specified targets when clean is called with any of the intensities, or an "*" for enabling regardless of the intensity.

  • Type:
destroy:
  intensities: ("normal" | "hard" | "maxim" | "*")[]
  targets: string[]
  • Example:
destroy:
  intensities: ["high"]
  targets: ["dist", "build"]

commitActions

If true, a commit will be made if an action that changes the code is performed and the Git workspace is clean. Learn more here.

  • Type: boolean
  • Example:
commitActions: true

commitMessage

Specifies the commit message to be used if a commit is made. If not provided, a default message is used.

  • Type: string
  • Example:
commitMessage: "Automated maintenance commit by fknode"

updateCmdOverride

Overrides the default command for the updating dependencies with the provided runtime script command. Works the same way as lintCmd or prettyCmd, we simply made the name more verbose because in most cases you don't need (and should not) mess around with it.

  • Type: string
  • Example:
updateCmdOverride: "update" # replaces "npm update" with "npm run update"

flagless

Enables flagless features.

  • Type:
flagless:
  flaglessUpdate: boolean
  flaglessDestroy: boolean
  flaglessLint: boolean
  flaglessPretty: boolean
  flaglessCommit: boolean
  • Example:
flagless:
  flaglessUpdate: true
  flaglessDestroy: false
  flaglessLint: true
  flaglessPretty: false
  flaglessCommit: true

releaseCmd

Specifies a task to be executed upon running the release command.

  • Type: string
  • Example:
releaseCmd: "release" # equals "npm run release"

releaseAlwaysDry

If true, the release command will always use dry-run.

  • Type: boolean
  • Example:
releaseAlwaysDry: true

commitCmd

Specifies a task to be executed upon running the commit command.

  • Type: string
  • Example:
commitCmd: "commit" # equals "npm run commit"

launchCmd

Specifies a task to be executed upon running the launch command. Only used for NodeJS and Bun, analog to launchFile in other runtimes.

  • Type: string
  • Example:
launchCmd: "start" # equals "npm run start"

launchFile

Specifies a path to a code file to be executed upon running the launch command. Only used for DenoJS, Cargo and Golang, analog to launchCmd in other runtimes.

  • Type: string
  • Example:
launchFile: "src/main.go" # runs "<PROJECT-ROOT>/src/main.go"

launchWithUpdate

Specifies whether to update a project's dependencies upon running the launch command. False by default.

  • Type: boolean
  • Example:
launchWithUpdate: true # updates deps of a project when launching it

projectEnvOverride

FuckingNode uses certain hints (especially your project's lockfile) to infer the runtime to use; however it may rarely fail. You can override its inference system and state the runtime to be used.

  • Type: "npm" | "pnpm" | "yarn" | "deno" | "bun" | "go" | "cargo"
  • Example:
projectEnvOverride: "cargo" # even if a "package-lock.json" existed on the root, we'll treat this as a Rust (Cargo) project now

buildCmd

Specifies a set of tasks to be executed upon running the build command. Unlike other "cmd" definitions, you can define several commands, separating them with the ^ character.

  • Type: string
  • Example:
buildCmd: "npm run build^cd dist^vercel --prod" # it'll run, in order, "npm run build", "cd dist", and "vercel --prod"

buildForRelease

If enabled and a buildCmd is set, it'll always run before releasing when you invoke fkrelease.

  • Type: boolean
  • Example:
buildCmd: "..."
releaseCmd: "..."
buildForRelease: true # now when running release, buildCmd will auto-run first

Full sample

This is an example of a full fknode.yaml file.

divineProtection: ["updater", "cleaner"]
lintCmd: "lint"
prettyCmd: "prettify"
destroy:
  intensities: ["high"]
  targets: ["dist", ".cache"]
commitActions: true
commitMessage: "Automated commit by fknode"
updateCmdOverride: "update"
flagless:
  flaglessUpdate: true
  flaglessDestroy: false
  flaglessLint: true
  flaglessPretty: false
  flaglessCommit: true
releaseCmd: "release"
releaseAlwaysDry: true
commitCmd: "commit"
launchCmd: "dev"
launchWithUpdate: true
projectEnvOverride: "bun"
buildCmd: "cd src^bun build.ts^mv out ../dist"
buildForRelease: true

You've now learnt how to configure each project to your liking.

Next: Kickstart - Now proceed a bunch of extra features from the CLI to enhance productivity; kickstart is the first one.