1. SitecoreAI development

Update your starter foundation code

SitecoreAI includes starter foundation code that is built into the solution, and is the recommended approach when you create a project. When you use the project creation wizard in the Deploy app, you connect to your source control account (for example, your GitHub account), and clone the starter foundation code there. Sitecore regularly updates the foundation code to make it more robust, and support new features.

When you develop a site with the starter foundation, the best practice is to add comments to your custom code. This helps you identify your changes when you update the code and need to compare your files with a newer version of the starter foundation. This topic describes the recommended steps to do this for your Content SDK app.

Update all your code

To update all your starter foundation code:

  1. Check out the latest Sitecore starter kit repository.
  2. Use a file and folder comparison tool (for example, WinMerge) to understand which changes were introduced since the last time you updated your code.
  3. Start by checking the package.json file in the examples/basic-nextjs (or the example you chose for your application) folder. This contains your Content SDK Next.js application. Check for new packages in the latest version of the starter kit, and install them by running npm install packageName@version. This ensures that dependent packages are also installed, and the package-lock.json file is updated accordingly.
  4. Manually update the rest of your code accordingly, making sure you keep the changes you made originally, or remove changes that are no longer necessary.

Update the Content SDK starter kit

To compare only the Content SDK application code, use the version found in the package.json file, to compare the version you originally cloned with the current one. Using this approach, you only compare the starter kit code versions, without any of your custom code.

To update the Content SDK starter kit code:

  1. In an empty folder, clone the starter kit using the following command:

    git clone https://github.com/Sitecore/xmcloud-starter-js.git
    
  2. Move into the example folder based on your initial selection and install the dependencies:

    cd xmcloud-starter-js/examples/basic-nextjs
    npm install
    
  3. Update the current foundation code:

    • Identify the missing packages, and install them by running npm install packageName@version.
    • Remove redundant packages.
    • Manually update the code that isn't related to package dependencies.
If you have suggestions for improving this article, let us know!