Skip to content

Commit 1e92936

Browse files
authored
Merge pull request #606 from devforth/live-demo-edit-build
Move ts compilate to docker file
2 parents b506a46 + 3fe0f3f commit 1e92936

5 files changed

Lines changed: 552 additions & 3 deletions

File tree

adminforth/commands/createApp/templates/Dockerfile.hbs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@ ADD package.json {{dockerAdditionalManifestFiles}} /code/
55
RUN {{packageManager}} {{dockerPackageInstallSubcommand}}
66
ADD . /code/
77
RUN {{packageManagerExec}} adminforth bundle
8+
RUN {{ packageManager }} run build
89
CMD ["sh", "-c", "{{packageManagerRun}} migrate:prod && {{packageManagerRun}} prod"]

adminforth/commands/createApp/templates/package.json.hbs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
"description": "",
1010
"scripts": {
1111
"dev": "{{packageManagerEnvDev}} tsx watch index.ts",
12-
"prod": "{{packageManagerEnvProd}} tsx index.ts",
12+
"build": "{{packageManagerEnvProd}} tsup index.ts --format esm --clean",
13+
"prod": "{{packageManagerEnvProd}} node dist/index.js",
1314
"start": "{{packageManagerRun}} dev",
1415
{{#if includePrismaMigrations}}
1516
"makemigration": "{{packageManagerEnvDev}} npx --yes prisma migrate dev --create-only",
@@ -30,6 +31,7 @@
3031
},
3132
"devDependencies": {
3233
"typescript": "6.0.3",
34+
"tsup": "^8.5.1",
3335
"tsx": "4.11.2",
3436
"@types/express": "^4.17.21",
3537
"@types/node": "latest"{{#if includePrismaMigrations}},

live-demo/app/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ RUN corepack prepare pnpm@latest-10 --activate
66
RUN pnpm i
77
ADD . /code/
88
RUN pnpm bundleNow
9+
RUN pnpm run build
910

1011

1112
CMD ["pnpm", "run", "startLive"]

live-demo/app/package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
"start": "tsx --env-file=.env --watch index.ts",
88
"test": "echo \"Error: no test specified\" && exit 1",
99
"bundleNow": "tsx bundleNow.ts",
10-
"startLive": "prisma migrate deploy && tsx index.ts",
10+
"build": "tsup index.ts --format esm --clean",
11+
"startLive": "prisma migrate deploy && node dist/index.js",
1112
"migrate": "prisma migrate deploy",
1213
"makemigration": "prisma migrate dev"
1314
},
@@ -47,7 +48,8 @@
4748
"devDependencies": {
4849
"dotenv": "^16.4.5",
4950
"prisma": "^6.1.0",
51+
"tsup": "^8.5.1",
5052
"tsx": "^4.11.2",
5153
"typescript": "^5.4.5"
5254
}
53-
}
55+
}

0 commit comments

Comments
 (0)