Skip to content

Commit 093f5bd

Browse files
authored
Merge pull request #68 from codecrafters-io/CC-1157-js-npm
CC-1157: add dependency resolution for js projects + update nodejs
2 parents 5fd4f74 + a04ee0a commit 093f5bd

File tree

16 files changed

+119
-33
lines changed

16 files changed

+119
-33
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
*.db
2+
node_modules/

compiled_starters/javascript/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Time to move on to the next stage!
3030

3131
Note: This section is for stages 2 and beyond.
3232

33-
1. Ensure you have `node (16)` installed locally
33+
1. Ensure you have `node (21)` installed locally
3434
1. Run `./your_sqlite3.sh` to run your program, which is implemented in
3535
`app/main.js`.
3636
1. Commit your changes and run `git push origin master` to submit your solution

compiled_starters/javascript/codecrafters.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ debug: false
77
# Use this to change the JavaScript version used to run your code
88
# on Codecrafters.
99
#
10-
# Available versions: nodejs-18
11-
language_pack: nodejs-18
10+
# Available versions: nodejs-21
11+
language_pack: nodejs-21

compiled_starters/javascript/package-lock.json

Lines changed: 14 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,16 @@
11
{
2-
"name": "sqlite-starter-javascript",
3-
"version": "1.0.0",
4-
"description": "This is a starting point for JavaScript solutions to the Build Your Own SQLite challenge",
5-
"main": "app/main.js",
6-
"author": "CodeCrafters",
7-
"type": "module",
8-
"license": "MIT"
9-
}
2+
"name": "@codecrafters/build-your-own-sqlite",
3+
"version": "1.0.0",
4+
"description": "Build your own SQLite challenge, from CodeCrafters",
5+
"main": "main.js",
6+
"type": "module",
7+
"scripts": {
8+
"dev": "node app/main.js"
9+
},
10+
"keywords": [
11+
"build-your-own-x"
12+
],
13+
"author": "",
14+
"license": "MIT",
15+
"dependencies": {}
16+
}

dockerfiles/nodejs-21.Dockerfile

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
FROM node:21.7-alpine3.19
2+
3+
ENV CODECRAFTERS_DEPENDENCY_FILE_PATHS="package.json,package-lock.json"
4+
5+
WORKDIR /app
6+
7+
COPY package.json ./
8+
COPY package-lock.json ./
9+
10+
# If dependencies in the package lock do not match those in package.json, instead of updating the package lock, npm ci will exit with an error.
11+
RUN npm ci
12+
13+
RUN mkdir -p /app-cached
14+
# If the node_modules directory exists, move it to /app-cached
15+
RUN if [ -d "/app/node_modules" ]; then mv /app/node_modules /app-cached; fi
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
*.db
2+
node_modules/

solutions/javascript/01-init/code/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Time to move on to the next stage!
3030

3131
Note: This section is for stages 2 and beyond.
3232

33-
1. Ensure you have `node (16)` installed locally
33+
1. Ensure you have `node (21)` installed locally
3434
1. Run `./your_sqlite3.sh` to run your program, which is implemented in
3535
`app/main.js`.
3636
1. Commit your changes and run `git push origin master` to submit your solution

solutions/javascript/01-init/code/codecrafters.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ debug: false
77
# Use this to change the JavaScript version used to run your code
88
# on Codecrafters.
99
#
10-
# Available versions: nodejs-18
11-
language_pack: nodejs-18
10+
# Available versions: nodejs-21
11+
language_pack: nodejs-21

solutions/javascript/01-init/code/package-lock.json

Lines changed: 14 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)