diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1a45a06..1ae665a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-22.04 steps: - name: Checkout source code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Install Calibre run: | @@ -24,7 +24,7 @@ jobs: ln -s /opt/calibre/ebook-convert ~/.local/bin/ebook-convert - name: Setup Node.js - uses: actions/setup-node@v1 + uses: actions/setup-node@v4 with: node-version: 10.22.1 @@ -52,12 +52,12 @@ jobs: npm run generate-epub mv book.epub ${BOOK_FILENAME}.epub - - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@v4 with: name: PDF path: ${{ env.BOOK_FILENAME }}.pdf - - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@v4 with: name: EPUB path: ${{ env.BOOK_FILENAME }}.epub @@ -65,7 +65,7 @@ jobs: - run: echo "ID=$(git describe --tags --always)" >> $GITHUB_OUTPUT id: release-id - - uses: softprops/action-gh-release@v1 + - uses: softprops/action-gh-release@v2 with: tag_name: ${{ steps.release-id.outputs.ID }} files: | diff --git a/.nvmrc b/.nvmrc new file mode 100644 index 0000000..0b9c032 --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +v10.22.1 diff --git a/README-original.md b/README-original.md index fd325d1..81c994f 100644 --- a/README-original.md +++ b/README-original.md @@ -53,9 +53,38 @@ Find pre-generated **PDF** and **EPUB** as [build artifacts of the latest releas > ⚠️ This project setup is now a bit old and thus, you may run into various issues when building this locally. We recommend to use node v10.22.1 and the latest version of Calibre if possible. +### About the nodejs version + +As the recommended node version (v10.22.1) is a bit old now, is more than likely that you do not have it installed on your system. You can have multiple versions of nodejs installed on your system using [nvm](https://github.com/nvm-sh/nvm). Refer to that project to install it and then you will be able to: + + - Install any node version that you need: +``` +nvm install 10.22.1 +nvm install 20.2.0 +``` + - Then you will be able to switch between node versions: +``` +nvm use 10.22.1 +node -v // will show v10.22.1 +nvm use 20.2.0 +node -v // will show v20.2.0 +``` + +As this project has a .nvmrc file you can call `nvm install` and `nvm use` without specifying the node version: +``` +// being anywhere inside this project +nvm install +node -v // will show v10.22.1 +``` + + +### Complete sequence of commands + +Considering the above about having nvm installed on your system, here is the complete sequence of commands to generate pdf and epub files by yourself: ``` git clone https://github.com/MostlyAdequate/mostly-adequate-guide.git cd mostly-adequate-guide/ +nvm install npm install npm run setup npm run generate-pdf diff --git a/README.md b/README.md index 080728c..30fd973 100644 --- a/README.md +++ b/README.md @@ -60,9 +60,39 @@ Encuentra archivos **PDF** y **EPUB** pregenerados como [artefactos construidos > ⚠️ La preparación del proyecto es un poco antigua, puedes encontrarte con distintos problemas cuando lo construyas localmente. Recomendamos el uso de node v10.22.1 y la última versión de Calibre si es posible. +### Sobre la versión de nodejs + +Dado que la versión de node recomendada (v10.22.1) es algo antigua, es más que probable que no la tengas instalada en tu sistema. Puedes tener instaladas múltiples versiones de nodejs utilizando [nvm](https://github.com/nvm-sh/nvm). Dirígete a este proyecto para instalarlo y entonces podrás: + + - Instalar cualquier versión de node que necesites: +``` +nvm install 10.22.1 +nvm install 20.2.0 +``` + - Y entonces podrás cambiar entre versiones de node: +``` +nvm use 10.22.1 +node -v // will show v10.22.1 +nvm use 20.2.0 +node -v // will show v20.2.0 +``` + +Como este proyecto tiene un archivo .nvmrc puedes ejecutar `nvm install` y `nvm use` sin especificar la versión de node: +``` +// estando en cualquier lugar dentro del proyecto +nvm install +node -v // will show v10.22.1 +``` + + +### Secuencia de comandos completa + +Teniendo en cuenta lo anterior acerca de tener nvm instalado en tu sistema, aquí está la secuencia completa de comandos para generar tú mismo los archivos pdf y epub: + ``` git clone https://github.com/MostlyAdequate/mostly-adequate-guide-es.git cd mostly-adequate-guide-es/ +nvm install npm install npm run setup npm run generate-pdf diff --git a/ch04-es.md b/ch04-es.md index dec1b2b..50296c9 100644 --- a/ch04-es.md +++ b/ch04-es.md @@ -111,6 +111,7 @@ En caso de preferir hacer los ejercicios directamente en archivos usando tu prop - clona el repositorio (`git clone git@github.com:MostlyAdequate/mostly-adequate-guide-es.git`) - ve a la sección *exercises* (`cd mostly-adequate-guide-es/exercises`) +- asegúrate de estar utilizando la versión recomendada de node, la v10.22.1 (por ejemplo con `nvm install`). Más información al respecto en [el readme del libro](./README.md#sobre-la-version-de-nodejs) - instala lo necesario usando [npm](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm) (`npm install`) - completa las respuestas modificando los archivos llamados *exercise_** dentro del directorio del correspondiente capítulo - ejecuta la corrección con npm (p. ej. `npm run ch04`) diff --git a/ch04.md b/ch04.md index f86ebcf..a05fbf6 100644 --- a/ch04.md +++ b/ch04.md @@ -117,6 +117,7 @@ Should you prefer to do exercises directly in files using your own editor: - clone the repository (`git clone git@github.com:MostlyAdequate/mostly-adequate-guide.git`) - go in the *exercises* section (`cd mostly-adequate-guide/exercises`) +- be sure to be using the recommended node version v10.22.1 (e.g. `nvm install`). More on this in [the readme of the book](./README-original.md#about-the-nodejs-version) - install the necessary plumbing using [npm](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm) (`npm install`) - complete answers by modifying the files named *exercise\_\** in the corresponding chapter's folder - run the correction with npm (e.g. `npm run ch04`) diff --git a/exercises/README-original.md b/exercises/README-original.md index 1f5a107..ac967f1 100644 --- a/exercises/README-original.md +++ b/exercises/README-original.md @@ -31,6 +31,8 @@ your proposal can be verified by running: npm run ch04 ``` +Remember to first install node dependencies being at the recommended node version of the project. More on this on [the main README of the project](../README-original.md#about-the-nodejs-version). + Alternatively, you can also have a peak at the corresponding solution file: in this case `solution_a.js`. diff --git a/exercises/README.md b/exercises/README.md index c117407..fc171fb 100644 --- a/exercises/README.md +++ b/exercises/README.md @@ -30,6 +30,8 @@ tu propuesta puede ser verificada ejecutando: npm run ch04 ``` +Recuerda instalar primero las dependencias estando en la versión de node recomendada por el proyecto. Más sobre esto en [el README principal del proyecto](../README.md#sobre-la-version-de-nodejs). + Alternativamente, también puedes echar un vistazo al archivo con la solución que corresponda: en este caso `solution_a.js`.