Skip to content

Commit 79c329b

Browse files
chore: Expose executable cli from SDK tools npm package (#682)
1 parent 3d3c8f0 commit 79c329b

File tree

9 files changed

+155
-86
lines changed

9 files changed

+155
-86
lines changed

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,8 @@ VSCode developers might use following debugging configuration for transformer an
111111
"env": {
112112
"OPENAPI_FILE_NAME": "./openapi/atlas-api.yaml"
113113
},
114-
"args": ["./openapi/atlas-api.yaml"],
115-
"program": "${workspaceFolder}/tools/transformer/src/transform"
114+
"args": ["transform", "--input", "./openapi/atlas-api.yaml", "--output", "./openapi/atlas-api-transformed.yaml"],
115+
"program": "${workspaceFolder}/tools/transformer/src/cli.js"
116116
}
117117
]
118118
}

package.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"name": "atlas-openapi-transformer",
3+
"description": "Expose CLI for Atlas OpenAPI transformations (flatten, transform). Root level package enables npx usage referencing github repository.",
4+
"bin": {
5+
"atlas-openapi-transformer": "tools/transformer/src/cli.js"
6+
},
7+
"dependencies": {
8+
"simple-node-logger": "^21.8.12",
9+
"yaml": "2.8.1",
10+
"yargs": "^17.7.2"
11+
},
12+
"engines": {
13+
"node": ">= 16",
14+
"npm": ">= 8"
15+
}
16+
}
17+

tools/package-lock.json

Lines changed: 19 additions & 50 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
@@ -5,6 +5,7 @@
55
"private": "true",
66
"main": "transformer/src/index.js",
77
"dependencies": {
8+
"yargs": "^17.7.2",
89
"simple-node-logger": "^21.8.12",
910
"yaml": "2.8.1"
1011
},
@@ -15,7 +16,6 @@
1516
"prettier": "3.6.2"
1617
},
1718
"scripts": {
18-
"sdk:transform": "node ./transformer/src/transform",
1919
"format": "prettier --write .",
2020
"format:check": "prettier --check .",
2121
"test": "jest **/__tests__/**.test.js",

tools/scripts/generate.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ echo "# Running transformation based on $OPENAPI_FILE_NAME to the $transformed_f
2222
cp "$OPENAPI_FOLDER/$OPENAPI_FILE_NAME" "$openapiFileLocation"
2323

2424
npm install
25-
npm run sdk:transform -- "$openapiFileLocation"
25+
npm exec --prefix .. atlas-openapi-transformer -- transform --input "$openapiFileLocation" --output "$openapiFileLocation"
2626

2727
echo "# Running OpenAPI generator validation"
2828
npm exec openapi-generator-cli -- validate -i "$openapiFileLocation"

tools/scripts/transform.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ echo "# Running transformation from $transformed_file OpenAPI from $OPENAPI_FILE
1919
cp "$OPENAPI_FOLDER/$OPENAPI_FILE_NAME" "$openapiFileLocation"
2020

2121
npm install
22-
npm run sdk:transform -- "$openapiFileLocation"
22+
npm exec --prefix .. atlas-openapi-transformer -- transform --input "$openapiFileLocation" --output "$openapiFileLocation"

0 commit comments

Comments
 (0)