@diia-inhouse/scaffold 2.23.0 → 2.52.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 (120) hide show
  1. package/LICENCE.md +59 -59
  2. package/dist/_sharedTemplates/actionTest.t +13 -12
  3. package/dist/_templates/add/action/01-action.ts.t +10 -8
  4. package/dist/_templates/add/action/01-interface.ts.t +12 -0
  5. package/dist/_templates/add/action/01-test.ts.t +1 -33
  6. package/dist/_templates/add/action/02-scriptRunner.t +1 -1
  7. package/dist/_templates/add/action/prompt.js +22 -9
  8. package/dist/_templates/add/action/prompt.js.map +1 -1
  9. package/dist/_templates/add/eventListener/01-event.ts.t +2 -2
  10. package/dist/_templates/add/generator/prompt.js +2 -1
  11. package/dist/_templates/add/generator/prompt.js.map +1 -1
  12. package/dist/_templates/add/model/01-interfaces.model.ts.t +1 -1
  13. package/dist/_templates/add/model/01-model.ts.t +1 -1
  14. package/dist/_templates/add/test/01-test.ts.t +1 -1
  15. package/dist/_templates/add/test/prompt.js +4 -1
  16. package/dist/_templates/add/test/prompt.js.map +1 -1
  17. package/dist/_templates/add/view/01-index.ts.t +7 -0
  18. package/dist/_templates/add/view/01-interface.ts.t +11 -0
  19. package/dist/_templates/add/view/01-view.ts.t +15 -0
  20. package/dist/_templates/add/view/02-scriptRunner.t +3 -0
  21. package/dist/_templates/add/view/prompt.js +30 -0
  22. package/dist/_templates/add/view/prompt.js.map +1 -0
  23. package/dist/_templates/init/admin/01-adminActionsService.ts.t +26 -0
  24. package/dist/_templates/init/admin/01-adminExecuteCustom.ts.t +34 -0
  25. package/dist/_templates/init/admin/01-adminExecuteCustomInterface.ts.t +10 -0
  26. package/dist/_templates/init/admin/01-adminExecuteQuery.ts.t +22 -0
  27. package/dist/_templates/init/admin/01-adminExecuteQueryInterface.ts.t +10 -0
  28. package/dist/_templates/init/admin/01-adminGetMeta.ts.t +22 -0
  29. package/dist/_templates/init/admin/01-adminGetMetaInterface.ts.t +7 -0
  30. package/dist/_templates/init/admin/01-adminService.ts.t +23 -0
  31. package/dist/_templates/init/admin/02-scriptRunner.ts.t +3 -0
  32. package/dist/_templates/init/admin/prompt.js +76 -0
  33. package/dist/_templates/init/admin/prompt.js.map +1 -0
  34. package/dist/_templates/init/matchers/01-matcher.ts.t +1 -1
  35. package/dist/_templates/init/matchers/01-vitest.d.ts.t +16 -0
  36. package/dist/_templates/init/matchers/02-scriptRunner.ts.t +1 -1
  37. package/dist/_templates/init/matchers/prompt.js +23 -17
  38. package/dist/_templates/init/matchers/prompt.js.map +1 -1
  39. package/dist/_templates/init/package/01-.gitignore.t +6 -0
  40. package/dist/_templates/init/package/01-.gitlab-ci.yml.t +7 -6
  41. package/dist/_templates/init/package/01-codeowners.t +5 -0
  42. package/dist/_templates/init/package/01-eslint.config.mjs.t +22 -0
  43. package/dist/_templates/init/package/01-package.json.t +8 -17
  44. package/dist/_templates/init/package/01-readme.md.t +4 -0
  45. package/dist/_templates/init/package/01-test.tsconfig.json.t +5 -1
  46. package/dist/_templates/init/package/01-vitest.config.mts.t +19 -0
  47. package/dist/_templates/init/package/prompt.js +8 -2
  48. package/dist/_templates/init/package/prompt.js.map +1 -1
  49. package/dist/_templates/init/service/01-.env.example.t +24 -19
  50. package/dist/_templates/init/service/01-.env.test.t +3 -0
  51. package/dist/_templates/init/service/01-.gitignore.t +1 -0
  52. package/dist/_templates/init/service/01-.gitlab-ci.yml.t +3 -7
  53. package/dist/_templates/init/service/01-.prettierignore.t +1 -0
  54. package/dist/_templates/init/service/01-codeowners.t +5 -0
  55. package/dist/_templates/init/service/01-eslint.config.mjs.t +21 -0
  56. package/dist/_templates/init/service/01-package.json.t +14 -28
  57. package/dist/_templates/init/service/01-proto.service.proto.t +15 -1
  58. package/dist/_templates/init/service/01-readme.md.t +11 -0
  59. package/dist/_templates/init/service/01-src.actions.v1.getAddResult.ts.t +15 -6
  60. package/dist/_templates/init/service/01-src.bootstrap.ts.t +5 -4
  61. package/dist/_templates/init/service/01-src.configs.config.ts.t +150 -0
  62. package/dist/_templates/init/service/01-src.configs.logger.ts.t +11 -0
  63. package/dist/_templates/init/service/01-src.configs.queue.ts.t +46 -0
  64. package/dist/_templates/init/service/01-src.deps.ts.t +1 -1
  65. package/dist/_templates/init/service/01-src.index.ts.t +3 -4
  66. package/dist/_templates/init/service/01-src.interfaces.actions.v1.getAddResult.ts.t +11 -0
  67. package/dist/_templates/init/service/01-src.interfaces.config.ts.t +1 -1
  68. package/dist/_templates/init/service/01-src.interfaces.queue.ts.t +23 -0
  69. package/dist/_templates/init/service/01-src.services.add.ts.t +9 -0
  70. package/dist/_templates/init/service/01-src.views.exampleViews.index.ts.t +7 -0
  71. package/dist/_templates/init/service/01-src.views.exampleViews.interface.ts.t +11 -0
  72. package/dist/_templates/init/service/01-src.views.exampleViews.view.ts.t +15 -0
  73. package/dist/_templates/init/service/01-tests.integration.actionts.getAddResult.spec.ts.t +7 -14
  74. package/dist/_templates/init/service/01-tests.interfaces.ts.t +3 -0
  75. package/dist/_templates/init/service/01-tests.tsconfig.json.t +6 -2
  76. package/dist/_templates/init/service/01-tests.utils.getApp.ts.t +18 -5
  77. package/dist/_templates/init/service/01-tests.vitest.d.ts.t +11 -0
  78. package/dist/_templates/init/service/01-tsconfig.json.t +2 -2
  79. package/dist/_templates/init/service/01-vitest.config.mts.t +42 -0
  80. package/dist/_templates/init/service/02-scriptRunner.ts.t +1 -1
  81. package/dist/_templates/init/service/prompt.js +44 -5
  82. package/dist/_templates/init/service/prompt.js.map +1 -1
  83. package/dist/_templates/init/temporal/01-worker.activity.activity-example.ts.t +14 -0
  84. package/dist/_templates/init/temporal/01-worker.activity.index.ts.t +9 -0
  85. package/dist/_templates/init/temporal/01-worker.index.ts.t +32 -0
  86. package/dist/_templates/init/temporal/01-worker.workflow.index.ts.t +9 -0
  87. package/dist/_templates/init/temporal/01-worker.workflow.workflow-example.ts.t +25 -0
  88. package/dist/_templates/init/temporal/02-scriptRunner.ts.t +3 -0
  89. package/dist/_templates/init/temporal/prompt.js +15 -0
  90. package/dist/_templates/init/temporal/prompt.js.map +1 -0
  91. package/dist/depsNames.js +28 -27
  92. package/dist/depsNames.js.map +1 -1
  93. package/dist/index.js +2 -2
  94. package/dist/index.js.map +1 -1
  95. package/dist/interfaces/_templates/add/view.js +3 -0
  96. package/dist/interfaces/_templates/add/view.js.map +1 -0
  97. package/dist/interfaces/_templates/init/admin.js +3 -0
  98. package/dist/interfaces/_templates/init/admin.js.map +1 -0
  99. package/dist/interfaces/_templates/init/matcher.js +6 -6
  100. package/dist/interfaces/_templates/init/service.js +3 -8
  101. package/dist/interfaces/_templates/init/service.js.map +1 -1
  102. package/dist/interfaces/_templates/init/temporal.js +3 -0
  103. package/dist/interfaces/_templates/init/temporal.js.map +1 -0
  104. package/dist/prompt/autocomplete.js +1 -3
  105. package/dist/prompt/autocomplete.js.map +1 -1
  106. package/dist/prompt/select/baseSelect.js +1 -3
  107. package/dist/prompt/select/baseSelect.js.map +1 -1
  108. package/dist/prompt/select/multiselect.js +1 -3
  109. package/dist/prompt/select/multiselect.js.map +1 -1
  110. package/dist/prompt/select/yesNoSelect.js +1 -2
  111. package/dist/prompt/select/yesNoSelect.js.map +1 -1
  112. package/dist/utils.js +3 -4
  113. package/dist/utils.js.map +1 -1
  114. package/package.json +17 -19
  115. package/dist/_templates/init/matchers/01-jest.d.ts.t +0 -16
  116. package/dist/_templates/init/package/01-.eslintignore.t +0 -7
  117. package/dist/_templates/init/service/01-.eslintignore.t +0 -9
  118. package/dist/_templates/init/service/01-dockerfile.t +0 -38
  119. package/dist/_templates/init/service/01-src.config.ts.t +0 -163
  120. package/dist/_templates/init/service/01-tests.jest.d.ts.t +0 -5
