Skip to content

chore(scripts): replace stripComments with decomment #3944

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 3 commits into from
Sep 14, 2022

Conversation

trivikr
Copy link
Member

@trivikr trivikr commented Sep 13, 2022

Issue

Refs #3847

Description

Replaces stripComments with decomment for removing comments

Testing

Running the script

main branch

$ yarn build:types:downlevel
...
Failed to format "clients/client-apigatewayv2/dist-types/ts3.4/models/models_0.d.ts". Skipping...
Failed to format "clients/client-cloudfront/dist-types/ts3.4/models/models_0.d.ts". Skipping...
Failed to format "clients/client-elastic-load-balancing-v2/dist-types/ts3.4/models/models_0.d.ts". Skipping...
Failed to format "clients/client-glacier/dist-types/ts3.4/models/models_0.d.ts". Skipping...
Failed to format "clients/client-lex-runtime-service/dist-types/ts3.4/models/models_0.d.ts". Skipping...
Failed to format "clients/client-lex-runtime-v2/dist-types/ts3.4/models/models_0.d.ts". Skipping...
Failed to format "clients/client-lookoutequipment/dist-types/ts3.4/models/models_0.d.ts". Skipping...
Failed to format "clients/client-mediastore/dist-types/ts3.4/models/models_0.d.ts". Skipping...
Failed to format "clients/client-quicksight/dist-types/ts3.4/QuickSight.d.ts". Skipping...
Failed to format "clients/client-route-53/dist-types/ts3.4/Route53.d.ts". Skipping...
Failed to format "clients/client-glue/dist-types/ts3.4/models/models_0.d.ts". Skipping...
Failed to format "clients/client-glue/dist-types/ts3.4/models/models_2.d.ts". Skipping...
Failed to format "clients/client-lightsail/dist-types/ts3.4/models/models_0.d.ts". Skipping...
Failed to format "clients/client-robomaker/dist-types/ts3.4/models/models_0.d.ts". Skipping...
Failed to format "clients/client-swf/dist-types/ts3.4/SWF.d.ts". Skipping...
Failed to format "clients/client-wisdom/dist-types/ts3.4/Wisdom.d.ts". Skipping...
Failed to format "clients/client-quicksight/dist-types/ts3.4/models/models_1.d.ts". Skipping...
Failed to format "clients/client-wafv2/dist-types/ts3.4/models/models_0.d.ts". Skipping...
Done in 114.96s.

pr branch

$ yarn build:types:downlevel
...
Done in 97.88s.
File which fails

Main branch: comments are present in clients/client-wisdom/dist-types/ts3.4/Wisdom.d.ts

$ tail clients/client-wisdom/dist-types/ts3.4/Wisdom.d.ts
     *       of type EXTERNAL. Include a single variable in <code>${variable}</code> format; this
     *       interpolated by Wisdom using ingested content. For example, if you ingest a Salesforce
     *       article, it has an <code>Id</code> value, and you can set the template URI to
     *         <code>https://myInstanceName.lightning.force.com/lightning/r/Knowledge__kav/*${Id}*\/view</code>.
     *     </p>
     */
    updateKnowledgeBaseTemplateUri(args: UpdateKnowledgeBaseTemplateUriCommandInput, options?: __HttpHandlerOptions): Promise<UpdateKnowledgeBaseTemplateUriCommandOutput>;
    updateKnowledgeBaseTemplateUri(args: UpdateKnowledgeBaseTemplateUriCommandInput, cb: (err: any, data?: UpdateKnowledgeBaseTemplateUriCommandOutput) => void): void;
    updateKnowledgeBaseTemplateUri(args: UpdateKnowledgeBaseTemplateUriCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: UpdateKnowledgeBaseTemplateUriCommandOutput) => void): void;
}

pr branch: no failure

$ tail clients/client-wisdom/dist-types/ts3.4/Wisdom.d.ts
  updateKnowledgeBaseTemplateUri(
    args: UpdateKnowledgeBaseTemplateUriCommandInput,
    cb: (err: any, data?: UpdateKnowledgeBaseTemplateUriCommandOutput) => void
  ): void;
  updateKnowledgeBaseTemplateUri(
    args: UpdateKnowledgeBaseTemplateUriCommandInput,
    options: __HttpHandlerOptions,
    cb: (err: any, data?: UpdateKnowledgeBaseTemplateUriCommandOutput) => void
  ): void;
}
Publish size (strip comments successful: client-acm)

main branch

$ du -sh clients/client-acm/dist-types               
424K	clients/client-acm/dist-types

pr branch

$ du -sh clients/client-acm/dist-types
424K    clients/client-acm/dist-types
Publish size (strip comments unsuccessful: client-glue)

main branch

$ du -sh clients/client-glue/dist-types
3.3M	clients/client-glue/dist-types

pr branch

$ du -sh clients/client-glue/dist-types
3.1M    clients/client-glue/dist-types

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@trivikr trivikr changed the title chore(scripts): replace stripComments with decomment for removing comments chore(scripts): replace stripComments with decomment Sep 13, 2022
@trivikr trivikr marked this pull request as ready for review September 13, 2022 21:46
@trivikr trivikr requested a review from a team as a code owner September 13, 2022 21:46
@trivikr trivikr merged commit a044789 into aws:main Sep 14, 2022
@trivikr trivikr deleted the decomment-strip-comments branch September 14, 2022 15:09
@github-actions
Copy link

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 Sep 29, 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.

2 participants