Skip to content

feat(endpoint): add wire protocol filtering option to copy models script #4068

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 20, 2022

Conversation

kuhe
Copy link
Contributor

@kuhe kuhe commented Oct 20, 2022

Issue

internal JS-3670

Description

  • enables model wire protocol filter in the script yarn copy-models
  • example: yarn copy-models -m ../_models -p restXml

@kuhe kuhe requested a review from a team as a code owner October 20, 2022 21:06
@kuhe kuhe force-pushed the feat/endpoints-2.0 branch from 228a322 to 5328d59 Compare October 20, 2022 21:11
try {
const fileContent = (await fsPromises.readFile(smithyModelsFile)).toString();
const model = require(absolutePath);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

switching to require since this is a JSON file

await spawnProcess(join(__dirname, "..", "..", "node_modules", ".bin", "prettier"), [
"--write",
`${OUTPUT_DIR}/*.json`,
]);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removing prettier step to save time. JSON.stringify(, null, 2) is good enough.

try {
const fileContent = (await fsPromises.readFile(smithyModelsFile)).toString();
const model = require(absolutePath);
const sdkId = getSdkId(model).toLowerCase().replace(/\s/g, "-");
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

confirmed this is the same set of filenames as before and does not create any new files

test: yarn copy-models -m ...

@kuhe kuhe merged commit 1acd79a into aws:main Oct 20, 2022
@kuhe kuhe deleted the feat/endpoints-2.0 branch October 20, 2022 21:58
@github-actions
Copy link

github-actions bot commented Nov 4, 2022

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 4, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants