create-gramstax 0.1.2 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -36,7 +36,7 @@
36
36
  },
37
37
  "dependencies": {
38
38
  "logging-pretty": "^3.0.0",
39
- "gramstax": "^0.1.1"
39
+ "gramstax": "^0.1.2"
40
40
  },
41
41
  "peerDependencies": {
42
42
  "typescript": "5.9.3"
@@ -1,4 +1,4 @@
1
- import { CtxCore } from "~/core"
1
+ import { CtxCore } from "~/core/ctx"
2
2
 
3
3
  export abstract class GuardBase extends CtxCore {
4
4
  public constructor(ctx: CtxCore) {
@@ -1,3 +1,3 @@
1
- import { CtxCore } from "~/core"
1
+ import { CtxCore } from "~/core/ctx"
2
2
 
3
3
  export abstract class PageBase extends CtxCore {}
@@ -1 +1 @@
1
- export abstract class RepositoryBase {}
1
+ export abstract class RepoBase {}
@@ -0,0 +1,3 @@
1
+ import { CacheExternal } from "gramstax"
2
+
3
+ export const ExternalCache = CacheExternal
@@ -1,5 +1,5 @@
1
1
  import { Gramstax } from "gramstax"
2
- import { UserGuard } from "~/guards"
2
+ import { UserGuard } from "~/guards/user"
3
3
  import { GeneralErrorPage } from "~/pages/general-error"
4
4
  import { GeneralErrorInputNotFoundPage } from "~/pages/general-error-input-notfound"
5
5
  import type { CtxCore } from "./ctx"
@@ -0,0 +1 @@
1
+ export class ExampleDb {}
@@ -1,4 +1,4 @@
1
- import { GuardBase } from "~/base"
1
+ import { GuardBase } from "~/base/guard"
2
2
  import { GeneralErrorPage } from "~/pages/general-error"
3
3
  import { UserNameNotFoundPage } from "~/pages/username-notfound"
4
4
 
@@ -1,15 +1,15 @@
1
1
  import { env } from "./env"
2
- import { log } from "./utils/log"
2
+ import { logUt } from "./utils/log"
3
3
  import { BotCore } from "./core/bot"
4
4
  import { MainThread } from "./threads/main"
5
- import { CacheExternal } from "gramstax"
5
+ import { ExternalCache } from "./cache/external"
6
6
 
7
7
  new MainThread(() => {
8
- log.success(`Bot started..`)
8
+ logUt.success(`Bot started..`)
9
9
 
10
10
  new BotCore({
11
11
  token: env.BOT_TOKEN,
12
12
  deploy: env.BOT_DEPLOY,
13
- cacheSession: new CacheExternal(env.CACHE_SESSION, `session`, 24 * 60 * 60 * 1000)
13
+ cacheSession: new ExternalCache(env.CACHE_SESSION, `session`, 24 * 60 * 60 * 1000)
14
14
  })
15
15
  })
@@ -1,4 +1,4 @@
1
- import { PageBase } from "~/base"
1
+ import { PageBase } from "~/base/page"
2
2
  import { StartPage } from "./start"
3
3
 
4
4
  export class GeneralErrorInputNotFoundPage extends PageBase {
@@ -1,5 +1,5 @@
1
- import { log } from "~/utils"
2
- import { PageBase } from "~/base"
1
+ import { logUt } from "~/utils/log"
2
+ import { PageBase } from "~/base/page"
3
3
  import { StartPage } from "./start"
4
4
 
5
5
  export class GeneralErrorPage extends PageBase {
@@ -10,7 +10,7 @@ export class GeneralErrorPage extends PageBase {
10
10
  }
11
11
 
12
12
  public async transition(constructorName: string, funcName: string, error: unknown, isUpdate = true) {
13
- log.errorMake(error, constructorName, funcName)
13
+ logUt.errorMake(error, constructorName, funcName)
14
14
  await this.sessionClear()
15
15
 
16
16
  const kb = this.kb()
@@ -1,4 +1,4 @@
1
- import { PageBase } from "~/base"
1
+ import { PageBase } from "~/base/page"
2
2
  import { StartPage } from "./start"
3
3
 
4
4
  export class HelpPage extends PageBase {
@@ -1,5 +1,5 @@
1
1
  import { HelpPage } from "./help"
2
- import { PageBase } from "~/base"
2
+ import { PageBase } from "~/base/page"
3
3
 
4
4
  export class StartPage extends PageBase {
5
5
  public kb() {
@@ -1,5 +1,5 @@
1
1
  import { HelpPage } from "./help"
2
- import { PageBase } from "~/base"
2
+ import { PageBase } from "~/base/page"
3
3
 
4
4
  export class UserNameNotFoundPage extends PageBase {
5
5
  public kb() {
@@ -1,3 +1,3 @@
1
- import { RepositoryBase } from "~/base"
1
+ import { RepoBase } from "~/base/repository"
2
2
 
3
- export class ExampleRepo extends RepositoryBase {}
3
+ export class ExampleRepo extends RepoBase {}
@@ -1,7 +1,7 @@
1
1
  import { isMainThread } from "bun"
2
2
 
3
3
  export class MainThread {
4
- constructor(wrapCode: () => any) {
4
+ public constructor(wrapCode: () => any) {
5
5
  if (isMainThread === true) {
6
6
  wrapCode()
7
7
  }
@@ -1,2 +1,2 @@
1
1
  import { log } from "gramstax"
2
- export { log }
2
+ export { log as logUt }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-gramstax",
3
- "version": "0.1.2",
3
+ "version": "0.2.0",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "access": "public",
@@ -1,4 +0,0 @@
1
- export * from "./guard"
2
- export * from "./page"
3
- export * from "./repository"
4
- export * from "./service"
@@ -1,2 +0,0 @@
1
- export * from "./bot"
2
- export * from "./ctx"
@@ -1 +0,0 @@
1
- export class Db {}
@@ -1 +0,0 @@
1
- export * from "./user"
@@ -1 +0,0 @@
1
- export * from "./example"
@@ -1 +0,0 @@
1
- export * from "./example"
@@ -1 +0,0 @@
1
- export * from "./main"
@@ -1 +0,0 @@
1
- export * from "./log"