From f5f0a560f1e45bddd8e4034699ef31feb00ff3b8 Mon Sep 17 00:00:00 2001 From: moonrailgun Date: Mon, 29 Jan 2024 01:18:35 +0800 Subject: [PATCH] fix: fix @tianji/shared build problem --- package.json | 1 - src/shared/package.json | 2 +- src/shared/src/server.ts | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index ebbe989..aed9c2f 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,6 @@ "start": "cd src/server && cross-env NODE_ENV=production node ./dist/src/server/main.js", "start:docker": "pnpm start:docker:db && pnpm start", "start:docker:db": "cd src/server && pnpm db:migrate:apply", - "postinstall": "cd src/server && pnpm db:generate", "test": "vitest", "build": "pnpm build:tracker && pnpm build:server && pnpm build:client && pnpm build:geo", "build:client": "cd src/client && pnpm build", diff --git a/src/shared/package.json b/src/shared/package.json index 78754ac..caa3256 100644 --- a/src/shared/package.json +++ b/src/shared/package.json @@ -9,7 +9,7 @@ "require": "./dist/cjs/src/shared/src/index.js" }, "scripts": { - "build": "pnpm build:cjs && pnpm build:esm", + "build": "concurrently --kill-others npm:build:cjs npm:build:esm", "build:cjs": "tsc --module commonjs --outDir ./dist/cjs", "build:esm": "tsc --module esnext --outDir ./dist/esm", "postinstall": "pnpm build" diff --git a/src/shared/src/server.ts b/src/shared/src/server.ts index 2c346ee..4b56e67 100644 --- a/src/shared/src/server.ts +++ b/src/shared/src/server.ts @@ -1,4 +1,4 @@ -import type { ServerStatusInfo } from '../../types'; +import { type ServerStatusInfo } from '../../types/server'; export function isServerOnline(info: ServerStatusInfo): boolean { return new Date(info.updatedAt).valueOf() + info.timeout * 1000 > Date.now();