feat: auth/gameToken 모듈로의 경로 변경 및 tsdown 설정 추가
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { randomUUID } from 'node:crypto';
|
||||
|
||||
import type { GameSessionTokenPayload } from '@sammo-ts/common';
|
||||
import type { GameSessionTokenPayload } from '@sammo-ts/common/auth/gameToken';
|
||||
import { isValid, parseISO } from 'date-fns';
|
||||
|
||||
interface RedisClientLike {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { GameSessionTokenPayload } from '@sammo-ts/common';
|
||||
import { decryptGameSessionToken } from '@sammo-ts/common';
|
||||
import type { GameSessionTokenPayload } from '@sammo-ts/common/auth/gameToken';
|
||||
import { decryptGameSessionToken } from '@sammo-ts/common/auth/gameToken';
|
||||
import { isAfter, isValid, parseISO } from 'date-fns';
|
||||
|
||||
import type { FlushStore } from './flushStore.js';
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { z } from 'zod';
|
||||
import type { GameSessionTokenPayload } from '@sammo-ts/common';
|
||||
import type { GameSessionTokenPayload } from '@sammo-ts/common/auth/gameToken';
|
||||
import type { DatabaseClient as InfraDatabaseClient, RedisConnector, GamePrisma } from '@sammo-ts/infra';
|
||||
|
||||
import type { TurnDaemonTransport } from './daemon/transport.js';
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { TRPCError } from '@trpc/server';
|
||||
import { decryptGameSessionToken } from '@sammo-ts/common';
|
||||
import { decryptGameSessionToken } from '@sammo-ts/common/auth/gameToken';
|
||||
import { isAfter, isValid, parseISO } from 'date-fns';
|
||||
import { z } from 'zod';
|
||||
|
||||
import type { GameSessionTokenPayload } from '@sammo-ts/common';
|
||||
import type { GameSessionTokenPayload } from '@sammo-ts/common/auth/gameToken';
|
||||
import { procedure, router } from '../../trpc.js';
|
||||
|
||||
const parseDate = (value: string): Date | null => {
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import fastify, { type FastifyRequest } from 'fastify';
|
||||
import cors from '@fastify/cors';
|
||||
import { fastifyTRPCPlugin } from '@trpc/server/adapters/fastify';
|
||||
import { buildGameEventChannel, type GameSessionTokenPayload } from '@sammo-ts/common';
|
||||
import { buildGameEventChannel } from '@sammo-ts/common';
|
||||
import type { GameSessionTokenPayload } from '@sammo-ts/common/auth/gameToken';
|
||||
import {
|
||||
createGamePostgresConnector,
|
||||
createRedisConnector,
|
||||
|
||||
@@ -15,7 +15,7 @@ import { InMemoryTurnDaemonTransport } from '../src/daemon/inMemoryTransport.js'
|
||||
import { InMemoryFlushStore } from '../src/auth/flushStore.js';
|
||||
import { RedisAccessTokenStore } from '../src/auth/accessTokenStore.js';
|
||||
import { appRouter } from '../src/router.js';
|
||||
import type { GameSessionTokenPayload } from '@sammo-ts/common';
|
||||
import type { GameSessionTokenPayload } from '@sammo-ts/common/auth/gameToken';
|
||||
|
||||
const profile: GameProfile = {
|
||||
id: 'che',
|
||||
|
||||
@@ -4,7 +4,7 @@ import { TRPCError } from '@trpc/server';
|
||||
import { addHours, addSeconds, isAfter, isValid, parseISO } from 'date-fns';
|
||||
import { z } from 'zod';
|
||||
|
||||
import { decryptGameSessionToken, encryptGameSessionToken } from '@sammo-ts/common';
|
||||
import { decryptGameSessionToken, encryptGameSessionToken } from '@sammo-ts/common/auth/gameToken';
|
||||
|
||||
import { procedure, router } from './trpc.js';
|
||||
import { toPublicUser } from './auth/userRepository.js';
|
||||
|
||||
@@ -5,9 +5,19 @@
|
||||
"type": "module",
|
||||
"main": "dist/index.js",
|
||||
"types": "dist/index.d.ts",
|
||||
"exports": {
|
||||
".": {
|
||||
"types": "./dist/index.d.ts",
|
||||
"default": "./dist/index.js"
|
||||
},
|
||||
"./auth/gameToken": {
|
||||
"types": "./dist/auth/gameToken.d.ts",
|
||||
"default": "./dist/auth/gameToken.js"
|
||||
}
|
||||
},
|
||||
"scripts": {
|
||||
"build": "tsdown -c ../../tsdown.config.ts -F @sammo-ts/common",
|
||||
"dev": "tsdown -c ../../tsdown.config.ts -F @sammo-ts/common --watch",
|
||||
"build": "tsdown -c ./tsdown.config.ts",
|
||||
"dev": "tsdown -c ./tsdown.config.ts --watch",
|
||||
"lint": "eslint .",
|
||||
"lint:fix": "eslint . --fix",
|
||||
"test": "vitest run --config vitest.config.ts",
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
export * from './rng.js';
|
||||
export * from './auth/gameToken.js';
|
||||
export * from './time/Clock.js';
|
||||
export * from './util/BytesLike.js';
|
||||
export * from './util/convertBytesLikeToArrayBuffer.js';
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
import { defineConfig } from 'tsdown';
|
||||
|
||||
export default defineConfig({
|
||||
entry: {
|
||||
index: 'src/index.ts',
|
||||
'auth/gameToken': 'src/auth/gameToken.ts',
|
||||
},
|
||||
format: 'es',
|
||||
outDir: 'dist',
|
||||
dts: {
|
||||
build: true,
|
||||
},
|
||||
sourcemap: true,
|
||||
target: 'node22',
|
||||
platform: 'node',
|
||||
fixedExtension: false,
|
||||
hash: false,
|
||||
});
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"extends": "../../tsconfig.paths.json",
|
||||
"compilerOptions": {
|
||||
"types": ["node"],
|
||||
"noEmit": true
|
||||
|
||||
Reference in New Issue
Block a user