Skip to content

Commit

Permalink
Merge branch 'release/v0.65.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
holtwick committed Jan 24, 2025
2 parents 26d2879 + 9355db3 commit 213a581
Show file tree
Hide file tree
Showing 16 changed files with 38 additions and 27 deletions.
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@zerva/monorepo",
"type": "module",
"version": "0.65.1",
"version": "0.65.2",
"private": true,
"engines": {
"node": ">=20.0.0"
Expand All @@ -24,15 +24,15 @@
"update": "pnpm -r update -i --latest"
},
"devDependencies": {
"@antfu/eslint-config": "^3.13.0",
"@antfu/eslint-config": "^3.14.0",
"@antfu/ni": "^23.2.0",
"@types/bun": "^1.1.16",
"@types/jest": "^29.5.14",
"@types/node": "^22.10.5",
"bumpp": "^9.10.0",
"eslint": "^9.17.0",
"@types/node": "^22.10.7",
"bumpp": "^9.10.1",
"eslint": "^9.18.0",
"only-allow": "^1.2.1",
"sort-package-json": "^2.12.0",
"sort-package-json": "^2.14.0",
"tsup": "^8.3.5",
"typescript": "^5.7.3",
"vite": "^6.0.7",
Expand Down
2 changes: 1 addition & 1 deletion zerva-bin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"test": "echo todo"
},
"dependencies": {
"@types/node": "^22.10.5",
"@types/node": "^22.10.7",
"display-notification": "^3.0.0",
"esbuild": "^0.24.2",
"esbuild-plugin-yaml": "^0.0.1",
Expand Down
2 changes: 1 addition & 1 deletion zerva-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
},
"devDependencies": {
"@types/jest": "^29.5.14",
"@types/node": "^22.10.5",
"@types/node": "^22.10.7",
"@zerva/bin": "workspace:*",
"tsup": "^8.3.5",
"typescript": "^5.7.3",
Expand Down
2 changes: 1 addition & 1 deletion zerva-email/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
"zeed": "^0.27.1"
},
"devDependencies": {
"@types/node": "^22.10.5",
"@types/node": "^22.10.7",
"tsup": "^8.3.5"
}
}
4 changes: 2 additions & 2 deletions zerva-http/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@zerva/http",
"type": "module",
"version": "0.65.1",
"version": "0.65.2",
"description": "🌱 Zerva Express HTTP",
"author": {
"name": "Dirk Holtwick",
Expand Down Expand Up @@ -54,7 +54,7 @@
"@types/compressible": "^2.0.2",
"@types/cors": "^2.8.17",
"@types/express": "^5.0.0",
"@types/express-serve-static-core": "^5.0.4",
"@types/express-serve-static-core": "^5.0.5",
"@types/negotiator": "^0.6.3",
"@types/on-headers": "^1.0.3",
"@types/vary": "^1.1.3",
Expand Down
8 changes: 6 additions & 2 deletions zerva-http/src/http.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,11 @@ export function useHttp(config?: {

if (postJson) {
log(`Post JSON, limit=${postLimit}`)
app.use(express.json({ limit: postLimit }))
app.use(express.json({ limit: postLimit,
verify: (req, res, buf) => {
if (req)
(req as any).rawBody = buf
} }))
}

if (postText) {
Expand Down Expand Up @@ -244,7 +248,7 @@ export function useHttp(config?: {
}
}
catch (err) {
log.warn(`Problems handling reuest for ${path}`, err)
log.warn(`Problems handling request for ${path}`, err)
}
})
}
Expand Down
2 changes: 1 addition & 1 deletion zerva-http/src/status.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Logger } from 'zeed'
import type { LoggerInterface } from 'zeed'
import { Logger } from 'zeed'

const log: LoggerInterface = Logger('status')

