Skip to content

Commit

Permalink
Merge pull request #58 from solaoi/feature_update-deps-and-some-fix
Browse files Browse the repository at this point in the history
Feature update deps and some fix
  • Loading branch information
solaoi authored Jul 14, 2022
2 parents cd45402 + c9a730a commit b2104e1
Show file tree
Hide file tree
Showing 8 changed files with 1,958 additions and 1,596 deletions.
8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
FROM node:18.0.0-alpine as builder
FROM node:18-alpine as builder
WORKDIR /app

COPY package.json package-lock.json .npmrc ./
# overrides field on package.json is not allowd npm ci command...
RUN npm i && npm update

FROM node:18.0.0-alpine
FROM node:18-alpine
WORKDIR /app
ENV PATH /app/node_modules/.bin:$PATH

COPY . .
COPY --from=builder /app/node_modules ./node_modules

ENV NEXT_TELEMETRY_DISABLED 1
ENV NODE_ENV production
ENV NEXT_TELEMETRY_DISABLED=1
ENV NODE_ENV=production

RUN npm run build

Expand Down
1 change: 1 addition & 0 deletions app/api/[[...slug]].ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const dynamicHandler = (method, slug) => {
}

const Handler: BlitzApiHandler = async (req: BlitzApiRequest, res: BlitzApiResponse) => {
res.shouldKeepAlive = false
const {
query: { slug },
method,
Expand Down
5 changes: 4 additions & 1 deletion app/lib/sqlite3Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@ const databasePath =
? join(process.cwd(), "db", database.replace("file:", ""))
: database.replace("file:", "")

const db = new Database(databasePath, { fileMustExist: true })
const db = new Database(databasePath, {
fileMustExist: true,
verbose: (o) => console.log("\u001b[32mbetter-sqlite3:query\x1b[39m " + o),
})

const getProjectIdByPreparedStatement = db.prepare("SELECT id FROM Project WHERE basePath = ?")
const getProjectIdBy = (basePath: string): number | null => {
Expand Down
8 changes: 3 additions & 5 deletions app/pages/stubs/[stubId].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -263,12 +263,10 @@ export const Stub = () => {
.split("\t")
.filter((s) => s !== "")
.map((l, i) => (
<>
<pre style={{ whiteSpace: "pre-wrap" }} key={"log_" + i}>
{i !== 0 ? `\n${l}` : l}
</pre>
<div key={"log_" + i}>
<pre style={{ whiteSpace: "pre-wrap" }}>{i !== 0 ? `\n${l}` : l}</pre>
<hr />
</>
</div>
))
: "Never been requested..."}
</Box>
Expand Down
3 changes: 3 additions & 0 deletions blitz.config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import { BlitzConfig, sessionMiddleware, simpleRolesIsAuthorized } from "blitz"

const config: BlitzConfig = {
log: {
level: "warn",
},
middleware: [
sessionMiddleware({
cookiePrefix: "co-metub",
Expand Down
2 changes: 1 addition & 1 deletion db/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ import { PrismaClient } from "@prisma/client"
const EnhancedPrisma = enhancePrisma(PrismaClient)

export * from "@prisma/client"
export default new EnhancedPrisma()
export default new EnhancedPrisma({ log: ["query", "warn", "error"] })
Loading

0 comments on commit b2104e1

Please sign in to comment.