@@ -6,10 +6,14 @@ to: <%= serviceName %>/tests/tsconfig.json
6
6
  "extends": "@diia-inhouse/configs/tsconfig",
7
7
  "compilerOptions": {
8
8
  "baseUrl": "../",
9
+ "types": ["vite/client", "vitest/globals", "./vitest.d.ts"],
10
+ "module": "ESNext",
11
+ "moduleResolution": "Bundler",
12
+ "isolatedModules": true,
9
13
  "paths": {
10
14
  "@services/*": ["src/services/*"],
11
15
  "@interfaces/*": ["src/interfaces/*"],
12
- <%if (h.isOptionSelected(selectedOptions, 'database')) {%>
16
+ <%if (h.isOptionSelected(selectedDependencies, 'database')) {%>
13
17
  "@models/*": ["src/models/*"],
14
18
  <%}%>
15
19
  "@dataMappers/*": ["src/dataMappers/*"],
@@ -19,5 +23,5 @@ to: <%= serviceName %>/tests/tsconfig.json
19
23
  },
20
24
  "noEmit": true
21
25
  },
22
- "include": ["./**/*"]
26
+ "include": ["./**/*", "../vitest.config.mts"]
23
27
  }
@@ -2,9 +2,11 @@
2
2
  to: <%= serviceName %>/tests/utils/getApp.ts
3
3
  ---
4
4
 
5
- import { Application, ServiceContext, ServiceOperator } from '@diia-inhouse/diia-app'
5
+ import { Application, GrpcClientFactory, ServiceContext, ServiceOperator, NodeTracerProvider, asFunction } from '@diia-inhouse/diia-app'
6
6
 
7
- import config from '@src/config'
7
+ import config from '@src/configs/config'
8
+ import { loggerConfig } from '@src/configs/logger'
9
+ import { <%= h.changeCase.pascal(serviceName) %>Definition } from '@src/generated'
8
10
 
