@odata2ts/odata2ts 0.23.0 → 0.24.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/CHANGELOG.md +14 -0
- package/README.md +74 -74
- package/lib/FactoryFunctionModel.d.ts +13 -13
- package/lib/FactoryFunctionModel.js +2 -2
- package/lib/FactoryFunctionModel.js.map +1 -1
- package/lib/NamingModel.d.ts +182 -182
- package/lib/NamingModel.js +11 -11
- package/lib/NamingModel.js.map +1 -1
- package/lib/OptionModel.d.ts +228 -223
- package/lib/OptionModel.js +23 -23
- package/lib/OptionModel.js.map +1 -1
- package/lib/app.d.ts +8 -8
- package/lib/app.js +63 -63
- package/lib/app.js.map +1 -1
- package/lib/cli.d.ts +3 -3
- package/lib/cli.js +153 -153
- package/lib/data-model/DataModel.d.ts +85 -85
- package/lib/data-model/DataModel.js +134 -134
- package/lib/data-model/DataModelDigestion.d.ts +44 -44
- package/lib/data-model/DataModelDigestion.js +274 -274
- package/lib/data-model/DataModelDigestion.js.map +1 -1
- package/lib/data-model/DataModelDigestionV2.d.ts +10 -10
- package/lib/data-model/DataModelDigestionV2.js +200 -200
- package/lib/data-model/DataModelDigestionV4.d.ts +3 -3
- package/lib/data-model/DataModelDigestionV4.js +195 -195
- package/lib/data-model/DataTypeModel.d.ts +102 -102
- package/lib/data-model/DataTypeModel.js +8 -8
- package/lib/data-model/DataTypeModel.js.map +1 -1
- package/lib/data-model/NamingHelper.d.ts +55 -55
- package/lib/data-model/NamingHelper.js +214 -214
- package/lib/data-model/ServiceConfigHelper.d.ts +21 -21
- package/lib/data-model/ServiceConfigHelper.js +113 -113
- package/lib/data-model/edmx/ODataEdmxModelBase.d.ts +80 -80
- package/lib/data-model/edmx/ODataEdmxModelBase.js +2 -2
- package/lib/data-model/edmx/ODataEdmxModelBase.js.map +1 -1
- package/lib/data-model/edmx/ODataEdmxModelV3.d.ts +63 -63
- package/lib/data-model/edmx/ODataEdmxModelV3.js +2 -2
- package/lib/data-model/edmx/ODataEdmxModelV4.d.ts +67 -67
- package/lib/data-model/edmx/ODataEdmxModelV4.js +2 -2
- package/lib/defaultConfig.d.ts +9 -9
- package/lib/defaultConfig.js +165 -164
- package/lib/defaultConfig.js.map +1 -1
- package/lib/evaluateConfig.d.ts +25 -25
- package/lib/evaluateConfig.js +82 -82
- package/lib/generator/ImportContainer.d.ts +16 -16
- package/lib/generator/ImportContainer.js +91 -91
- package/lib/generator/ImportContainer.js.map +1 -1
- package/lib/generator/ModelGenerator.d.ts +2 -2
- package/lib/generator/ModelGenerator.js +211 -183
- package/lib/generator/ModelGenerator.js.map +1 -1
- package/lib/generator/QueryObjectGenerator.d.ts +2 -2
- package/lib/generator/QueryObjectGenerator.js +239 -239
- package/lib/generator/ServiceGenerator.d.ts +8 -8
- package/lib/generator/ServiceGenerator.js +422 -422
- package/lib/generator/ServiceGenerator.js.map +1 -1
- package/lib/generator/index.d.ts +3 -3
- package/lib/generator/index.js +9 -9
- package/lib/index.d.ts +3 -3
- package/lib/index.js +6 -6
- package/lib/project/ProjectManager.d.ts +30 -30
- package/lib/project/ProjectManager.js +177 -175
- package/lib/project/ProjectManager.js.map +1 -1
- package/lib/project/formatter/BaseFormatter.d.ts +49 -49
- package/lib/project/formatter/BaseFormatter.js +30 -30
- package/lib/project/formatter/FileFormatter.d.ts +16 -16
- package/lib/project/formatter/FileFormatter.js +2 -2
- package/lib/project/formatter/NoopFormatter.d.ts +29 -29
- package/lib/project/formatter/NoopFormatter.js +42 -42
- package/lib/project/formatter/PrettierFormatter.d.ts +46 -46
- package/lib/project/formatter/PrettierFormatter.js +92 -92
- package/lib/project/formatter/index.d.ts +2 -2
- package/lib/project/formatter/index.js +14 -14
- package/lib/project/logger/logFilePath.d.ts +1 -1
- package/lib/project/logger/logFilePath.js +12 -12
- package/lib/run-cli.d.ts +2 -2
- package/lib/run-cli.js +6 -6
- package/package.json +27 -28
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import { BaseFormatter } from "./BaseFormatter";
|
|
2
|
-
/**
|
|
3
|
-
* Prettier formatter.
|
|
4
|
-
*
|
|
5
|
-
* NOTE: Should be created like this => const formatter = await new NoopFormatter("./test.ts").init();
|
|
6
|
-
*
|
|
7
|
-
* @export
|
|
8
|
-
* @class NoopFormatter
|
|
9
|
-
* @extends {Formatter}
|
|
10
|
-
*/
|
|
11
|
-
export declare class NoopFormatter extends BaseFormatter {
|
|
12
|
-
/**
|
|
13
|
-
* Initializes the formatter.
|
|
14
|
-
*
|
|
15
|
-
* @abstract
|
|
16
|
-
* @returns {Promise<Formatter>} Initialized formatter
|
|
17
|
-
* @memberof Formatter
|
|
18
|
-
*/
|
|
19
|
-
init(): Promise<BaseFormatter>;
|
|
20
|
-
/**
|
|
21
|
-
* Formats a given source code.
|
|
22
|
-
*
|
|
23
|
-
* @abstract
|
|
24
|
-
* @param {string} source Source code to format
|
|
25
|
-
* @returns {string} Formatted source code
|
|
26
|
-
* @memberof Formatter
|
|
27
|
-
*/
|
|
28
|
-
format(source: string): Promise<string>;
|
|
29
|
-
}
|
|
1
|
+
import { BaseFormatter } from "./BaseFormatter";
|
|
2
|
+
/**
|
|
3
|
+
* Prettier formatter.
|
|
4
|
+
*
|
|
5
|
+
* NOTE: Should be created like this => const formatter = await new NoopFormatter("./test.ts").init();
|
|
6
|
+
*
|
|
7
|
+
* @export
|
|
8
|
+
* @class NoopFormatter
|
|
9
|
+
* @extends {Formatter}
|
|
10
|
+
*/
|
|
11
|
+
export declare class NoopFormatter extends BaseFormatter {
|
|
12
|
+
/**
|
|
13
|
+
* Initializes the formatter.
|
|
14
|
+
*
|
|
15
|
+
* @abstract
|
|
16
|
+
* @returns {Promise<Formatter>} Initialized formatter
|
|
17
|
+
* @memberof Formatter
|
|
18
|
+
*/
|
|
19
|
+
init(): Promise<BaseFormatter>;
|
|
20
|
+
/**
|
|
21
|
+
* Formats a given source code.
|
|
22
|
+
*
|
|
23
|
+
* @abstract
|
|
24
|
+
* @param {string} source Source code to format
|
|
25
|
+
* @returns {string} Formatted source code
|
|
26
|
+
* @memberof Formatter
|
|
27
|
+
*/
|
|
28
|
+
format(source: string): Promise<string>;
|
|
29
|
+
}
|
|
@@ -1,43 +1,43 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.NoopFormatter = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const BaseFormatter_1 = require("./BaseFormatter");
|
|
6
|
-
/**
|
|
7
|
-
* Prettier formatter.
|
|
8
|
-
*
|
|
9
|
-
* NOTE: Should be created like this => const formatter = await new NoopFormatter("./test.ts").init();
|
|
10
|
-
*
|
|
11
|
-
* @export
|
|
12
|
-
* @class NoopFormatter
|
|
13
|
-
* @extends {Formatter}
|
|
14
|
-
*/
|
|
15
|
-
class NoopFormatter extends BaseFormatter_1.BaseFormatter {
|
|
16
|
-
/**
|
|
17
|
-
* Initializes the formatter.
|
|
18
|
-
*
|
|
19
|
-
* @abstract
|
|
20
|
-
* @returns {Promise<Formatter>} Initialized formatter
|
|
21
|
-
* @memberof Formatter
|
|
22
|
-
*/
|
|
23
|
-
init() {
|
|
24
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
25
|
-
return this;
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* Formats a given source code.
|
|
30
|
-
*
|
|
31
|
-
* @abstract
|
|
32
|
-
* @param {string} source Source code to format
|
|
33
|
-
* @returns {string} Formatted source code
|
|
34
|
-
* @memberof Formatter
|
|
35
|
-
*/
|
|
36
|
-
format(source) {
|
|
37
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
38
|
-
return source;
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
exports.NoopFormatter = NoopFormatter;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NoopFormatter = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const BaseFormatter_1 = require("./BaseFormatter");
|
|
6
|
+
/**
|
|
7
|
+
* Prettier formatter.
|
|
8
|
+
*
|
|
9
|
+
* NOTE: Should be created like this => const formatter = await new NoopFormatter("./test.ts").init();
|
|
10
|
+
*
|
|
11
|
+
* @export
|
|
12
|
+
* @class NoopFormatter
|
|
13
|
+
* @extends {Formatter}
|
|
14
|
+
*/
|
|
15
|
+
class NoopFormatter extends BaseFormatter_1.BaseFormatter {
|
|
16
|
+
/**
|
|
17
|
+
* Initializes the formatter.
|
|
18
|
+
*
|
|
19
|
+
* @abstract
|
|
20
|
+
* @returns {Promise<Formatter>} Initialized formatter
|
|
21
|
+
* @memberof Formatter
|
|
22
|
+
*/
|
|
23
|
+
init() {
|
|
24
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
25
|
+
return this;
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Formats a given source code.
|
|
30
|
+
*
|
|
31
|
+
* @abstract
|
|
32
|
+
* @param {string} source Source code to format
|
|
33
|
+
* @returns {string} Formatted source code
|
|
34
|
+
* @memberof Formatter
|
|
35
|
+
*/
|
|
36
|
+
format(source) {
|
|
37
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
38
|
+
return source;
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
exports.NoopFormatter = NoopFormatter;
|
|
43
43
|
//# sourceMappingURL=NoopFormatter.js.map
|
|
@@ -1,46 +1,46 @@
|
|
|
1
|
-
import { BaseFormatter } from "./BaseFormatter";
|
|
2
|
-
export declare class PrettierFormatter extends BaseFormatter {
|
|
3
|
-
/**
|
|
4
|
-
* Prettier options found in the project.
|
|
5
|
-
*
|
|
6
|
-
* @private
|
|
7
|
-
* @type {prettier.Options}
|
|
8
|
-
* @memberof PrettierFormatter
|
|
9
|
-
*/
|
|
10
|
-
private options;
|
|
11
|
-
/**
|
|
12
|
-
* Initializes the formatter.
|
|
13
|
-
*
|
|
14
|
-
* @returns {Promise<PrettierFormatter>} Initialized formatter
|
|
15
|
-
* @memberof PrettierFormatter
|
|
16
|
-
*/
|
|
17
|
-
init(): Promise<PrettierFormatter>;
|
|
18
|
-
/**
|
|
19
|
-
* Formats a given source code.
|
|
20
|
-
*
|
|
21
|
-
* @abstract
|
|
22
|
-
* @param {string} source Source code to format
|
|
23
|
-
* @returns {string} Formatted source code
|
|
24
|
-
* @memberof Formatter
|
|
25
|
-
*/
|
|
26
|
-
format(source: string): Promise<string>;
|
|
27
|
-
/**
|
|
28
|
-
* Converts prettier indentation config to ts-morph settings.
|
|
29
|
-
*
|
|
30
|
-
* @private
|
|
31
|
-
* @param {boolean | undefined} useTabs Flag, whether to use tabs or not
|
|
32
|
-
* @param {number | undefined} tabWidth Width of a simulated tab, each number represents a space
|
|
33
|
-
* @returns {IndentationText} Converted indentation text
|
|
34
|
-
* @memberof PrettierFormatter
|
|
35
|
-
*/
|
|
36
|
-
private convertIndentation;
|
|
37
|
-
/**
|
|
38
|
-
* Converts prettier newline config to ts-morph settings.
|
|
39
|
-
*
|
|
40
|
-
* @private
|
|
41
|
-
* @param {string | undefined} eol prettier end-of-line config
|
|
42
|
-
* @returns {NewLineKind | undefined} Converted new line kind
|
|
43
|
-
* @memberof PrettierFormatter
|
|
44
|
-
*/
|
|
45
|
-
private convertNewline;
|
|
46
|
-
}
|
|
1
|
+
import { BaseFormatter } from "./BaseFormatter";
|
|
2
|
+
export declare class PrettierFormatter extends BaseFormatter {
|
|
3
|
+
/**
|
|
4
|
+
* Prettier options found in the project.
|
|
5
|
+
*
|
|
6
|
+
* @private
|
|
7
|
+
* @type {prettier.Options}
|
|
8
|
+
* @memberof PrettierFormatter
|
|
9
|
+
*/
|
|
10
|
+
private options;
|
|
11
|
+
/**
|
|
12
|
+
* Initializes the formatter.
|
|
13
|
+
*
|
|
14
|
+
* @returns {Promise<PrettierFormatter>} Initialized formatter
|
|
15
|
+
* @memberof PrettierFormatter
|
|
16
|
+
*/
|
|
17
|
+
init(): Promise<PrettierFormatter>;
|
|
18
|
+
/**
|
|
19
|
+
* Formats a given source code.
|
|
20
|
+
*
|
|
21
|
+
* @abstract
|
|
22
|
+
* @param {string} source Source code to format
|
|
23
|
+
* @returns {string} Formatted source code
|
|
24
|
+
* @memberof Formatter
|
|
25
|
+
*/
|
|
26
|
+
format(source: string): Promise<string>;
|
|
27
|
+
/**
|
|
28
|
+
* Converts prettier indentation config to ts-morph settings.
|
|
29
|
+
*
|
|
30
|
+
* @private
|
|
31
|
+
* @param {boolean | undefined} useTabs Flag, whether to use tabs or not
|
|
32
|
+
* @param {number | undefined} tabWidth Width of a simulated tab, each number represents a space
|
|
33
|
+
* @returns {IndentationText} Converted indentation text
|
|
34
|
+
* @memberof PrettierFormatter
|
|
35
|
+
*/
|
|
36
|
+
private convertIndentation;
|
|
37
|
+
/**
|
|
38
|
+
* Converts prettier newline config to ts-morph settings.
|
|
39
|
+
*
|
|
40
|
+
* @private
|
|
41
|
+
* @param {string | undefined} eol prettier end-of-line config
|
|
42
|
+
* @returns {NewLineKind | undefined} Converted new line kind
|
|
43
|
+
* @memberof PrettierFormatter
|
|
44
|
+
*/
|
|
45
|
+
private convertNewline;
|
|
46
|
+
}
|
|
@@ -1,93 +1,93 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PrettierFormatter = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const prettier_1 = tslib_1.__importDefault(require("prettier"));
|
|
6
|
-
const ts_morph_1 = require("ts-morph");
|
|
7
|
-
const BaseFormatter_1 = require("./BaseFormatter");
|
|
8
|
-
class PrettierFormatter extends BaseFormatter_1.BaseFormatter {
|
|
9
|
-
/**
|
|
10
|
-
* Initializes the formatter.
|
|
11
|
-
*
|
|
12
|
-
* @returns {Promise<PrettierFormatter>} Initialized formatter
|
|
13
|
-
* @memberof PrettierFormatter
|
|
14
|
-
*/
|
|
15
|
-
init() {
|
|
16
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
17
|
-
const options = yield prettier_1.default.resolveConfig(this.output);
|
|
18
|
-
if (options) {
|
|
19
|
-
this.options = options;
|
|
20
|
-
this.settings = {
|
|
21
|
-
indentationText: this.convertIndentation(this.options.useTabs, this.options.tabWidth),
|
|
22
|
-
insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces: this.options.bracketSpacing !== undefined ? this.options.bracketSpacing : true,
|
|
23
|
-
newLineKind: this.convertNewline(this.options.endOfLine),
|
|
24
|
-
quoteKind: this.options.singleQuote ? ts_morph_1.QuoteKind.Single : ts_morph_1.QuoteKind.Double,
|
|
25
|
-
useTrailingCommas: this.options.trailingComma === "none" ? false : true,
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
|
-
else
|
|
29
|
-
this.settings = {};
|
|
30
|
-
return this;
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* Formats a given source code.
|
|
35
|
-
*
|
|
36
|
-
* @abstract
|
|
37
|
-
* @param {string} source Source code to format
|
|
38
|
-
* @returns {string} Formatted source code
|
|
39
|
-
* @memberof Formatter
|
|
40
|
-
*/
|
|
41
|
-
format(source) {
|
|
42
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
43
|
-
return prettier_1.default.format(source, Object.assign({ parser: "typescript" }, this.options));
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
/**
|
|
47
|
-
* Converts prettier indentation config to ts-morph settings.
|
|
48
|
-
*
|
|
49
|
-
* @private
|
|
50
|
-
* @param {boolean | undefined} useTabs Flag, whether to use tabs or not
|
|
51
|
-
* @param {number | undefined} tabWidth Width of a simulated tab, each number represents a space
|
|
52
|
-
* @returns {IndentationText} Converted indentation text
|
|
53
|
-
* @memberof PrettierFormatter
|
|
54
|
-
*/
|
|
55
|
-
convertIndentation(useTabs, tabWidth) {
|
|
56
|
-
if (useTabs)
|
|
57
|
-
return ts_morph_1.IndentationText.Tab;
|
|
58
|
-
switch (tabWidth) {
|
|
59
|
-
case 2:
|
|
60
|
-
return ts_morph_1.IndentationText.TwoSpaces;
|
|
61
|
-
case 4:
|
|
62
|
-
return ts_morph_1.IndentationText.FourSpaces;
|
|
63
|
-
case 8:
|
|
64
|
-
return ts_morph_1.IndentationText.EightSpaces;
|
|
65
|
-
default:
|
|
66
|
-
return ts_morph_1.IndentationText.TwoSpaces;
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
/**
|
|
70
|
-
* Converts prettier newline config to ts-morph settings.
|
|
71
|
-
*
|
|
72
|
-
* @private
|
|
73
|
-
* @param {string | undefined} eol prettier end-of-line config
|
|
74
|
-
* @returns {NewLineKind | undefined} Converted new line kind
|
|
75
|
-
* @memberof PrettierFormatter
|
|
76
|
-
*/
|
|
77
|
-
convertNewline(eol) {
|
|
78
|
-
switch (eol) {
|
|
79
|
-
case "lf":
|
|
80
|
-
return ts_morph_1.NewLineKind.LineFeed;
|
|
81
|
-
case "crlf":
|
|
82
|
-
return ts_morph_1.NewLineKind.CarriageReturnLineFeed;
|
|
83
|
-
case "cr":
|
|
84
|
-
return ts_morph_1.NewLineKind.CarriageReturnLineFeed;
|
|
85
|
-
case "auto":
|
|
86
|
-
return ts_morph_1.NewLineKind.LineFeed;
|
|
87
|
-
default:
|
|
88
|
-
return ts_morph_1.NewLineKind.LineFeed;
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
exports.PrettierFormatter = PrettierFormatter;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PrettierFormatter = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const prettier_1 = tslib_1.__importDefault(require("prettier"));
|
|
6
|
+
const ts_morph_1 = require("ts-morph");
|
|
7
|
+
const BaseFormatter_1 = require("./BaseFormatter");
|
|
8
|
+
class PrettierFormatter extends BaseFormatter_1.BaseFormatter {
|
|
9
|
+
/**
|
|
10
|
+
* Initializes the formatter.
|
|
11
|
+
*
|
|
12
|
+
* @returns {Promise<PrettierFormatter>} Initialized formatter
|
|
13
|
+
* @memberof PrettierFormatter
|
|
14
|
+
*/
|
|
15
|
+
init() {
|
|
16
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
17
|
+
const options = yield prettier_1.default.resolveConfig(this.output);
|
|
18
|
+
if (options) {
|
|
19
|
+
this.options = options;
|
|
20
|
+
this.settings = {
|
|
21
|
+
indentationText: this.convertIndentation(this.options.useTabs, this.options.tabWidth),
|
|
22
|
+
insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces: this.options.bracketSpacing !== undefined ? this.options.bracketSpacing : true,
|
|
23
|
+
newLineKind: this.convertNewline(this.options.endOfLine),
|
|
24
|
+
quoteKind: this.options.singleQuote ? ts_morph_1.QuoteKind.Single : ts_morph_1.QuoteKind.Double,
|
|
25
|
+
useTrailingCommas: this.options.trailingComma === "none" ? false : true,
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
else
|
|
29
|
+
this.settings = {};
|
|
30
|
+
return this;
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Formats a given source code.
|
|
35
|
+
*
|
|
36
|
+
* @abstract
|
|
37
|
+
* @param {string} source Source code to format
|
|
38
|
+
* @returns {string} Formatted source code
|
|
39
|
+
* @memberof Formatter
|
|
40
|
+
*/
|
|
41
|
+
format(source) {
|
|
42
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
43
|
+
return prettier_1.default.format(source, Object.assign({ parser: "typescript" }, this.options));
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Converts prettier indentation config to ts-morph settings.
|
|
48
|
+
*
|
|
49
|
+
* @private
|
|
50
|
+
* @param {boolean | undefined} useTabs Flag, whether to use tabs or not
|
|
51
|
+
* @param {number | undefined} tabWidth Width of a simulated tab, each number represents a space
|
|
52
|
+
* @returns {IndentationText} Converted indentation text
|
|
53
|
+
* @memberof PrettierFormatter
|
|
54
|
+
*/
|
|
55
|
+
convertIndentation(useTabs, tabWidth) {
|
|
56
|
+
if (useTabs)
|
|
57
|
+
return ts_morph_1.IndentationText.Tab;
|
|
58
|
+
switch (tabWidth) {
|
|
59
|
+
case 2:
|
|
60
|
+
return ts_morph_1.IndentationText.TwoSpaces;
|
|
61
|
+
case 4:
|
|
62
|
+
return ts_morph_1.IndentationText.FourSpaces;
|
|
63
|
+
case 8:
|
|
64
|
+
return ts_morph_1.IndentationText.EightSpaces;
|
|
65
|
+
default:
|
|
66
|
+
return ts_morph_1.IndentationText.TwoSpaces;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Converts prettier newline config to ts-morph settings.
|
|
71
|
+
*
|
|
72
|
+
* @private
|
|
73
|
+
* @param {string | undefined} eol prettier end-of-line config
|
|
74
|
+
* @returns {NewLineKind | undefined} Converted new line kind
|
|
75
|
+
* @memberof PrettierFormatter
|
|
76
|
+
*/
|
|
77
|
+
convertNewline(eol) {
|
|
78
|
+
switch (eol) {
|
|
79
|
+
case "lf":
|
|
80
|
+
return ts_morph_1.NewLineKind.LineFeed;
|
|
81
|
+
case "crlf":
|
|
82
|
+
return ts_morph_1.NewLineKind.CarriageReturnLineFeed;
|
|
83
|
+
case "cr":
|
|
84
|
+
return ts_morph_1.NewLineKind.CarriageReturnLineFeed;
|
|
85
|
+
case "auto":
|
|
86
|
+
return ts_morph_1.NewLineKind.LineFeed;
|
|
87
|
+
default:
|
|
88
|
+
return ts_morph_1.NewLineKind.LineFeed;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
exports.PrettierFormatter = PrettierFormatter;
|
|
93
93
|
//# sourceMappingURL=PrettierFormatter.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { FileFormatter } from "./FileFormatter";
|
|
2
|
-
export declare function createFormatter(outputDir: string, usePrettier: boolean): Promise<FileFormatter>;
|
|
1
|
+
import type { FileFormatter } from "./FileFormatter";
|
|
2
|
+
export declare function createFormatter(outputDir: string, usePrettier: boolean): Promise<FileFormatter>;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createFormatter = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const PrettierFormatter_1 = require("./PrettierFormatter");
|
|
6
|
-
const NoopFormatter_1 = require("./NoopFormatter");
|
|
7
|
-
function createFormatter(outputDir, usePrettier) {
|
|
8
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
9
|
-
const formatter = usePrettier ? new PrettierFormatter_1.PrettierFormatter(outputDir) : new NoopFormatter_1.NoopFormatter(outputDir);
|
|
10
|
-
yield formatter.init();
|
|
11
|
-
return formatter;
|
|
12
|
-
});
|
|
13
|
-
}
|
|
14
|
-
exports.createFormatter = createFormatter;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createFormatter = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const PrettierFormatter_1 = require("./PrettierFormatter");
|
|
6
|
+
const NoopFormatter_1 = require("./NoopFormatter");
|
|
7
|
+
function createFormatter(outputDir, usePrettier) {
|
|
8
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
9
|
+
const formatter = usePrettier ? new PrettierFormatter_1.PrettierFormatter(outputDir) : new NoopFormatter_1.NoopFormatter(outputDir);
|
|
10
|
+
yield formatter.init();
|
|
11
|
+
return formatter;
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
exports.createFormatter = createFormatter;
|
|
15
15
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function logFilePath(filePath: string): string;
|
|
1
|
+
export declare function logFilePath(filePath: string): string;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.logFilePath = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const path_1 = tslib_1.__importDefault(require("path"));
|
|
6
|
-
function logFilePath(filePath) {
|
|
7
|
-
// we only show file paths relative to work dir of running process
|
|
8
|
-
const relativePath = path_1.default.relative(process.cwd(), filePath);
|
|
9
|
-
// beautify slashes for windows
|
|
10
|
-
return relativePath.split(path_1.default.sep).join("/");
|
|
11
|
-
}
|
|
12
|
-
exports.logFilePath = logFilePath;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.logFilePath = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const path_1 = tslib_1.__importDefault(require("path"));
|
|
6
|
+
function logFilePath(filePath) {
|
|
7
|
+
// we only show file paths relative to work dir of running process
|
|
8
|
+
const relativePath = path_1.default.relative(process.cwd(), filePath);
|
|
9
|
+
// beautify slashes for windows
|
|
10
|
+
return relativePath.split(path_1.default.sep).join("/");
|
|
11
|
+
}
|
|
12
|
+
exports.logFilePath = logFilePath;
|
|
13
13
|
//# sourceMappingURL=logFilePath.js.map
|
package/lib/run-cli.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
export {};
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
export {};
|
package/lib/run-cli.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
"use strict";
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
const cli_1 = require("./cli");
|
|
5
|
-
// noinspection JSIgnoredPromiseFromCall
|
|
6
|
-
new cli_1.Cli().run();
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
const cli_1 = require("./cli");
|
|
5
|
+
// noinspection JSIgnoredPromiseFromCall
|
|
6
|
+
new cli_1.Cli().run();
|
|
7
7
|
//# sourceMappingURL=run-cli.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@odata2ts/odata2ts",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.24.0",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -45,48 +45,47 @@
|
|
|
45
45
|
"cli"
|
|
46
46
|
],
|
|
47
47
|
"peerDependencies": {
|
|
48
|
-
"@odata2ts/
|
|
49
|
-
"@odata2ts/odata-
|
|
50
|
-
"@odata2ts/odata-service": "^0.15.0"
|
|
48
|
+
"@odata2ts/odata-query-objects": "^0.18.2",
|
|
49
|
+
"@odata2ts/odata-service": "^0.15.2"
|
|
51
50
|
},
|
|
52
51
|
"dependencies": {
|
|
53
52
|
"@odata2ts/converter-api": "^0.1.2",
|
|
54
53
|
"@odata2ts/converter-runtime": "^0.1.5",
|
|
55
|
-
"@odata2ts/odata-core": "^0.3.
|
|
54
|
+
"@odata2ts/odata-core": "^0.3.8",
|
|
56
55
|
"camel-case": "^4.1.2",
|
|
57
|
-
"commander": "^
|
|
56
|
+
"commander": "^10.0.1",
|
|
58
57
|
"constant-case": "^3.0.4",
|
|
59
|
-
"cosmiconfig": "^
|
|
60
|
-
"cosmiconfig-typescript-loader": "^4.
|
|
61
|
-
"deepmerge": "^4.
|
|
62
|
-
"fs-extra": "^
|
|
58
|
+
"cosmiconfig": "^8.2.0",
|
|
59
|
+
"cosmiconfig-typescript-loader": "^4.3.0",
|
|
60
|
+
"deepmerge": "^4.3.1",
|
|
61
|
+
"fs-extra": "^11.1.1",
|
|
63
62
|
"pascal-case": "^3.1.2",
|
|
64
|
-
"prettier": "^2.
|
|
63
|
+
"prettier": "^2.8.8",
|
|
65
64
|
"snake-case": "^3.0.4",
|
|
66
|
-
"ts-morph": "^
|
|
67
|
-
"ts-node": "^10.
|
|
65
|
+
"ts-morph": "^18.0.0",
|
|
66
|
+
"ts-node": "^10.9.1",
|
|
68
67
|
"tsconfig-loader": "^1.1.0",
|
|
69
68
|
"upper-case-first": "^2.0.2",
|
|
70
|
-
"xml2js": "^0.
|
|
69
|
+
"xml2js": "^0.6.0"
|
|
71
70
|
},
|
|
72
71
|
"devDependencies": {
|
|
73
72
|
"@odata2ts/converter-v2-to-v4": "^0.1.4",
|
|
74
73
|
"@odata2ts/http-client-api": "^0.1.0",
|
|
75
|
-
"@odata2ts/odata-query-objects": "^0.18.
|
|
76
|
-
"@odata2ts/odata-service": "^0.15.
|
|
77
|
-
"@
|
|
78
|
-
"@types/
|
|
79
|
-
"@types/
|
|
80
|
-
"@types/
|
|
81
|
-
"@types/
|
|
82
|
-
"
|
|
83
|
-
"jest": "^
|
|
84
|
-
"rimraf": "^
|
|
85
|
-
"ts-jest": "^
|
|
86
|
-
"type-fest": "2.
|
|
87
|
-
"typescript": "^
|
|
74
|
+
"@odata2ts/odata-query-objects": "^0.18.2",
|
|
75
|
+
"@odata2ts/odata-service": "^0.15.2",
|
|
76
|
+
"@odata2ts/test-converters": "^0.2.6",
|
|
77
|
+
"@types/fs-extra": "^11.0.1",
|
|
78
|
+
"@types/jest": "^29.5.2",
|
|
79
|
+
"@types/node": "^20.3.0",
|
|
80
|
+
"@types/prettier": "^2.7.3",
|
|
81
|
+
"@types/xml2js": "^0.4.11",
|
|
82
|
+
"jest": "^29.5.0",
|
|
83
|
+
"rimraf": "^5.0.1",
|
|
84
|
+
"ts-jest": "^29.1.0",
|
|
85
|
+
"type-fest": "2.12.2",
|
|
86
|
+
"typescript": "^5.1.3"
|
|
88
87
|
},
|
|
89
88
|
"types": "./lib/index.d.ts",
|
|
90
|
-
"gitHead": "
|
|
89
|
+
"gitHead": "03016b8c3e7ec6fade37afcce777e6547edb384f",
|
|
91
90
|
"readme": "README.md"
|
|
92
91
|
}
|