Skip to content

Commit 9f8e582

Browse files
authored
fix: improve def command (#3788)
* fix: improve the def command * fix: improve the def command
1 parent 61669c6 commit 9f8e582

File tree

2 files changed

+14
-16
lines changed

2 files changed

+14
-16
lines changed

lib/command/definitions.js

+2-7
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ const actingHelpers = [...require('../plugin/standardActingHelpers'), 'REST'];
1717
* @param {Map} params.supportObject
1818
* @param {Array<string>} params.helperNames
1919
* @param {Array<string>} params.importPaths
20-
* @param {Array<string>} params.customHelpers
2120
* @param params.translations
2221
*
2322
* @returns {string}
@@ -29,15 +28,13 @@ const getDefinitionsFileContent = ({
2928
supportObject,
3029
importPaths,
3130
translations,
32-
customHelpers,
3331
}) => {
3432
const getHelperListFragment = ({
3533
hasCustomHelper,
3634
hasCustomStepsFile,
37-
customHelpers,
3835
}) => {
3936
if (hasCustomHelper && hasCustomStepsFile) {
40-
return `${['ReturnType<steps_file>', ...customHelpers].join(', ')}`;
37+
return `${['ReturnType<steps_file>', 'WithTranslation<Methods>'].join(', ')}`;
4138
}
4239

4340
if (hasCustomStepsFile) {
@@ -50,7 +47,6 @@ const getDefinitionsFileContent = ({
5047
const helpersListFragment = getHelperListFragment({
5148
hasCustomHelper,
5249
hasCustomStepsFile,
53-
customHelpers,
5450
});
5551

5652
const importPathsFragment = importPaths.join('\n');
@@ -143,7 +139,7 @@ module.exports = function (genPath, options) {
143139
}
144140

145141
if (!actingHelpers.includes(name)) {
146-
customHelpers.push(`WithTranslation<${name}>`);
142+
customHelpers.push(name);
147143
}
148144
}
149145

@@ -186,7 +182,6 @@ module.exports = function (genPath, options) {
186182
translations,
187183
hasCustomStepsFile,
188184
hasCustomHelper,
189-
customHelpers,
190185
});
191186

192187
// add aliases for translations

tsconfig.json

+12-9
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,26 @@
11
{
2+
"ts-node": {
3+
"files": true
4+
},
25
"compilerOptions": {
6+
"target": "es2018",
7+
"lib": ["es2018", "DOM"],
8+
"esModuleInterop": true,
9+
"module": "commonjs",
10+
"types": ["node"],
11+
"declaration": true,
12+
"skipLibCheck": true,
313
"allowJs": true,
414
"checkJs": true,
5-
"module": "commonjs",
615
"noImplicitAny": false,
716
"noImplicitThis": false,
817
"noEmit": true,
9-
"strictNullChecks": true,
10-
"types": [
11-
"node"
12-
],
13-
"target": "es2018"
18+
"strictNullChecks": true
1419
},
20+
"exclude": ["node_modules", "typings/tests"],
1521
"compileOnSave": true,
1622
"include": [
1723
"lib",
1824
"typings"
19-
],
20-
"exclude": [
21-
"typings/tests"
2225
]
2326
}

0 commit comments

Comments
 (0)