@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.
Files changed (78) hide show
  1. package/dist/_sharedTemplates/actionTest.t +5 -5
  2. package/dist/_templates/add/action/01-action.ts.t +5 -5
  3. package/dist/_templates/add/action/01-interface.ts.t +1 -2
  4. package/dist/_templates/add/action/02-scriptRunner.t +2 -2
  5. package/dist/_templates/add/eventListener/01-event.ts.t +3 -3
  6. package/dist/_templates/add/eventListener/02-scriptRunner.ts.t +2 -2
  7. package/dist/_templates/add/externalEventListener/01-event.ts.t +1 -1
  8. package/dist/_templates/add/externalEventListener/02-scriptRunner.t +2 -2
  9. package/dist/_templates/add/model/01-model.ts.t +2 -2
  10. package/dist/_templates/add/model/02-scriptRunner.ts.t +2 -2
  11. package/dist/_templates/add/scheduledTask/02-scriptRunner.t +2 -2
  12. package/dist/_templates/add/task/01-task.ts.t +11 -11
  13. package/dist/_templates/add/task/02-scriptRunner.t +1 -3
  14. package/dist/_templates/add/test/02-scriptRunner.ts.t +2 -2
  15. package/dist/_templates/add/view/01-index.ts.t +2 -2
  16. package/dist/_templates/add/view/01-view.ts.t +1 -1
  17. package/dist/_templates/add/view/02-scriptRunner.t +2 -2
  18. package/dist/_templates/init/admin/01-adminExecuteCustom.ts.t +3 -2
  19. package/dist/_templates/init/admin/01-adminExecuteCustomInterface.ts.t +1 -1
  20. package/dist/_templates/init/admin/01-adminExecuteQuery.ts.t +2 -2
  21. package/dist/_templates/init/admin/01-adminExecuteQueryInterface.ts.t +1 -1
  22. package/dist/_templates/init/admin/01-adminGetMetaInterface.ts.t +2 -1
  23. package/dist/_templates/init/admin/01-adminService.ts.t +1 -1
  24. package/dist/_templates/init/admin/02-scriptRunner.ts.t +2 -2
  25. package/dist/_templates/init/matchers/01-index.ts.t +1 -1
  26. package/dist/_templates/init/matchers/01-inject-setup.ts.t +1 -2
  27. package/dist/_templates/init/matchers/01-new-setup.ts.t +1 -2
  28. package/dist/_templates/init/matchers/02-scriptRunner.ts.t +2 -2
  29. package/dist/_templates/init/package/01-oxfmt.config.ts.t +7 -0
  30. package/dist/_templates/init/package/01-oxlint.config.ts.t +13 -0
  31. package/dist/_templates/init/package/01-package.json.t +42 -33
  32. package/dist/_templates/init/package/01-test.tsconfig.json.t +4 -6
  33. package/dist/_templates/init/package/01-test.unit.index.ts.t +7 -7
  34. package/dist/_templates/init/package/01-tsconfig.json.t +3 -7
  35. package/dist/_templates/init/package/01-tsdown.config.ts.t +18 -0
  36. package/dist/_templates/init/package/01-vitest.config.mts.t +9 -2
  37. package/dist/_templates/init/package/prompt.js +1 -1
  38. package/dist/_templates/init/package/prompt.js.map +1 -1
  39. package/dist/_templates/init/service/01-.gitignore.t +1 -0
  40. package/dist/_templates/init/service/01-.gitlab-ci.yml.t +4 -0
  41. package/dist/_templates/init/service/01-migrate-mongo-config.ts.t +4 -2
  42. package/dist/_templates/init/service/01-migrations.sample-migration.ts.t +8 -9
  43. package/dist/_templates/init/service/01-migrations.tsconfig.json.t +7 -12
  44. package/dist/_templates/init/service/01-oxfmt.config.ts.t +10 -0
  45. package/dist/_templates/init/service/01-oxlint.config.ts.t +24 -0
  46. package/dist/_templates/init/service/01-package.json.t +7 -17
  47. package/dist/_templates/init/service/01-src.actions.v1.getAddResult.ts.t +9 -6
  48. package/dist/_templates/init/service/01-src.bootstrap.ts.t +6 -6
  49. package/dist/_templates/init/service/01-src.configs.config.ts.t +2 -2
  50. package/dist/_templates/init/service/01-src.configs.queue.ts.t +1 -1
  51. package/dist/_templates/init/service/01-src.deps.ts.t +5 -6
  52. package/dist/_templates/init/service/01-src.index.ts.t +4 -3
  53. package/dist/_templates/init/service/01-src.interfaces.actions.v1.getAddResult.ts.t +1 -1
  54. package/dist/_templates/init/service/01-src.interfaces.config.ts.t +1 -1
  55. package/dist/_templates/init/service/01-src.interfaces.deps.ts.t +1 -1
  56. package/dist/_templates/init/service/01-src.views.exampleViews.index.ts.t +2 -2
  57. package/dist/_templates/init/service/01-src.views.exampleViews.view.ts.t +2 -2
  58. package/dist/_templates/init/service/01-tests.integration.actionts.getAddResult.spec.ts.t +7 -7
  59. package/dist/_templates/init/service/01-tests.interfaces.ts.t +1 -1
  60. package/dist/_templates/init/service/01-tests.tsconfig.json.t +10 -9
  61. package/dist/_templates/init/service/01-tests.utils.getApp.ts.t +7 -7
  62. package/dist/_templates/init/service/01-tests.utils.getDeps.ts.t +4 -4
  63. package/dist/_templates/init/service/01-tsconfig.json.t +19 -9
  64. package/dist/_templates/init/service/01-vitest.config.mts.t +4 -4
  65. package/dist/_templates/init/service/prompt.js +1 -1
  66. package/dist/_templates/init/service/prompt.js.map +1 -1
  67. package/dist/_templates/init/temporal/01-worker.activity.index.ts.t +1 -1
  68. package/dist/_templates/init/temporal/01-worker.index.ts.t +4 -4
  69. package/dist/_templates/init/temporal/01-worker.workflow.index.ts.t +1 -1
  70. package/dist/_templates/init/temporal/01-worker.workflow.workflow-example.ts.t +1 -1
  71. package/dist/_templates/init/temporal/02-scriptRunner.ts.t +2 -2
  72. package/dist/depsNames.js +16 -10
  73. package/dist/depsNames.js.map +1 -1
  74. package/package.json +1 -1
  75. package/dist/_templates/init/package/01-.prettierignore.t +0 -5
  76. package/dist/_templates/init/package/01-eslint.config.mjs.t +0 -22
  77. package/dist/_templates/init/service/01-.prettierignore.t +0 -7
  78. 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 <%= h.changeCase.pascal(name) %>Action from '<%= relateActionPathFromTest %>'
