Skip to content

Commit fdc210e

Browse files
chore(deps-dev): bump prettier from 2.8.4 to 3.5.3 in /tools (#541)
1 parent eb36b89 commit fdc210e

File tree

10 files changed

+47
-46
lines changed

10 files changed

+47
-46
lines changed

tools/package-lock.json

Lines changed: 10 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tools/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"@openapitools/openapi-generator-cli": "2.18.1",
1313
"jest": "29.7.0",
1414
"replace-in-file": "^8.3.0",
15-
"prettier": "2.8.4"
15+
"prettier": "3.5.3"
1616
},
1717
"scripts": {
1818
"sdk:transform": "node ./transformer/src/transform",

tools/transformer/__tests__/transformations.test.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,27 +15,27 @@ beforeEach(() => {
1515
test("Transform oneOf enum", () => {
1616
transformOneOf(
1717
".components.schemas.ApiAtlasRegionConfigView.properties.regionName",
18-
api
18+
api,
1919
);
2020
expect(
21-
api.components.schemas.ApiAtlasRegionConfigView.properties.regionName
21+
api.components.schemas.ApiAtlasRegionConfigView.properties.regionName,
2222
).toMatchInlineSnapshot(cases.EnumOneOf);
2323
});
2424

2525
test("Transform oneOf model", () => {
2626
transformOneOf(".components.schemas.ApiAtlasHardwareSpecView", api);
2727
expect(
28-
api.components.schemas.ApiAtlasHardwareSpecView.properties
28+
api.components.schemas.ApiAtlasHardwareSpecView.properties,
2929
).toMatchInlineSnapshot(cases.PropertiesOneOf);
3030
});
3131

3232
test("Transform AllOf model", () => {
3333
transformAllOf(".components.schemas.ApiAtlasRegionConfigView", api);
3434
expect(api.components.schemas.ApiAtlasRegionConfigView).toMatchInlineSnapshot(
35-
cases.ParentAllOf
35+
cases.ParentAllOf,
3636
);
3737
expect(
38-
api.components.schemas.ApiAtlasAWSRegionConfigView
38+
api.components.schemas.ApiAtlasAWSRegionConfigView,
3939
).toMatchInlineSnapshot(cases.ChildAllOf);
4040
});
4141

@@ -46,10 +46,10 @@ test("Transform already transformed model ", () => {
4646
transformAllOf(".components.schemas.ApiAtlasRegionConfigView", api);
4747

4848
expect(api.components.schemas.ApiAtlasRegionConfigView).toMatchInlineSnapshot(
49-
cases.ParentAllOf
49+
cases.ParentAllOf,
5050
);
5151
expect(
52-
api.components.schemas.ApiAtlasAWSRegionConfigView
52+
api.components.schemas.ApiAtlasAWSRegionConfigView,
5353
).toMatchInlineSnapshot(cases.ChildAllOf);
5454
});
5555

tools/transformer/src/atlasTransformations.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,13 @@ module.exports = function runTransformations(openapi) {
3434
openapi,
3535
"",
3636
"Manual",
37-
ignoredModelNames
37+
ignoredModelNames,
3838
);
3939
openapi = applyModelNameTransformations(
4040
openapi,
4141
"",
4242
"View",
43-
ignoredModelNames
43+
ignoredModelNames,
4444
);
4545

4646
if (openapi.components.schemas.ApiAtlasFTSAnalyzers) {

tools/transformer/src/engine/readers.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@
99
function getAllObjectsWithProperty(
1010
apiObject,
1111
key,
12-
predicate = (_k, _v) => true
12+
predicate = (_k, _v) => true,
1313
) {
1414
return getAllObjects(
1515
apiObject,
16-
(obj) => key in obj && predicate(key, obj[key])
16+
(obj) => key in obj && predicate(key, obj[key]),
1717
);
1818
}
1919

tools/transformer/src/transformations/allOf.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ function applyAllOfTransformations(api) {
2525

2626
console.info(
2727
"# AllOf transformations: ",
28-
allOfTransformations.map((e) => e.path)
28+
allOfTransformations.map((e) => e.path),
2929
);
3030

3131
for (let { path } of allOfTransformations) {
@@ -52,12 +52,12 @@ function transformAllOf(objectPath, api) {
5252
const childName = getObjectNameFromReference(childRef);
5353
if (!childObject) {
5454
throw new Error(
55-
`Missing object reference: ${childRef} for ${parentName}`
55+
`Missing object reference: ${childRef} for ${parentName}`,
5656
);
5757
}
5858
if (removeParentFromAllOf(childObject, parentName)) {
5959
console.debug(
60-
`AllOf: Moving ${parentName} (parent) properties into ${childName} (child) properties`
60+
`AllOf: Moving ${parentName} (parent) properties into ${childName} (child) properties`,
6161
);
6262
if (!childObject.allOf) {
6363
childObject.allOf = {};

tools/transformer/src/transformations/anyOf.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ function applyAnyOfTransformations(api) {
2222

2323
console.info(
2424
"# AnyOf transformations: " +
25-
JSON.stringify(transformationPaths, undefined, 2)
25+
JSON.stringify(transformationPaths, undefined, 2),
2626
);
2727

2828
for (let { path } of anyOfTransformations) {
@@ -42,11 +42,11 @@ function transformAnyOf(objectPath, api) {
4242

4343
// Expand references
4444
const childObjects = parentObject.anyOf.map((childRef) =>
45-
getObjectFromReference(childRef, api)
45+
getObjectFromReference(childRef, api),
4646
);
4747
const isEnum = childObjects.reduce(
4848
(isEnum, childObject) => isEnum && childObject.enum,
49-
true
49+
true,
5050
);
5151

5252
if (isEnum) {
@@ -59,7 +59,7 @@ function transformAnyOf(objectPath, api) {
5959
// Moves all the enum values of the children into the parent
6060
function transformAnyOfEnum(parentObject, api) {
6161
const childObjects = parentObject.anyOf.map((childRef) =>
62-
getObjectFromReference(childRef, api)
62+
getObjectFromReference(childRef, api),
6363
);
6464

6565
if (!parentObject.enum) {
@@ -84,7 +84,7 @@ function transformAnyOfEnum(parentObject, api) {
8484
// Moves all the propertis of the children into the parent
8585
function transformAnyOfProperties(parentObject, api) {
8686
const childObjects = parentObject.anyOf.map((childRef) =>
87-
getObjectFromReference(childRef, api)
87+
getObjectFromReference(childRef, api),
8888
);
8989

9090
for (let childObject of childObjects) {
@@ -115,7 +115,7 @@ function transformAnyOfProperties(parentObject, api) {
115115
if (duplicates.length > 0) {
116116
const duplicatesSource = childObject.title || "";
117117
console.info(
118-
`## ${duplicatesSource} - Detected properties that would be overriden: ${duplicates}\n`
118+
`## ${duplicatesSource} - Detected properties that would be overriden: ${duplicates}\n`,
119119
);
120120
}
121121
parentObject.properties = {

tools/transformer/src/transformations/discriminator.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ function applyDiscriminatorTransformations(api) {
2020

2121
console.info(
2222
"# Discriminator transformations: ",
23-
transformations.map((e) => e.path)
23+
transformations.map((e) => e.path),
2424
);
2525

2626
for (let { path } of transformations) {
@@ -44,7 +44,7 @@ function transformDiscriminatorOneOf(objectPath, api) {
4444
Please consider adding oneOf or discriminator mapping section to object: ${parentName}`);
4545
}
4646
console.info(
47-
`Setting oneOf based on discriminator for allOf transformation in ${parentName}`
47+
`Setting oneOf based on discriminator for allOf transformation in ${parentName}`,
4848
);
4949
// Ignore objects that point to themselves
5050
oneOfReferences = Object.values(parentObject.discriminator.mapping);

tools/transformer/src/transformations/name.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ function applyModelNameTransformations(api, prefix, suffix, ignoreModels) {
2828
.replace(suffix, "");
2929
if (api.components.schemas[schemaTransformedName]) {
3030
throw new Error(
31-
`components.schemas already contain key ${schemaTransformedName}. Please rename ${schemaKey} object to avoid name overlap.`
31+
`components.schemas already contain key ${schemaTransformedName}. Please rename ${schemaKey} object to avoid name overlap.`,
3232
);
3333
}
3434
api.components.schemas[schemaTransformedName] =

tools/transformer/src/transformations/oneOf.js

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ function applyOneOfTransformations(api) {
2424
transformationPaths = oneOfTransformations.map((e) => e.path);
2525
console.info(
2626
"# OneOf transformations: " +
27-
JSON.stringify(transformationPaths, undefined, 2)
27+
JSON.stringify(transformationPaths, undefined, 2),
2828
);
2929

3030
for (let { path } of oneOfTransformations) {
@@ -44,11 +44,11 @@ function transformOneOf(objectPath, api) {
4444

4545
// Expand references
4646
const childObjects = parentObject.oneOf.map((childRef) =>
47-
getObjectFromReference(childRef, api)
47+
getObjectFromReference(childRef, api),
4848
);
4949
const isEnum = childObjects.reduce(
5050
(isEnum, childObject) => isEnum && childObject.enum,
51-
true
51+
true,
5252
);
5353

5454
if (isEnum) {
@@ -61,7 +61,7 @@ function transformOneOf(objectPath, api) {
6161
// Moves all the enum values of the children into the parent
6262
function transformOneOfEnum(parentObject, api) {
6363
const childObjects = parentObject.oneOf.map((childRef) =>
64-
getObjectFromReference(childRef, api)
64+
getObjectFromReference(childRef, api),
6565
);
6666

6767
if (!parentObject.enum) {
@@ -86,7 +86,7 @@ function transformOneOfEnum(parentObject, api) {
8686
// Moves all the propertis of the children into the parent
8787
function transformOneOfProperties(parentObject, api) {
8888
const childObjects = parentObject.oneOf.map((childRef) =>
89-
getObjectFromReference(childRef, api)
89+
getObjectFromReference(childRef, api),
9090
);
9191

9292
for (let childObject of childObjects) {
@@ -106,10 +106,10 @@ function transformOneOfProperties(parentObject, api) {
106106
} else {
107107
// Otherwise this situation require human intervention
108108
console.error(
109-
"OpenAPI object is missing properties or allOf field. This is usually an error in the OpenAPI spec."
109+
"OpenAPI object is missing properties or allOf field. This is usually an error in the OpenAPI spec.",
110110
);
111111
console.error(
112-
"Please ensure that elements of oneOf schema are objects (classes) instead of single types (bool, string etc.)."
112+
"Please ensure that elements of oneOf schema are objects (classes) instead of single types (bool, string etc.).",
113113
);
114114
throw new Error(`${JSON.stringify(childObject, "", 2)}`);
115115
}
@@ -144,8 +144,8 @@ function handleDuplicates(parentObject, childObject) {
144144
`${duplicatesSource} mismatch type detected: ${JSON.stringify(
145145
mismatches,
146146
undefined,
147-
2
148-
)}`
147+
2,
148+
)}`,
149149
);
150150
}
151151
}
@@ -160,7 +160,7 @@ function filterReferenceOrTypeMissmatch(mismatches) {
160160
if (mismatch.key === ignoredProperty) {
161161
console.warn(
162162
"Type mismatch found when merging base types. Ignoring due to known mismatches",
163-
JSON.stringify(mismatch, undefined, 2)
163+
JSON.stringify(mismatch, undefined, 2),
164164
);
165165
return false;
166166
}
@@ -175,12 +175,12 @@ function mergeDuplicates(
175175
duplicatesSourceLabel,
176176
duplicates,
177177
childObject,
178-
parentObject
178+
parentObject,
179179
) {
180180
console.info(
181181
`## ${duplicatesSourceLabel} - Detected properties that would be overriden: ${JSON.stringify(
182-
duplicates
183-
)}\n`
182+
duplicates,
183+
)}\n`,
184184
);
185185
for (duplicate of duplicates) {
186186
childProperty = childObject.properties[duplicate.key];

0 commit comments

Comments
 (0)