Skip to content

Updating packages/Refactoring#17

Open
mariofink wants to merge 10 commits into
openmindlab:masterfrom
mariofink:master
Open

Updating packages/Refactoring#17
mariofink wants to merge 10 commits into
openmindlab:masterfrom
mariofink:master

Conversation

@mariofink
Copy link
Copy Markdown

This pull request includes several updates to dependencies, Node.js version requirements, and code style, as well as significant refactoring and modernization of the src/customtypes.ts and src/generate.ts files. The changes improve code readability, consistency, and maintainability, and update the project to use newer versions of its dependencies and Node.js.

This pull request also updates the type definitions to the latest version of B2C Commerce Script 25.10: https://salesforcecommercecloud.github.io/b2c-dev-doc/docs/current/scriptapi/html/

Dependency and Environment Updates:

  • Updated the required Node.js version from 16.16.0 to 24.12.0 in .nvmrc and removed the engines field from package.json to reflect this change. [1] [2]
  • Upgraded multiple dependencies and devDependencies in package.json, including cheerio, cli-progress, comment-json, picocolors, prettier, properties-reader, xml2js, and TypeScript-related packages.
  • Added an empty .prettierrc file to support Prettier configuration.
  • Added a format script using Prettier and updated the test script in package.json.

Code Refactoring and Style Improvements:

General modernization and style:

  • Refactored src/customtypes.ts and src/generate.ts to use consistent double quotes, arrow functions, and modern JavaScript/TypeScript conventions. [1] [2] [3] [4] [5] [6] [7] [8]
  • Replaced direct prettier imports with named format imports and updated formatting calls to use await format(...). [1] [2] [3] [4]
  • Improved array handling, string manipulation, and error handling throughout src/customtypes.ts. [1] [2] [3] [4]
  • Enhanced XML parsing and attribute processing logic in src/customtypes.ts, making it more robust and readable. [1] [2]

Type and attribute definition updates:

  • Added RESTErrorResponse to the list of type definitions in @types/sfcc/attrs.txt.

These changes collectively modernize the codebase, improve maintainability, and ensure compatibility with newer Node.js and dependency versions.

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.

1 participant