Expand Down
2 changes: 1 addition & 1 deletion zerva-mqtt/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
"zeed": "^0.27.1"
},
"devDependencies": {
"@types/node": "^22.10.5",
"@types/node": "^22.10.7",
"tsup": "^8.3.5"
}
}
2 changes: 1 addition & 1 deletion zerva-rpc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
"zeed": "^0.27.1"
},
"devDependencies": {
"@types/node": "^22.10.5",
"@types/node": "^22.10.7",
"@zerva/bin": "workspace:*",
"tsup": "^8.3.5",
"typescript": "^5.7.3",
Expand Down
2 changes: 1 addition & 1 deletion zerva-sqlite-bun/src/table.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { arrayMinus, arraySorted, getTimestamp, isArray, isBoolean, isNumber, isPrimitive, isString, Logger } from 'zeed'
import type { Database as SqliteDatabase, Statement as SqliteStatement } from 'bun:sqlite'
import type { Primitive } from 'zeed'
import { arrayMinus, arraySorted, getTimestamp, isArray, isBoolean, isNumber, isPrimitive, isString, Logger } from 'zeed'
// import type { SqliteDatabase, SqliteRunResult, SqliteStatement } from './sqlite'

export interface SqliteRunResult {
Expand Down
2 changes: 1 addition & 1 deletion zerva-sqlite/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"watch": "tsup src/index.ts --watch"
},
"dependencies": {
"better-sqlite3": "^11.7.2",
"better-sqlite3": "<11.8.0",
"zeed": "^0.27.1"
},
"devDependencies": {
Expand Down
4 changes: 2 additions & 2 deletions zerva-sqlite/src/table-schema.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { arrayMinus, arraySorted, getTimestamp, isArray, isBoolean, isPrimitive, Logger } from 'zeed'
import type { Infer, Primitive, Type } from 'zeed'
import { mapSchemaTypeToField } from './_types'
import type { OrderByMany, SqliteTableDefault } from './_types'
import type { SqliteDatabase, SqliteRunResult, SqliteStatement } from './sqlite'
import { arrayMinus, arraySorted, getTimestamp, isArray, isBoolean, isPrimitive, Logger } from 'zeed'
import { mapSchemaTypeToField } from './_types'

const log = Logger('sqlite:table')

Expand Down
2 changes: 1 addition & 1 deletion zerva-sqlite/src/table.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { arrayMinus, arraySorted, getTimestamp, isArray, isBoolean, isPrimitive, Logger } from 'zeed'
import type { Primitive } from 'zeed'
import type { OrderByMany, SqliteTableDefault } from './_types'
import type { SqliteDatabase, SqliteRunResult, SqliteStatement } from './sqlite'
import { arrayMinus, arraySorted, getTimestamp, isArray, isBoolean, isPrimitive, Logger } from 'zeed'

const log = Logger('sqlite:table')

Expand Down
2 changes: 1 addition & 1 deletion zerva-vite/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@zerva/vite",
"type": "module",
"version": "0.65.1",
"version": "0.65.2",
"description": "🌱 Zerva and Vite",
"author": {
"name": "Dirk Holtwick",
Expand Down
15 changes: 11 additions & 4 deletions zerva-vite/src/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export function useVite(config?: {
www?: string
mode?: string
// hmr?: boolean
cacheAssets?: boolean
}) {
const log = LoggerFromConfig(config?.log ?? true, moduleName, LogLevelInfo)
log(`use ${moduleName} ${process.env.ZERVA}`)
Expand All @@ -35,6 +36,7 @@ export function useVite(config?: {
www = './dist_www',
mode = (ZERVA_DEVELOPMENT ? 'development' : 'production'),
// hmr = true,
cacheAssets = true,
} = config ?? {}

const rootPath = toPath(root)
Expand Down Expand Up @@ -95,10 +97,15 @@ export function useVite(config?: {
const multiInputCache: Record<string, string> = {}

// Cache static assets
app.get(/[^\/]assets\//, (req: any, res: any) => {
res.setHeader('Cache-Control', 'max-age=31536000, immutable')
// Cache-Control: max-age=31536000, immutable
})
if (cacheAssets) {
app.use((req, res, next) => {
const path = req.path
if (path.includes('/assets/') || /.*\.(?:png|ico|svg|jpg|pdf|jpeg|mp4|mp3|woff2|ttf|tflite)$/.test(req.path)) {
res.setHeader('Cache-Control', 'max-age=31536000, immutable')
}
next()
})
}

// Map dynamic routes to index.html
app?.get(/.*/, (req: any, res: any) => {
Expand Down
2 changes: 1 addition & 1 deletion zerva-websocket/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
"zeed": "^0.27.1"
},
"devDependencies": {
"@types/node": "^22.10.5",
"@types/node": "^22.10.7",
"@zerva/bin": "workspace:*",
"tsup": "^8.3.5",
"typescript": "^5.7.3",
Expand Down

0 comments on commit 213a581

Please sign in to comment.