Skip to content

chore(non-clients): sort npm scripts #2823

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 1 commit into from
Sep 24, 2021
Merged

Conversation

trivikr
Copy link
Member

@trivikr trivikr commented Sep 24, 2021

Issue

Follow-up to #2821

Description

Sorts npm scripts in alphabetical order

Achieved by running the following script in packages and lib:

const { readdirSync, readFileSync, writeFileSync } = require("fs");
const { join } = require("path");

readdirSync(join(process.cwd()), { withFileTypes: true })
  .filter((dirent) => dirent.isDirectory())
  .map((dirent) => dirent.name)
  .forEach((workspaceName) => {
    const packageJsonPath = join(process.cwd(), workspaceName, "package.json");
    const packageJson = JSON.parse(readFileSync(packageJsonPath).toString());
    packageJson.scripts = Object.fromEntries(Object.entries(packageJson.scripts).sort());
    writeFileSync(packageJsonPath, JSON.stringify(packageJson, null, 2).concat(`\n`));
  });

Testing

N/A


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

@codecov-commenter
Copy link

codecov-commenter commented Sep 24, 2021

Codecov Report

Merging #2823 (a934e85) into main (a1fb9a2) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #2823   +/-   ##
=======================================
  Coverage   60.41%   60.41%           
=======================================
  Files         554      554           
  Lines       28885    28885           
  Branches     7072     7072           
=======================================
  Hits        17452    17452           
  Misses      11433    11433           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a1fb9a2...a934e85. Read the comment docs.

@trivikr trivikr changed the title chore(packages): sort npm scripts chore(non-clients): sort npm scripts Sep 24, 2021
@AllanZhengYP AllanZhengYP merged commit 655e6be into aws:main Sep 24, 2021
@trivikr trivikr deleted the sort-npm-scripts branch October 7, 2021 22:58
@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 Oct 22, 2021
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.

3 participants