@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
@@ -3,19 +3,14 @@ to: <%= serviceName %>/migrations/tsconfig.json
3
3
  ---
4
4
  {
5
5
  "extends": "../tsconfig.json",
6
- "ts-node": {
7
- "files": true
8
- },
9
6
  "compilerOptions": {
10
7
  "sourceMap": true,
11
- "baseUrl": "../",
12
8
  "paths": {
13
- "@services/*": ["dist/types/services/*"],
14
- "@interfaces/*": ["dist/types/interfaces/*"],
15
- "@src/*": ["dist/types/"],
16
- }
9
+ "@services/*": ["../src/services/*"],
10
+ "@interfaces/*": ["../src/interfaces/*"],
11
+ "@src/*": ["../src/*"]
12
+ },
13
+ "rootDir": "../"
17
14
  },
18
- "include": [
19
- "./**/*"
20
- ]
21
- }
15
+ "include": ["./**/*"]
16
+ }
@@ -0,0 +1,10 @@
1
+ ---
2
+ to: <%= serviceName %>/oxfmt.config.ts
3
+ ---
4
+
5
+ import config from '@diia-inhouse/oxc-config/oxfmt'
6
+
7
+ export default {
8
+ ...config,
9
+ ignorePatterns: [...(config.ignorePatterns ?? []), 'src/generated'],
10
+ }
@@ -0,0 +1,24 @@
1
+ ---
2
+ to: <%= serviceName %>/oxlint.config.ts
3
+ ---
4
+
5
+ import { defineConfig, base } from '@diia-inhouse/oxc-config/oxlint'
6
+
7
+ export default defineConfig({
8
+ ...base,
9
+ ignorePatterns: [...base.ignorePatterns, 'src/generated', 'migrate-mongo-config.ts'],
10
+ rules: {
11
+ ...base.rules,
12
+ '@diia-inhouse/locale/no-hardcoded-cyrillic': 'off',
13
+ 'eslint/no-restricted-imports': 'off',
14
+ },
15
+ overrides: [
16
+ ...(base.overrides ?? []),
17
+ {
18
+ files: ['migrations/**/*.ts'],
19
+ rules: {
20
+ 'unicorn/filename-case': 'off',
21
+ },
22
+ },
23
+ ],
24
+ })
@@ -5,25 +5,26 @@ to: <%= serviceName %>/package.json
5
5
  {
6
6
  "name": "<%= serviceName %>",
7
7
  "version": "1.0.0",
8
+ "type": "module",
8
9
  "description": "<%= description %>",
9
10
  "author": "diia-team",
10
11
  "main": "dist/index.js",
11
12
  "scripts": {
12
13
  "prepare": "ts-patch install -s",
13
- "build": "rimraf dist/ && mkdir dist && npm run genproto && tsc",
14
+ "build": "rimraf dist && npm run genproto && tsc && tsc-alias",
14
15
  "start": "node dist/index.js",
15
16
  "semantic-release": "semantic-release -e @diia-inhouse/configs/dist/semantic-release/service-stage --debug --ci",
16
17
  "semantic-release-prod": "semantic-release -e @diia-inhouse/configs/dist/semantic-release/service-prod --debug --ci",
17
- "lint": "eslint . && prettier --check . && buf format ./proto --diff --exit-code ",
18
- "lint-fix": "eslint . --fix && prettier --write . && buf format ./proto --write",
18
+ "lint": "oxlint && oxfmt --check . && buf format ./proto --diff --exit-code",
19
+ "lint-fix": "oxlint --fix && oxfmt . && buf format ./proto --write",
19
20
  "lint:lockfile": "lockfile-lint --path package-lock.json --allowed-hosts registry.npmjs.org gitlab.diia.org.ua --validate-https",
20
21
  "test": "npm run genproto -- --generateClient=true && tsc --project tests/tsconfig.json --noEmit && vitest run",
21
22
  "test:watch": "vitest watch",
22
23
  "test:coverage": "vitest run --coverage",
23
24
  <%if (h.isOptionSelected(selectedDependencies, 'database')) {%>
24
25
  "migrate-test": "NODE_ENV=test npm run migrate up",
25
- "migrate": "sh -c 'ts-node --project migrations/tsconfig.json node_modules/.bin/migrate-mongo $0 $1 -f migrate-mongo-config.ts'",
26
- "indexes:sync": "node -r module-alias/register ./node_modules/.bin/diia-db sync-indexes",
26
+ "migrate": "npm run indexes:sync && sh -c 'tsx --tsconfig migrations/tsconfig.json node_modules/.bin/migrate-mongo $0 $1 -f migrate-mongo-config.ts'",
27
+ "indexes:sync": "./node_modules/.bin/diia-db sync-indexes",
27
28
  <%}%>
28
29
  "find-circulars": "madge --circular --extensions ts ./",
29
30
  "scaffold": "scaffold",
@@ -31,26 +32,15 @@ to: <%= serviceName %>/package.json
31
32
  },
32
33
  "keywords": [],
33
34
  "engines": {
34
- "node": ">=22"
35
+ "node": ">=24"
35
36
  },
36
37
  "files": [
37
38
  "dist"
38
39
  ],
39
- "_moduleAliases": {
40
- "@services": "dist/services",
41
- "@interfaces": "dist/interfaces",
42
- "@actions": "dist/actions",
43
- "@src": "dist",
44
- "@tests": "tests"
45
- },
46
40
  "commitlint": {
47
41
  "extends": "@diia-inhouse/configs/dist/commitlint"
48
42
  },
49
- "prettier": "@diia-inhouse/eslint-config/prettier",
50
43
  "madge": {
51
44
  "tsConfig": "./tsconfig.json"
52
- },
53
- "overrides": {
54
- "protobufjs": "7.2.5"
55
45
  }
56
46
  }