9
11
  import { TestDeps } from '@tests/interfaces'
10
12
  import deps from '@tests/utils/getDeps'
@@ -12,15 +14,26 @@ import deps from '@tests/utils/getDeps'
12
14
  import { AppConfig } from '@interfaces/config'
13
15
  import { AppDeps } from '@interfaces/deps'
14
16
 
17
+ const modules = {
18
+ actions: import.meta.glob('/src/actions/**/*.ts'),
19
+ services: import.meta.glob('/src/services/**/*.ts'),
20
+ }
21
+
15
22
  export async function getApp(): Promise<ServiceOperator<AppConfig, AppDeps & TestDeps>> {
16
- const app = new Application<ServiceContext<AppConfig, AppDeps & TestDeps>>('<%= h.changeCase.pascal(serviceName) %>')
23
+ const app = new Application<ServiceContext<AppConfig, AppDeps & TestDeps>>('<%= h.changeCase.pascal(serviceName) %>', new NodeTracerProvider(), loggerConfig)
17
24
 
18
25
  await app.setConfig(config)
19
26
  await app.setDeps(deps)
20
27
 
21
- const appOperator = await app.initialize()
28
+ const dynamicDeps = await app.extractDependenciesFromModules(modules, 'src')
29
+ const appOperator = await app.initialize(dynamicDeps)
30
+ const { grpcService } = await appOperator.start()
22
31
 
23
- await appOperator.start()
32
+ appOperator.container.register({
33
+ <%= h.changeCase.camel(serviceName) %>Client: asFunction((grpcClientFactory: GrpcClientFactory) =>
34
+ grpcClientFactory.createGrpcClient(<%= h.changeCase.pascal(serviceName) %>Definition, `localhost:${grpcService.serverPort}`),
35
+ ).singleton(),
36
+ })
24
37
 
25
38
  return appOperator
26
39
  }
@@ -0,0 +1,11 @@
1
+ ---
2
+ to: <%= serviceName %>/tests/vitest.d.ts
3
+ ---
4
+
5
+ import 'vitest'
6
+ import { CustomMatchers } from '@diia-inhouse/test/vitest'
7
+
8
+ declare module 'vitest' {
9
+ interface Assertion<T> extends CustomMatchers<T> {}
10
+ interface AsymmetricMatchersContaining extends CustomMatchers {}
11
+ }
@@ -11,7 +11,7 @@ to: <%= serviceName %>/tsconfig.json
11
11
  "paths": {
12
12
  "@services/*": ["src/services/*"],
13
13
  "@interfaces/*": ["src/interfaces/*"],
14
- <%if (h.isOptionSelected(selectedOptions, 'database')) {%>
14
+ <%if (h.isOptionSelected(selectedDependencies, 'database')) {%>
15
15
  "@models/*": ["src/models/*"],
16
16
  <%}%>
17
17
  "@dataMappers/*": ["src/dataMappers/*"],
@@ -20,5 +20,5 @@ to: <%= serviceName %>/tsconfig.json
20
20
  "@tests/*": ["tests/*"]
21
21
  }
22
22
  },
23
- "include": ["src/**/*", "tests/jest.d.ts"]
23
+ "include": ["src/**/*"]
24
24
  }
@@ -0,0 +1,42 @@
1
+ ---
2
+ to: <%= serviceName %>/vitest.config.mts
3
+ ---
4
+
5
+ import tsConfigPaths from 'vite-tsconfig-paths'
6
+ import { defineProject } from 'vitest/config'
7
+
8
+ const timeout = 60 * 1000
9
+
10
+ export default defineProject({
11
+ plugins: [tsConfigPaths()],
12
+ test: {
13
+ env: {
14
+ NODE_ENV: 'test',
15
+ },
16
+ clearMocks: true,
17
+ restoreMocks: true,
18
+ mockReset: true,
19
+ globals: true,
20
+ testTimeout: timeout,
21
+ hookTimeout: timeout,
22
+ exclude: ['node_modules', 'dist'],
23
+ projects: [
24
+ {
25
+ extends: true,
26
+ test: {
27
+ name: 'unit',
28
+ include: ['tests/unit/**/*.spec.ts'],
29
+ },
30
+ },
31
+ {
32
+ extends: true,
33
+ test: {
34
+ name: 'integration',
35
+ include: ['tests/integration/**/*.spec.ts'],
36
+ },
37
+ },
38
+ ],
39
+ },
40
+ })
41
+
42
+
@@ -1,5 +1,5 @@
1
1
  ---
2
- sh: "cd <%= serviceName %> && npm install <%= dependencies.deps %> && npm install --save-dev <%= dependencies.devDeps %> && npm run lint-fix && cp .env.example .env && cp .env.test .env.test.local && npm run build && npm test"
2
+ sh: "cd <%= serviceName %> && echo 'Installing dependencies and setting up environment, please wait...' && npm install <%= dependencies.deps %> && npm install --save-dev <%= dependencies.devDeps %> && npm run lint-fix && cp .env.example .env && cp .env.test .env.test.local && npm run build && npm test"
3
3
  ---
4
4
 
5
5
  This file does not appear in the final package generation
@@ -7,7 +7,17 @@ const chalk_1 = __importDefault(require("chalk"));
7
7
  const depsNames_1 = require("../../../depsNames");
8
8
  const service_1 = require("../../../interfaces/_templates/init/service");
9
9
  const index_1 = require("../../../prompt/index");
