From 82f2c736e05952313b63e79112a6662304178f14 Mon Sep 17 00:00:00 2001 From: Samuel Kopp <62482066+boywithkeyboard@users.noreply.github.com> Date: Sun, 16 Jul 2023 16:36:28 +0200 Subject: [PATCH] BREAKING: rename files (#104) * remove files * add lowercase files * remove files * add files --- cheetah.ts | 6 +++--- Collection.ts => collection.ts | 0 Context.ts => context.ts | 4 ++-- Exception.ts => exception.ts | 0 mod.ts | 6 +++--- RequestContext.ts => request_context.ts | 0 ResponseContext.ts => response_context.ts | 0 test/{Exception.test.ts => exception.test.ts} | 0 x/{Cache.ts => cache.ts} | 0 x/{LocationData.ts => location_data.ts} | 0 x/mod.ts | 8 -------- x/{sendMail.ts => send_email.ts} | 0 x/x.test.tsx | 8 ++++---- 13 files changed, 12 insertions(+), 20 deletions(-) rename Collection.ts => collection.ts (100%) rename Context.ts => context.ts (94%) rename Exception.ts => exception.ts (100%) rename RequestContext.ts => request_context.ts (100%) rename ResponseContext.ts => response_context.ts (100%) rename test/{Exception.test.ts => exception.test.ts} (100%) rename x/{Cache.ts => cache.ts} (100%) rename x/{LocationData.ts => location_data.ts} (100%) delete mode 100644 x/mod.ts rename x/{sendMail.ts => send_email.ts} (100%) diff --git a/cheetah.ts b/cheetah.ts index e764eb8..f9f2c4d 100644 --- a/cheetah.ts +++ b/cheetah.ts @@ -1,8 +1,8 @@ // Copyright 2023 Samuel Kopp. All rights reserved. Apache-2.0 license. import { base, Method } from './base.ts' -import { Collection } from './Collection.ts' -import { Context } from './Context.ts' -import { Exception } from './Exception.ts' +import { Collection } from './collection.ts' +import { Context } from './context.ts' +import { Exception } from './exception.ts' import { Extension, validExtension } from './extensions.ts' import { Handler, HandlerOrSchema, Payload } from './handler.ts' diff --git a/Collection.ts b/collection.ts similarity index 100% rename from Collection.ts rename to collection.ts diff --git a/Context.ts b/context.ts similarity index 94% rename from Context.ts rename to context.ts index daf2eeb..66caabb 100644 --- a/Context.ts +++ b/context.ts @@ -1,7 +1,7 @@ // Copyright 2023 Samuel Kopp. All rights reserved. Apache-2.0 license. import { ZodType } from 'https://deno.land/x/zod@v3.21.4/types.ts' -import { RequestContext } from './RequestContext.ts' -import { ResponseContext } from './ResponseContext.ts' +import { RequestContext } from './request_context.ts' +import { ResponseContext } from './response_context.ts' import { AppContext } from './cheetah.ts' import { ObjectType, Payload } from './handler.ts' diff --git a/Exception.ts b/exception.ts similarity index 100% rename from Exception.ts rename to exception.ts diff --git a/mod.ts b/mod.ts index 2b1e563..1eeee34 100644 --- a/mod.ts +++ b/mod.ts @@ -1,8 +1,8 @@ // Copyright 2023 Samuel Kopp. All rights reserved. Apache-2.0 license. -export { Collection } from './Collection.ts' -export type { Context } from './Context.ts' -export { Exception } from './Exception.ts' export { cheetah as default } from './cheetah.ts' export type { AppConfig, AppContext } from './cheetah.ts' +export { Collection } from './collection.ts' +export { Context } from './context.ts' +export { Exception } from './exception.ts' export { createExtension } from './extensions.ts' export type { Extension } from './extensions.ts' diff --git a/RequestContext.ts b/request_context.ts similarity index 100% rename from RequestContext.ts rename to request_context.ts diff --git a/ResponseContext.ts b/response_context.ts similarity index 100% rename from ResponseContext.ts rename to response_context.ts diff --git a/test/Exception.test.ts b/test/exception.test.ts similarity index 100% rename from test/Exception.test.ts rename to test/exception.test.ts diff --git a/x/Cache.ts b/x/cache.ts similarity index 100% rename from x/Cache.ts rename to x/cache.ts diff --git a/x/LocationData.ts b/x/location_data.ts similarity index 100% rename from x/LocationData.ts rename to x/location_data.ts diff --git a/x/mod.ts b/x/mod.ts deleted file mode 100644 index 3eac3c2..0000000 --- a/x/mod.ts +++ /dev/null @@ -1,8 +0,0 @@ -// Copyright 2023 Samuel Kopp. All rights reserved. Apache-2.0 license. -export { Cache } from './Cache.ts' -export { LocationData } from './LocationData.ts' -export { env } from './env.ts' -export { jsx } from './jsx.tsx' -export { createKey, default as jwt, importKey } from './jwt.ts' -export { otp } from './otp.ts' -export { sendMail } from './sendMail.ts' diff --git a/x/sendMail.ts b/x/send_email.ts similarity index 100% rename from x/sendMail.ts rename to x/send_email.ts diff --git a/x/x.test.tsx b/x/x.test.tsx index d3eba7b..34f34c5 100644 --- a/x/x.test.tsx +++ b/x/x.test.tsx @@ -6,7 +6,7 @@ import { } from 'https://deno.land/std@0.194.0/testing/asserts.ts' import { cheetah } from '../cheetah.ts' import { h, jsx } from './jsx.tsx' -import { createKey, importKey, jwt } from './mod.ts' +import { createKey, importKey, sign, verify } from './jwt.ts' Deno.test('x', async (t) => { await t.step('jwt', async () => { @@ -15,10 +15,10 @@ Deno.test('x', async (t) => { assertInstanceOf(cryptoKey, CryptoKey) - const token = await jwt.sign({ example: 'object' }, key) + const token = await sign({ example: 'object' }, key) - assertEquals(await jwt.verify(token, key) !== undefined, true) - assertEquals(await jwt.verify(token, cryptoKey) !== undefined, true) + assertEquals(await verify(token, key) !== undefined, true) + assertEquals(await verify(token, cryptoKey) !== undefined, true) }) await t.step('jsx', async () => {