5
+ import { GrpcClient } from '@src/generated/index.js'
6
+
7
+ import <%= h.changeCase.pascal(name) %>Action from '<%= relateActionPathFromTest %>.js'
8
8
 
9
- import { getApp } from '@tests/utils/getApp'
9
+ import { ActionResult } from '<%= relativeInterfacePath %>.js'
10
10
 
11
- import { ActionResult } from '<%= relativeInterfacePath %>'
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
- import { ValidationSchema } from '@diia-inhouse/validators'
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
- readonly validationRules: ValidationSchema<Context['params']> = {}
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 prettier --write <%= actionPath %> <%= interfacePath %> <%= testPath %>"
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 prettier --write <%= eventPath %> <%= eventInterfacePath %>"
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 prettier --write <%= eventPath %> <%= eventInterfacePath %>"
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
- <%= h.changeCase.pascal(name) %>
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 prettier --write <%= modelPath %> <%= interfacePath%> "
3
- ---
2
+ sh: "npx oxfmt <%= modelPath %> <%= interfacePath %>"
3
+ ---
@@ -1,3 +1,3 @@
1
1
  ---
2
- sh: "npx prettier --write <%= scheduledTaskPath %>"
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
- import { ValidationSchema } from '@diia-inhouse/validators'
9
- import { ExternalEventPayload } from '@interfaces/externalEventListeners/<%= h.changeCase.camel(taskEnumKey) %>'
10
- import { TaskPayload } from '@interfaces/tasks/<%= h.changeCase.camel(taskEnumKey) %>'
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
- readonly name: string = ServiceTask.<%= taskEnumKey %>
17
+ readonly name: string = ServiceTask.<%= taskEnumKey %>
18
18
 
