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.
- package/dist/src/templates/package.json +1 -1
- package/dist/src/templates/src/base/guard.ts +1 -1
- package/dist/src/templates/src/base/page.ts +1 -1
- package/dist/src/templates/src/base/repository.ts +1 -1
- package/dist/src/templates/src/cache/external.ts +3 -0
- package/dist/src/templates/src/core/bot.ts +1 -1
- package/dist/src/templates/src/db/example.ts +1 -0
- package/dist/src/templates/src/guards/user.ts +1 -1
- package/dist/src/templates/src/index.ts +4 -4
- package/dist/src/templates/src/pages/general-error-input-notfound.ts +1 -1
- package/dist/src/templates/src/pages/general-error.ts +3 -3
- package/dist/src/templates/src/pages/help.ts +1 -1
- package/dist/src/templates/src/pages/start.ts +1 -1
- package/dist/src/templates/src/pages/username-notfound.ts +1 -1
- package/dist/src/templates/src/repositories/example.ts +2 -2
- package/dist/src/templates/src/threads/main.ts +1 -1
- package/dist/src/templates/src/utils/log.ts +1 -1
- package/package.json +1 -1
- package/dist/src/templates/src/base/index.ts +0 -4
- package/dist/src/templates/src/core/index.ts +0 -2
- package/dist/src/templates/src/db/index.ts +0 -1
- package/dist/src/templates/src/guards/index.ts +0 -1
- package/dist/src/templates/src/repositories/index.ts +0 -1
- package/dist/src/templates/src/services/index.ts +0 -1
- package/dist/src/templates/src/threads/index.ts +0 -1
- package/dist/src/templates/src/utils/index.ts +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
export abstract class
|
|
1
|
+
export abstract class RepoBase {}
|
|
@@ -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,15 +1,15 @@
|
|
|
1
1
|
import { env } from "./env"
|
|
2
|
-
import {
|
|
2
|
+
import { logUt } from "./utils/log"
|
|
3
3
|
import { BotCore } from "./core/bot"
|
|
4
4
|
import { MainThread } from "./threads/main"
|
|
5
|
-
import {
|
|
5
|
+
import { ExternalCache } from "./cache/external"
|
|
6
6
|
|
|
7
7
|
new MainThread(() => {
|
|
8
|
-
|
|
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
|
|
13
|
+
cacheSession: new ExternalCache(env.CACHE_SESSION, `session`, 24 * 60 * 60 * 1000)
|
|
14
14
|
})
|
|
15
15
|
})
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
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
|
-
|
|
13
|
+
logUt.errorMake(error, constructorName, funcName)
|
|
14
14
|
await this.sessionClear()
|
|
15
15
|
|
|
16
16
|
const kb = this.kb()
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { RepoBase } from "~/base/repository"
|
|
2
2
|
|
|
3
|
-
export class ExampleRepo extends
|
|
3
|
+
export class ExampleRepo extends RepoBase {}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { log } from "gramstax"
|
|
2
|
-
export { log }
|
|
2
|
+
export { log as logUt }
|
package/package.json
CHANGED
|
@@ -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"
|