Skip to content

Commit

Permalink
Merge pull request #103 from codecrafters-io/bump-bun-version
Browse files Browse the repository at this point in the history
Bump bun version
  • Loading branch information
andy1li authored Oct 2, 2024
2 parents ec717ea + 2b692a9 commit f2c39ae
Show file tree
Hide file tree
Showing 15 changed files with 97 additions and 63 deletions.
2 changes: 1 addition & 1 deletion compiled_starters/typescript/.codecrafters/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@

set -e # Exit on failure

exec bun run app/main.ts "$@"
exec bun run $(dirname $0)/app/main.ts "$@"
Binary file modified compiled_starters/typescript/bun.lockb
Binary file not shown.
11 changes: 4 additions & 7 deletions compiled_starters/typescript/package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
{
"name": "@codecrafters/build-your-own-grep",
"description": "Build your own Grep challenge, from CodeCrafters",
"name": "@codecrafters/grep",
"description": "Build your own grep challenge, from CodeCrafters",
"type": "module",
"scripts": {
"dev": "bun run app/main.ts"
},
"dependencies": {
"fs-extra": "^11.2.0"
},
"devDependencies": {
"@types/node": "^20.12.12"
"@types/bun": "latest"
}
}
}
36 changes: 25 additions & 11 deletions compiled_starters/typescript/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,27 @@
{
"compilerOptions": {
"target": "ES2020",
"module": "ES2022",
"moduleResolution": "node",
"esModuleInterop": true,
"strict": true,
"skipLibCheck": true,
},
"ts-node": {
"esm": true
}
"compilerOptions": {
// Enable latest features
"lib": ["ESNext", "DOM"],
"target": "ESNext",
"module": "ESNext",
"moduleDetection": "force",
"jsx": "react-jsx",
"allowJs": true,

// Bundler mode
"moduleResolution": "bundler",
"allowImportingTsExtensions": true,
"verbatimModuleSyntax": true,
"noEmit": true,

// Best practices
"strict": true,
"skipLibCheck": true,
"noFallthroughCasesInSwitch": true,

// Some stricter flags (disabled by default)
"noUnusedLocals": false,
"noUnusedParameters": false,
"noPropertyAccessFromIndexSignature": false
}
}
2 changes: 1 addition & 1 deletion compiled_starters/typescript/your_program.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ set -e # Exit early if any commands fail
#
# - Edit this to change how your program runs locally
# - Edit .codecrafters/run.sh to change how your program runs remotely
exec bun run app/main.ts "$@"
exec bun run $(dirname $0)/app/main.ts "$@"
9 changes: 5 additions & 4 deletions dockerfiles/bun-1.1.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
FROM oven/bun:1.1.4-alpine
# syntax=docker/dockerfile:1.7-labs
FROM oven/bun:1.1-alpine

ENV CODECRAFTERS_DEPENDENCY_FILE_PATHS="package.json,bun.lockb"

WORKDIR /app

COPY package.json ./
COPY bun.lockb ./
# .git & README.md are unique per-repository. We ignore them on first copy to prevent cache misses
COPY --exclude=.git --exclude=README.md . /app

# For reproducible builds.
# This will install the exact versions of each package specified in the lockfile.
# If package.json disagrees with bun.lockb, Bun will exit with an error. The lockfile will not be updated.
RUN bun install --frozen-lockfile

RUN mkdir -p /app-cached
# If the node_modules directory exists, move it to /app-cached
RUN mkdir -p /app-cached
RUN if [ -d "/app/node_modules" ]; then mv /app/node_modules /app-cached; fi
2 changes: 1 addition & 1 deletion solutions/typescript/01-cq2/code/.codecrafters/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@

set -e # Exit on failure

exec bun run app/main.ts "$@"
exec bun run $(dirname $0)/app/main.ts "$@"
Binary file modified solutions/typescript/01-cq2/code/bun.lockb
Binary file not shown.
11 changes: 4 additions & 7 deletions solutions/typescript/01-cq2/code/package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
{
"name": "@codecrafters/build-your-own-grep",
"description": "Build your own Grep challenge, from CodeCrafters",
"name": "@codecrafters/grep",
"description": "Build your own grep challenge, from CodeCrafters",
"type": "module",
"scripts": {
"dev": "bun run app/main.ts"
},
"dependencies": {
"fs-extra": "^11.2.0"
},
"devDependencies": {
"@types/node": "^20.12.12"
"@types/bun": "latest"
}
}
}
36 changes: 25 additions & 11 deletions solutions/typescript/01-cq2/code/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,27 @@
{
"compilerOptions": {
"target": "ES2020",
"module": "ES2022",
"moduleResolution": "node",
"esModuleInterop": true,
"strict": true,
"skipLibCheck": true,
},
"ts-node": {
"esm": true
}
"compilerOptions": {
// Enable latest features
"lib": ["ESNext", "DOM"],
"target": "ESNext",
"module": "ESNext",
"moduleDetection": "force",
"jsx": "react-jsx",
"allowJs": true,

// Bundler mode
"moduleResolution": "bundler",
"allowImportingTsExtensions": true,
"verbatimModuleSyntax": true,
"noEmit": true,

// Best practices
"strict": true,
"skipLibCheck": true,
"noFallthroughCasesInSwitch": true,

// Some stricter flags (disabled by default)
"noUnusedLocals": false,
"noUnusedParameters": false,
"noPropertyAccessFromIndexSignature": false
}
}
2 changes: 1 addition & 1 deletion solutions/typescript/01-cq2/code/your_program.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ set -e # Exit early if any commands fail
#
# - Edit this to change how your program runs locally
# - Edit .codecrafters/run.sh to change how your program runs remotely
exec bun run app/main.ts "$@"
exec bun run $(dirname $0)/app/main.ts "$@"
2 changes: 1 addition & 1 deletion starter_templates/typescript/code/.codecrafters/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@

set -e # Exit on failure

exec bun run app/main.ts "$@"
exec bun run $(dirname $0)/app/main.ts "$@"
Binary file modified starter_templates/typescript/code/bun.lockb
Binary file not shown.
11 changes: 4 additions & 7 deletions starter_templates/typescript/code/package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
{
"name": "@codecrafters/build-your-own-grep",
"description": "Build your own Grep challenge, from CodeCrafters",
"name": "@codecrafters/grep",
"description": "Build your own grep challenge, from CodeCrafters",
"type": "module",
"scripts": {
"dev": "bun run app/main.ts"
},
"dependencies": {
"fs-extra": "^11.2.0"
},
"devDependencies": {
"@types/node": "^20.12.12"
"@types/bun": "latest"
}
}
}
36 changes: 25 additions & 11 deletions starter_templates/typescript/code/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,27 @@
{
"compilerOptions": {
"target": "ES2020",
"module": "ES2022",
"moduleResolution": "node",
"esModuleInterop": true,
"strict": true,
"skipLibCheck": true,
},
"ts-node": {
"esm": true
}
"compilerOptions": {
// Enable latest features
"lib": ["ESNext", "DOM"],
"target": "ESNext",
"module": "ESNext",
"moduleDetection": "force",
"jsx": "react-jsx",
"allowJs": true,

// Bundler mode
"moduleResolution": "bundler",
"allowImportingTsExtensions": true,
"verbatimModuleSyntax": true,
"noEmit": true,

// Best practices
"strict": true,
"skipLibCheck": true,
"noFallthroughCasesInSwitch": true,

// Some stricter flags (disabled by default)
"noUnusedLocals": false,
"noUnusedParameters": false,
"noPropertyAccessFromIndexSignature": false
}
}

0 comments on commit f2c39ae

Please sign in to comment.