File tree Expand file tree Collapse file tree 4 files changed +15
-5
lines changed
Expand file tree Collapse file tree 4 files changed +15
-5
lines changed Original file line number Diff line number Diff line change @@ -38,10 +38,10 @@ RUN npm run ui:build
3838
3939# Build Next.js app
4040WORKDIR /src/MyApp.Client
41- COPY MyApp.Client/package*.json MyApp.Client/npm-shrinkwrap.json ./
41+ COPY MyApp.Client/package*.json MyApp.Client/npm-shrinkwrap.json MyApp.Client/postinstall.mjs ./
4242RUN npm ci
4343COPY MyApp.Client/ ./
44- RUN npm run build:prod
44+ RUN npm run build
4545
4646# Restore and publish .NET app
4747WORKDIR /src
Original file line number Diff line number Diff line change 11/// <reference types="next" />
22/// <reference types="next/image-types/global" />
3- import "./dist/dev/ types/routes.d.ts" ;
3+ import "./dist/types/routes.d.ts" ;
44
55// NOTE: This file should not be edited
66// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.
Original file line number Diff line number Diff line change 55 "dev" : " next dev" ,
66 "dtos" : " npx get-dtos ts" ,
77 "build" : " next build" ,
8- "build:local" : " cross-env NODE_ENV=development MODE=local next build" ,
98 "publish" : " npm run build && dotnet publish ../MyApp/MyApp.csproj -c Release" ,
109 "start" : " next start" ,
1110 "typecheck" : " tsc" ,
1211 "test" : " vitest" ,
1312 "test:ui" : " vitest --ui" ,
1413 "test:run" : " vitest run" ,
15- "postinstall" : " test -f ./postinstall.mjs && node ./postinstall.mjs || true "
14+ "postinstall" : " node ./postinstall.mjs"
1615 },
1716 "dependencies" : {
1817 "@servicestack/client" : " ^2.1.13" ,
Original file line number Diff line number Diff line change 55import { execSync } from 'child_process'
66import { join , dirname } from 'path'
77import { fileURLToPath } from 'url'
8+ import { readdirSync , existsSync } from 'fs'
89
910const __filename = fileURLToPath ( import . meta. url )
1011const __dirname = dirname ( __filename )
@@ -20,6 +21,16 @@ function isDotnetInstalled() {
2021
2122function runMigration ( ) {
2223 const myAppPath = join ( __dirname , '..' , 'MyApp' )
24+ const appDataPath = join ( myAppPath , 'App_Data' )
25+
26+ // Only run migration if App_Data doesn't exist or has no files (other than .gitkeep)
27+ if ( existsSync ( appDataPath ) ) {
28+ const files = readdirSync ( appDataPath ) . filter ( file => file !== '.gitkeep' )
29+ if ( files . length > 0 ) {
30+ console . log ( 'Skipping migration: App_Data already contains files' )
31+ return
32+ }
33+ }
2334
2435 try {
2536 console . log ( 'Running database migration...' )
You can’t perform that action at this time.
0 commit comments