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

fix: moves auro library to dependencies in package.json #18 #19

Closed
wants to merge 1 commit into from

Conversation

chrisfalaska
Copy link
Contributor

@chrisfalaska chrisfalaska commented Oct 9, 2024

Alaska Airlines Pull Request

Moves Auro Library into dependencies from devDependencies to avoid installation issues, as originally reported in #573.

Resolves: #18

Summary:

  • Moved to dependencies within package.json
  • Regenerated package.lock
  • Verified build and test ran successfully

Type of change:

Please delete options that are not relevant.

  • Revision of an existing capability

Checklist:

  • My update follows the CONTRIBUTING guidelines of this project
  • I have performed a self-review of my own update

By submitting this Pull Request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Pull Requests will be evaluated by their quality of update and whether it is consistent with the goals and values of this project. Any submission is to be considered a conversation between the submitter and the maintainers of this project and may require changes to your submission.

Thank you for your submission!

-- Auro Design System Team

Summary by Sourcery

Fix installation issues by moving Auro Library to dependencies in package.json. Refactor AuroFormValidation class to enhance validation logic and error message handling. Update TypeScript configuration for ES6 targeting and Node module resolution. Regenerate package-lock.json to reflect dependency changes.

Bug Fixes:

  • Move Auro Library from devDependencies to dependencies in package.json to resolve installation issues.

Enhancements:

  • Refactor AuroFormValidation class to use AuroLibraryRuntimeUtils for element matching and remove getCamelCaseName method.
  • Add a force parameter to the validate method to allow forced validation execution.
  • Improve error message handling by directly accessing input elements and their validation messages.

Build:

  • Regenerate package-lock.json to reflect the updated dependencies.

Chores:

  • Update tsconfig.json to target ES6, use Node module resolution, and configure module resolution paths.

@chrisfalaska chrisfalaska requested a review from a team as a code owner October 9, 2024 16:59
Copy link

sourcery-ai bot commented Oct 9, 2024

Reviewer's Guide by Sourcery

This pull request moves the Auro Library from devDependencies to dependencies in package.json to resolve installation issues. The changes also include updates to the AuroFormValidation class, improvements in error handling and validation, and configuration updates for TypeScript and ESLint.

Updated class diagram for AuroFormValidation

classDiagram
    class AuroFormValidation {
        +AuroLibraryRuntimeUtils runtimeUtils
        +validate(elem: object, force: boolean): void
        +getAuroInputs(elem: object): void
        +getErrorMessage(elem: object): void
    }
    class AuroLibraryRuntimeUtils
    AuroFormValidation --> AuroLibraryRuntimeUtils
Loading

File-Level Changes

Change Details Files
Moved Auro Library to dependencies
  • Moved Auro Library from devDependencies to dependencies in package.json
  • Regenerated package.lock file
package.json
package-lock.json
Updated AuroFormValidation class implementation
  • Imported AuroLibraryRuntimeUtils from @aurodesignsystem/auro-library
  • Added constructor to initialize runtimeUtils
  • Updated validate method to accept a 'force' parameter
  • Replaced getCamelCaseName method with runtimeUtils.elementMatch
  • Modified error message handling and event dispatching
  • Updated element querying to include '[auro-input]' selector
dist/validation.js
dist/validation.d.ts
Improved error handling and validation
  • Added null checks for elem.value in validation logic
  • Updated custom event dispatching to use 'auroFormElement-validated'
  • Modified error message retrieval logic
dist/validation.js
Updated TypeScript configuration
  • Set target to ES2015
  • Added moduleResolution and baseUrl settings
  • Configured paths for @parse5 module resolution
tsconfig.json
Added ESLint configuration
  • Created new eslint.config.mjs file
  • Configured ESLint to use @aurodesignsystem/eslint-config
eslint.config.mjs

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

@chrisfalaska chrisfalaska self-assigned this Oct 9, 2024
@chrisfalaska chrisfalaska linked an issue Oct 9, 2024 that may be closed by this pull request
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 @chrisfalaska - I've reviewed your changes - here's some feedback:

Overall Comments:

  • The changes improve code quality and error handling. However, changing to a default export and modifying the event naming convention could potentially break existing code. Please ensure these changes are documented and that users are informed about how to update their imports and event listeners.
  • The addition of TypeScript configurations and ESLint rules is a positive step towards improving code consistency and catching potential issues early.
Here's what I looked at during the review
  • 🟡 General issues: 1 issue 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.

* @returns {void}
*/
validate(elem) {
validate(elem, force) {
Copy link

Choose a reason for hiding this comment

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

suggestion: Document the usage of the new 'force' parameter

The addition of the 'force' parameter provides more control over validation timing. Consider adding a brief comment or updating the method's JSDoc to explain when and how to use this parameter.

/**
 * Validates the input element(s).
 * @param {HTMLElement} elem - The element to validate.
 * @param {boolean} [force=false] - If true, forces validation regardless of current state.
 * @returns {void}
 */
validate(elem, force = false) {

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 incorrectly installed in devDependencies
1 participant