ples work
All checks were successful
Publish Docker Images / docker (push) Successful in 40s

This commit is contained in:
Lee 2023-11-16 12:16:52 +00:00
parent 36d07fa8dd
commit 805e698668
13 changed files with 458 additions and 89 deletions

3
.gitignore vendored

@ -34,3 +34,6 @@ yarn-error.log*
# vercel # vercel
.vercel .vercel
# Typescript compilied files
dist

@ -1,10 +1,7 @@
FROM fascinated/docker-images:node-pnpm-latest FROM fascinated/docker-images:node-pnpm-latest
WORKDIR /usr/src/app WORKDIR /usr/src/app
# COPY package.json pnpm-lock.yaml ./
# RUN pnpm install
COPY . . COPY . .
RUN pnpm run build
ENV PORT=3000 ENV PORT=3000
EXPOSE 3000 EXPOSE 3000
CMD [ "pnpm", "start" ] CMD [ "pnpm", "start" ]

@ -6,7 +6,7 @@
"author": "fascinated", "author": "fascinated",
"license": "MIT", "license": "MIT",
"scripts": { "scripts": {
"build": "tsc", "build": "tsup src/index.ts --format cjs,esm --dts",
"start": "node dist/index.js", "start": "node dist/index.js",
"dev": "nodemon --exec ts-node src/index.ts" "dev": "nodemon --exec ts-node src/index.ts"
}, },

@ -1,10 +1,7 @@
FROM fascinated/docker-images:node-pnpm-latest FROM fascinated/docker-images:node-pnpm-latest
WORKDIR /usr/src/app WORKDIR /usr/src/app
# COPY package.json pnpm-lock.yaml ./
# RUN pnpm install
COPY . . COPY . .
RUN pnpm run build
ENV PORT=3000 ENV PORT=3000
EXPOSE 3000 EXPOSE 3000
CMD [ "pnpm", "start" ] CMD [ "pnpm", "start" ]

@ -6,7 +6,7 @@
"author": "fascinated", "author": "fascinated",
"license": "MIT", "license": "MIT",
"scripts": { "scripts": {
"build": "tsc", "build": "tsup src/index.ts --format cjs,esm --dts",
"start": "node dist/index.js", "start": "node dist/index.js",
"dev": "nodemon --exec ts-node src/index.ts" "dev": "nodemon --exec ts-node src/index.ts"
}, },

@ -19,6 +19,7 @@
"name": "proxy", "name": "proxy",
"dependencies": { "dependencies": {
"@types/express": "^4.17.21", "@types/express": "^4.17.21",
"infisical-node": "^1.5.0" "infisical-node": "^1.5.0",
"tsup": "^7.2.0"
} }
} }

@ -6,6 +6,10 @@
"publishConfig": { "publishConfig": {
"access": "public" "access": "public"
}, },
"main": "./src/index.ts", "main": "./dist/index.js",
"types": "./src/index.ts" "module": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"scripts": {
"build": "tsup src/index.ts --format cjs,esm --dts"
}
} }

@ -1,4 +1,4 @@
import express from "express"; import express, { Express } from "express";
type ServerType = { type ServerType = {
/** /**
@ -10,7 +10,7 @@ type ServerType = {
onLoaded?: () => void; onLoaded?: () => void;
}; };
export function createServer({ port = 3000, onLoaded }: ServerType) { export function createServer({ port = 3000, onLoaded }: ServerType): Express {
if (typeof port === "string") { if (typeof port === "string") {
port = Number(port); port = Number(port);
if (isNaN(port)) { if (isNaN(port)) {

@ -14,5 +14,5 @@
"noEmit": true, "noEmit": true,
"lib": ["es2022", "dom", "dom.iterable"] "lib": ["es2022", "dom", "dom.iterable"]
}, },
"exclude": ["node_modules"] "exclude": ["node_modules", "dist"]
} }

@ -6,6 +6,10 @@
"publishConfig": { "publishConfig": {
"access": "public" "access": "public"
}, },
"main": "./src/index.ts", "main": "./dist/index.js",
"types": "./src/index.ts" "module": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"scripts": {
"build": "tsup src/index.ts --format cjs,esm --dts"
}
} }

@ -1,7 +1,7 @@
{ {
"extends": "tsconfig/server.json", "extends": "tsconfig/server.json"
"compilerOptions": { // "compilerOptions": {
"outDir": "dist", // "outDir": "dist",
"rootDir": "src" // "rootDir": "src"
} // }
} }

495
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

@ -3,8 +3,8 @@
"globalDependencies": ["**/.env"], "globalDependencies": ["**/.env"],
"pipeline": { "pipeline": {
"build": { "build": {
"dependsOn": ["^build"], "outputs": ["dist/**"],
"outputs": [".next/**", "!.next/cache/**"] "dependsOn": ["^build"]
}, },
"lint": {}, "lint": {},
"dev": { "dev": {