19
- <% if (isDelayedTask) { %>
19
+ <% if (isDelayedTask) { %>
20
20
  readonly isDelayed: boolean = true
21
- <% } %>
21
+ <% } %>
22
22
 
23
23
 
24
- <% if (isTaskWithValidation) { %>
25
- readonly validationRules: ValidationSchema<TaskPayload> = {}
26
- <% } %>
24
+ <% if (isTaskWithValidation) { %>
25
+ readonly validationRules: ValidationSchema<TaskPayload> = {}
26
+ <% } %>
27
27
 
28
- async handler(<%= isTaskWithValidation ? "payload: TaskPayload" : '' %>): Promise<void> {}
28
+ async handler(<%= isTaskWithValidation ? "payload: TaskPayload" : '' %>): Promise<void> {}
29
29
  }
@@ -1,5 +1,3 @@
1
1
  ---
2
- sh: "npx prettier --write <%= taskPath %> <% taskInterfacePath %>"
2
+ sh: "npx oxfmt <%= taskPath %> <%= taskInterfacePath %>"
3
3
  ---
4
-
5
-
@@ -1,3 +1,3 @@
1
1
  ---
2
- sh: "npx prettier --write <%= testPath %>"
3
- ---
2
+ sh: "npx oxfmt <%= testPath %>"
3
+ ---
@@ -2,6 +2,6 @@
2
2
  to: <%= indexPath %>
3
3
  ---
4
4
 
5
- export { <%= className %> as default } from './view'
5
+ export { <%= className %> as default } from './view.js'
6
6
 
7
- export * from './interface'
7
+ export * from './interface.js'
@@ -2,7 +2,7 @@
2
2
  to: <%= viewPath %>
3
3
  ---
4
4
 
5
- import { ViewParams, ViewScreen } from './interface'
5
+ import { ViewParams, ViewScreen } from './interface.js'
6
6
 
