Skip to content

Commit 239468e

Browse files
authored
Merge pull request #650 from ferllop/master
Rename .nvm to .nvmrc, add explanations about its use in readme and reference to it in ch04 and exercises/readme
2 parents a798f30 + b1c5112 commit 239468e

File tree

5 files changed

+38
-5
lines changed

5 files changed

+38
-5
lines changed

.github/workflows/build.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
runs-on: ubuntu-22.04
1414
steps:
1515
- name: Checkout source code
16-
uses: actions/checkout@v2.3.1
16+
uses: actions/checkout@v4
1717

1818
- name: Install Calibre
1919
run: |
@@ -24,7 +24,7 @@ jobs:
2424
ln -s /opt/calibre/ebook-convert ~/.local/bin/ebook-convert
2525
2626
- name: Setup Node.js
27-
uses: actions/setup-node@v1
27+
uses: actions/setup-node@v4
2828
with:
2929
node-version: 10.22.1
3030

@@ -47,20 +47,20 @@ jobs:
4747
npm run generate-epub
4848
mv book.epub ${BOOK_FILENAME}.epub
4949
50-
- uses: actions/upload-artifact@v2
50+
- uses: actions/upload-artifact@v4
5151
with:
5252
name: PDF
5353
path: ${{ env.BOOK_FILENAME }}.pdf
5454

55-
- uses: actions/upload-artifact@v2
55+
- uses: actions/upload-artifact@v4
5656
with:
5757
name: EPUB
5858
path: ${{ env.BOOK_FILENAME }}.epub
5959

6060
- run: echo "ID=$(git describe --tags --always)" >> $GITHUB_OUTPUT
6161
id: release-id
6262

63-
- uses: softprops/action-gh-release@v1
63+
- uses: softprops/action-gh-release@v2
6464
with:
6565
tag_name: ${{ steps.release-id.outputs.ID }}
6666
files: |
File renamed without changes.

README.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,39 @@ Find pre-generated **PDF** and **EPUB** as [build artifacts of the latest releas
5353

5454
> ⚠️ 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.
5555
56+
### About the nodejs version
57+
58+
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:
59+
60+
- Install any node version that you need:
61+
```
62+
nvm install 10.22.1
63+
nvm install 20.2.0
64+
```
65+
- Then you will be able to switch between node versions:
66+
```
67+
nvm use 10.22.1
68+
node -v // will show v10.22.1
69+
nvm use 20.2.0
70+
node -v // will show v20.2.0
71+
```
72+
73+
As this project has a .nvmrc file you can call `nvm install` and `nvm use` without specifying the node version:
74+
```
75+
// being anywhere inside this project
76+
nvm install
77+
node -v // will show v10.22.1
78+
```
79+
80+
81+
### Complete sequence of commands
82+
83+
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:
84+
5685
```
5786
git clone https://github.com/MostlyAdequate/mostly-adequate-guide.git
5887
cd mostly-adequate-guide/
88+
nvm install
5989
npm install
6090
npm run setup
6191
npm run generate-pdf

ch04.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ Should you prefer to do exercises directly in files using your own editor:
117117

118118
- clone the repository (`git clone git@github.com:MostlyAdequate/mostly-adequate-guide.git`)
119119
- go in the *exercises* section (`cd mostly-adequate-guide/exercises`)
120+
- 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.md#about-the-nodejs-version)
120121
- install the necessary plumbing using [npm](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm) (`npm install`)
121122
- complete answers by modifying the files named *exercise\_\** in the corresponding chapter's folder
122123
- run the correction with npm (e.g. `npm run ch04`)

exercises/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ your proposal can be verified by running:
3131
npm run ch04
3232
```
3333

34+
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.md#about-the-nodejs-version).
35+
3436
Alternatively, you can also have a peak at the corresponding solution file: in this case
3537
`solution_a.js`.
3638

0 commit comments

Comments
 (0)