Skip to content
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

feat(api): writeDepVersionFile method will write the version of root #71

Closed
wants to merge 1 commit into from

Conversation

sun-mota
Copy link
Contributor

@sun-mota sun-mota commented Oct 17, 2024

Alaska Airlines Pull Request

writeDepVersionFile('root') will read the version from ./package.json and write rootVersion.js file

This PR should be merged before AlaskaAirlines/auro-datepicker#265

Before Submitting this pull request:

  • Link all tickets in this repository related to this PR in the Development section
    note: all pull requests require at least one linked ticket
  • If this PR is Ready For Review, all ticket's linked under Development must have their status changed to Ready For Review as well

By submitting this Pull Request, I confirm that my contribution is made under the terms of the Apache 2.0 license and I have performed a self-review of my own update.

Summary by Sourcery

New Features:

  • Introduce writeDepVersionFile method to read the version from the root package.json and write it to a rootVersion.js file.

@sun-mota sun-mota self-assigned this Oct 17, 2024
@sun-mota sun-mota requested a review from a team as a code owner October 17, 2024 23:47
@sun-mota sun-mota linked an issue Oct 17, 2024 that may be closed by this pull request
Copy link

sourcery-ai bot commented Oct 17, 2024

Reviewer's Guide by Sourcery

This pull request modifies the writeDepVersionFile function in the versionWriter.js script to handle a new 'root' package option. The changes allow the function to write the version of the root package.json file when 'root' is passed as an argument.

Sequence diagram for writeDepVersionFile function with 'root' package

sequenceDiagram
    participant Caller
    participant versionWriter as versionWriter.js
    participant fs as File System
    Caller->>versionWriter: call writeDepVersionFile('root')
    versionWriter->>fs: require('path').relative(__dirname, './package.json')
    versionWriter->>fs: read package.json
    fs-->>versionWriter: return version
    versionWriter->>fs: write ./src/rootVersion.js
    fs-->>versionWriter: confirm write
    versionWriter-->>Caller: complete
Loading

File-Level Changes

Change Details Files
Modified writeDepVersionFile function to handle 'root' package
  • Added a condition to determine the path of package.json based on the 'root' argument
  • Modified the elemSubName calculation to use 'root' directly when it's passed as an argument
  • Used path.relative to get the correct path for the root package.json file
scripts/build/versionWriter.js

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time. You can also use
    this command to specify where the summary should be inserted.

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @sun-mota - I've reviewed your changes - here's some feedback:

Overall Comments:

  • Consider using a more explicit method (e.g., a boolean flag or enum) to differentiate between root and non-root packages instead of string comparison. This could improve code clarity and reduce potential errors.
  • It would be helpful to include more context in the PR description about why this PR needs to be merged before the linked issue. This information can assist reviewers and future maintainers in understanding the dependencies between changes.
Here's what I looked at during the review
  • 🟡 General issues: 2 issues found
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

scripts/build/versionWriter.js Show resolved Hide resolved
scripts/build/versionWriter.js Show resolved Hide resolved
`writeDepVersionFile('root')` will read the version from `./package.json` and write `rootVersion.js` file
@sun-mota sun-mota force-pushed the sunMoat/feat/writeRootVersion/70 branch from 4b1d16f to eeecbed Compare October 17, 2024 23:52
@sun-mota sun-mota closed this Oct 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

auro-library: Add a capability to get current module's version
1 participant