Skip to content

Commit 08ac9d9

Browse files
authored
Merge branch 'master' into docs-wording-improvements
2 parents 5b6733e + d7d4b09 commit 08ac9d9

File tree

26 files changed

+1857
-2406
lines changed

26 files changed

+1857
-2406
lines changed

.dockerignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
node_modules
1+
node_modules
2+
app/Dockerfile

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
node_modules
2+
app/Dockerfile

Dockerfile

+2-3
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,20 @@ WORKDIR /app
55
COPY requirements.txt .
66
RUN pip install -r requirements.txt
77

8-
FROM node:12-alpine AS app-base
8+
FROM node:18-alpine AS app-base
99
WORKDIR /app
1010
COPY app/package.json app/yarn.lock ./
1111
COPY app/spec ./spec
1212
COPY app/src ./src
1313

1414
# Run tests to validate app
1515
FROM app-base AS test
16-
RUN apk add --no-cache python3 g++ make
1716
RUN yarn install
1817
RUN yarn test
1918

2019
# Clear out the node_modules and create the zip
2120
FROM app-base AS app-zip-creator
22-
COPY app/package.json app/yarn.lock ./
21+
COPY --from=test /app/package.json /app/yarn.lock ./
2322
COPY app/spec ./spec
2423
COPY app/src ./src
2524
RUN apk add zip && \

README.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,14 @@ This project has a `docker-compose.yml` file, which will start the mkdocs applic
3131
local machine and help you see changes instantly.
3232

3333
```bash
34-
docker-compose up
34+
docker compose up
3535
```
3636

3737
## Contributing
3838

3939
If you find typos or other issues with the tutorial, feel free to create a PR and suggest fixes!
4040

41-
If you have ideas on how to make the tutorial better want to suggest adding new content, please open an issue first before working on your idea. While we love input, we want to keep the tutorial scoped to new-comers.
41+
If you have ideas on how to make the tutorial better or want to suggest adding new content, please open an
42+
issue first before working on your idea. While we love input, we want to keep the tutorial scoped to new-comers.
4243
As such, we may reject ideas for more advanced requests and don't want you to lose any work you might
4344
have done. So, ask first and we'll gladly hear your thoughts!

app/package.json

+8-8
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@
99
"dev": "nodemon src/index.js"
1010
},
1111
"dependencies": {
12-
"express": "^4.17.1",
13-
"mysql": "^2.17.1",
14-
"sqlite3": "^5.0.0",
15-
"uuid": "^3.3.3",
16-
"wait-port": "^0.2.2"
12+
"express": "^4.18.2",
13+
"mysql2": "^2.3.3",
14+
"sqlite3": "^5.1.2",
15+
"uuid": "^9.0.0",
16+
"wait-port": "^1.0.4"
1717
},
1818
"resolutions": {
1919
"ansi-regex": "5.0.1"
@@ -26,8 +26,8 @@
2626
"singleQuote": true
2727
},
2828
"devDependencies": {
29-
"jest": "^27.2.5",
30-
"nodemon": "^2.0.13",
31-
"prettier": "^1.18.2"
29+
"jest": "^29.3.1",
30+
"nodemon": "^2.0.20",
31+
"prettier": "^2.7.1"
3232
}
3333
}

app/spec/routes/addItem.spec.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
const db = require('../../src/persistence');
22
const addItem = require('../../src/routes/addItem');
33
const ITEM = { id: 12345 };
4-
const uuid = require('uuid/v4');
4+
const {v4 : uuid} = require('uuid');
55

6-
jest.mock('uuid/v4', () => jest.fn());
6+
jest.mock('uuid', () => ({ v4: jest.fn() }));
77

88
jest.mock('../../src/persistence', () => ({
99
removeItem: jest.fn(),

app/src/persistence/mysql.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
const waitPort = require('wait-port');
22
const fs = require('fs');
3-
const mysql = require('mysql');
3+
const mysql = require('mysql2');
44

55
const {
66
MYSQL_HOST: HOST,
@@ -29,11 +29,12 @@ async function init() {
2929
user,
3030
password,
3131
database,
32+
charset: 'utf8mb4',
3233
});
3334

3435
return new Promise((acc, rej) => {
3536
pool.query(
36-
'CREATE TABLE IF NOT EXISTS todo_items (id varchar(36), name varchar(255), completed boolean)',
37+
'CREATE TABLE IF NOT EXISTS todo_items (id varchar(36), name varchar(255), completed boolean) DEFAULT CHARSET utf8mb4',
3738
err => {
3839
if (err) return rej(err);
3940

app/src/routes/addItem.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
const db = require('../persistence');
2-
const uuid = require('uuid/v4');
2+
const {v4 : uuid} = require('uuid');
33

44
module.exports = async (req, res) => {
55
const item = {

0 commit comments

Comments
 (0)