diff --git a/javascript-esm/.nvmrc b/javascript-esm/.nvmrc deleted file mode 100644 index 1a2f5bd..0000000 --- a/javascript-esm/.nvmrc +++ /dev/null @@ -1 +0,0 @@ -lts/* \ No newline at end of file diff --git a/javascript-esm/.tool-versions b/javascript-esm/.tool-versions new file mode 100644 index 0000000..e2d8fff --- /dev/null +++ b/javascript-esm/.tool-versions @@ -0,0 +1,2 @@ +node 22 +yarn 3 diff --git a/javascript-esm/README.md b/javascript-esm/README.md index c8d4d9a..a93fb3e 100644 --- a/javascript-esm/README.md +++ b/javascript-esm/README.md @@ -1,15 +1,30 @@ # Javascript ESM -Skeleton project for Javascript (ESM) with Jest for testing. +Skeleton project for Javascript (ESM). -## Usage -- `./script/setup` to install dependencies -- `./script/test` to run the tests -- `./script/start` to run the index.js file +## Prerequisites + +The toolchain this project needs is declared in [`.tool-versions`](./.tool-versions): + +``` +node 22 +yarn 3 +``` +Install those however you prefer, as long as they end up on your `PATH`. The quickest route is +[mise](https://mise.jdx.dev/), which reads the file for you: + +```sh +mise install +``` + +## Usage +- `./script/setup` to fetch dependencies +- `./script/test` to run the tests, or `./script/test --watch` to re-run them on every change +- `./script/start` to run the app ## Structure - Code located in [`index.js`](./src/index.js) - Tests located in [`index.test.js`](./src/index.test.js) -However, you're free to organise your code as you like. +However, you're free to organise your code as you like. diff --git a/javascript-esm/script/setup b/javascript-esm/script/setup index d302646..e2cee61 100755 --- a/javascript-esm/script/setup +++ b/javascript-esm/script/setup @@ -1,5 +1,7 @@ #!/usr/bin/env bash -set -e +set -euo pipefail + +cd "$(dirname "${BASH_SOURCE[0]}")/.." yarn diff --git a/javascript-esm/script/start b/javascript-esm/script/start index 420ecee..61c9770 100755 --- a/javascript-esm/script/start +++ b/javascript-esm/script/start @@ -1,5 +1,7 @@ #!/usr/bin/env bash -set -e +set -euo pipefail + +cd "$(dirname "${BASH_SOURCE[0]}")/.." yarn start