7
7
  export class <%= className %> {
8
8
  toScreen(params: ViewParams): ViewScreen {
@@ -1,3 +1,3 @@
1
1
  ---
2
- sh: "npx prettier --write <%= viewPath %> <%= interfacePath %> <%= indexPath %>"
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 AdminService from '@services/admin'
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/pkg-admin'
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
 
@@ -2,6 +2,7 @@
2
2
  to: <%= interfacePath %>/adminGetMeta.ts
3
3
  ---
4
4
  import { ActionContext } from '@diia-inhouse/types'
5
- import { AdminGetMetaRes } from '@src/generated'
5
+
6
+ import { AdminGetMetaRes } from '@src/generated/index.js'
6
7
 
7
8
  export type ActionResult = AdminGetMetaRes
@@ -3,7 +3,7 @@ to: <%= adminServicePath %>/index.ts
3
3
  ---
4
4
  import { AdminExposer, ExtractEvents } from '@diia-inhouse/admin'
5
5
 
6
- import { AdminActions } from './actions'
6
+ import { AdminActions } from './actions.js'
7
7
 
8
8
  export default class AdminService {
9
9
  constructor(
@@ -1,3 +1,3 @@
1
1
  ---
2
- sh: "npx prettier --write <%= actionPath %> <%= interfacePath %> && npm install @diia-inhouse/pkg-admin"
3
- ---
2
+ sh: "npx oxfmt <%= actionPath %> <%= interfacePath %> && npm install @diia-inhouse/admin"
3
+ ---
@@ -2,4 +2,4 @@
2
2
  to: <%= rootMatcherPath %>
3
3
  ---
4
4
 
5
- export { <%= name %> } from './<%= name %>'
5
+ export { <%= name %> } from './<%= name %>.js'
@@ -2,7 +2,6 @@
2
2
  inject: true
3
3
  to: <%= overrideSetupFilePath %>
4
4
  ---
5
- import * as matchers from './matchers'
5
+ import * as matchers from './matchers/index.js'
6
6
 
7
7
  expect.extend(matchers)
8
-
@@ -2,7 +2,6 @@
2
2
  unless_exists: true
3
3
  to: <%= newSetupFilePath %>
4
4
  ---
5
- import * as matchers from './matchers'
5
+ import * as matchers from './matchers/index.js'
6
6
 
7
7
  expect.extend(matchers)
8
-
@@ -1,3 +1,3 @@
1
1
  ---
2
- sh: "npx prettier --write <%= tsConfigPath %> <%= matcherPath %> <%= vitestTypesDeclarationPath %>"
3
- ---
2
+ sh: "npx oxfmt <%= tsConfigPath %> <%= matcherPath %> <%= vitestTypesDeclarationPath %>"
3
+ ---
@@ -0,0 +1,7 @@
1
+ ---
2
+ to: <%= packageName %>/oxfmt.config.ts
3
+ ---
4
+
5
+ import config from '@diia-inhouse/oxc-config/oxfmt'
6
+
7
+ export default config
@@ -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
- "name": "@diia-inhouse/<%= packageName %>",
7
- "version": "1.0.0",
8
- "description": "<%= description %>",
9
- "author": "diia-team",
10
- "main": "dist/index.js",
11
- "types": "dist/types/index.d.ts",
12
- "engines": {
13
- "node": ">=22"
14
- },
15
- "scripts": {
16
- "build": "tsc",
17
- "prebuild": "rimraf dist",
18
- "prepare": "npm run build",
19
- "semantic-release": "semantic-release",
20
- "start": "npm run build && node dist/index.js",
21
- "lint": "eslint . && prettier --check .",
22
- "lint-fix": "eslint . --fix && prettier --write .",
23
- "test": "tsc --project tests/tsconfig.json --noEmit && vitest run",
24
- "test:watch": "vitest watch",
25
- "test:coverage": "vitest run --coverage",
26
- "find-circulars": "madge --circular --extensions ts ./",
27
- "lint:lockfile": "lockfile-lint --path package-lock.json --allowed-hosts registry.npmjs.org gitlab.diia.org.ua --validate-https"
28
- },
29
- "files": ["dist"],
30
- "keywords": [],
31
- "devDependencies": {},
32
- "commitlint": {
33
- "extends": "@diia-inhouse/configs/dist/commitlint"
34
- },
35
- "release": {
36
- "extends": "@diia-inhouse/configs/dist/semantic-release/package"
37
- },
38
- "prettier": "@diia-inhouse/eslint-config/prettier"
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
- "@services/*": ["src/services/*"],
15
- "@interfaces/*": ["src/interfaces/*"],
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
- it('should be return 3', () => {
9
- const result = add(1, 2)
10
-
11
- expect(result).toBe(3)
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
- "baseUrl": ".",
12
- "paths": {
13
- "@services/*": ["src/services/*"],
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 { defineProject } from 'vitest/config'
6
+ import { defineConfig } from 'vitest/config'
7
7
 
8
8
  const timeout = 60 * 1000
9
9
 
10
- export default defineProject({
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 "prettier", please wait. \n'), chalk_1.default.blue('If you have some troubles with a new project, try to reinstall dependencies and run the prettier manually \n\n'));
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,8FAA8F,CAAC,EAC1G,eAAK,CAAC,IAAI,CAAC,gHAAgH,CAAC,CAC/H,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"}
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"}
@@ -10,3 +10,4 @@ dist
10
10
  node_modules
11
11
  .DS_Store
12
12
  src/generated
13
+ coverage
@@ -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
- require('dotenv-flow').config({ silent: true })
4
+ import dotenvFlow from 'dotenv-flow'
5
5
 
6
6
  import { MongoHelper } from '@diia-inhouse/db'
7
7
 
8
- module.exports = MongoHelper.getMigrateMongoConfig()
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 'module-alias/register'
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
- const collectionName = ''
11
-
12
- export async function up(db: Db): Promise<void> {
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(db: Db): Promise<void> {
17
- // await db.dropCollection(collectionName)
14
+ export async function down(_db: Db): Promise<void> {
15
+ // const collectionName = ''
16
+ // await _db.dropCollection(collectionName)
18
17
  }