Skip to content

Commit

Permalink
Merge pull request #264 from codecrafters-io/update-bun-buildpack
Browse files Browse the repository at this point in the history
CC-1438: Update bun buildpack
  • Loading branch information
andy1li authored Oct 1, 2024
2 parents 5cc0c06 + b174eec commit 4765ff3
Show file tree
Hide file tree
Showing 10 changed files with 86 additions and 43 deletions.
Binary file modified compiled_starters/typescript/bun.lockb
Binary file not shown.
2 changes: 1 addition & 1 deletion compiled_starters/typescript/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
"async": "^3.2.0"
},
"devDependencies": {
"@types/node": "^20.12.11"
"@types/bun": "latest"
}
}
38 changes: 26 additions & 12 deletions compiled_starters/typescript/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,27 @@
{
"compilerOptions": {
"target": "ES2020",
"module": "ES2020",
"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
}
}
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
Binary file modified solutions/typescript/01-jm1/code/bun.lockb
Binary file not shown.
2 changes: 1 addition & 1 deletion solutions/typescript/01-jm1/code/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
"async": "^3.2.0"
},
"devDependencies": {
"@types/node": "^20.12.11"
"@types/bun": "latest"
}
}
38 changes: 26 additions & 12 deletions solutions/typescript/01-jm1/code/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,27 @@
{
"compilerOptions": {
"target": "ES2020",
"module": "ES2020",
"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
}
}
Binary file modified starter_templates/typescript/code/bun.lockb
Binary file not shown.
2 changes: 1 addition & 1 deletion starter_templates/typescript/code/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
"async": "^3.2.0"
},
"devDependencies": {
"@types/node": "^20.12.11"
"@types/bun": "latest"
}
}
38 changes: 26 additions & 12 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": "ES2020",
"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 4765ff3

Please sign in to comment.