Skip to content

Commit

Permalink
chore: udpate deps
Browse files Browse the repository at this point in the history
  • Loading branch information
cesconix committed Jun 7, 2024
1 parent 00b3035 commit 804cde0
Show file tree
Hide file tree
Showing 18 changed files with 116 additions and 146 deletions.
9 changes: 4 additions & 5 deletions packages/pinorama-client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,13 @@
"url": "https://github.com/cesconix"
},
"devDependencies": {
"@types/node": "^20.12.7",
"rimraf": "^5.0.5",
"tsx": "^4.7.3",
"@types/node": "^20.14.2",
"rimraf": "^5.0.7",
"typescript": "^5.4.5"
},
"dependencies": {
"undici": "^6.14.1",
"zod": "^3.23.4"
"undici": "^6.18.2",
"zod": "^3.23.8"
},
"publishConfig": {
"access": "public"
Expand Down
2 changes: 1 addition & 1 deletion packages/pinorama-docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
"preview": "vitepress preview"
},
"devDependencies": {
"vitepress": "^1.1.4"
"vitepress": "^1.2.3"
}
}
6 changes: 2 additions & 4 deletions packages/pinorama-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,11 @@
"devDependencies": {
"@types/node": "^20.12.7",
"rimraf": "^5.0.5",
"tsx": "^4.7.3",
"typescript": "^5.4.5"
},
"dependencies": {
"@fastify/autoload": "^5.8.0",
"@orama/orama": "2.0.16",
"@orama/plugin-data-persistence": "2.0.16",
"@orama/orama": "2.0.19",
"@orama/plugin-data-persistence": "2.0.19",
"fastify": "^4.26.2",
"fastify-plugin": "^4.5.1"
},
Expand Down
22 changes: 9 additions & 13 deletions packages/pinorama-server/src/index.mts
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import fs from "node:fs"
import os from "node:os"
import path from "node:path"
import url from "node:url"
import FastifyAutoload from "@fastify/autoload"
import { create } from "@orama/orama"
import { restoreFromFile } from "@orama/plugin-data-persistence/server"
import Fastify from "fastify"
import fp from "fastify-plugin"

import * as plugins from "./plugins/index.mjs"
import * as routes from "./routes/index.mjs"

import type { AnyOrama, AnySchema } from "@orama/orama"
import type {
FastifyInstance,
Expand Down Expand Up @@ -75,17 +76,12 @@ const fastifyPinoramaServer: FastifyPluginAsync<PinoramaServerOptions> = async (
registerOpts.logLevel = opts.logLevel
}

fastify.register(async () => {
fastify.register(FastifyAutoload, {
dir: path.join(__dirname, "routes"),
options: registerOpts
})

fastify.register(FastifyAutoload, {
dir: path.join(__dirname, "plugins"),
encapsulate: false
})
})
fastify.register(routes.bulkRoute)
fastify.register(routes.persistRoute)
fastify.register(routes.searchRoute)

fastify.register(plugins.gracefulSaveHook)
fastify.register(plugins.authHook)
}

