diff --git a/.github/workflows/build-and-push-docker-image.yml b/.github/workflows/build-and-push-docker-image.yml index cdb1f425..95e1751e 100644 --- a/.github/workflows/build-and-push-docker-image.yml +++ b/.github/workflows/build-and-push-docker-image.yml @@ -31,9 +31,6 @@ jobs: - run: pnpm install - - name: Compile TypeScript - run: pnpm docker-build-ts - # Publish to container registry - name: Log in to the Container registry uses: docker/login-action@v3 diff --git a/.gitignore b/.gitignore index 100c8e60..821f08dd 100644 --- a/.gitignore +++ b/.gitignore @@ -4,7 +4,6 @@ node_modules dist __tests__/fixtures/__temp -docker/clone-and-preflight.js *.tsbuildinfo diff --git a/Dockerfile b/Dockerfile index 33acd3cc..5ce691db 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,6 @@ -FROM node:lts-alpine +# TODO: Switch back to lts-alpine once v22 becomes LTS +# FROM node:lts-alpine +FROM node:22-alpine WORKDIR /preflight @@ -21,6 +23,6 @@ ENV PNPM_HOME=/usr/local/bin RUN pnpm add --global @upleveled/preflight@latest -COPY ./docker/clone-and-preflight.js ./ -RUN chmod +x ./clone-and-preflight.js -ENTRYPOINT ["./clone-and-preflight.js"] +COPY ./docker/clone-and-preflight.ts ./ +RUN chmod +x ./clone-and-preflight.ts +ENTRYPOINT ["./clone-and-preflight.ts"] diff --git a/docker/clone-and-preflight.ts b/docker/clone-and-preflight.ts index 94743df3..664dc165 100644 --- a/docker/clone-and-preflight.ts +++ b/docker/clone-and-preflight.ts @@ -1,4 +1,4 @@ -#!/usr/bin/env node +#!/usr/bin/env -S node --experimental-strip-types import { argv, cwd, exit } from 'node:process'; import { execa as bindExeca } from 'execa'; diff --git a/docker/tsconfig.build.json b/docker/tsconfig.build.json deleted file mode 100644 index 416d155d..00000000 --- a/docker/tsconfig.build.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "extends": "./tsconfig.json", - "compilerOptions": { - // Without this, module: Node16 causes emit in CommonJS, which leads to this error: - // - // ReferenceError: exports is not defined in ES module scope - // This file is being treated as an ES module because it has a '.js' file extension and '/preflight/package.json' contains "type": "module". To treat it as a CommonJS script, rename it to use the '.cjs' file extension. - "module": "ESNext", - "moduleResolution": "Node10", - "noEmit": false - }, - "include": ["clone-and-preflight.ts"] -} diff --git a/docker/tsconfig.json b/docker/tsconfig.json deleted file mode 100644 index b5d2d5d8..00000000 --- a/docker/tsconfig.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "extends": "eslint-config-upleveled/tsconfig.base.json", - "compilerOptions": { - "module": "Node16", - "moduleResolution": "Node16", - "target": "ES2020" - }, - "include": ["clone-and-preflight.ts"], - "exclude": ["node_modules"] -} diff --git a/package.json b/package.json index f03b936c..11a0b6e8 100644 --- a/package.json +++ b/package.json @@ -20,8 +20,7 @@ ], "scripts": { "docker-build": "docker build --tag preflight .", - "docker-build-run": "pnpm docker-build-ts && pnpm docker-build && pnpm docker-run", - "docker-build-ts": "tsc --project docker/tsconfig.build.json", + "docker-build-run": "pnpm docker-build && pnpm docker-run", "docker-run": "docker run preflight", "lint": "eslint . --max-warnings 0", "start": "tsx watch ./src/index.ts", diff --git a/tsconfig.json b/tsconfig.json index bdfab1b8..576daed6 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,8 +1,20 @@ +// For files outside of /src { "$schema": "https://json.schemastore.org/tsconfig", - "files": [], - "references": [ - { "path": "./docker/tsconfig.json" }, - { "path": "./tsconfig.root.json" } - ] + "extends": "eslint-config-upleveled/tsconfig.base.json", + "compilerOptions": { + "module": "NodeNext", + "moduleResolution": "NodeNext", + "allowImportingTsExtensions": true, + "checkJs": true + }, + "include": [ + "**/*.ts", + "**/*.tsx", + "**/*.js", + "**/*.jsx", + "**/*.cjs", + "**/*.mjs" + ], + "exclude": ["node_modules", "__tests__/fixtures"] } diff --git a/tsconfig.root.json b/tsconfig.root.json deleted file mode 100644 index aa6f4c3f..00000000 --- a/tsconfig.root.json +++ /dev/null @@ -1,21 +0,0 @@ -// For files outside of /src -{ - "$schema": "https://json.schemastore.org/tsconfig", - "extends": "eslint-config-upleveled/tsconfig.base.json", - "compilerOptions": { - "composite": true, - "module": "NodeNext", - "moduleResolution": "NodeNext", - "allowImportingTsExtensions": true, - "checkJs": true - }, - "include": [ - "**/*.ts", - "**/*.tsx", - "**/*.js", - "**/*.jsx", - "**/*.cjs", - "**/*.mjs" - ], - "exclude": ["node_modules", "__tests__/fixtures", "docker"] -}