10
- const choices = Object.values(service_1.ServiceDeps).map((choice) => ({ name: choice }));
10
+ const readmePointsDescriptionMap = {
11
+ figma: 'Provide a link to the Figma doc',
12
+ api: 'Provide a link to the API doc',
13
+ docs: 'Provide a link to the docs',
14
+ };
15
+ const serviceDepsToPackageDeps = {
16
+ database: ['@diia-inhouse/db', 'migrate-mongo'],
17
+ redis: ['@diia-inhouse/redis'],
18
+ external: ['@diia-inhouse/diia-queue'],
19
+ internal: ['@diia-inhouse/diia-queue'],
20
+ };
11
21
  exports.default = {
12
22
  prompt: async ({ prompter }) => {
13
23
  console.log(chalk_1.default.bold('After a files generation scaffold tries to run "npm install" and "prettier", please wait. \n'));
@@ -17,19 +27,48 @@ exports.default = {
17
27
  message: "What's your new service name (e.g. criminal-cert-service)?",
18
28
  required: true,
19
29
  });
30
+ const selectedDependencies = await (0, index_1.promptMultiSelect)({
31
+ message: 'Which external dependencies do you want use with that service?',
32
+ choices: service_1.ServiceDeps.map((choice) => ({ name: choice })),
33
+ });
20
34
  const { description } = await prompter.prompt({
21
35
  type: 'input',
22
36
  name: 'description',
23
37
  message: "What's your new service description?",
24
38
  required: true,
25
39
  });
26
- const selectedOptions = await (0, index_1.promptMultiSelect)({
27
- message: 'Which external dependencies do you want use with that service?',
28
- choices,
40
+ const { codeowners } = await prompter.prompt({
41
+ type: 'input',
42
+ name: 'codeowners',
43
+ message: 'List codeowners for this service (e.g. @user1, @user2)',
44
+ required: true,
45
+ });
46
+ const selectedReadmePoints = await (0, index_1.promptMultiSelect)({
47
+ message: 'Which points do you want to add to the README?',
48
+ choices: service_1.ReadmePoints.map((choice) => ({ name: choice })),
29
49
  });
50
+ const selectedReadmePointValues = new Map();
51
+ for await (const point of selectedReadmePoints) {
52
+ const { value } = await prompter.prompt({
53
+ type: 'input',
54
+ name: 'value',
55
+ message: readmePointsDescriptionMap[point],
56
+ required: true,
57
+ });
58
+ selectedReadmePointValues.set(point, value);
59
+ }
30
60
  console.log(chalk_1.default.red.bold("Don't forget to add charts and envs to the infra repo manually\r"));
31
61
  const { devDeps, deps } = depsNames_1.serviceDependencies;
32
- return { serviceName, description, dependencies: { devDeps: devDeps.join(' '), deps: deps.join(' ') }, selectedOptions };
62
+ const packageDepsToUse = deps.filter((dep) => !Object.values(serviceDepsToPackageDeps).flat().includes(dep) ||
63
+ selectedDependencies.some((selectedDep) => serviceDepsToPackageDeps[selectedDep].includes(dep)));
64
+ return {
65
+ serviceName,
66
+ description,
67
+ codeowners,
68
+ dependencies: { devDeps: devDeps.join(' '), deps: packageDepsToUse.join(' ') },
69
+ selectedDependencies,
70
+ selectedReadmePointValues,
71
+ };
33
72
  },
34
73
  };
35
74
  //# sourceMappingURL=prompt.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"prompt.js","sourceRoot":"","sources":["../../../../src/_templates/init/service/prompt.ts"],"names":[],"mappings":";;;;;AAAA,kDAAyB;AAEzB,kDAAwD;AAExD,yEAAkF;AAElF,iDAAyD;AAEzD,MAAM,OAAO,GAAwB,MAAM,CAAC,MAAM,CAAC,qBAAW,CAAC,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC,CAAA;AAEnG,kBAAe;IACX,MAAM,EAAE,KAAK,EAAE,EAAE,QAAQ,EAAU,EAAoB,EAAE;QACrD,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,IAAI,CAAC,8FAA8F,CAAC,CAAC,CAAA;QAEvH,MAAM,EAAE,WAAW,EAAE,GAAG,MAAM,QAAQ,CAAC,MAAM,CAAC;YAC1C,IAAI,EAAE,OAAO;YACb,IAAI,EAAE,aAAa;YACnB,OAAO,EAAE,4DAA4D;YACrE,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,GAAG,MAAM,IAAA,yBAAiB,EAAc;YACzD,OAAO,EAAE,gEAAgE;YACzE,OAAO;SACV,CAAC,CAAA;QAEF,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,GAAG,CAAC,IAAI,CAAC,kEAAkE,CAAC,CAAC,CAAA;QAE/F,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,+BAAmB,CAAA;QAE7C,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,YAAY,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,eAAe,EAAE,CAAA;IAC5H,CAAC;CACJ,CAAA"}
1
+ {"version":3,"file":"prompt.js","sourceRoot":"","sources":["../../../../src/_templates/init/service/prompt.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,14 @@
1
+ ---
2
+ to: <%= workerRoot %>/activities/activityExample.ts
3
+ ---
4
+
5
+ export class ExampleActivities {
6
+ constructor(
7
+ private readonly config: AppConfig,
8
+ private readonly logger: Logger,
9
+ ) {}
10
+
11
+ async exampleActivity(): Promise<void> {
12
+ this.logger.info('Example activity loaded successfully')
13
+ }
14
+ }
@@ -0,0 +1,9 @@
1
+ ---
2
+ to: <%= workerRoot %>/activities/index.ts
3
+ ---
4
+
5
+ import { ExampleActivities } from './activityExample'
6
+
7
+ export const workerActivities = {
8
+ exampleActivities: ExampleActivities,
9
+ } as const
@@ -0,0 +1,32 @@
1
+ ---
2
+ to: <%= workerRoot %>/index.ts
3
+ ---
4
+
5
+ import { Application, NodeTracerProvider, ServiceContext } from '@diia-inhouse/diia-app'
6
+
7
+ import { initWorker, instantiateActivities } from '@diia-inhouse/workflow/worker'
8
+
9
+ import { AppConfig } from '@interfaces/config'
10
+ import { AppDeps } from '@interfaces/deps'
11
+
12
+ import { workerActivities } from './activities'
13
+
14
+ export async function initTemporal(
15
+ app: Application<ServiceContext<AppConfig, AppDeps>>,
16
+ nodeTracerProvider: NodeTracerProvider,
17
+ ): Promise<void> {
18
+ const config = app.getConfig()
19
+ const logger = app.container!.resolve('logger')
20
+ const envService = app.container!.resolve('envService')
21
+
22
+ const activities = instantiateActivities(app, workerActivities)
23
+ const worker = await initWorker(
24
+ config,
25
+ { workflowsPath: require.resolve('./workflows'), activities },
26
+ envService,
27
+ logger,
28
+ nodeTracerProvider,
29
+ )
30
+
31
+ await worker.run()
32
+ }
@@ -0,0 +1,9 @@
1
+ ---
2
+ to: <%= workerRoot %>/workflows/index.ts
3
+ ---
4
+
5
+ import { WorkflowInterceptorsFactory, workflowInterceptors } from '@diia-inhouse/workflow/operations'
6
+
7
+ export * from './workflowExample'
8
+
9
+ export const interceptors: WorkflowInterceptorsFactory = workflowInterceptors
@@ -0,0 +1,25 @@
1
+ ---
2
+ to: <%= workerRoot %>/workflows/workflowExample.ts
3
+ ---
4
+
5
+ import { buildActivitiesProxy, log } from '@diia-inhouse/workflow/operations'
6
+
7
+ import type { workerActivities } from '../../activities'
8
+
9
+ const { exampleActivities } = buildActivitiesProxy<typeof workerActivities>()
10
+
11
+ const activities = exampleActivities({
12
+ startToCloseTimeout: '24 hours',
13
+ heartbeatTimeout: '120 seconds',
14
+ retry: {
15
+ maximumAttempts: 7,
16
+ initialInterval: '5 minutes',
17
+ maximumInterval: '60 minutes',
18
+ },
19
+ })
20
+
21
+ export async function exampleWorkflow(): Promise<void> {
22
+ log.info('Starting example workflow')
23
+
24
+ await activities.exampleActivity()
25
+ }
@@ -0,0 +1,3 @@
1
+ ---
2
+ sh: "npx prettier --write <%= workerRoot %>"
3
+ ---
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const node_path_1 = __importDefault(require("node:path"));
7
+ const chalk_1 = __importDefault(require("chalk"));
8
+ exports.default = {
9
+ prompt: async () => {
10
+ const workerRoot = node_path_1.default.resolve(process.cwd(), 'src/worker');
11
+ console.log(chalk_1.default.red.bold('Do not forget to call initTemporal function in bootstrap.ts and add dependencies to deps.ts \n'));
12
+ return { workerRoot };
13
+ },
14
+ };
15
+ //# sourceMappingURL=prompt.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prompt.js","sourceRoot":"","sources":["../../../../src/_templates/init/temporal/prompt.ts"],"names":[],"mappings":";;;;;AAAA,0DAA4B;AAE5B,kDAAyB;AAIzB,kBAAe;IACX,MAAM,EAAE,KAAK,IAAsB,EAAE;QACjC,MAAM,UAAU,GAAG,mBAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,YAAY,CAAC,CAAA;QAE5D,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,GAAG,CAAC,IAAI,CAAC,gGAAgG,CAAC,CAAC,CAAA;QAE7H,OAAO,EAAE,UAAU,EAAE,CAAA;IACzB,CAAC;CACJ,CAAA"}
package/dist/depsNames.js CHANGED
@@ -1,15 +1,14 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.serviceDependencies = exports.packageDependencies = void 0;
4
- const devDeps = [
3
+ exports.serviceDependencies = exports.PackageDeps = exports.packageDependencies = void 0;
4
+ const PackageDevDeps = [
5
5
  '@diia-inhouse/configs',
6
6
  '@diia-inhouse/eslint-config',
7
7
  '@diia-inhouse/test',
8
8
  '@diia-inhouse/genproto',
9
- '@diia-inhouse/test',
10
- '@types/jest',
9
+ '@vitest/coverage-v8',
10
+ '@vitest/ui',
11
11
  'eslint',
12
- 'jest',
13
12
  'lockfile-lint',
14
13
  'madge',
15
14
  'prettier',
@@ -17,30 +16,32 @@ const devDeps = [
17
16
  'semantic-release',
18
17
  'ts-node',
19
18
  'ts-patch',
20
- 'ts-proto',
21
19
  'typescript',
20
+ 'vite-tsconfig-paths',
21
+ 'vitest',
22
+ 'vitest-mock-extended',
23
+ ];
24
+ exports.packageDependencies = { devDeps: PackageDevDeps };
25
+ exports.PackageDeps = [
26
+ '@diia-inhouse/crypto',
27
+ '@diia-inhouse/db',
28
+ '@diia-inhouse/design-system',
29
+ '@diia-inhouse/diia-app',
30
+ '@diia-inhouse/diia-logger',
31
+ '@diia-inhouse/diia-queue',
32
+ '@diia-inhouse/diia-metrics',
33
+ '@diia-inhouse/env',
34
+ '@diia-inhouse/errors',
35
+ '@diia-inhouse/healthcheck',
36
+ '@diia-inhouse/redis',
37
+ '@diia-inhouse/types',
38
+ '@diia-inhouse/utils',
39
+ '@diia-inhouse/validators',
40
+ 'migrate-mongo',
41
+ 'module-alias',
22
42
  ];
23
- exports.packageDependencies = { devDeps };
24
43
  exports.serviceDependencies = {
25
- devDeps: [...devDeps, '@diia-inhouse/scaffold'],
26
- deps: [
27
- '@diia-inhouse/analytics',
28
- '@diia-inhouse/crypto',
29
- '@diia-inhouse/db',
30
- '@diia-inhouse/diia-app',
31
- '@diia-inhouse/diia-logger',
32
- '@diia-inhouse/diia-queue',
33
- '@diia-inhouse/diia-metrics',
34
- '@diia-inhouse/env',
35
- '@diia-inhouse/errors',
36
- '@diia-inhouse/healthcheck',
37
- '@diia-inhouse/http',
38
- '@diia-inhouse/redis',
39
- '@diia-inhouse/types',
40
- '@diia-inhouse/utils',
41
- '@diia-inhouse/validators',
42
- 'migrate-mongo',
43
- 'module-alias',
44
- ],
44
+ devDeps: [...PackageDevDeps, '@diia-inhouse/scaffold', '@bufbuild/buf'],
45
+ deps: exports.PackageDeps,
45
46
  };
46
47
  //# sourceMappingURL=depsNames.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"depsNames.js","sourceRoot":"","sources":["../src/depsNames.ts"],"names":[],"mappings":";;;AAAA,MAAM,OAAO,GAAG;IACZ,uBAAuB;IACvB,6BAA6B;IAC7B,oBAAoB;IACpB,wBAAwB;IACxB,oBAAoB;IACpB,aAAa;IACb,QAAQ;IACR,MAAM;IACN,eAAe;IACf,OAAO;IACP,UAAU;IACV,QAAQ;IACR,kBAAkB;IAClB,SAAS;IACT,UAAU;IACV,UAAU;IACV,YAAY;CACf,CAAA;AAEY,QAAA,mBAAmB,GAAG,EAAE,OAAO,EAAE,CAAA;AAEjC,QAAA,mBAAmB,GAAG;IAC/B,OAAO,EAAE,CAAC,GAAG,OAAO,EAAE,wBAAwB,CAAC;IAC/C,IAAI,EAAE;QACF,yBAAyB;QACzB,sBAAsB;QACtB,kBAAkB;QAClB,wBAAwB;QACxB,2BAA2B;QAC3B,0BAA0B;QAC1B,4BAA4B;QAC5B,mBAAmB;QACnB,sBAAsB;QACtB,2BAA2B;QAC3B,oBAAoB;QACpB,qBAAqB;QACrB,qBAAqB;QACrB,qBAAqB;QACrB,0BAA0B;QAC1B,eAAe;QACf,cAAc;KACjB;CACJ,CAAA"}
1
+ {"version":3,"file":"depsNames.js","sourceRoot":"","sources":["../src/depsNames.ts"],"names":[],"mappings":";;;AAAA,MAAM,cAAc,GAAG;IACnB,uBAAuB;IACvB,6BAA6B;IAC7B,oBAAoB;IACpB,wBAAwB;IACxB,qBAAqB;IACrB,YAAY;IACZ,QAAQ;IACR,eAAe;IACf,OAAO;IACP,UAAU;IACV,QAAQ;IACR,kBAAkB;IAClB,SAAS;IACT,UAAU;IACV,YAAY;IACZ,qBAAqB;IACrB,QAAQ;IACR,sBAAsB;CAChB,CAAA;AAEG,QAAA,mBAAmB,GAAG,EAAE,OAAO,EAAE,cAAc,EAAE,CAAA;AAEjD,QAAA,WAAW,GAAG;IACvB,sBAAsB;IACtB,kBAAkB;IAClB,6BAA6B;IAC7B,wBAAwB;IACxB,2BAA2B;IAC3B,0BAA0B;IAC1B,4BAA4B;IAC5B,mBAAmB;IACnB,sBAAsB;IACtB,2BAA2B;IAC3B,qBAAqB;IACrB,qBAAqB;IACrB,qBAAqB;IACrB,0BAA0B;IAC1B,eAAe;IACf,cAAc;CACR,CAAA;AAIG,QAAA,mBAAmB,GAAG;IAC/B,OAAO,EAAE,CAAC,GAAG,cAAc,EAAE,wBAAwB,EAAE,eAAe,CAAC;IACvE,IAAI,EAAE,mBAAW;CACpB,CAAA"}
package/dist/index.js CHANGED
@@ -8,7 +8,7 @@ const hygen_1 = require("hygen");
8
8
  const utils_1 = require("./utils");
9
9
  const defaultTemplates = node_path_1.default.resolve(__dirname, './_templates');
10
10
  async function main() {
11
- (0, hygen_1.runner)(process.argv.slice(2), {
11
+ void (0, hygen_1.runner)(process.argv.slice(2), {
12
12
  logger: new hygen_1.Logger(console.log.bind(console)),
13
13
  createPrompter: () => require('enquirer'),
14
14
  exec: (action) => (0, utils_1.shExecutor)(action),
@@ -18,5 +18,5 @@ async function main() {
18
18
  helpers: utils_1.helpers,
19
19
  });
20
20
  }
21
- main();
21
+ void main();
22
22
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;AAAA,0DAA4B;AAE5B,iCAAsC;AAEtC,mCAA6C;AAE7C,MAAM,gBAAgB,GAAG,mBAAI,CAAC,OAAO,CAAC,SAAS,EAAE,cAAc,CAAC,CAAA;AAEhE,KAAK,UAAU,IAAI;IACf,IAAA,cAAM,EAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE;QAC1B,MAAM,EAAE,IAAI,cAAM,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC7C,cAAc,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,UAAU,CAAC;QACzC,IAAI,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,IAAA,kBAAU,EAAC,MAAM,CAAC;QACpC,GAAG,EAAE,OAAO,CAAC,GAAG,EAAE;QAClB,SAAS,EAAE,gBAAgB;QAC3B,KAAK,EAAE,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC;QACjC,OAAO,EAAP,eAAO;KACV,CAAC,CAAA;AACN,CAAC;AAED,IAAI,EAAE,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;AAAA,0DAA4B;AAE5B,iCAAsC;AAEtC,mCAA6C;AAE7C,MAAM,gBAAgB,GAAG,mBAAI,CAAC,OAAO,CAAC,SAAS,EAAE,cAAc,CAAC,CAAA;AAEhE,KAAK,UAAU,IAAI;IACf,KAAK,IAAA,cAAM,EAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE;QAC/B,MAAM,EAAE,IAAI,cAAM,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC7C,cAAc,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,UAAU,CAAC;QACzC,IAAI,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,IAAA,kBAAU,EAAC,MAAM,CAAC;QACpC,GAAG,EAAE,OAAO,CAAC,GAAG,EAAE;QAClB,SAAS,EAAE,gBAAgB;QAC3B,KAAK,EAAE,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC;QACjC,OAAO,EAAP,eAAO;KACV,CAAC,CAAA;AACN,CAAC;AAED,KAAK,IAAI,EAAE,CAAA"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=view.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"view.js","sourceRoot":"","sources":["../../../../src/interfaces/_templates/add/view.ts"],"names":[],"mappings":""}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=admin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"admin.js","sourceRoot":"","sources":["../../../../src/interfaces/_templates/init/admin.ts"],"names":[],"mappings":""}
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ProjectJestType = void 0;
4
- var ProjectJestType;
5
- (function (ProjectJestType) {
6
- ProjectJestType["Integration"] = "integration";
7
- ProjectJestType["Unit"] = "unit";
8
- })(ProjectJestType || (exports.ProjectJestType = ProjectJestType = {}));
3
+ exports.ProjectTestType = void 0;
4
+ var ProjectTestType;
5
+ (function (ProjectTestType) {
6
+ ProjectTestType["Integration"] = "integration";
7
+ ProjectTestType["Unit"] = "unit";
8
+ })(ProjectTestType || (exports.ProjectTestType = ProjectTestType = {}));
9
9
  //# sourceMappingURL=matcher.js.map
@@ -1,11 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ServiceDeps = void 0;
4
- var ServiceDeps;
5
- (function (ServiceDeps) {
6
- ServiceDeps["database"] = "database";
7
- ServiceDeps["redis"] = "redis";
8
- ServiceDeps["external"] = "external";
9
- ServiceDeps["internal"] = "internal";
10
- })(ServiceDeps || (exports.ServiceDeps = ServiceDeps = {}));
3
+ exports.ReadmePoints = exports.ServiceDeps = void 0;
4
+ exports.ServiceDeps = ['database', 'redis', 'external', 'internal'];
5
+ exports.ReadmePoints = ['figma', 'api', 'docs'];
11
6
  //# sourceMappingURL=service.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"service.js","sourceRoot":"","sources":["../../../../src/interfaces/_templates/init/service.ts"],"names":[],"mappings":";;;AASA,IAAY,WAKX;AALD,WAAY,WAAW;IACnB,oCAAqB,CAAA;IACrB,8BAAe,CAAA;IACf,oCAAqB,CAAA;IACrB,oCAAqB,CAAA;AACzB,CAAC,EALW,WAAW,2BAAX,WAAW,QAKtB"}
1
+ {"version":3,"file":"service.js","sourceRoot":"","sources":["../../../../src/interfaces/_templates/init/service.ts"],"names":[],"mappings":";;;AAWa,QAAA,WAAW,GAAG,CAAC,UAAU,EAAE,OAAO,EAAE,UAAU,EAAE,UAAU,CAAU,CAAA;AAIpE,QAAA,YAAY,GAAG,CAAC,OAAO,EAAE,KAAK,EAAE,MAAM,CAAU,CAAA"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=temporal.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"temporal.js","sourceRoot":"","sources":["../../../../src/interfaces/_templates/init/temporal.ts"],"names":[],"mappings":""}
@@ -1,12 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.promptAutoComplete = void 0;
4
- // eslint-disable-next-line @typescript-eslint/no-var-requires
3
+ exports.promptAutoComplete = promptAutoComplete;
5
4
  const { AutoComplete } = require('enquirer');
6
5
  async function promptAutoComplete(params) {
7
6
  const prompt = new AutoComplete(params);
8
7
  const answer = await prompt.run();
9
8
  return answer;
10
9
  }
11
- exports.promptAutoComplete = promptAutoComplete;
12
10
  //# sourceMappingURL=autocomplete.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"autocomplete.js","sourceRoot":"","sources":["../../src/prompt/autocomplete.ts"],"names":[],"mappings":";;;AAEA,8DAA8D;AAC9D,MAAM,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC,CAAA;AAErC,KAAK,UAAU,kBAAkB,CAAa,MAA0B;IAC3E,MAAM,MAAM,GAAG,IAAI,YAAY,CAAC,MAAM,CAAC,CAAA;IAEvC,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,GAAG,EAAE,CAAA;IAEjC,OAAO,MAAM,CAAA;AACjB,CAAC;AAND,gDAMC"}
1
+ {"version":3,"file":"autocomplete.js","sourceRoot":"","sources":["../../src/prompt/autocomplete.ts"],"names":[],"mappings":";;AAIA,gDAMC;AARD,MAAM,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC,CAAA;AAErC,KAAK,UAAU,kBAAkB,CAAa,MAA0B;IAC3E,MAAM,MAAM,GAAG,IAAI,YAAY,CAAC,MAAM,CAAC,CAAA;IAEvC,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,GAAG,EAAE,CAAA;IAEjC,OAAO,MAAM,CAAA;AACjB,CAAC"}
@@ -1,12 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.promptBaseSelect = void 0;
4
- // eslint-disable-next-line @typescript-eslint/no-var-requires
3
+ exports.promptBaseSelect = promptBaseSelect;
5
4
  const { Select } = require('enquirer');
6
5
  async function promptBaseSelect(params) {
7
6
  const prompt = new Select(params);
8
7
  const answer = await prompt.run();
9
8
  return answer;
10
9
  }
11
- exports.promptBaseSelect = promptBaseSelect;
12
10
  //# sourceMappingURL=baseSelect.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"baseSelect.js","sourceRoot":"","sources":["../../../src/prompt/select/baseSelect.ts"],"names":[],"mappings":";;;AAEA,8DAA8D;AAC9D,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC,CAAA;AAE/B,KAAK,UAAU,gBAAgB,CAAC,MAAoB;IACvD,MAAM,MAAM,GAAG,IAAI,MAAM,CAAC,MAAM,CAAC,CAAA;IAEjC,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,GAAG,EAAE,CAAA;IAEjC,OAAO,MAAM,CAAA;AACjB,CAAC;AAND,4CAMC"}
1
+ {"version":3,"file":"baseSelect.js","sourceRoot":"","sources":["../../../src/prompt/select/baseSelect.ts"],"names":[],"mappings":";;AAIA,4CAMC;AARD,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC,CAAA;AAE/B,KAAK,UAAU,gBAAgB,CAAC,MAAoB;IACvD,MAAM,MAAM,GAAG,IAAI,MAAM,CAAC,MAAM,CAAC,CAAA;IAEjC,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,GAAG,EAAE,CAAA;IAEjC,OAAO,MAAM,CAAA;AACjB,CAAC"}
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.promptMultiSelect = void 0;
4
- // eslint-disable-next-line @typescript-eslint/no-var-requires
3
+ exports.promptMultiSelect = promptMultiSelect;
5
4
  const { MultiSelect } = require('enquirer');
6
5
  async function promptMultiSelect(params) {
7
6
  const prompt = new MultiSelect({
@@ -11,5 +10,4 @@ async function promptMultiSelect(params) {
11
10
  const answers = await prompt.run();
12
11
  return answers;
13
12
  }
14
- exports.promptMultiSelect = promptMultiSelect;
15
13
  //# sourceMappingURL=multiselect.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"multiselect.js","sourceRoot":"","sources":["../../../src/prompt/select/multiselect.ts"],"names":[],"mappings":";;;AAEA,8DAA8D;AAC9D,MAAM,EAAE,WAAW,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC,CAAA;AAEpC,KAAK,UAAU,iBAAiB,CAAmB,MAAyB;IAC/E,MAAM,MAAM,GAAG,IAAI,WAAW,CAAC;QAC3B,IAAI,EAAE,6CAA6C;QACnD,GAAG,MAAM;KACZ,CAAC,CAAA;IAEF,MAAM,OAAO,GAAG,MAAM,MAAM,CAAC,GAAG,EAAE,CAAA;IAElC,OAAO,OAAO,CAAA;AAClB,CAAC;AATD,8CASC"}
1
+ {"version":3,"file":"multiselect.js","sourceRoot":"","sources":["../../../src/prompt/select/multiselect.ts"],"names":[],"mappings":";;AAIA,8CASC;AAXD,MAAM,EAAE,WAAW,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC,CAAA;AAEpC,KAAK,UAAU,iBAAiB,CAAmB,MAAyB;IAC/E,MAAM,MAAM,GAAG,IAAI,WAAW,CAAC;QAC3B,IAAI,EAAE,6CAA6C;QACnD,GAAG,MAAM;KACZ,CAAC,CAAA;IAEF,MAAM,OAAO,GAAG,MAAM,MAAM,CAAC,GAAG,EAAE,CAAA;IAElC,OAAO,OAAO,CAAA;AAClB,CAAC"}
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.promptYesNoSelect = void 0;
3
+ exports.promptYesNoSelect = promptYesNoSelect;
4
4
  const baseSelect_1 = require("./baseSelect");
5
5
  const YES = 'yes';
6
6
  const NO = 'no';
@@ -13,5 +13,4 @@ async function promptYesNoSelect(params) {
13
13
  });
14
14
  return result === YES;
15
15
  }
16
- exports.promptYesNoSelect = promptYesNoSelect;
17
16
  //# sourceMappingURL=yesNoSelect.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"yesNoSelect.js","sourceRoot":"","sources":["../../../src/prompt/select/yesNoSelect.ts"],"names":[],"mappings":";;;AAEA,6CAA+C;AAE/C,MAAM,GAAG,GAAG,KAAK,CAAA;AACjB,MAAM,EAAE,GAAG,IAAI,CAAA;AAER,KAAK,UAAU,iBAAiB,CAAC,MAAyB;IAC7D,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,CAAA;IAE1B,MAAM,MAAM,GAAG,MAAM,IAAA,6BAAgB,EAAC;QAClC,OAAO;QACP,OAAO,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC;QAClB,OAAO,EAAE,GAAG;KACf,CAAC,CAAA;IAEF,OAAO,MAAM,KAAK,GAAG,CAAA;AACzB,CAAC;AAVD,8CAUC"}
1
+ {"version":3,"file":"yesNoSelect.js","sourceRoot":"","sources":["../../../src/prompt/select/yesNoSelect.ts"],"names":[],"mappings":";;AAMA,8CAUC;AAfD,6CAA+C;AAE/C,MAAM,GAAG,GAAG,KAAK,CAAA;AACjB,MAAM,EAAE,GAAG,IAAI,CAAA;AAER,KAAK,UAAU,iBAAiB,CAAC,MAAyB;IAC7D,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,CAAA;IAE1B,MAAM,MAAM,GAAG,MAAM,IAAA,6BAAgB,EAAC;QAClC,OAAO;QACP,OAAO,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC;QAClB,OAAO,EAAE,GAAG;KACf,CAAC,CAAA;IAEF,OAAO,MAAM,KAAK,GAAG,CAAA;AACzB,CAAC"}