diff --git a/compiled_starters/typescript/bun.lockb b/compiled_starters/typescript/bun.lockb index 9da3c184..b1b90ed9 100755 Binary files a/compiled_starters/typescript/bun.lockb and b/compiled_starters/typescript/bun.lockb differ diff --git a/compiled_starters/typescript/package.json b/compiled_starters/typescript/package.json index ac399c95..cdb7a8bb 100644 --- a/compiled_starters/typescript/package.json +++ b/compiled_starters/typescript/package.json @@ -9,6 +9,6 @@ "async": "^3.2.0" }, "devDependencies": { - "@types/node": "^20.12.11" + "@types/bun": "latest" } } diff --git a/compiled_starters/typescript/tsconfig.json b/compiled_starters/typescript/tsconfig.json index 74d153ab..238655f2 100644 --- a/compiled_starters/typescript/tsconfig.json +++ b/compiled_starters/typescript/tsconfig.json @@ -1,13 +1,27 @@ { - "compilerOptions": { - "target": "ES2020", - "module": "ES2020", - "moduleResolution": "node", - "esModuleInterop": true, - "strict": true, - "skipLibCheck": true, - }, - "ts-node": { - "esm": true - } -} \ No newline at end of file + "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 + } +} diff --git a/dockerfiles/bun-1.1.Dockerfile b/dockerfiles/bun-1.1.Dockerfile index 4db10410..e118d6f6 100644 --- a/dockerfiles/bun-1.1.Dockerfile +++ b/dockerfiles/bun-1.1.Dockerfile @@ -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 diff --git a/solutions/typescript/01-jm1/code/bun.lockb b/solutions/typescript/01-jm1/code/bun.lockb index 9da3c184..b1b90ed9 100755 Binary files a/solutions/typescript/01-jm1/code/bun.lockb and b/solutions/typescript/01-jm1/code/bun.lockb differ diff --git a/solutions/typescript/01-jm1/code/package.json b/solutions/typescript/01-jm1/code/package.json index ac399c95..cdb7a8bb 100644 --- a/solutions/typescript/01-jm1/code/package.json +++ b/solutions/typescript/01-jm1/code/package.json @@ -9,6 +9,6 @@ "async": "^3.2.0" }, "devDependencies": { - "@types/node": "^20.12.11" + "@types/bun": "latest" } } diff --git a/solutions/typescript/01-jm1/code/tsconfig.json b/solutions/typescript/01-jm1/code/tsconfig.json index 74d153ab..238655f2 100644 --- a/solutions/typescript/01-jm1/code/tsconfig.json +++ b/solutions/typescript/01-jm1/code/tsconfig.json @@ -1,13 +1,27 @@ { - "compilerOptions": { - "target": "ES2020", - "module": "ES2020", - "moduleResolution": "node", - "esModuleInterop": true, - "strict": true, - "skipLibCheck": true, - }, - "ts-node": { - "esm": true - } -} \ No newline at end of file + "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 + } +} diff --git a/starter_templates/typescript/code/bun.lockb b/starter_templates/typescript/code/bun.lockb index 9da3c184..b1b90ed9 100755 Binary files a/starter_templates/typescript/code/bun.lockb and b/starter_templates/typescript/code/bun.lockb differ diff --git a/starter_templates/typescript/code/package.json b/starter_templates/typescript/code/package.json index ac399c95..cdb7a8bb 100644 --- a/starter_templates/typescript/code/package.json +++ b/starter_templates/typescript/code/package.json @@ -9,6 +9,6 @@ "async": "^3.2.0" }, "devDependencies": { - "@types/node": "^20.12.11" + "@types/bun": "latest" } } diff --git a/starter_templates/typescript/code/tsconfig.json b/starter_templates/typescript/code/tsconfig.json index 74d153ab..238655f2 100644 --- a/starter_templates/typescript/code/tsconfig.json +++ b/starter_templates/typescript/code/tsconfig.json @@ -1,13 +1,27 @@ { - "compilerOptions": { - "target": "ES2020", - "module": "ES2020", - "moduleResolution": "node", - "esModuleInterop": true, - "strict": true, - "skipLibCheck": true, - }, - "ts-node": { - "esm": true - } -} \ No newline at end of file + "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 + } +}