Core Core scripts

Ready-to-use npm scripts are included within the same core package:

npm install @anyblades/buildawesome-kit

To reuse in your project, link them under scripts/ subfolder like this:

mkdir scripts
cd scripts/
ln -s ../node_modules/@anyblades/buildawesome-kit/packages/scripts/package.json
cd ..

Finally, register scripts as a "virtual" npm workspace:

  "workspaces": ["scripts"],
  "scripts": {
    "scripts": "npm -w scripts run",
    "start": "npm run scripts -- start",
    "stage": "npm run scripts -- stage",
    "build": "npm run scripts -- build"
  },
Done! 🥷
Build Awesome Kit's npm run start / stage / build are ready to use in your project, AND automatically updated via @anyblades/buildawesome-kit package.

Live example: /anyblades/buildawesome-micro-starters/tree/main/bare-scripts


Appendix

How it works:

{
  "private": true,
  "name": "scripts",
  "scripts": {
    "=== START": "with-tw: 1) `&` for parallel run 2) `tw` is last to stay alive 3) trap/wait for graceful exit",
    "start": "npm run ba -- --serve --incremental",
    "start:with-tw": "trap 'kill 0' INT; npm start & npm run tw -- --watch & wait",
    "=== STAGE": "1) `rm -r` w/o trailing slash to avoid symlink catastrophe! 2) `;` to bypass no dir errors",
    "stage": "rm -r ../_site; npm run build && serve ../_site/",
    "=== BUILD": "`;` to make `tw` optional",
    "build": "npm run tw; npm run ba",
    "=== INNER": "commands written so that extra arguments can be passed",
    "ba": "cd ../ && NODE_OPTIONS=--preserve-symlinks buildawesome ${BA_OPTIONS:-$ELTY_OPTIONS}",
    "tw": "[ -z \"$TW_OPTIONS\" ] && exit 0; cd ../ && tailwindcss ${TW_OPTIONS}",
    "=== DEV": "===",
    "dev:kit": "cd ../ && npm link @anyblades/buildawesome-kit-config && cd node_modules/@anyblades/ && ln -sf buildawesome-kit-config/node_modules/@anyblades/* ./ && cd buildawesome-kit-config/ && npm link @anyblades/blades"
  }
}

Find and kill 11ty processes

ps aux | grep eleventy
pkill -f eleventy

You can even combine it with other processes hanging around:

ps aux | grep -E 'eleventy|tailwind|.bin/serve'
pkill -f tailwind
pkill -f .bin/serve