@diia-inhouse/scaffold 2.53.13 → 2.54.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/_sharedTemplates/actionTest.t +5 -5
- package/dist/_templates/add/action/01-action.ts.t +5 -5
- package/dist/_templates/add/action/01-interface.ts.t +1 -2
- package/dist/_templates/add/action/02-scriptRunner.t +2 -2
- package/dist/_templates/add/eventListener/01-event.ts.t +3 -3
- package/dist/_templates/add/eventListener/02-scriptRunner.ts.t +2 -2
- package/dist/_templates/add/externalEventListener/01-event.ts.t +1 -1
- package/dist/_templates/add/externalEventListener/02-scriptRunner.t +2 -2
- package/dist/_templates/add/model/01-model.ts.t +2 -2
- package/dist/_templates/add/model/02-scriptRunner.ts.t +2 -2
- package/dist/_templates/add/scheduledTask/02-scriptRunner.t +2 -2
- package/dist/_templates/add/task/01-task.ts.t +11 -11
- package/dist/_templates/add/task/02-scriptRunner.t +1 -3
- package/dist/_templates/add/test/02-scriptRunner.ts.t +2 -2
- package/dist/_templates/add/view/01-index.ts.t +2 -2
- package/dist/_templates/add/view/01-view.ts.t +1 -1
- package/dist/_templates/add/view/02-scriptRunner.t +2 -2
- package/dist/_templates/init/admin/01-adminExecuteCustom.ts.t +3 -2
- package/dist/_templates/init/admin/01-adminExecuteCustomInterface.ts.t +1 -1
- package/dist/_templates/init/admin/01-adminExecuteQuery.ts.t +2 -2
- package/dist/_templates/init/admin/01-adminExecuteQueryInterface.ts.t +1 -1
- package/dist/_templates/init/admin/01-adminGetMetaInterface.ts.t +2 -1
- package/dist/_templates/init/admin/01-adminService.ts.t +1 -1
- package/dist/_templates/init/admin/02-scriptRunner.ts.t +2 -2
- package/dist/_templates/init/matchers/01-index.ts.t +1 -1
- package/dist/_templates/init/matchers/01-inject-setup.ts.t +1 -2
- package/dist/_templates/init/matchers/01-new-setup.ts.t +1 -2
- package/dist/_templates/init/matchers/02-scriptRunner.ts.t +2 -2
- package/dist/_templates/init/package/01-oxfmt.config.ts.t +7 -0
- package/dist/_templates/init/package/01-oxlint.config.ts.t +13 -0
- package/dist/_templates/init/package/01-package.json.t +42 -33
- package/dist/_templates/init/package/01-test.tsconfig.json.t +4 -6
- package/dist/_templates/init/package/01-test.unit.index.ts.t +7 -7
- package/dist/_templates/init/package/01-tsconfig.json.t +3 -7
- package/dist/_templates/init/package/01-tsdown.config.ts.t +18 -0
- package/dist/_templates/init/package/01-vitest.config.mts.t +9 -2
- package/dist/_templates/init/package/prompt.js +1 -1
- package/dist/_templates/init/package/prompt.js.map +1 -1
- package/dist/_templates/init/service/01-.gitignore.t +1 -0
- package/dist/_templates/init/service/01-.gitlab-ci.yml.t +4 -0
- package/dist/_templates/init/service/01-migrate-mongo-config.ts.t +4 -2
- package/dist/_templates/init/service/01-migrations.sample-migration.ts.t +8 -9
- package/dist/_templates/init/service/01-migrations.tsconfig.json.t +7 -12
- package/dist/_templates/init/service/01-oxfmt.config.ts.t +10 -0
- package/dist/_templates/init/service/01-oxlint.config.ts.t +24 -0
- package/dist/_templates/init/service/01-package.json.t +7 -17
- package/dist/_templates/init/service/01-src.actions.v1.getAddResult.ts.t +9 -6
- package/dist/_templates/init/service/01-src.bootstrap.ts.t +6 -6
- package/dist/_templates/init/service/01-src.configs.config.ts.t +2 -2
- package/dist/_templates/init/service/01-src.configs.queue.ts.t +1 -1
- package/dist/_templates/init/service/01-src.deps.ts.t +5 -6
- package/dist/_templates/init/service/01-src.index.ts.t +4 -3
- package/dist/_templates/init/service/01-src.interfaces.actions.v1.getAddResult.ts.t +1 -1
- package/dist/_templates/init/service/01-src.interfaces.config.ts.t +1 -1
- package/dist/_templates/init/service/01-src.interfaces.deps.ts.t +1 -1
- package/dist/_templates/init/service/01-src.views.exampleViews.index.ts.t +2 -2
- package/dist/_templates/init/service/01-src.views.exampleViews.view.ts.t +2 -2
- package/dist/_templates/init/service/01-tests.integration.actionts.getAddResult.spec.ts.t +7 -7
- package/dist/_templates/init/service/01-tests.interfaces.ts.t +1 -1
- package/dist/_templates/init/service/01-tests.tsconfig.json.t +10 -9
- package/dist/_templates/init/service/01-tests.utils.getApp.ts.t +7 -7
- package/dist/_templates/init/service/01-tests.utils.getDeps.ts.t +4 -4
- package/dist/_templates/init/service/01-tsconfig.json.t +19 -9
- package/dist/_templates/init/service/01-vitest.config.mts.t +4 -4
- package/dist/_templates/init/service/prompt.js +1 -1
- package/dist/_templates/init/service/prompt.js.map +1 -1
- package/dist/_templates/init/temporal/01-worker.activity.index.ts.t +1 -1
- package/dist/_templates/init/temporal/01-worker.index.ts.t +4 -4
- package/dist/_templates/init/temporal/01-worker.workflow.index.ts.t +1 -1
- package/dist/_templates/init/temporal/01-worker.workflow.workflow-example.ts.t +1 -1
- package/dist/_templates/init/temporal/02-scriptRunner.ts.t +2 -2
- package/dist/depsNames.js +16 -10
- package/dist/depsNames.js.map +1 -1
- package/package.json +1 -1
- package/dist/_templates/init/package/01-.prettierignore.t +0 -5
- package/dist/_templates/init/package/01-eslint.config.mjs.t +0 -22
- package/dist/_templates/init/service/01-.prettierignore.t +0 -7
- package/dist/_templates/init/service/01-eslint.config.mjs.t +0 -22
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { clientCallOptions } from '@diia-inhouse/diia-app'
|
|
2
2
|
|
|
3
|
-
import { GrpcClient } from '@src/generated'
|
|
4
|
-
|
|
5
3
|
import TestKit from '@diia-inhouse/test'
|
|
6
4
|
|
|
7
|
-
import
|
|
5
|
+
import { GrpcClient } from '@src/generated/index.js'
|
|
6
|
+
|
|
7
|
+
import <%= h.changeCase.pascal(name) %>Action from '<%= relateActionPathFromTest %>.js'
|
|
8
8
|
|
|
9
|
-
import {
|
|
9
|
+
import { ActionResult } from '<%= relativeInterfacePath %>.js'
|
|
10
10
|
|
|
11
|
-
import {
|
|
11
|
+
import { getApp } from '@tests/utils/getApp.js'
|
|
12
12
|
|
|
13
13
|
describe(`Action ${<%= h.changeCase.pascal(name) %>Action.name}`, () => {
|
|
14
14
|
let app: Awaited<ReturnType<typeof getApp>>
|
|
@@ -3,13 +3,14 @@ to: <%= actionPath %>
|
|
|
3
3
|
---
|
|
4
4
|
|
|
5
5
|
import { GrpcAppAction } from '@diia-inhouse/diia-app'
|
|
6
|
+
|
|
6
7
|
import { SessionType } from '@diia-inhouse/types'
|
|
7
8
|
|
|
8
9
|
<% if (isActionWithValidation) { %>
|
|
9
|
-
|
|
10
|
+
import { ValidationSchema } from '@diia-inhouse/validators'
|
|
10
11
|
<% } %>
|
|
11
12
|
|
|
12
|
-
import { ActionResult, Context } from '<%= relativeInterfacePath
|
|
13
|
+
import { ActionResult, Context } from '<%= relativeInterfacePath %>.js'
|
|
13
14
|
|
|
14
15
|
export default class <%= h.changeCase.pascal(name) %>Action implements GrpcAppAction<Context> {
|
|
15
16
|
readonly name = '<%= name %>'
|
|
@@ -17,15 +18,14 @@ export default class <%= h.changeCase.pascal(name) %>Action implements GrpcAppAc
|
|
|
17
18
|
readonly sessionType = SessionType.None
|
|
18
19
|
|
|
19
20
|
<% if (isActionWithValidation) { %>
|
|
20
|
-
|
|
21
|
+
readonly validationRules: ValidationSchema<Context['params']> = {}
|
|
21
22
|
<% } %>
|
|
22
23
|
|
|
23
24
|
constructor(private readonly service: unknown) {}
|
|
24
|
-
|
|
25
|
+
|
|
25
26
|
async handler(args: Context): Promise<ActionResult> {
|
|
26
27
|
const {
|
|
27
28
|
params: {},
|
|
28
29
|
} = args
|
|
29
30
|
}
|
|
30
31
|
}
|
|
31
|
-
|
|
@@ -4,8 +4,7 @@ to: <%= interfacePath %>
|
|
|
4
4
|
|
|
5
5
|
import { ActionContext } from '@diia-inhouse/types'
|
|
6
6
|
|
|
7
|
-
import { <%= h.changeCase.pascal(name) %>Req, <%= h.changeCase.pascal(name) %>Res } from '@src/generated'
|
|
8
|
-
|
|
7
|
+
import { <%= h.changeCase.pascal(name) %>Req, <%= h.changeCase.pascal(name) %>Res } from '@src/generated/index.js'
|
|
9
8
|
|
|
10
9
|
export type Context = ActionContext<<%= h.changeCase.pascal(name) %>Req>
|
|
11
10
|
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
---
|
|
2
|
-
sh: "npx
|
|
3
|
-
---
|
|
2
|
+
sh: "npx oxfmt <%= actionPath %> <%= interfacePath %> <%= testPath %>"
|
|
3
|
+
---
|
|
@@ -5,14 +5,14 @@ to: <%= eventPath %>
|
|
|
5
5
|
import { EventBusListener, InternalEvent } from '@diia-inhouse/diia-queue'
|
|
6
6
|
import { ValidationSchema } from '@diia-inhouse/validators'
|
|
7
7
|
|
|
8
|
-
import { EventPayload } from '@interfaces/eventListeners/<%= h.changeCase.camel(eventEnumKey)
|
|
8
|
+
import { EventPayload } from '@interfaces/eventListeners/<%= h.changeCase.camel(eventEnumKey) %>.js'
|
|
9
9
|
|
|
10
10
|
export default class <%= eventEnumKey %>EventListener implements EventBusListener {
|
|
11
11
|
readonly event: InternalEvent = InternalEvent.<%= eventEnumKey %>
|
|
12
12
|
|
|
13
13
|
readonly validationRules: ValidationSchema<EventPayload> = {}
|
|
14
|
-
|
|
14
|
+
|
|
15
15
|
constructor(private readonly service: unknown) {}
|
|
16
16
|
|
|
17
17
|
async handler(message: EventPayload): Promise<void> {}
|
|
18
|
-
}
|
|
18
|
+
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
---
|
|
2
|
-
sh: "npx
|
|
3
|
-
---
|
|
2
|
+
sh: "npx oxfmt <%= eventPath %> <%= eventInterfacePath %>"
|
|
3
|
+
---
|
|
@@ -5,7 +5,7 @@ to: <%= eventPath %>
|
|
|
5
5
|
import { EventBusListener, ExternalEvent } from '@diia-inhouse/diia-queue'
|
|
6
6
|
import { ValidationSchema } from '@diia-inhouse/validators'
|
|
7
7
|
|
|
8
|
-
import { ExternalEventPayload } from '@interfaces/externalEventListeners/<%= h.changeCase.camel(eventEnumKey)
|
|
8
|
+
import { ExternalEventPayload } from '@interfaces/externalEventListeners/<%= h.changeCase.camel(eventEnumKey) %>.js'
|
|
9
9
|
|
|
10
10
|
export default class <%= eventEnumKey %>EventListener implements EventBusListener {
|
|
11
11
|
readonly event: ExternalEvent = ExternalEvent.<%= eventEnumKey %>
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
---
|
|
2
|
-
sh: "npx
|
|
3
|
-
---
|
|
2
|
+
sh: "npx oxfmt <%= eventPath %> <%= eventInterfacePath %>"
|
|
3
|
+
---
|
|
@@ -5,8 +5,8 @@ to: <%= modelPath %>
|
|
|
5
5
|
import { Model, Schema, model, models } from '@diia-inhouse/db'
|
|
6
6
|
|
|
7
7
|
import {
|
|
8
|
-
|
|
9
|
-
} from '@interfaces/models/<%= name
|
|
8
|
+
<%= h.changeCase.pascal(name) %>
|
|
9
|
+
} from '@interfaces/models/<%= name %>.js'
|
|
10
10
|
|
|
11
11
|
export const <%= name %>Schema = new Schema<<%= h.changeCase.pascal(name) %>>(
|
|
12
12
|
{},
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
---
|
|
2
|
-
sh: "npx
|
|
3
|
-
---
|
|
2
|
+
sh: "npx oxfmt <%= modelPath %> <%= interfacePath %>"
|
|
3
|
+
---
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
---
|
|
2
|
-
sh: "npx
|
|
3
|
-
---
|
|
2
|
+
sh: "npx oxfmt <%= scheduledTaskPath %>"
|
|
3
|
+
---
|
|
@@ -5,25 +5,25 @@ to: <%= taskPath %>
|
|
|
5
5
|
import { TaskListener } from '@diia-inhouse/diia-queue'
|
|
6
6
|
|
|
7
7
|
<% if (isTaskWithValidation) { %>
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
import { ValidationSchema } from '@diia-inhouse/validators'
|
|
9
|
+
import { ExternalEventPayload } from '@interfaces/externalEventListeners/<%= h.changeCase.camel(taskEnumKey) %>.js'
|
|
10
|
+
import { TaskPayload } from '@interfaces/tasks/<%= h.changeCase.camel(taskEnumKey) %>.js'
|
|
11
11
|
<% } %>
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
import { ServiceTask } from '@interfaces/tasks'
|
|
14
|
+
import { ServiceTask } from '@interfaces/tasks.js'
|
|
15
15
|
|
|
16
16
|
export default class <%= taskEnumKey %>Task implements TaskListener {
|
|
17
|
-
|
|
17
|
+
readonly name: string = ServiceTask.<%= taskEnumKey %>
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
<% if (isDelayedTask) { %>
|
|
20
20
|
readonly isDelayed: boolean = true
|
|
21
|
-
|
|
21
|
+
<% } %>
|
|
22
22
|
|
|
23
23
|
|
|
24
|
-
|
|
25
|
-
readonly validationRules: ValidationSchema<TaskPayload> =
|
|
26
|
-
|
|
24
|
+
<% if (isTaskWithValidation) { %>
|
|
25
|
+
readonly validationRules: ValidationSchema<TaskPayload> = {}
|
|
26
|
+
<% } %>
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
async handler(<%= isTaskWithValidation ? "payload: TaskPayload" : '' %>): Promise<void> {}
|
|
29
29
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
---
|
|
2
|
-
sh: "npx
|
|
3
|
-
---
|
|
2
|
+
sh: "npx oxfmt <%= testPath %>"
|
|
3
|
+
---
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
---
|
|
2
|
-
sh: "npx
|
|
3
|
-
---
|
|
2
|
+
sh: "npx oxfmt <%= viewPath %> <%= interfacePath %> <%= indexPath %>"
|
|
3
|
+
---
|
|
@@ -7,9 +7,10 @@ import { GrpcAppAction } from '@diia-inhouse/diia-app'
|
|
|
7
7
|
import { SessionType } from '@diia-inhouse/types'
|
|
8
8
|
import { ValidationSchema } from '@diia-inhouse/validators'
|
|
9
9
|
|
|
10
|
-
import
|
|
10
|
+
import { AdminActions } from '@services/admin/actions.js'
|
|
11
|
+
import AdminService from '@services/admin/index.js'
|
|
11
12
|
|
|
12
|
-
import { ActionResult, Context } from '@interfaces/actions/v1/admin/adminExecuteCustom'
|
|
13
|
+
import { ActionResult, Context } from '@interfaces/actions/v1/admin/adminExecuteCustom.js'
|
|
13
14
|
|
|
14
15
|
export default class AdminExecuteCustomAction implements GrpcAppAction<Context> {
|
|
15
16
|
readonly name = 'adminExecuteCustom'
|
|
@@ -3,7 +3,7 @@ to: <%= interfacePath %>/adminExecuteCommand.ts
|
|
|
3
3
|
---
|
|
4
4
|
import { ActionContext } from '@diia-inhouse/types'
|
|
5
5
|
|
|
6
|
-
import { AdminExecuteCustomReq, AdminExecuteCustomRes } from '@src/generated'
|
|
6
|
+
import { AdminExecuteCustomReq, AdminExecuteCustomRes } from '@src/generated/index.js'
|
|
7
7
|
|
|
8
8
|
export type Context = ActionContext<AdminExecuteCustomReq>
|
|
9
9
|
|
|
@@ -4,10 +4,10 @@ to: <%= actionPath %>/adminExecuteQuery.ts
|
|
|
4
4
|
|
|
5
5
|
import { GrpcAppAction } from '@diia-inhouse/diia-app'
|
|
6
6
|
|
|
7
|
-
import { ModelExposer } from '@diia-inhouse/
|
|
7
|
+
import { ModelExposer } from '@diia-inhouse/admin'
|
|
8
8
|
import { SessionType } from '@diia-inhouse/types'
|
|
9
9
|
|
|
10
|
-
import { ActionResult, Context } from '@interfaces/actions/v1/admin/adminExecuteQuery'
|
|
10
|
+
import { ActionResult, Context } from '@interfaces/actions/v1/admin/adminExecuteQuery.js'
|
|
11
11
|
|
|
12
12
|
export default class AdminExecuteQueryAction implements GrpcAppAction<Context> {
|
|
13
13
|
readonly name = 'adminExecuteQuery'
|
|
@@ -3,7 +3,7 @@ to: <%= interfacePath %>/adminExecuteQuery.ts
|
|
|
3
3
|
---
|
|
4
4
|
import { ActionContext } from '@diia-inhouse/types'
|
|
5
5
|
|
|
6
|
-
import { AdminExecuteQueryReq, AdminExecuteQueryRes } from '@src/generated'
|
|
6
|
+
import { AdminExecuteQueryReq, AdminExecuteQueryRes } from '@src/generated/index.js'
|
|
7
7
|
|
|
8
8
|
export type Context = ActionContext<AdminExecuteQueryReq>
|
|
9
9
|
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
---
|
|
2
|
-
sh: "npx
|
|
3
|
-
---
|
|
2
|
+
sh: "npx oxfmt <%= actionPath %> <%= interfacePath %> && npm install @diia-inhouse/admin"
|
|
3
|
+
---
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
---
|
|
2
|
-
sh: "npx
|
|
3
|
-
---
|
|
2
|
+
sh: "npx oxfmt <%= tsConfigPath %> <%= matcherPath %> <%= vitestTypesDeclarationPath %>"
|
|
3
|
+
---
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
---
|
|
2
|
+
to: <%= packageName %>/oxlint.config.ts
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
import { defineConfig, base } from '@diia-inhouse/oxc-config/oxlint'
|
|
6
|
+
|
|
7
|
+
export default defineConfig({
|
|
8
|
+
...base,
|
|
9
|
+
rules: {
|
|
10
|
+
...base.rules,
|
|
11
|
+
'@diia-inhouse/locale/no-hardcoded-cyrillic': 'off',
|
|
12
|
+
},
|
|
13
|
+
})
|
|
@@ -3,37 +3,46 @@ to: <%= packageName %>/package.json
|
|
|
3
3
|
---
|
|
4
4
|
|
|
5
5
|
{
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
"
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
"
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
"
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
"
|
|
37
|
-
|
|
38
|
-
|
|
6
|
+
"name": "@diia-inhouse/<%= packageName %>",
|
|
7
|
+
"version": "1.0.0",
|
|
8
|
+
"type": "module",
|
|
9
|
+
"description": "<%= description %>",
|
|
10
|
+
"author": "diia-team",
|
|
11
|
+
"main": "dist/index.js",
|
|
12
|
+
"types": "dist/index.d.ts",
|
|
13
|
+
"exports": {
|
|
14
|
+
".": {
|
|
15
|
+
"types": "./dist/index.d.ts",
|
|
16
|
+
"default": "./dist/index.js"
|
|
17
|
+
},
|
|
18
|
+
"./package.json": "./package.json"
|
|
19
|
+
},
|
|
20
|
+
"engines": {
|
|
21
|
+
"node": ">=24"
|
|
22
|
+
},
|
|
23
|
+
"scripts": {
|
|
24
|
+
"prebuild": "rimraf dist",
|
|
25
|
+
"build": "tsdown",
|
|
26
|
+
"prepare": "npm run build",
|
|
27
|
+
"semantic-release": "semantic-release",
|
|
28
|
+
"lint": "oxlint && oxfmt --check .",
|
|
29
|
+
"lint-fix": "oxlint --fix && oxfmt .",
|
|
30
|
+
"test": "tsc --project tests/tsconfig.json --noEmit && vitest run",
|
|
31
|
+
"test:watch": "vitest watch",
|
|
32
|
+
"test:coverage": "vitest run --coverage",
|
|
33
|
+
"find-circulars": "madge --circular --extensions ts ./",
|
|
34
|
+
"lint:lockfile": "lockfile-lint --path package-lock.json --allowed-hosts registry.npmjs.org gitlab.diia.org.ua --validate-https"
|
|
35
|
+
},
|
|
36
|
+
"files": ["dist"],
|
|
37
|
+
"keywords": [],
|
|
38
|
+
"devDependencies": {},
|
|
39
|
+
"commitlint": {
|
|
40
|
+
"extends": "@diia-inhouse/configs/dist/commitlint"
|
|
41
|
+
},
|
|
42
|
+
"release": {
|
|
43
|
+
"extends": "@diia-inhouse/configs/dist/semantic-release/package"
|
|
44
|
+
},
|
|
45
|
+
"madge": {
|
|
46
|
+
"tsConfig": "./tsconfig.json"
|
|
47
|
+
}
|
|
39
48
|
}
|
|
@@ -5,19 +5,17 @@ to: <%= packageName %>/tests/tsconfig.json
|
|
|
5
5
|
{
|
|
6
6
|
"extends": "@diia-inhouse/configs/tsconfig",
|
|
7
7
|
"compilerOptions": {
|
|
8
|
-
"baseUrl": "../",
|
|
9
8
|
"types": ["vite/client", "vitest/globals"],
|
|
10
9
|
"module": "ESNext",
|
|
11
10
|
"moduleResolution": "Bundler",
|
|
12
11
|
"isolatedModules": true,
|
|
13
12
|
"paths": {
|
|
14
|
-
"@
|
|
15
|
-
"@
|
|
16
|
-
"@src/*": ["src/*"],
|
|
17
|
-
"@tests/*": ["tests/*"]
|
|
13
|
+
"@src/*": ["../src/*"],
|
|
14
|
+
"@tests/*": ["./*"]
|
|
18
15
|
},
|
|
19
16
|
"noEmit": true,
|
|
20
|
-
"strict": true
|
|
17
|
+
"strict": true,
|
|
18
|
+
"rootDir": "../"
|
|
21
19
|
},
|
|
22
20
|
"include": ["./**/*", "../vitest.config.mts"]
|
|
23
21
|
}
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
to: <%= packageName %>/tests/unit/index.spec.ts
|
|
3
3
|
---
|
|
4
4
|
|
|
5
|
-
import { add } from '@src/index'
|
|
5
|
+
import { add } from '@src/index.js'
|
|
6
6
|
|
|
7
7
|
describe('Add', () => {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
})
|
|
8
|
+
it('should be return 3', () => {
|
|
9
|
+
const result = add(1, 2)
|
|
10
|
+
|
|
11
|
+
expect(result).toBe(3)
|
|
12
|
+
})
|
|
13
|
+
})
|
|
@@ -8,13 +8,9 @@ to: <%= packageName %>/tsconfig.json
|
|
|
8
8
|
"outDir": "dist",
|
|
9
9
|
"declaration": true,
|
|
10
10
|
"declarationDir": "dist/types",
|
|
11
|
-
"
|
|
12
|
-
"
|
|
13
|
-
|
|
14
|
-
"@interfaces/*": ["src/interfaces/*"],
|
|
15
|
-
"@src/*": ["src/*"],
|
|
16
|
-
"@tests/*": ["tests/*"]
|
|
17
|
-
}
|
|
11
|
+
"isolatedDeclarations": true,
|
|
12
|
+
"strict": true,
|
|
13
|
+
"rootDir": "./src"
|
|
18
14
|
},
|
|
19
15
|
"include": ["src/**/*"],
|
|
20
16
|
"exclude": ["node_modules", "tests"]
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
---
|
|
2
|
+
to: <%= packageName %>/tsdown.config.ts
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
import { defineConfig } from 'tsdown'
|
|
6
|
+
|
|
7
|
+
export default defineConfig({
|
|
8
|
+
entry: ['src/index.ts'],
|
|
9
|
+
format: 'esm',
|
|
10
|
+
dts: true,
|
|
11
|
+
unbundle: true,
|
|
12
|
+
outDir: 'dist',
|
|
13
|
+
target: 'es2022',
|
|
14
|
+
clean: true,
|
|
15
|
+
fixedExtension: false,
|
|
16
|
+
report: false,
|
|
17
|
+
deps: { skipNodeModulesBundle: true },
|
|
18
|
+
})
|
|
@@ -3,14 +3,21 @@ to: <%= packageName %>/vitest.config.mts
|
|
|
3
3
|
---
|
|
4
4
|
|
|
5
5
|
import tsConfigPaths from 'vite-tsconfig-paths'
|
|
6
|
-
import {
|
|
6
|
+
import { defineConfig } from 'vitest/config'
|
|
7
7
|
|
|
8
8
|
const timeout = 60 * 1000
|
|
9
9
|
|
|
10
|
-
export default
|
|
10
|
+
export default defineConfig({
|
|
11
11
|
plugins: [tsConfigPaths()],
|
|
12
12
|
test: {
|
|
13
13
|
name: 'unit',
|
|
14
|
+
env: {
|
|
15
|
+
NODE_ENV: 'test',
|
|
16
|
+
},
|
|
17
|
+
clearMocks: true,
|
|
18
|
+
restoreMocks: true,
|
|
19
|
+
mockReset: true,
|
|
20
|
+
globals: true,
|
|
14
21
|
testTimeout: timeout,
|
|
15
22
|
hookTimeout: timeout,
|
|
16
23
|
exclude: ['node_modules', 'dist'],
|
|
@@ -7,7 +7,7 @@ const chalk_1 = __importDefault(require("chalk"));
|
|
|
7
7
|
const depsNames_1 = require("../../../depsNames");
|
|
8
8
|
exports.default = {
|
|
9
9
|
prompt: async ({ prompter }) => {
|
|
10
|
-
console.log(chalk_1.default.red.bold('README!\n'), chalk_1.default.blue('After a files generation scaffold tries to run "npm install" and "
|
|
10
|
+
console.log(chalk_1.default.red.bold('README!\n'), chalk_1.default.blue('After a files generation scaffold tries to run "npm install" and "oxfmt", please wait. \n'), chalk_1.default.blue('If you have some troubles with a new project, try to reinstall dependencies and run oxfmt manually \n\n'));
|
|
11
11
|
const { packageName } = await prompter.prompt({
|
|
12
12
|
type: 'input',
|
|
13
13
|
name: 'packageName',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prompt.js","sourceRoot":"","sources":["../../../../src/_templates/init/package/prompt.ts"],"names":[],"mappings":";;;;;AAAA,kDAAyB;AAEzB,kDAAwD;AAIxD,kBAAe;IACX,MAAM,EAAE,KAAK,EAAE,EAAE,QAAQ,EAAU,EAAoB,EAAE;QACrD,OAAO,CAAC,GAAG,CACP,eAAK,CAAC,GAAG,CAAC,IAAI,CAAC,WAAW,CAAC,EAC3B,eAAK,CAAC,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"prompt.js","sourceRoot":"","sources":["../../../../src/_templates/init/package/prompt.ts"],"names":[],"mappings":";;;;;AAAA,kDAAyB;AAEzB,kDAAwD;AAIxD,kBAAe;IACX,MAAM,EAAE,KAAK,EAAE,EAAE,QAAQ,EAAU,EAAoB,EAAE;QACrD,OAAO,CAAC,GAAG,CACP,eAAK,CAAC,GAAG,CAAC,IAAI,CAAC,WAAW,CAAC,EAC3B,eAAK,CAAC,IAAI,CAAC,2FAA2F,CAAC,EACvG,eAAK,CAAC,IAAI,CAAC,yGAAyG,CAAC,CACxH,CAAA;QAED,MAAM,EAAE,WAAW,EAAE,GAAG,MAAM,QAAQ,CAAC,MAAM,CAAC;YAC1C,IAAI,EAAE,OAAO;YACb,IAAI,EAAE,aAAa;YACnB,OAAO,EAAE,+BAA+B;YACxC,QAAQ,EAAE,IAAI;SACjB,CAAC,CAAA;QAEF,MAAM,EAAE,WAAW,EAAE,GAAG,MAAM,QAAQ,CAAC,MAAM,CAAC;YAC1C,IAAI,EAAE,OAAO;YACb,IAAI,EAAE,aAAa;YACnB,OAAO,EAAE,sCAAsC;YAC/C,QAAQ,EAAE,IAAI;SACjB,CAAC,CAAA;QAEF,MAAM,EAAE,UAAU,EAAE,GAAG,MAAM,QAAQ,CAAC,MAAM,CAAC;YACzC,IAAI,EAAE,OAAO;YACb,IAAI,EAAE,YAAY;YAClB,OAAO,EAAE,wDAAwD;YACjE,QAAQ,EAAE,IAAI;SACjB,CAAC,CAAA;QAEF,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,UAAU,EAAE,YAAY,EAAE,EAAE,OAAO,EAAE,+BAAmB,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,CAAA;IACrH,CAAC;CACJ,CAAA"}
|
|
@@ -9,8 +9,12 @@ variables:
|
|
|
9
9
|
RUN_UNIT_TESTS: 'false'
|
|
10
10
|
TEST_RUNNER: 'vitest'
|
|
11
11
|
CI_PIPELINE_TYPE: nodeJS-tag
|
|
12
|
+
CI_BUFBUILD_PROTOBUF_VERSION: '2.12.0'
|
|
12
13
|
|
|
13
14
|
include:
|
|
14
15
|
- project: diia-inhouse/ci
|
|
15
16
|
ref: main
|
|
16
17
|
file: main/node.gitlab-ci.yaml
|
|
18
|
+
- project: diia-inhouse/ci
|
|
19
|
+
ref: main
|
|
20
|
+
file: main/proto.gitlab-ci.yaml
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
---
|
|
2
2
|
to: <%= serviceName %>/migrate-mongo-config.ts
|
|
3
3
|
---
|
|
4
|
-
|
|
4
|
+
import dotenvFlow from 'dotenv-flow'
|
|
5
5
|
|
|
6
6
|
import { MongoHelper } from '@diia-inhouse/db'
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
dotenvFlow.config({ silent: true })
|
|
9
|
+
|
|
10
|
+
export default MongoHelper.getMigrateMongoConfig()
|
|
@@ -1,18 +1,17 @@
|
|
|
1
1
|
---
|
|
2
2
|
to: <%= serviceName %>/migrations/sample-migration.ts
|
|
3
3
|
---
|
|
4
|
-
import '
|
|
5
|
-
import { config } from 'dotenv-flow'
|
|
4
|
+
import dotenvFlow from 'dotenv-flow'
|
|
6
5
|
import { Db } from 'mongodb'
|
|
7
6
|
|
|
8
|
-
config({ silent: true })
|
|
7
|
+
dotenvFlow.config({ silent: true })
|
|
9
8
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
// await db.createCollection(collectionName)
|
|
9
|
+
export async function up(_db: Db): Promise<void> {
|
|
10
|
+
// const collectionName = ''
|
|
11
|
+
// await _db.createCollection(collectionName)
|
|
14
12
|
}
|
|
15
13
|
|
|
16
|
-
export async function down(
|
|
17
|
-
//
|
|
14
|
+
export async function down(_db: Db): Promise<void> {
|
|
15
|
+
// const collectionName = ''
|
|
16
|
+
// await _db.dropCollection(collectionName)
|
|
18
17
|
}
|