@@ -3,14 +3,15 @@ to: <%= serviceName %>/src/actions/v1/getAddResult.ts
3
3
  ---
4
4
 
5
5
  import { GrpcAppAction } from '@diia-inhouse/diia-app'
6
+
6
7
  import { SessionType } from '@diia-inhouse/types'
7
8
  import { ValidationSchema } from '@diia-inhouse/validators'
8
9
 
9
- import { GetAddResultReq } from '@src/generated'
10
+ import { GetAddResultReq } from '@src/generated/index.js'
10
11
 
11
- import AddService from '@services/add'
12
+ import AddService from '@services/add.js'
12
13
 
13
- import { ActionResult, Context } from '@interfaces/actions/v1/getAddResult'
14
+ import { ActionResult, Context } from '@interfaces/actions/v1/getAddResult.js'
14
15
 
15
16
  export default class GetAddResultAction implements GrpcAppAction<Context> {
16
17
  readonly name = 'getAddResult'
@@ -18,14 +19,16 @@ export default class GetAddResultAction implements GrpcAppAction<Context> {
18
19
  readonly sessionType = SessionType.None
19
20
 
20
21
  readonly validationRules: ValidationSchema<GetAddResultReq> = {
21
- a: {type: 'number'},
22
- b: {type: 'number'}
22
+ a: { type: 'number' },
23
+ b: { type: 'number' },
23
24
  }
24
25
 
25
26
  constructor(private readonly addService: AddService) {}
26
27
 
27
28
  async handler(args: Context): Promise<ActionResult> {
28
- const { params: { a, b } } = args
29
+ const {
30
+ params: { a, b },
31
+ } = args
29
32
 
30
33
  const result = this.addService.add(a, b)
31
34
 
@@ -4,16 +4,16 @@ to: <%= serviceName %>/src/bootstrap.ts
4
4
 
5
5
  import { Application, NodeTracerProvider, ServiceContext } from '@diia-inhouse/diia-app'
6
6
 
7
- import configFactory from '@src/configs/config'
8
- import { loggerConfig } from '@src/configs/logger'
9
- import deps from '@src/deps'
7
+ import configFactory from '@src/configs/config.js'
8
+ import { loggerConfig } from '@src/configs/logger.js'
9
+ import deps from '@src/deps.js'
10
10
 
11
- import { AppConfig } from '@interfaces/config'
12
- import { AppDeps } from '@interfaces/deps'
11
+ import { AppConfig } from '@interfaces/config.js'
12
+ import { AppDeps } from '@interfaces/deps.js'
13
13
 
14
14
  export async function bootstrap(serviceName: string, nodeTracerProvider: NodeTracerProvider): Promise<void> {
15
15
  const app = new Application<ServiceContext<AppConfig, AppDeps>>(serviceName, nodeTracerProvider, loggerConfig)
16
-
16
+
17
17
  await app.setConfig(configFactory)
18
18
  await app.setDeps(deps)
19
19
 
@@ -11,10 +11,10 @@ import { RedisOptions } from '@diia-inhouse/redis'
11
11
  <%if (h.isOptionSelected(selectedDependencies, ['internal', 'external'])) {%>
12
12
  import { QueueConnectionType, QueueTypes } from '@diia-inhouse/diia-queue'
13
13
 
14
- import serviceRulesConfig from '@src/configs/queue'
14
+ import serviceRulesConfig from '@src/configs/queue.js'
15
15
  <%}%>
16
16
 
17
- // eslint-disable-next-line @typescript-eslint/explicit-function-return-type
17
+ // oxlint-disable-next-line typescript/explicit-function-return-type
18
18
  export default async (<%= h.isOptionSelected(selectedDependencies, ['database', 'internal', 'external']) ? "envService: EnvService, " : '' %> <%= h.isOptionSelected(selectedDependencies, ['internal', 'external']) ? "serviceName: string" : '' %>) => ({
19
19
  healthCheck: {
20
20
  isEnabled: EnvService.getVar('HEALTH_CHECK_IS_ENABLED', 'boolean'),
@@ -8,7 +8,7 @@ import {
8
8
  InternalTopics,
9
9
  ScheduledTaskEvents,
10
10
  ScheduledTaskQueueNames,
11
- } from '@interfaces/queue'
11
+ } from '@interfaces/queue.js'
12
12
 
13
13
  export default {
14
14
  portalEvents: [],
@@ -2,12 +2,11 @@
2
2
  to: <%= serviceName %>/src/deps.ts
3
3
  ---
4
4
 
5
- import { DepsFactoryFn } from "@diia-inhouse/diia-app";
5
+ import { DepsFactoryFn } from '@diia-inhouse/diia-app'
6
6
 
7
- import { AppConfig } from '@interfaces/config'
8
- import { AppDeps } from "@interfaces/deps";
7
+ import { AppConfig } from '@interfaces/config.js'
8
+ import { AppDeps } from '@interfaces/deps.js'
9
9
 
10
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
11
10
  export default async (_config: AppConfig): ReturnType<DepsFactoryFn<AppConfig, AppDeps>> => {
12
- return {};
13
- };
11
+ return {}
12
+ }
@@ -3,11 +3,12 @@ to: <%= serviceName %>/src/index.ts
3
3
  ---
4
4
 
5
5
  import { initTracing } from '@diia-inhouse/diia-app'
6
+
6
7
  import { utils } from '@diia-inhouse/utils'
7
8
 
9
+ const serviceName = utils.getServiceName()
8
10
  const nodeTracerProvider = initTracing()
9
11
 
10
- import 'module-alias/register'
11
- import { bootstrap } from './bootstrap'
12
+ import { bootstrap } from './bootstrap.js'
12
13
 
13
- void bootstrap(utils.getServiceName(), nodeTracerProvider)
14
+ void bootstrap(serviceName, nodeTracerProvider)
@@ -4,7 +4,7 @@ to: <%= serviceName %>/src/interfaces/actions/v1/getAddResult.ts
4
4
 
5
5
  import { ActionContext } from '@diia-inhouse/types'
6
6
 
7
- import { GetAddResultReq, GetAddResultRes } from '@src/generated'
7
+ import { GetAddResultReq, GetAddResultRes } from '@src/generated/index.js'
8
8
 
9
9
  export type Context = ActionContext<GetAddResultReq>
10
10
 
@@ -2,6 +2,6 @@
2
2
  to: <%= serviceName %>/src/interfaces/config.ts
3
3
  ---
4
4
 
5
- import config from '@src/configs/config'
5
+ import config from '@src/configs/config.js'
6
6
 
7
7
  export type AppConfig = Awaited<ReturnType<typeof config>>
@@ -2,7 +2,7 @@
2
2
  to: <%= serviceName %>/src/interfaces/deps.ts
3
3
  ---
4
4
 
5
- import { AppConfig } from '@src/interfaces/config'
5
+ import { AppConfig } from '@src/interfaces/config.js'
6
6
 
7
7
  export type AppDeps = {
8
8
  config: AppConfig
@@ -2,6 +2,6 @@
2
2
  to: <%= serviceName %>/src/views/exampleViews/index.ts
3
3
  ---
4
4
 
5
- export { <%= h.changeCase.pascalCase(serviceName) %>InfoViews as default } from './view'
5
+ export { <%= h.changeCase.pascalCase(serviceName) %>InfoViews as default } from './view.js'
6
6
 
7
- export * from './interface'
7
+ export * from './interface.js'
@@ -2,7 +2,7 @@
2
2
  to: <%= serviceName %>/src/views/exampleViews/view.ts
3
3
  ---
4
4
 
5
- import { ViewParams, ViewScreen } from './interface'
5
+ import { ViewParams, ViewScreen } from './interface.js'
6
6
 
7
7
  export class <%= h.changeCase.pascalCase(serviceName) %>InfoViews {
8
8
  toScreen(_params: ViewParams): ViewScreen {
@@ -12,4 +12,4 @@ export class <%= h.changeCase.pascalCase(serviceName) %>InfoViews {
12
12
  bottomGroup: [],
13
13
  }
14
14
  }
15
- }
15
+ }
@@ -2,13 +2,13 @@
2
2
  to: <%= serviceName %>/tests/integration/actions/v1/getAddResult.spec.ts
3
3
  ---
4
4
 
5
- import { <%= h.changeCase.pascal(serviceName) %>Client } from '@src/generated'
5
+ import { <%= h.changeCase.pascal(serviceName) %>Client } from '@src/generated/index.js'
6
6
 
7
- import { ActionResult } from '@interfaces/actions/v1/getAddResult'
7
+ import GetAddResultAction from '@src/actions/v1/getAddResult.js'
8
8
 
9
- import GetAddResultAction from '@src/actions/v1/getAddResult'
9
+ import { getApp } from '@tests/utils/getApp.js'
10
10
 
11
- import { getApp } from '@tests/utils/getApp'
11
+ import { ActionResult } from '@interfaces/actions/v1/getAddResult.js'
12
12
 
13
13
  describe(`Action ${GetAddResultAction.name}`, () => {
14
14
  let app: Awaited<ReturnType<typeof getApp>>
@@ -21,9 +21,9 @@ describe(`Action ${GetAddResultAction.name}`, () => {
21
21
 
22
22
  it('should return correct result', async () => {
23
23
  // Arrange
24
- const a = 2;
25
- const b = 3;
26
-
24
+ const a = 2
25
+ const b = 3
26
+
27
27
  // Act
28
28
  const result = await <%= h.changeCase.camel(serviceName) %>Client.getAddResult({ a, b })
29
29
 
@@ -4,7 +4,7 @@ to: <%= serviceName %>/tests/interfaces.ts
4
4
 
5
5
  import TestKit from '@diia-inhouse/test'
6
6
 
7
- import { <%= h.changeCase.pascal(serviceName) %>Client } from '@src/generated'
7
+ import { <%= h.changeCase.pascal(serviceName) %>Client } from '@src/generated/index.js'
8
8
 
9
9
  export interface TestDeps {
10
10
  testKit: TestKit
@@ -5,23 +5,24 @@ to: <%= serviceName %>/tests/tsconfig.json
5
5
  {
6
6
  "extends": "@diia-inhouse/configs/tsconfig",
7
7
  "compilerOptions": {
8
- "baseUrl": "../",
9
8
  "types": ["vite/client", "vitest/globals", "./vitest.d.ts"],
10
9
  "module": "ESNext",
11
10
  "moduleResolution": "Bundler",
12
11
  "isolatedModules": true,
13
12
  "paths": {
14
- "@services/*": ["src/services/*"],
15
- "@interfaces/*": ["src/interfaces/*"],
13
+ "@services/*": ["../src/services/*"],
14
+ "@interfaces/*": ["../src/interfaces/*"],
16
15
  <%if (h.isOptionSelected(selectedDependencies, 'database')) {%>
17
- "@models/*": ["src/models/*"],
16
+ "@models/*": ["../src/models/*"],
18
17
  <%}%>
19
- "@dataMappers/*": ["src/dataMappers/*"],
20
- "@actions/*": ["src/actions/*"],
21
- "@src/*": ["src/*"],
22
- "@tests/*": ["tests/*"]
18
+ "@dataMappers/*": ["../src/dataMappers/*"],
19
+ "@actions/*": ["../src/actions/*"],
20
+ "@src/*": ["../src/*"],
21
+ "@tests/*": ["./*"]
23
22
  },
24
- "noEmit": true
23
+ "noEmit": true,
24
+ "strict": true,
25
+ "rootDir": "../"
25
26
  },
26
27
  "include": ["./**/*", "../vitest.config.mts"]
27
28
  }
@@ -4,15 +4,15 @@ to: <%= serviceName %>/tests/utils/getApp.ts
4
4
 
5
5
  import { Application, GrpcClientFactory, ServiceContext, ServiceOperator, NodeTracerProvider, asFunction } from '@diia-inhouse/diia-app'
6
6
 
7
- import config from '@src/configs/config'
8
- import { loggerConfig } from '@src/configs/logger'
9
- import { <%= h.changeCase.pascal(serviceName) %>Definition } from '@src/generated'
7
+ import config from '@src/configs/config.js'
8
+ import { loggerConfig } from '@src/configs/logger.js'
9
+ import { <%= h.changeCase.pascal(serviceName) %>Definition } from '@src/generated/index.js'
10
10
 
11
- import { TestDeps } from '@tests/interfaces'
12
- import deps from '@tests/utils/getDeps'
11
+ import { TestDeps } from '@tests/interfaces.js'
12
+ import deps from '@tests/utils/getDeps.js'
13
13
 
14
- import { AppConfig } from '@interfaces/config'
15
- import { AppDeps } from '@interfaces/deps'
14
+ import { AppConfig } from '@interfaces/config.js'
15
+ import { AppDeps } from '@interfaces/deps.js'
16
16
 
17
17
  const modules = {
18
18
  actions: import.meta.glob('/src/actions/**/*.ts'),
@@ -6,12 +6,12 @@ import { DepsFactoryFn, asClass } from '@diia-inhouse/diia-app'
6
6
 
7
7
  import TestKit from '@diia-inhouse/test'
8
8
 
9
- import deps from '@src/deps'
9
+ import deps from '@src/deps.js'
10
10
 
11
- import { TestDeps } from '@tests/interfaces'
11
+ import { TestDeps } from '@tests/interfaces.js'
12
12
 
13
- import { AppConfig } from '@interfaces/config'
14
- import { AppDeps } from '@interfaces/deps'
13
+ import { AppConfig } from '@interfaces/config.js'
14
+ import { AppDeps } from '@interfaces/deps.js'
15
15
 
16
16
  export default async (config: AppConfig): ReturnType<DepsFactoryFn<AppConfig, AppDeps & TestDeps>> => {
17
17
  return {
@@ -5,20 +5,30 @@ to: <%= serviceName %>/tsconfig.json
5
5
  {
6
6
  "extends": "@diia-inhouse/configs/tsconfig",
7
7
  "compilerOptions": {
8
+ "plugins": [
9
+ {
10
+ "transform": "@diia-inhouse/diia-app/dist/plugins/openapi"
11
+ }
12
+ ],
8
13
  "outDir": "dist",
14
+ "declaration": true,
9
15
  "declarationDir": "dist/types",
10
- "baseUrl": ".",
16
+ "resolveJsonModule": true,
17
+ "strict": true,
18
+ "skipLibCheck": true,
19
+ "lib": ["es2023", "DOM"],
11
20
  "paths": {
12
- "@services/*": ["src/services/*"],
13
- "@interfaces/*": ["src/interfaces/*"],
21
+ "@services/*": ["./src/services/*"],
22
+ "@interfaces/*": ["./src/interfaces/*"],
14
23
  <%if (h.isOptionSelected(selectedDependencies, 'database')) {%>
15
- "@models/*": ["src/models/*"],
24
+ "@models/*": ["./src/models/*"],
16
25
  <%}%>
17
- "@dataMappers/*": ["src/dataMappers/*"],
18
- "@actions/*": ["src/actions/*"],
19
- "@src/*": ["src/*"],
20
- "@tests/*": ["tests/*"]
21
- }
26
+ "@dataMappers/*": ["./src/dataMappers/*"],
27
+ "@actions/*": ["./src/actions/*"],
28
+ "@src/*": ["./src/*"],
29
+ "@tests/*": ["./tests/*"]
30
+ },
31
+ "rootDir": "./src"
22
32
  },
23
33
  "include": ["src/**/*"]
24
34
  }
@@ -2,13 +2,14 @@
2
2
  to: <%= serviceName %>/vitest.config.mts
3
3
  ---
4
4
 
5
- import tsConfigPaths from 'vite-tsconfig-paths'
6
5
  import { defineProject } from 'vitest/config'
7
6
 
8
7
  const timeout = 60 * 1000
9
8
 
10
9
  export default defineProject({
11
- plugins: [tsConfigPaths()],
10
+ resolve: {
11
+ tsconfigPaths: true,
12
+ },
12
13
  test: {
13
14
  env: {
14
15
  NODE_ENV: 'test',
@@ -20,6 +21,7 @@ export default defineProject({
20
21
  testTimeout: timeout,
21
22
  hookTimeout: timeout,
22
23
  exclude: ['node_modules', 'dist'],
24
+ setupFiles: ['@diia-inhouse/test/vitest'],
23
25
  projects: [
24
26
  {
25
27
  extends: true,
@@ -38,5 +40,3 @@ export default defineProject({
38
40
  ],
39
41
  },
40
42
  })
41
-
42
-
@@ -20,7 +20,7 @@ const serviceDepsToPackageDeps = {
20
20
  };
21
21
  exports.default = {
22
22
  prompt: async ({ prompter }) => {
23
- console.log(chalk_1.default.bold('After a files generation scaffold tries to run "npm install" and "prettier", please wait. \n'));
23
+ console.log(chalk_1.default.bold('After a files generation scaffold tries to run "npm install" and "oxfmt", please wait. \n'));
24
24
  const { serviceName } = await prompter.prompt({
25
25
  type: 'input',
26
26
  name: 'serviceName',
@@ -1 +1 @@
1
- {"version":3,"file":"prompt.js","sourceRoot":"","sources":["../../../../src/_templates/init/service/prompt.ts"],"names":[],"mappings":";;;;;AAAA,kDAAyB;AAEzB,kDAAoE;AAEpE,yEAAyH;AACzH,iDAAyD;AAEzD,MAAM,0BAA0B,GAAgC;IAC5D,KAAK,EAAE,iCAAiC;IACxC,GAAG,EAAE,+BAA+B;IACpC,IAAI,EAAE,4BAA4B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AC,WAAW,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CACtG,CAAA;QAED,OAAO;YACH,WAAW;YACX,WAAW;YACX,UAAU;YACV,YAAY,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,IAAI,EAAE,gBAAgB,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE;YAC9E,oBAAoB;YACpB,yBAAyB;SAC5B,CAAA;IACL,CAAC;CACJ,CAAA"}
@@ -2,7 +2,7 @@
2
2
  to: <%= workerRoot %>/activities/index.ts
3
3
  ---
4
4
 
5
- import { ExampleActivities } from './activityExample'
5
+ import { ExampleActivities } from './activityExample.js'
6
6
 
7
7
  export const workerActivities = {
8
8
  exampleActivities: ExampleActivities,
@@ -6,10 +6,10 @@ import { Application, NodeTracerProvider, ServiceContext } from '@diia-inhouse/d
6
6
 
7
7
  import { initWorker, instantiateActivities } from '@diia-inhouse/workflow/worker'
8
8
 
9
- import { AppConfig } from '@interfaces/config'
10
- import { AppDeps } from '@interfaces/deps'
9
+ import { AppConfig } from '@interfaces/config.js'
10
+ import { AppDeps } from '@interfaces/deps.js'
11
11
 
12
- import { workerActivities } from './activities'
12
+ import { workerActivities } from './activities/index.js'
13
13
 
14
14
  export async function initTemporal(
15
15
  app: Application<ServiceContext<AppConfig, AppDeps>>,
@@ -22,7 +22,7 @@ export async function initTemporal(
22
22
  const activities = instantiateActivities(app, workerActivities)
23
23
  const worker = await initWorker(
24
24
  config,
25
- { workflowsPath: require.resolve('./workflows'), activities },
25
+ { workflowsPath: import.meta.resolve('./workflows/index.js'), activities },
26
26
  envService,
27
27
  logger,
28
28
  nodeTracerProvider,
@@ -4,6 +4,6 @@ to: <%= workerRoot %>/workflows/index.ts
4
4
 
5
5
  import { WorkflowInterceptorsFactory, workflowInterceptors } from '@diia-inhouse/workflow/operations'
6
6
 
7
- export * from './workflowExample'
7
+ export * from './workflowExample.js'
8
8
 
9
9
  export const interceptors: WorkflowInterceptorsFactory = workflowInterceptors
@@ -4,7 +4,7 @@ to: <%= workerRoot %>/workflows/workflowExample.ts
4
4
 
5
5
  import { buildActivitiesProxy, log } from '@diia-inhouse/workflow/operations'
6
6
 
7
- import type { workerActivities } from '../../activities'
7
+ import type { workerActivities } from '../activities/index.js'
8
8
 
9
9
  const { exampleActivities } = buildActivitiesProxy<typeof workerActivities>()
10
10
 
@@ -1,3 +1,3 @@
1
1
  ---
2
- sh: "npx prettier --write <%= workerRoot %>"
3
- ---
2
+ sh: "npx oxfmt <%= workerRoot %>"
3
+ ---
package/dist/depsNames.js CHANGED
@@ -1,26 +1,33 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.serviceDependencies = exports.PackageDeps = exports.packageDependencies = void 0;
4
- const PackageDevDeps = [
4
+ const CommonDevDeps = [
5
5
  '@diia-inhouse/configs',
6
- '@diia-inhouse/eslint-config',
6
+ '@diia-inhouse/oxc-config',
7
7
  '@diia-inhouse/test',
8
- '@diia-inhouse/genproto',
9
8
  '@vitest/coverage-v8',
10
9
  '@vitest/ui',
11
- 'eslint',
12
10
  'lockfile-lint',
13
11
  'madge',
14
- 'prettier',
12
+ 'oxfmt',
13
+ 'oxlint',
14
+ 'oxlint-tsgolint',
15
15
  'rimraf',
16
16
  'semantic-release',
17
- 'ts-node',
18
- 'ts-patch',
19
17
  'typescript',
20
- 'vite-tsconfig-paths',
21
18
  'vitest',
22
19
  'vitest-mock-extended',
23
20
  ];
21
+ const PackageDevDeps = [...CommonDevDeps, 'tsdown', 'vite-tsconfig-paths'];
22
+ const ServiceDevDeps = [
23
+ ...CommonDevDeps,
24
+ '@bufbuild/buf',
25
+ '@diia-inhouse/genproto',
26
+ '@diia-inhouse/scaffold',
27
+ 'ts-patch',
28
+ 'tsc-alias',
29
+ 'tsx',
30
+ ];
24
31
  exports.packageDependencies = { devDeps: PackageDevDeps };
25
32
  exports.PackageDeps = [
26
33
  '@diia-inhouse/crypto',
@@ -38,10 +45,9 @@ exports.PackageDeps = [
38
45
  '@diia-inhouse/utils',
39
46
  '@diia-inhouse/validators',
40
47
  'migrate-mongo',
41
- 'module-alias',
42
48
  ];
43
49
  exports.serviceDependencies = {
44
- devDeps: [...PackageDevDeps, '@diia-inhouse/scaffold', '@bufbuild/buf'],
50
+ devDeps: ServiceDevDeps,
45
51
  deps: exports.PackageDeps,
46
52
  };
47
53
  //# sourceMappingURL=depsNames.js.map