{"id":18750635,"url":"https://github.com/webiny/webiny-upgrades","last_synced_at":"2025-11-26T20:30:17.785Z","repository":{"id":39801108,"uuid":"429520263","full_name":"webiny/webiny-upgrades","owner":"webiny","description":"Contains upgrade scripts, executed via the `webiny upgrade` command.","archived":false,"fork":false,"pushed_at":"2025-02-11T10:41:13.000Z","size":3469,"stargazers_count":0,"open_issues_count":1,"forks_count":1,"subscribers_count":8,"default_branch":"main","last_synced_at":"2025-02-11T11:33:46.908Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/webiny.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-11-18T17:28:53.000Z","updated_at":"2025-02-11T10:41:17.000Z","dependencies_parsed_at":"2023-11-21T14:05:07.379Z","dependency_job_id":"c7467ea2-d6ff-4d3c-a5e2-0fe5eeebc22f","html_url":"https://github.com/webiny/webiny-upgrades","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webiny%2Fwebiny-upgrades","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webiny%2Fwebiny-upgrades/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webiny%2Fwebiny-upgrades/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webiny%2Fwebiny-upgrades/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/webiny","download_url":"https://codeload.github.com/webiny/webiny-upgrades/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239635832,"owners_count":19672238,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-07T17:12:39.747Z","updated_at":"2025-11-26T20:30:17.739Z","avatar_url":"https://github.com/webiny.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# webiny-upgrades\nContains upgrade scripts, executed via the `webiny upgrade` command.\n\n# Development Notes\n\n## Creating New Upgrades\n\nThe first step is to create a new folder in the repository root. \n\nFor example, if we're writing an upgrade script for the upcoming `5.50.0` version of Webiny, we need to create a folder named `5.50.0`. Once that's done, simply create an `index.js` file in it, and start writing your script For example:\n\n```js\nconst { log } = require(\"../utils\");\n\nmodule.exports = async context =\u003e {\n    log.info(\"Doing something...\");\n    \n    // Do whatever you might need to do...\n    \n    // Format updated files.\n    const files = [...];\n    await prettierFormat(files, context);\n\n    /**\n     * Install new packages.\n     */\n    await yarnInstall({\n        context\n    });\n};\n```\n\n## Fixing An Existing Upgrade Script\n\nNoticed something is off with a live upgrade script?\n\nWhen fixing an upgrade script, in order to avoid further affecting the existing live one, it's recommended we just copy/paste the existing script. So, for example, copy the code from the existing `5.50.0` into a new `5.50.0-hot-fix` folder. Then, when testing the upgrade script via the Webiny CLI, just tell the upgrade command to use the new code, via the `--use-version` flag. For example:\n\n```\nyarn webiny upgrade --use-version 5.50.0-hot-fix\n```\n\nOnce you've concluded the fix is ready to go live, simply delete the initial `5.50.0` folder and remove the `-hot-fix` suffix from the `5.50.0-hot-fix` folder name.\n\n## Local Testing\n\nLet's say you have a Webiny project on which you'd like to test the new upgrade script.\n\nYou don't need to make a change and push it into the `webiny-upgrades` repository in order to test it. Via terminal, simply navigate to your Webiny project, and from there run the upgrade directly. For example:\n\n```\nnode ../webiny-upgrades/index.js 5.50.0-hot-fix\n```\n\n\u003e Note that the `webiny-upgrades` folder contains a clone of this repo.\n\nOnce you're done, it's still advised that you push the changes and do a complete end-to-end test with the Webiny CLI. For example, from the new Webiny project directory, run:\n\n```\nyarn webiny upgrade --use-version 5.50.0-hot-fix\n```\n\n\u003e IMPORTANT: the version you pass to the Webiny CLI *must* match the upgrade folder name in this repo!\n\nYou can also run the upgrade command via the Webiny CLI from a locally cloned `webiny-js` repository:\n\n```\nnode ../webiny-js/packages/cli/bin.js upgrade --use-version 5.50.0-hot-fix\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebiny%2Fwebiny-upgrades","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwebiny%2Fwebiny-upgrades","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebiny%2Fwebiny-upgrades/lists"}