JSPM

@webiny/api-upgrade

5.34.9-beta.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 2
  • Score
    100M100P100Q52504F
  • License MIT

A set of upgrade utils, plugins and types.

Package Exports

  • @webiny/api-upgrade
  • @webiny/api-upgrade/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@webiny/api-upgrade) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

@webiny/api-upgrade

code style: prettier PRs Welcome

A set of upgrade utils, plugins and types.

Each application will need to maintain its own upgrade plugins, this package is just help to ease the running of the upgrade plugins and to check if upgrade is actually necessary.

Usage

// Get your upgrade plugins
const upgradePlugins = context.plugins
  .byType<UpgradePlugin>("api-upgrade")
  .filter(pl => pl.app === "file-manager");

// Run "getApplicablePlugin" to validate and get the applicable plugin
const plugin = getApplicablePlugin({
  deployedVersion: context.WEBINY_VERSION,
  installedAppVersion: "5.0.0",
  upgradePlugins,
  upgradeToVersion: "5.1.0"
});

// Execute your upgrade plugin
await plugin.apply(context);

// If you have input data for your plugin, run it with "data" as second parameter
await plugin.apply(context, data);