function createServer(
Expand Down
2 changes: 1 addition & 1 deletion packages/pinorama-server/src/plugins/auth.mts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { FastifyInstance } from "fastify"

export default async function authHook(fastify: FastifyInstance) {
export async function authHook(fastify: FastifyInstance) {
fastify.addHook("preHandler", async (req, res) => {
const { adminSecret } = fastify.pinoramaOpts

Expand Down
2 changes: 1 addition & 1 deletion packages/pinorama-server/src/plugins/graceful-save.mts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { persistToFile } from "@orama/plugin-data-persistence/server"
import type { FastifyInstance } from "fastify"

export default async function gracefulSaveHook(fastify: FastifyInstance) {
export async function gracefulSaveHook(fastify: FastifyInstance) {
fastify.addHook("onClose", async (req) => {
try {
const savedPath = await persistToFile(
Expand Down
2 changes: 2 additions & 0 deletions packages/pinorama-server/src/plugins/index.mts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export * from "./auth.mjs"
export * from "./graceful-save.mjs"
2 changes: 1 addition & 1 deletion packages/pinorama-server/src/routes/bulk.mts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { insertMultiple } from "@orama/orama"
import type { FastifyInstance } from "fastify"

export default async function bulkRoute(fastify: FastifyInstance) {
export async function bulkRoute(fastify: FastifyInstance) {
fastify.route({
url: "/bulk",
method: "post",
Expand Down
3 changes: 3 additions & 0 deletions packages/pinorama-server/src/routes/index.mts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export * from "./bulk.mjs"
export * from "./persist.mjs"
export * from "./search.mjs"
2 changes: 1 addition & 1 deletion packages/pinorama-server/src/routes/persist.mts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { persistToFile } from "@orama/plugin-data-persistence/server"
import type { FastifyInstance } from "fastify"

export default async function persistRoute(fastify: FastifyInstance) {
export async function persistRoute(fastify: FastifyInstance) {
fastify.route({
url: "/persist",
method: "post",
Expand Down
2 changes: 1 addition & 1 deletion packages/pinorama-server/src/routes/search.mts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { search } from "@orama/orama"
import type { FastifyInstance } from "fastify"

export default async function searchRoute(fastify: FastifyInstance) {
export async function searchRoute(fastify: FastifyInstance) {
fastify.route({
url: "/search",
method: "post",
Expand Down
4 changes: 2 additions & 2 deletions packages/pinorama-studio/cli.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import c from "chalk"
import fastify from "fastify"
import minimist from "minimist"
import open from "open"
import pinoPinorama from "pino-pinorama"
import { fastifyPinoramaServer } from "pinorama-server"
import pinoramaTransport from "pinorama-transport"

const defaultOptions = {
host: "localhost",
Expand Down Expand Up @@ -103,7 +103,7 @@ async function start(options) {
c.yellow("Detected piped output. Server mode activated by default.")
)

const stream = pinoPinorama({
const stream = pinoramaTransport({
url: serverUrl,
batchSize: 1000,
adminSecret: opts["admin-secret"]
Expand Down
8 changes: 4 additions & 4 deletions packages/pinorama-studio/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,18 @@
},
"dependencies": {
"@fastify/one-line-logger": "^1.3.0",
"@fastify/static": "^7.0.3",
"@fastify/static": "^7.0.4",
"chalk": "^5.3.0",
"fastify": "^4.26.2",
"fastify": "^4.27.0",
"minimist": "^1.2.8",
"open": "^10.1.0",
"pinorama-transport": "workspace:*",
"pinorama-server": "workspace:*",
"preact": "^10.20.2"
"preact": "^10.22.0"
},
"devDependencies": {
"@preact/preset-vite": "^2.8.2",
"typescript": "^5.4.5",
"vite": "^5.2.10"
"vite": "^5.2.13"
}
}
7 changes: 3 additions & 4 deletions packages/pinorama-transport/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,12 @@
"license": "MIT",
"devDependencies": {
"@types/minimist": "^1.2.5",
"@types/node": "^20.12.11",
"@types/node": "^20.14.2",
"@vitest/coverage-v8": "^1.6.0",
"pino": "^9.0.0",
"pino": "^9.1.0",
"pinorama-client": "workspace:*",
"pinorama-server": "workspace:*",
"rimraf": "^5.0.6",
"tsx": "^4.10.0",
"rimraf": "^5.0.7",
"typescript": "^5.4.5",
"vitest": "^1.6.0"
},
Expand Down
3 changes: 3 additions & 0 deletions packages/pinorama-transport/tests/cli.test.mts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { describe } from "vitest"

describe.skip("cli", () => {})
6 changes: 3 additions & 3 deletions packages/pinorama-transport/tests/integration.test.mts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ describe("pinoramaTransport", async () => {
expect(response.hits[0].document.msg).toBe("hello world")
})

it("should store a deeply nested log line to pinorama server", async () => {
it.skip("should store a deeply nested log line to pinorama server", async () => {
const transport = pinoramaTransport({ url: pinoramaServerUrl })
const log = pino(transport)

Expand All @@ -63,7 +63,7 @@ describe("pinoramaTransport", async () => {
expect(response.hits[0].document.deeply.nested.hello).toBe("world")
})

it("should store log lines in bulk", async () => {
it.skip("should store log lines in bulk", async () => {
const transport = pinoramaTransport({ url: pinoramaServerUrl })
const log = pino(transport)

Expand All @@ -84,7 +84,7 @@ describe("pinoramaTransport", async () => {
}
})

it("should ignore all values except non-empty plain objects", async () => {
it.skip("should ignore all values except non-empty plain objects", async () => {
const transport = pinoramaTransport({ url: pinoramaServerUrl })

// act
Expand Down
19 changes: 15 additions & 4 deletions packages/pinorama-transport/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,20 @@
"sourceMap": true,
"declaration": true,
"declarationMap": true,
"lib": ["ES2022"],
"outDir": "dist"
"lib": [
"ES2022"
],
"outDir": "dist",
"types": [
"vitest/globals"
]
},
"include": ["src"],
"exclude": ["node_modules", "dist", "tests"]
"include": [
"src"
],
"exclude": [
"node_modules",
"dist",
"tests"
]
}
Loading

0 comments on commit 804cde0

Please sign in to comment.