Skip to content

Commit 614695d

Browse files
chore: fix startup script
1 parent 4d1f8f0 commit 614695d

File tree

9 files changed

+38
-37
lines changed

9 files changed

+38
-37
lines changed

examples/epic-stack/.vscode/remix.code-snippets

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,4 +77,4 @@
7777
"}",
7878
],
7979
},
80-
}
80+
}

examples/epic-stack/app/root.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ import { type Theme, getTheme } from './utils/theme.server.ts'
3939
import { makeTimings, time } from './utils/timing.server.ts'
4040
import { getToast } from './utils/toast.server.ts'
4141
import { useOptionalUser } from './utils/user.ts'
42-
import "./styles/tailwind.css"
42+
import './styles/tailwind.css'
4343

4444
export const links: Route.LinksFunction = () => {
4545
return [

examples/epic-stack/app/utils/db.server.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { remember } from '@epic-web/remember'
2-
import {PrismaClient} from '@prisma/client/index'
2+
import { PrismaClient } from '@prisma/client/index'
33

44
import chalk from 'chalk'
55

examples/epic-stack/docs/server-timing.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,10 @@ export async function loader({ params }: Route.LoaderArgs) {
7878
// We have a general headers handler to save you from boilerplating.
7979
export const headers: HeadersFunction = pipeHeaders
8080
// this is basically what it does though
81-
export const headers: Route.HeadersFunction = ({ loaderHeaders, parentHeaders }) => {
81+
export const headers: Route.HeadersFunction = ({
82+
loaderHeaders,
83+
parentHeaders,
84+
}) => {
8285
return {
8386
'Server-Timing': combineServerTimings(parentHeaders, loaderHeaders), // <-- 4. Send headers
8487
}

examples/epic-stack/index.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,15 @@ sourceMapSupport.install({
1616
},
1717
})
1818

19-
2019
if (process.env.MOCKS === 'true') {
2120
await import('./tests/mocks/index.ts')
2221
}
2322

2423
if (process.env.NODE_ENV === 'production') {
25-
let build = (await import('./build/server/static/js/app.js'))
26-
build = build?.default || build;
24+
let build = await import('./build/server/static/js/app.js')
25+
build = build?.default || build
2726
build = build?.createApp || build
28-
build();
27+
build()
2928
} else {
3029
await import('./server/dev-build.js')
3130
}
Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
import { defineConfig } from '@rsbuild/core';
2-
import { pluginReact } from '@rsbuild/plugin-react';
3-
import { pluginReactRouter } from 'rsbuild-plugin-react-router';
4-
import 'react-router';
1+
import { defineConfig } from '@rsbuild/core'
2+
import { pluginReact } from '@rsbuild/plugin-react'
3+
import { pluginReactRouter } from 'rsbuild-plugin-react-router'
4+
import 'react-router'
55

66
export default defineConfig(() => {
7-
return {
8-
output: {
9-
externals: [
10-
'better-sqlite3',
11-
'express',
12-
]
13-
},
14-
plugins: [pluginReactRouter({customServer: true, serverOutput: 'commonjs'}), pluginReact()],
15-
};
16-
});
7+
return {
8+
output: {
9+
externals: ['better-sqlite3', 'express'],
10+
},
11+
plugins: [
12+
pluginReactRouter({ customServer: true, serverOutput: 'commonjs' }),
13+
pluginReact(),
14+
],
15+
}
16+
})

examples/epic-stack/server/dev-build.js

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,22 @@ import { createRsbuild, loadConfig } from '@rsbuild/core'
22
import 'dotenv/config'
33

44
async function startServer() {
5-
const config = await loadConfig()
6-
const rsbuild = await createRsbuild({
7-
rsbuildConfig: config.content,
8-
})
9-
const devServer = await rsbuild.createDevServer()
5+
const config = await loadConfig()
6+
const rsbuild = await createRsbuild({
7+
rsbuildConfig: config.content,
8+
})
9+
const devServer = await rsbuild.createDevServer()
1010

11-
// Load the bundle first to get createApp
12-
if (!devServer.environments?.node) {
13-
throw new Error('Node environment not found in dev server')
14-
}
11+
// Load the bundle first to get createApp
12+
if (!devServer.environments?.node) {
13+
throw new Error('Node environment not found in dev server')
14+
}
1515

16-
const bundle = await devServer.environments.node.loadBundle('app')
17-
const { createApp } = bundle
18-
const app = await createApp(devServer)
16+
const bundle = await devServer.environments.node.loadBundle('app')
17+
const { createApp } = bundle
18+
const app = await createApp(devServer)
1919

20-
devServer.connectWebSocket({ server: app })
20+
devServer.connectWebSocket({ server: app })
2121
}
2222

2323
void startServer().catch(console.error)

examples/epic-stack/server/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ sourceMapSupport.install({
3030
},
3131
})
3232

33-
3433
const MODE = process.env.NODE_ENV ?? 'development'
3534
const IS_PROD = MODE === 'production'
3635
const IS_DEV = MODE === 'development'

examples/epic-stack/server/utils/monitoring.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {PrismaInstrumentation} from '@prisma/instrumentation'
1+
import { PrismaInstrumentation } from '@prisma/instrumentation'
22
import * as Sentry from '@sentry/node'
33
import { nodeProfilingIntegration } from '@sentry/profiling-node'
44

0 commit comments

Comments
 (0)