Skip to content

Commit

Permalink
Simplify, run TypeScript using --experimental-strip-types
Browse files Browse the repository at this point in the history
  • Loading branch information
karlhorky committed Oct 13, 2024
1 parent 6a6fe6c commit 1bd6ac9
Show file tree
Hide file tree
Showing 9 changed files with 25 additions and 60 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/build-and-push-docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ node_modules
dist

__tests__/fixtures/__temp
docker/clone-and-preflight.js

*.tsbuildinfo

Expand Down
10 changes: 6 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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"]
2 changes: 1 addition & 1 deletion docker/clone-and-preflight.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
13 changes: 0 additions & 13 deletions docker/tsconfig.build.json

This file was deleted.

10 changes: 0 additions & 10 deletions docker/tsconfig.json

This file was deleted.

3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
22 changes: 17 additions & 5 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -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"]
}
21 changes: 0 additions & 21 deletions tsconfig.root.json

This file was deleted.

0 comments on commit 1bd6ac9

Please sign in to comment.