Skip to main content

Updating module dependencies

When a project is converted to YAML, its module dependencies are also converted so that they can be used in the YAML workspace. The converter stores these copies under .aditoprj/dependencies and replaces the corresponding version specifications in the YAML workspace's package.json with local file: paths.

To update a dependency version, transfer your work to AOD, change and install the dependency there, and then convert the updated project back to YAML.

Understand the difference​

For example, the AOD module can declare a compatible version range:

AOD package.json (excerpt)
{
"peerDependencies": {
"@aditosoftware/attribute": ">=3.0.0 <6.0.0"
}
}

The corresponding generated YAML workspace references a converted local copy:

YAML package.json (excerpt)
{
"peerDependencies": {
"@aditosoftware/attribute": "file:./.aditoprj/dependencies/@aditosoftware/attribute"
}
}

The file: value is a path, not a version number. Editing it does not update the source module version or regenerate the converted dependency. Keep the local path in the YAML workspace and make version changes in the AOD project instead. The example uses peerDependencies; check the relevant dependency section in your own package.json.


Update a dependency step by step​

  1. Save your YAML work. Save all files in VS Code and review your changes. Create a commit or backup where appropriate so you can restore your work.

  2. Transfer the YAML changes to AOD. In the Designer, run Transfer Extension Pack Changes on the original AOD project and wait for it to finish. The transfer can overwrite files in that project, so review and preserve any separate AOD changes first. See Transfer Extension Pack Changes.

  3. Change the dependency in the AOD project. Open the AOD project's package.json and update the relevant version or version range. For example, if the module supports the new major version, its peer dependency could be changed as follows:

    - "@aditosoftware/attribute": ">=3.0.0 <6.0.0"
    + "@aditosoftware/attribute": ">=3.0.0 <7.0.0"

    Choose the range required by your project. A range describes compatible versions; increasing its upper bound alone does not guarantee that a particular version is installed.

  4. Install and verify the AOD dependencies. Run npm install in the AOD project root, or use the dependency installation command prescribed by your project. Check the resulting package-lock.json and installed version to confirm that npm resolved the intended version. For example, run npm ls @aditosoftware/attribute in the AOD project root. See Dependency types and versioning.

  5. Convert the updated project to YAML. In the Designer, run Open in Extension Pack and wait for conversion to finish. This regenerates the YAML working copy and its converted dependencies. Do not start this step while the existing YAML copy contains changes that have not been transferred or otherwise preserved; conversion can replace or regenerate its contents.

  6. Initialize and check the YAML workspace. Open the regenerated workspace in VS Code and install its dependencies if needed, as described in Initialize the generated workspace. Verify that the expected converted module is present under .aditoprj/dependencies, review the resulting changes, and run the checks and tests appropriate to the updated module. Review modifications that target the updated dependency as well.

note

If you use ADITO: Convert (AOD) instead of the Designer transfer, it writes to a separate -aod output directory. Apply the version change and install dependencies in the intended AOD project, and reconcile working copies before converting back to YAML.