Socket
Socket
Sign inDemoInstall

@yworks/migrate-yfiles-app

Package Overview
Dependencies
303
Maintainers
4
Versions
6
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @yworks/migrate-yfiles-app

Semi-automatically migrate yFiles for HTML code to the latest version


Version published
Weekly downloads
3
Maintainers
4
Created
Weekly downloads
 

Readme

Source

yFiles for HTML migration tool

Migrate outdated yFiles for HTML code to yFiles for HTML 2.6.

The source of this tool is available at GitHub.

Usage

  1. Install the migration tool globally:

    npm install -g @yworks/migrate-yfiles-app

  2. Migrate your project:

    migrate-yfiles-app --src=./src --dest=./src-migrated --from=1.3

The output of the tool includes code locations in a simple format that will be recognized by most IDEs (e.g. VS Code, Webstorm), so you can click on output lines to migrate the corresponding code manually.

Incremental Mode

The tool offers an incremental mode where it will not actually transform your files, but will only output messages that describe what has to be changed at which location. This allows you to migrate your app iteratively, until no such messages are printed anymore. The messages usually take the following form:

The thing 'oldThing' has been changed to 'newThing' in version <versionNumber>. [additional information here.]
  at <absolute path to file, including line and column numbers>

We recommend running the tool once in non-incremental mode to get the automatic code changes, and afterwards running it in incremental mode to migrate the things that could not be handled automatically.

Messages can also be suppressed by putting a comment with the content @migration-ignore above the line where the message occurs. This is useful if you are sure that the code is already correct.

Command Line Arguments

Required Arguments

-f--fromThe version of yFiles for HTML from which to migrate. Available options: 1.3, 1.4, 2.0, 2.1, 2.2, 2.3, 2.4
-s--srcThe input file/directory to be transformed.
-d--destThe destination directory where all transformed files will be written to.
This has to be empty unless the --incremental or --force options are specified.

Optional Arguments

-i--incrementalRun the migration tool in incremental mode.
-e--extensionsWhich file extensions to transform. Default: .js and .ts
--ignore-patternIgnore files that match the provided glob expression (default: **/node_modules/**).
-l--singlelineWrite log messages in a single line instead of printing the source location to a second line.
-v--verboseLog verbose jscodeshift messages
--forceOverwrite files in the destination directory.
-nc--nocolorDon't colorize the log messages.
--versionShow the version number.
--helpShow help.
-t--transformsWhich transforms to apply.

Logging Debug Messages

The migration tool uses the npm debug module to log debugging information in individual transforms. To enable all debug messages, set the DEBUG environment variable to migrate-yfiles-app:*. This will output all migration tool debug messages. To restrict the debug output to a specific feature/transform, use the corresponding specifier, e.g. DEBUG=migrate-yfiles-app:toEs6Class.

VS Code Problem Matcher

Navigating possible problems detected by the migration tool can be facilitated using a problem matcher in VS Code. The messages are summarized by file in the problems panel, and the corresponding sections are highlighted in the source code:

VS Code Problem Matcher

To enable problem matching in VS Code, add a task with the matcher definition to your .vscode/tasks.json file:

{
  "version": "2.0.0",
  "tasks": [
    {
      "label": "Run yFiles migration tool",
      "type": "shell",
      "command": "migrate-yfiles-app",
      "args": [
        "--src=app-src",
        "--dest=dest/",
        "--from=1.3",
        "--force",
        "--singleline" 
      ],
      "problemMatcher": {
        "fileLocation": ["absolute"],
        "pattern": {
          "regexp": "^(.*?):(\\d+):(\\d+)\\s-\\s(.*)$",
          "file": 1,
          "line": 2,
          "column": 3,
          "message": 4
        }
      },
      "presentation": {
        "clear": true,
        "showReuseMessage": false
      }
    }
  ]
}

FAQs

Last updated on 10 Jul 2023

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc