@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.
- package/LICENCE.md +59 -59
- package/dist/_sharedTemplates/actionTest.t +13 -12
- package/dist/_templates/add/action/01-action.ts.t +10 -8
- package/dist/_templates/add/action/01-interface.ts.t +12 -0
- package/dist/_templates/add/action/01-test.ts.t +1 -33
- package/dist/_templates/add/action/02-scriptRunner.t +1 -1
- package/dist/_templates/add/action/prompt.js +22 -9
- package/dist/_templates/add/action/prompt.js.map +1 -1
- package/dist/_templates/add/eventListener/01-event.ts.t +2 -2
- package/dist/_templates/add/generator/prompt.js +2 -1
- package/dist/_templates/add/generator/prompt.js.map +1 -1
- package/dist/_templates/add/model/01-interfaces.model.ts.t +1 -1
- package/dist/_templates/add/model/01-model.ts.t +1 -1
- package/dist/_templates/add/test/01-test.ts.t +1 -1
- package/dist/_templates/add/test/prompt.js +4 -1
- package/dist/_templates/add/test/prompt.js.map +1 -1
- package/dist/_templates/add/view/01-index.ts.t +7 -0
- package/dist/_templates/add/view/01-interface.ts.t +11 -0
- package/dist/_templates/add/view/01-view.ts.t +15 -0
- package/dist/_templates/add/view/02-scriptRunner.t +3 -0
- package/dist/_templates/add/view/prompt.js +30 -0
- package/dist/_templates/add/view/prompt.js.map +1 -0
- package/dist/_templates/init/admin/01-adminActionsService.ts.t +26 -0
- package/dist/_templates/init/admin/01-adminExecuteCustom.ts.t +34 -0
- package/dist/_templates/init/admin/01-adminExecuteCustomInterface.ts.t +10 -0
- package/dist/_templates/init/admin/01-adminExecuteQuery.ts.t +22 -0
- package/dist/_templates/init/admin/01-adminExecuteQueryInterface.ts.t +10 -0
- package/dist/_templates/init/admin/01-adminGetMeta.ts.t +22 -0
- package/dist/_templates/init/admin/01-adminGetMetaInterface.ts.t +7 -0
- package/dist/_templates/init/admin/01-adminService.ts.t +23 -0
- package/dist/_templates/init/admin/02-scriptRunner.ts.t +3 -0
- package/dist/_templates/init/admin/prompt.js +76 -0
- package/dist/_templates/init/admin/prompt.js.map +1 -0
- package/dist/_templates/init/matchers/01-matcher.ts.t +1 -1
- package/dist/_templates/init/matchers/01-vitest.d.ts.t +16 -0
- package/dist/_templates/init/matchers/02-scriptRunner.ts.t +1 -1
- package/dist/_templates/init/matchers/prompt.js +23 -17
- package/dist/_templates/init/matchers/prompt.js.map +1 -1
- package/dist/_templates/init/package/01-.gitignore.t +6 -0
- package/dist/_templates/init/package/01-.gitlab-ci.yml.t +7 -6
- package/dist/_templates/init/package/01-codeowners.t +5 -0
- package/dist/_templates/init/package/01-eslint.config.mjs.t +22 -0
- package/dist/_templates/init/package/01-package.json.t +8 -17
- package/dist/_templates/init/package/01-readme.md.t +4 -0
- package/dist/_templates/init/package/01-test.tsconfig.json.t +5 -1
- package/dist/_templates/init/package/01-vitest.config.mts.t +19 -0
- package/dist/_templates/init/package/prompt.js +8 -2
- package/dist/_templates/init/package/prompt.js.map +1 -1
- package/dist/_templates/init/service/01-.env.example.t +24 -19
- package/dist/_templates/init/service/01-.env.test.t +3 -0
- package/dist/_templates/init/service/01-.gitignore.t +1 -0
- package/dist/_templates/init/service/01-.gitlab-ci.yml.t +3 -7
- package/dist/_templates/init/service/01-.prettierignore.t +1 -0
- package/dist/_templates/init/service/01-codeowners.t +5 -0
- package/dist/_templates/init/service/01-eslint.config.mjs.t +21 -0
- package/dist/_templates/init/service/01-package.json.t +14 -28
- package/dist/_templates/init/service/01-proto.service.proto.t +15 -1
- package/dist/_templates/init/service/01-readme.md.t +11 -0
- package/dist/_templates/init/service/01-src.actions.v1.getAddResult.ts.t +15 -6
- package/dist/_templates/init/service/01-src.bootstrap.ts.t +5 -4
- package/dist/_templates/init/service/01-src.configs.config.ts.t +150 -0
- package/dist/_templates/init/service/01-src.configs.logger.ts.t +11 -0
- package/dist/_templates/init/service/01-src.configs.queue.ts.t +46 -0
- package/dist/_templates/init/service/01-src.deps.ts.t +1 -1
- package/dist/_templates/init/service/01-src.index.ts.t +3 -4
- package/dist/_templates/init/service/01-src.interfaces.actions.v1.getAddResult.ts.t +11 -0
- package/dist/_templates/init/service/01-src.interfaces.config.ts.t +1 -1
- package/dist/_templates/init/service/01-src.interfaces.queue.ts.t +23 -0
- package/dist/_templates/init/service/01-src.services.add.ts.t +9 -0
- package/dist/_templates/init/service/01-src.views.exampleViews.index.ts.t +7 -0
- package/dist/_templates/init/service/01-src.views.exampleViews.interface.ts.t +11 -0
- package/dist/_templates/init/service/01-src.views.exampleViews.view.ts.t +15 -0
- package/dist/_templates/init/service/01-tests.integration.actionts.getAddResult.spec.ts.t +7 -14
- package/dist/_templates/init/service/01-tests.interfaces.ts.t +3 -0
- package/dist/_templates/init/service/01-tests.tsconfig.json.t +6 -2
- package/dist/_templates/init/service/01-tests.utils.getApp.ts.t +18 -5
- package/dist/_templates/init/service/01-tests.vitest.d.ts.t +11 -0
- package/dist/_templates/init/service/01-tsconfig.json.t +2 -2
- package/dist/_templates/init/service/01-vitest.config.mts.t +42 -0
- package/dist/_templates/init/service/02-scriptRunner.ts.t +1 -1
- package/dist/_templates/init/service/prompt.js +44 -5
- package/dist/_templates/init/service/prompt.js.map +1 -1
- package/dist/_templates/init/temporal/01-worker.activity.activity-example.ts.t +14 -0
- package/dist/_templates/init/temporal/01-worker.activity.index.ts.t +9 -0
- package/dist/_templates/init/temporal/01-worker.index.ts.t +32 -0
- package/dist/_templates/init/temporal/01-worker.workflow.index.ts.t +9 -0
- package/dist/_templates/init/temporal/01-worker.workflow.workflow-example.ts.t +25 -0
- package/dist/_templates/init/temporal/02-scriptRunner.ts.t +3 -0
- package/dist/_templates/init/temporal/prompt.js +15 -0
- package/dist/_templates/init/temporal/prompt.js.map +1 -0
- package/dist/depsNames.js +28 -27
- package/dist/depsNames.js.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/interfaces/_templates/add/view.js +3 -0
- package/dist/interfaces/_templates/add/view.js.map +1 -0
- package/dist/interfaces/_templates/init/admin.js +3 -0
- package/dist/interfaces/_templates/init/admin.js.map +1 -0
- package/dist/interfaces/_templates/init/matcher.js +6 -6
- package/dist/interfaces/_templates/init/service.js +3 -8
- package/dist/interfaces/_templates/init/service.js.map +1 -1
- package/dist/interfaces/_templates/init/temporal.js +3 -0
- package/dist/interfaces/_templates/init/temporal.js.map +1 -0
- package/dist/prompt/autocomplete.js +1 -3
- package/dist/prompt/autocomplete.js.map +1 -1
- package/dist/prompt/select/baseSelect.js +1 -3
- package/dist/prompt/select/baseSelect.js.map +1 -1
- package/dist/prompt/select/multiselect.js +1 -3
- package/dist/prompt/select/multiselect.js.map +1 -1
- package/dist/prompt/select/yesNoSelect.js +1 -2
- package/dist/prompt/select/yesNoSelect.js.map +1 -1
- package/dist/utils.js +3 -4
- package/dist/utils.js.map +1 -1
- package/package.json +17 -19
- package/dist/_templates/init/matchers/01-jest.d.ts.t +0 -16
- package/dist/_templates/init/package/01-.eslintignore.t +0 -7
- package/dist/_templates/init/service/01-.eslintignore.t +0 -9
- package/dist/_templates/init/service/01-dockerfile.t +0 -38
- package/dist/_templates/init/service/01-src.config.ts.t +0 -163
- package/dist/_templates/init/service/01-tests.jest.d.ts.t +0 -5
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
---
|
|
2
|
+
to: <%= actionPath %>/adminExecuteCustom.ts
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
import { GrpcAppAction } from '@diia-inhouse/diia-app'
|
|
6
|
+
|
|
7
|
+
import { SessionType } from '@diia-inhouse/types'
|
|
8
|
+
import { ValidationSchema } from '@diia-inhouse/validators'
|
|
9
|
+
|
|
10
|
+
import AdminService from '@services/admin'
|
|
11
|
+
|
|
12
|
+
import { ActionResult, Context } from '@interfaces/actions/v1/admin/adminExecuteCustom'
|
|
13
|
+
|
|
14
|
+
export default class AdminExecuteCustomAction implements GrpcAppAction<Context> {
|
|
15
|
+
readonly name = 'adminExecuteCustom'
|
|
16
|
+
|
|
17
|
+
readonly sessionType = SessionType.None
|
|
18
|
+
|
|
19
|
+
readonly validationRules: ValidationSchema<Context['params']> = {
|
|
20
|
+
event: { type: 'string', enum: Object.keys(AdminActions) },
|
|
21
|
+
params: { type: 'string' },
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
constructor(private readonly adminService: AdminService) {}
|
|
25
|
+
|
|
26
|
+
async handler(args: Context): Promise<ActionResult> {
|
|
27
|
+
const {
|
|
28
|
+
params: { event, params = '' },
|
|
29
|
+
} = args
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
return await this.adminService.executeCustom(event as ExtractEvents<typeof AdminActions>, params)
|
|
33
|
+
}
|
|
34
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
---
|
|
2
|
+
to: <%= interfacePath %>/adminExecuteCommand.ts
|
|
3
|
+
---
|
|
4
|
+
import { ActionContext } from '@diia-inhouse/types'
|
|
5
|
+
|
|
6
|
+
import { AdminExecuteCustomReq, AdminExecuteCustomRes } from '@src/generated'
|
|
7
|
+
|
|
8
|
+
export type Context = ActionContext<AdminExecuteCustomReq>
|
|
9
|
+
|
|
10
|
+
export type ActionResult = AdminExecuteCustomRes
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
---
|
|
2
|
+
to: <%= actionPath %>/adminExecuteQuery.ts
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
import { GrpcAppAction } from '@diia-inhouse/diia-app'
|
|
6
|
+
|
|
7
|
+
import { ModelExposer } from '@diia-inhouse/pkg-admin'
|
|
8
|
+
import { SessionType } from '@diia-inhouse/types'
|
|
9
|
+
|
|
10
|
+
import { ActionResult, Context } from '@interfaces/actions/v1/admin/adminExecuteQuery'
|
|
11
|
+
|
|
12
|
+
export default class AdminExecuteQueryAction implements GrpcAppAction<Context> {
|
|
13
|
+
readonly name = 'adminExecuteQuery'
|
|
14
|
+
|
|
15
|
+
readonly sessionType = SessionType.None
|
|
16
|
+
|
|
17
|
+
constructor(private readonly modelExposer: ModelExposer) {}
|
|
18
|
+
|
|
19
|
+
async handler(args: Context): Promise<ActionResult> {
|
|
20
|
+
return await this.modelExposer.executeQuery(args.params.params)
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
---
|
|
2
|
+
to: <%= interfacePath %>/adminExecuteQuery.ts
|
|
3
|
+
---
|
|
4
|
+
import { ActionContext } from '@diia-inhouse/types'
|
|
5
|
+
|
|
6
|
+
import { AdminExecuteQueryReq, AdminExecuteQueryRes } from '@src/generated'
|
|
7
|
+
|
|
8
|
+
export type Context = ActionContext<AdminExecuteQueryReq>
|
|
9
|
+
|
|
10
|
+
export type ActionResult = AdminExecuteQueryRes
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
---
|
|
2
|
+
to: <%= actionPath %>/adminGetMeta.ts
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
import { GrpcAppAction } from '@diia-inhouse/diia-app'
|
|
6
|
+
|
|
7
|
+
import { AdminExposer } from '@diia-inhouse/admin'
|
|
8
|
+
import { SessionType } from '@diia-inhouse/types'
|
|
9
|
+
|
|
10
|
+
import { ActionResult } from '@interfaces/actions/v1/admin/adminGetMeta'
|
|
11
|
+
|
|
12
|
+
export default class AdminGetMetaAction implements GrpcAppAction {
|
|
13
|
+
readonly name = 'adminGetMeta'
|
|
14
|
+
|
|
15
|
+
readonly sessionType = SessionType.None
|
|
16
|
+
|
|
17
|
+
constructor(private readonly adminExposer: AdminExposer) {}
|
|
18
|
+
|
|
19
|
+
async handler(): Promise<ActionResult> {
|
|
20
|
+
return await this.adminExposer.getMeta()
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
---
|
|
2
|
+
to: <%= adminServicePath %>/index.ts
|
|
3
|
+
---
|
|
4
|
+
import { AdminExposer, ExtractEvents } from '@diia-inhouse/admin'
|
|
5
|
+
|
|
6
|
+
import { AdminActions } from './actions'
|
|
7
|
+
|
|
8
|
+
export default class AdminService {
|
|
9
|
+
constructor(
|
|
10
|
+
private readonly adminExposer: AdminExposer,
|
|
11
|
+
) {}
|
|
12
|
+
|
|
13
|
+
async executeCustom(event: ExtractEvents<typeof AdminActions>, params: string): Promise<{ result: string }> {
|
|
14
|
+
const actionExposer = this.adminExposer.getActionExposer<typeof AdminActions>()
|
|
15
|
+
|
|
16
|
+
const { execute, isEventType } = actionExposer.process(event, params)
|
|
17
|
+
|
|
18
|
+
return await execute(async (parsedParams) => {
|
|
19
|
+
if (isEventType('testCustomAction', parsedParams)) {
|
|
20
|
+
}
|
|
21
|
+
})
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
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 ({ prompter }) => {
|
|
10
|
+
const finalActionPath = node_path_1.default.resolve(process.cwd(), 'src/actions/v1/admin');
|
|
11
|
+
const finalInterfacePath = node_path_1.default.resolve(process.cwd(), 'src/interfaces/actions/v1/admin');
|
|
12
|
+
const adminServicePath = node_path_1.default.resolve(process.cwd(), 'src/services/admin');
|
|
13
|
+
console.log(chalk_1.default.red.bold('README!\n'));
|
|
14
|
+
console.log(chalk_1.default.green(`
|
|
15
|
+
Do not forget to add proto definitions
|
|
16
|
+
|
|
17
|
+
--- proto definitions ----
|
|
18
|
+
|
|
19
|
+
// Admin
|
|
20
|
+
rpc AdminExecuteQuery(AdminExecuteQueryReq) returns (AdminExecuteQueryRes);
|
|
21
|
+
rpc AdminExecuteCustom(AdminExecuteCustomReq) returns (AdminExecuteCustomRes);
|
|
22
|
+
rpc AdminGetMeta(google.protobuf.Empty) returns (AdminGetMetaRes) {}
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
// Admin
|
|
26
|
+
message AdminExecuteQueryReq {
|
|
27
|
+
string params = 1;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
message AdminExecuteQueryRes {
|
|
31
|
+
string data = 1;
|
|
32
|
+
int32 total = 2;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
message AdminExecuteCustomReq {
|
|
36
|
+
string event = 1;
|
|
37
|
+
string params = 2;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
message AdminExecuteCustomRes {
|
|
41
|
+
string result = 1;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
message AdminGetMetaRes {
|
|
45
|
+
string result = 1;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
---- deps.ts ----
|
|
49
|
+
{
|
|
50
|
+
adminExposer: asClass(AdminExposer, {
|
|
51
|
+
injector: () => {
|
|
52
|
+
return {
|
|
53
|
+
adapters: [
|
|
54
|
+
new MongoModelAdapter("yourModel", yourModel),
|
|
55
|
+
], // can be empty array []
|
|
56
|
+
actions: AdminActions, // can be empty array []
|
|
57
|
+
};
|
|
58
|
+
},
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
`));
|
|
63
|
+
await prompter.prompt({
|
|
64
|
+
type: 'confirm',
|
|
65
|
+
name: 'confirm',
|
|
66
|
+
message: 'Please read the README and press enter to continue',
|
|
67
|
+
required: true,
|
|
68
|
+
});
|
|
69
|
+
return {
|
|
70
|
+
actionPath: finalActionPath,
|
|
71
|
+
interfacePath: finalInterfacePath,
|
|
72
|
+
adminServicePath,
|
|
73
|
+
};
|
|
74
|
+
},
|
|
75
|
+
};
|
|
76
|
+
//# sourceMappingURL=prompt.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prompt.js","sourceRoot":"","sources":["../../../../src/_templates/init/admin/prompt.ts"],"names":[],"mappings":";;;;;AAAA,0DAA4B;AAE5B,kDAAyB;AAKzB,kBAAe;IACX,MAAM,EAAE,KAAK,EAAE,EAAE,QAAQ,EAAU,EAAoB,EAAE;QACrD,MAAM,eAAe,GAAG,mBAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,sBAAsB,CAAC,CAAA;QAC3E,MAAM,kBAAkB,GAAG,mBAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,iCAAiC,CAAC,CAAA;QACzF,MAAM,gBAAgB,GAAG,mBAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,oBAAoB,CAAC,CAAA;QAE1E,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,GAAG,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAA;QACxC,OAAO,CAAC,GAAG,CACP,eAAK,CAAC,KAAK,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;SAgDf,CAAC,CACD,CAAA;QAED,MAAM,QAAQ,CAAC,MAAM,CAAC;YAClB,IAAI,EAAE,SAAS;YACf,IAAI,EAAE,SAAS;YACf,OAAO,EAAE,oDAAoD;YAC7D,QAAQ,EAAE,IAAI;SACjB,CAAC,CAAA;QAEF,OAAO;YACH,UAAU,EAAE,eAAe;YAC3B,aAAa,EAAE,kBAAkB;YACjC,gBAAgB;SACnB,CAAA;IACL,CAAC;CACJ,CAAA"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
---
|
|
2
|
+
to: <%= vitestTypesDeclarationPath %>
|
|
3
|
+
force: true
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
import 'vitest'
|
|
7
|
+
import { CustomMatchers } from '@diia-inhouse/test/vitest'
|
|
8
|
+
|
|
9
|
+
interface Matchers<R> {
|
|
10
|
+
<%= tsConfigPath %>(): any
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
declare module 'vitest' {
|
|
14
|
+
interface Assertion<T> extends CustomMatchers<T> {}
|
|
15
|
+
interface AsymmetricMatchersContaining extends CustomMatchers {}
|
|
16
|
+
}
|
|
@@ -12,14 +12,15 @@ const MATCHERS_FOLDER_NAME = 'matchers';
|
|
|
12
12
|
exports.default = {
|
|
13
13
|
prompt: async ({ prompter }) => {
|
|
14
14
|
const testsPath = node_path_1.default.resolve(process.cwd(), 'tests');
|
|
15
|
-
const existingMatchers = Object.values(matcher_1.
|
|
15
|
+
const existingMatchers = Object.values(matcher_1.ProjectTestType).filter((projectType) => {
|
|
16
16
|
const matcherPath = node_path_1.default.resolve(testsPath, projectType, MATCHERS_FOLDER_NAME);
|
|
17
|
-
|
|
17
|
+
// eslint-disable-next-line security/detect-non-literal-fs-filename
|
|
18
|
+
return node_fs_1.default.existsSync(matcherPath); // nosemgrep: eslint.detect-non-literal-fs-filename
|
|
18
19
|
});
|
|
19
20
|
if (existingMatchers.length > 0) {
|
|
20
21
|
console.log('\n');
|
|
21
|
-
for (const
|
|
22
|
-
console.log(chalk_1.default.red.bold(`${
|
|
22
|
+
for (const projectTestType of existingMatchers) {
|
|
23
|
+
console.log(chalk_1.default.red.bold(`${projectTestType} matchers already exists!\r`));
|
|
23
24
|
}
|
|
24
25
|
throw new Error('Matchers are already initialized');
|
|
25
26
|
}
|
|
@@ -31,42 +32,47 @@ exports.default = {
|
|
|
31
32
|
});
|
|
32
33
|
const projectFolder = await (0, prompt_1.promptAutoComplete)({
|
|
33
34
|
name: 'projectFolder',
|
|
34
|
-
message: 'Select
|
|
35
|
-
choices: Object.values(matcher_1.
|
|
35
|
+
message: 'Select vitest-project where do you want use new matcher \r',
|
|
36
|
+
choices: Object.values(matcher_1.ProjectTestType),
|
|
36
37
|
});
|
|
37
38
|
const matcherFolderPath = node_path_1.default.resolve(testsPath, projectFolder, MATCHERS_FOLDER_NAME);
|
|
38
39
|
const rootMatcherPath = node_path_1.default.resolve(matcherFolderPath, 'index.ts');
|
|
39
|
-
|
|
40
|
+
// eslint-disable-next-line security/detect-non-literal-fs-filename
|
|
41
|
+
const isRootMatcherExists = node_fs_1.default.existsSync(rootMatcherPath); // nosemgrep: eslint.detect-non-literal-fs-filename
|
|
40
42
|
if (isRootMatcherExists) {
|
|
41
43
|
console.log(chalk_1.default.red.bold(`${rootMatcherPath} already exists!\r`));
|
|
42
44
|
throw new Error('You can use this scaffold only for matcher initialization');
|
|
43
45
|
}
|
|
44
46
|
const matcherPath = node_path_1.default.resolve(matcherFolderPath, `${name}.ts`);
|
|
45
|
-
const
|
|
46
|
-
|
|
47
|
+
const vitestTypesDeclarationPath = node_path_1.default.resolve(testsPath, 'vitest.d.ts');
|
|
48
|
+
// eslint-disable-next-line security/detect-non-literal-fs-filename
|
|
49
|
+
const isVitestTypesDeclarationExists = node_fs_1.default.existsSync(vitestTypesDeclarationPath); // nosemgrep: eslint.detect-non-literal-fs-filename
|
|
47
50
|
let rootTsConfigPath = node_path_1.default.resolve(process.cwd(), 'tsconfig.json');
|
|
48
51
|
let extendedTsConfig = '';
|
|
49
|
-
if (
|
|
50
|
-
console.log(chalk_1.default.red.bold(`${
|
|
52
|
+
if (isVitestTypesDeclarationExists) {
|
|
53
|
+
console.log(chalk_1.default.red.bold(`${vitestTypesDeclarationPath} already exists!\r`));
|
|
51
54
|
console.log(chalk_1.default.red.bold('This file will be override\r'));
|
|
52
55
|
rootTsConfigPath = '';
|
|
53
56
|
}
|
|
54
57
|
else {
|
|
55
|
-
|
|
58
|
+
// eslint-disable-next-line security/detect-non-literal-fs-filename
|
|
59
|
+
const isExist = node_fs_1.default.existsSync(rootTsConfigPath); // nosemgrep: eslint.detect-non-literal-fs-filename
|
|
60
|
+
if (!isExist) {
|
|
56
61
|
throw new Error('You can use this scaffold only inside ts-project');
|
|
57
62
|
}
|
|
58
|
-
// eslint-disable-next-line
|
|
59
|
-
const tsConfig = require(rootTsConfigPath);
|
|
60
|
-
extendedTsConfig = { ...tsConfig, include: [...tsConfig.include, 'tests/
|
|
63
|
+
// eslint-disable-next-line security/detect-non-literal-require
|
|
64
|
+
const tsConfig = require(rootTsConfigPath); // nosemgrep: eslint.detect-non-literal-require
|
|
65
|
+
extendedTsConfig = { ...tsConfig, include: [...tsConfig.include, 'tests/vitest.d.ts'] };
|
|
61
66
|
}
|
|
62
67
|
const setupFilePath = node_path_1.default.resolve(testsPath, projectFolder, 'setup.ts');
|
|
63
|
-
|
|
68
|
+
// eslint-disable-next-line security/detect-non-literal-fs-filename
|
|
69
|
+
const isSetupFileExists = node_fs_1.default.existsSync(setupFilePath); // nosemgrep: eslint.detect-non-literal-fs-filename
|
|
64
70
|
const [newSetupFilePath, overrideSetupFilePath] = isSetupFileExists ? [undefined, setupFilePath] : [setupFilePath, undefined];
|
|
65
71
|
return {
|
|
66
72
|
name,
|
|
67
73
|
matcherPath,
|
|
68
74
|
rootMatcherPath,
|
|
69
|
-
|
|
75
|
+
vitestTypesDeclarationPath,
|
|
70
76
|
tsConfigPath: rootTsConfigPath,
|
|
71
77
|
tsConfigContent: extendedTsConfig,
|
|
72
78
|
newSetupFilePath,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prompt.js","sourceRoot":"","sources":["../../../../src/_templates/init/matchers/prompt.ts"],"names":[],"mappings":";;;;;AAAA,sDAAwB;AACxB,0DAA4B;AAE5B,kDAAyB;AAGzB,yEAAsF;AACtF,4CAAoD;AAEpD,MAAM,oBAAoB,GAAG,UAAU,CAAA;AAEvC,kBAAe;IACX,MAAM,EAAE,KAAK,EAAE,EAAE,QAAQ,EAAU,EAAoB,EAAE;QACrD,MAAM,SAAS,GAAG,mBAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,OAAO,CAAC,CAAA;QAEtD,MAAM,gBAAgB,GAAG,MAAM,CAAC,MAAM,CAAC,yBAAe,CAAC,CAAC,MAAM,CAAC,CAAC,WAAW,EAAE,EAAE;YAC3E,MAAM,WAAW,GAAG,mBAAI,CAAC,OAAO,CAAC,SAAS,EAAE,WAAW,EAAE,oB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|
4
4
|
|
|
5
|
+
include:
|
|
6
|
+
- project: diia-inhouse/ci
|
|
7
|
+
ref: main
|
|
8
|
+
file: main/package.gitlab-ci.yaml
|
|
9
|
+
|
|
5
10
|
variables:
|
|
6
11
|
LINT_COMMIT: 'true'
|
|
7
|
-
RUN_UNIT_TESTS: 'true'
|
|
8
12
|
NODE_PACKAGE_MANAGER: 'npm'
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
project: diia-inhouse/ci
|
|
12
|
-
ref: main
|
|
13
|
-
file: main/package.gitlab-ci.yaml
|
|
13
|
+
CHART_NAME: <%= packageName %>
|
|
14
|
+
CI_PROTO_JAVA_DISABLE_TYPES: 'true'
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
---
|
|
2
|
+
to: <%= packageName %>/eslint.config.mjs
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
import diiaConfig from '@diia-inhouse/eslint-config'
|
|
6
|
+
|
|
7
|
+
/** @type {import('eslint').Linter.Config} */
|
|
8
|
+
export default [
|
|
9
|
+
...diiaConfig,
|
|
10
|
+
{
|
|
11
|
+
ignores: ['*.js', '*.mjs', 'node_modules', 'dist', 'coverage'],
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
languageOptions: {
|
|
15
|
+
parserOptions: {
|
|
16
|
+
project: ['./tsconfig.json', './tests/tsconfig.json'],
|
|
17
|
+
ecmaVersion: 2022,
|
|
18
|
+
sourceType: `module`,
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
]
|
|
@@ -3,14 +3,14 @@ to: <%= packageName %>/package.json
|
|
|
3
3
|
---
|
|
4
4
|
|
|
5
5
|
{
|
|
6
|
-
"name": "
|
|
6
|
+
"name": "@diia-inhouse/<%= packageName %>",
|
|
7
7
|
"version": "1.0.0",
|
|
8
8
|
"description": "<%= description %>",
|
|
9
9
|
"author": "diia-team",
|
|
10
10
|
"main": "dist/index.js",
|
|
11
11
|
"types": "dist/types/index.d.ts",
|
|
12
12
|
"engines": {
|
|
13
|
-
"node": ">=
|
|
13
|
+
"node": ">=22"
|
|
14
14
|
},
|
|
15
15
|
"scripts": {
|
|
16
16
|
"build": "tsc",
|
|
@@ -18,31 +18,22 @@ to: <%= packageName %>/package.json
|
|
|
18
18
|
"prepare": "npm run build",
|
|
19
19
|
"semantic-release": "semantic-release",
|
|
20
20
|
"start": "npm run build && node dist/index.js",
|
|
21
|
-
"lint": "eslint
|
|
22
|
-
"lint-fix": "eslint
|
|
23
|
-
"test": "
|
|
24
|
-
"test:
|
|
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",
|
|
25
26
|
"find-circulars": "madge --circular --extensions ts ./",
|
|
26
27
|
"lint:lockfile": "lockfile-lint --path package-lock.json --allowed-hosts registry.npmjs.org gitlab.diia.org.ua --validate-https"
|
|
27
28
|
},
|
|
28
29
|
"files": ["dist"],
|
|
29
30
|
"keywords": [],
|
|
30
31
|
"devDependencies": {},
|
|
31
|
-
"jest": {
|
|
32
|
-
"preset": "@diia-inhouse/configs/dist/jest"
|
|
33
|
-
},
|
|
34
32
|
"commitlint": {
|
|
35
33
|
"extends": "@diia-inhouse/configs/dist/commitlint"
|
|
36
34
|
},
|
|
37
|
-
"eslintConfig": {
|
|
38
|
-
"extends": "@diia-inhouse/eslint-config",
|
|
39
|
-
"parserOptions": {
|
|
40
|
-
"project": ["./tsconfig.json", "./tests/tsconfig.json"]
|
|
41
|
-
}
|
|
42
|
-
},
|
|
43
35
|
"release": {
|
|
44
|
-
"extends": "@diia-inhouse/configs/dist/semantic-release/package"
|
|
45
|
-
"branches": ["main"]
|
|
36
|
+
"extends": "@diia-inhouse/configs/dist/semantic-release/package"
|
|
46
37
|
},
|
|
47
38
|
"prettier": "@diia-inhouse/eslint-config/prettier"
|
|
48
39
|
}
|
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
to: <%= packageName %>/README.md
|
|
3
3
|
---
|
|
4
4
|
|
|
5
|
+
# Package setup instructions. Remove after setup.
|
|
6
|
+
|
|
7
|
+
- [ ] Init git repo and push separate branch "semantic-dummy-release". It's needed for semantic release mechanism.
|
|
8
|
+
|
|
5
9
|
### <%= packageName %>
|
|
6
10
|
|
|
7
11
|
<%= description %>
|
|
@@ -6,6 +6,10 @@ to: <%= packageName %>/tests/tsconfig.json
|
|
|
6
6
|
"extends": "@diia-inhouse/configs/tsconfig",
|
|
7
7
|
"compilerOptions": {
|
|
8
8
|
"baseUrl": "../",
|
|
9
|
+
"types": ["vite/client", "vitest/globals"],
|
|
10
|
+
"module": "ESNext",
|
|
11
|
+
"moduleResolution": "Bundler",
|
|
12
|
+
"isolatedModules": true,
|
|
9
13
|
"paths": {
|
|
10
14
|
"@services/*": ["src/services/*"],
|
|
11
15
|
"@interfaces/*": ["src/interfaces/*"],
|
|
@@ -15,5 +19,5 @@ to: <%= packageName %>/tests/tsconfig.json
|
|
|
15
19
|
"noEmit": true,
|
|
16
20
|
"strict": true
|
|
17
21
|
},
|
|
18
|
-
"include": ["./**/*"]
|
|
22
|
+
"include": ["./**/*", "../vitest.config.mts"]
|
|
19
23
|
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
---
|
|
2
|
+
to: <%= packageName %>/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
|
+
name: 'unit',
|
|
14
|
+
testTimeout: timeout,
|
|
15
|
+
hookTimeout: timeout,
|
|
16
|
+
exclude: ['node_modules', 'dist'],
|
|
17
|
+
include: ['tests/unit/**/*.spec.ts'],
|
|
18
|
+
},
|
|
19
|
+
})
|
|
@@ -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
|
|
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'));
|
|
11
11
|
const { packageName } = await prompter.prompt({
|
|
12
12
|
type: 'input',
|
|
13
13
|
name: 'packageName',
|
|
@@ -20,7 +20,13 @@ exports.default = {
|
|
|
20
20
|
message: "What's your new package description?",
|
|
21
21
|
required: true,
|
|
22
22
|
});
|
|
23
|
-
|
|
23
|
+
const { codeowners } = await prompter.prompt({
|
|
24
|
+
type: 'input',
|
|
25
|
+
name: 'codeowners',
|
|
26
|
+
message: 'List codeowners for this package (e.g. @user1, @user2)',
|
|
27
|
+
required: true,
|
|
28
|
+
});
|
|
29
|
+
return { packageName, description, codeowners, dependencies: { devDeps: depsNames_1.packageDependencies.devDeps.join(' ') } };
|
|
24
30
|
},
|
|
25
31
|
};
|
|
26
32
|
//# sourceMappingURL=prompt.js.map
|
|
@@ -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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4,21 +4,21 @@ to: <%= serviceName %>/.env.example
|
|
|
4
4
|
NODE_ENV=local
|
|
5
5
|
LOG_LEVEL=info
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
TRANSPORT_OPTIONS={"host":"localhost","port":"6379"}
|
|
7
|
+
NODE_OPTIONS=--enable-source-maps
|
|
9
8
|
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
TRACING_ENABLED=false
|
|
10
|
+
TRACING_EXPORTER_URL=
|
|
12
11
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
<%if (h.isOptionSelected(
|
|
12
|
+
VAULT_ENABLED=false
|
|
13
|
+
VAULT_ADDR=
|
|
14
|
+
VAULT_ROLE=
|
|
15
|
+
|
|
16
|
+
<% if (h.isOptionSelected(selectedDependencies, 'redis')) { -%>
|
|
18
17
|
STORE_READ_WRITE_OPTIONS={"port":6379}
|
|
19
18
|
STORE_READ_ONLY_OPTIONS={"port":6379}
|
|
20
|
-
|
|
21
|
-
<%
|
|
19
|
+
|
|
20
|
+
<% } -%>
|
|
21
|
+
<% if (h.isOptionSelected(selectedDependencies, 'database')) { -%>
|
|
22
22
|
MONGO_HOST=mongo1
|
|
23
23
|
MONGO_HOSTS=mongo1,mongo2,mongo3
|
|
24
24
|
MONGO_PORT=27017
|
|
@@ -27,18 +27,21 @@ MONGO_USER=
|
|
|
27
27
|
MONGO_PASSWORD=
|
|
28
28
|
MONGO_REPLICA_SET=diia
|
|
29
29
|
MONGO_READ_PREFERENCE=primary
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
<%}
|
|
33
|
-
<%if (h.isOptionSelected(
|
|
30
|
+
MONGO_METRICS_ENABLED=false
|
|
31
|
+
|
|
32
|
+
<% } -%>
|
|
33
|
+
<% if (h.isOptionSelected(selectedDependencies, 'internal')) { -%>
|
|
34
34
|
RABBIT_HOST=127.0.0.1
|
|
35
35
|
RABBIT_PORT=5672
|
|
36
36
|
RABBIT_USERNAME=guest
|
|
37
37
|
RABBIT_PASSWORD=guest
|
|
38
38
|
RABBIT_HEARTBEAT=60
|
|
39
39
|
RABBIT_QUEUE_PREFETCH_COUNT=1
|
|
40
|
-
|
|
41
|
-
|
|
40
|
+
RABBIT_ASSERT_EXCHANGES=true
|
|
41
|
+
RABBIT_ASSERT_QUEUES=true
|
|
42
|
+
|
|
43
|
+
<% } -%>
|
|
44
|
+
<% if (h.isOptionSelected(selectedDependencies, 'external')) { -%>
|
|
42
45
|
EXTERNAL_RABBIT_HOST=127.0.0.1
|
|
43
46
|
EXTERNAL_RABBIT_PORT=5672
|
|
44
47
|
EXTERNAL_RABBIT_USERNAME=guest
|
|
@@ -46,10 +49,12 @@ EXTERNAL_RABBIT_PASSWORD=guest
|
|
|
46
49
|
EXTERNAL_RABBIT_HEARTBEAT=60
|
|
47
50
|
EXTERNAL_RABBIT_QUEUE_PREFETCH_COUNT=1
|
|
48
51
|
EXTERNAL_RABBIT_ASSERT_EXCHANGES=true
|
|
49
|
-
|
|
52
|
+
EXTERNAL_RABBIT_ASSERT_QUEUES=true
|
|
50
53
|
|
|
51
|
-
|
|
54
|
+
<% } -%>
|
|
52
55
|
METRICS_CUSTOM_DISABLED=true
|
|
56
|
+
METRICS_PUSH_GATEWAY_IS_ENABLED=false
|
|
57
|
+
METRICS_PUSH_GATEWAY_URL=http://localhost:9091
|
|
53
58
|
|
|
54
59
|
HEALTH_CHECK_IS_ENABLED=false
|
|
55
60
|
HEALTH_CHECK_IS_PORT=4545
|