Coder Social home page Coder Social logo

zengine-migrator's Introduction

Zengine Migrator

Set up your Zengine plugin for version 2 migration

Install

npm i -g ZengineHQ/zengine-migrator

Usage

Usage: zmig [options]

CLI for transforming legacy Zengine plugins into version 2 compatible repositories

Migrate an existing repository from any frontend directory, or

Starting in an empty directory, build a full repository from scratch by passing an ID and token

Options:
  -b --branch <branch>    specify a branch of the legacy wrapper repo (default: "#master")
  -u --user <user>        specify the github user for the legacy wrapper repo (default: "ZengineHQ/")
  -i --id <id>            specify the id of plugin code to fetch from Zengine API
  -t --token <token>      specify the access token for fetching plugin code
  -d --dirname <dirname>  specify the name of your frontend code directory (fetched code will be saved at ./plugins/<dirname>/src)
  -h, --help              output usage information

Examples

Existing Repository

(assumes mayan directory structure)

cd ./plugins/my-cool-plugin # root directory of your FRONTEND source code (probably not repo top level)
zmig # run the command!

zmig --branch my-test-branch --user myuser # clones myuser/legacy-plugin-wrapper#my-test-branch
zmig -b my-test-branch -u myuser # alias!

Migrating into a new directory (uncommon)

mkdir new-plugin-repo
cd new-plugin-repo
zmig # run the command!
cp -r ~/path/to/old-directory/ ./src # copy your legacy code into the dedicated src folder

Fetching Code from Zengine API

Useful/necessary if you don't have your plugin code in a version-controlled repository already

Obtain the plugin ID and your access token in the Zengine developer tools

zmig --id 123 --token abc456
# using these arguments will first grab your files from the Zengine API
# and scaffold a full mayan-based project before migrating your code

# Now we can use mayan to develop/deploy

# be sure to install dependencies in the right directory
cd plugins/name-of-frontend-dir
npm i
cd ../..

mayan watch --frontend # "live" development server started up with HMR!
mayan deploy --frontend # pushes a draft version to Zengine servers
mayan publish --frontend --yes # builds and publishes your Zengine plugin

zengine-migrator's People

Contributors

tehpsalmist avatar dependabot[bot] avatar jscarton avatar

Watchers

Ted Kulp avatar Anthony Putignano avatar James Cloos avatar David McNelis avatar A Park(s) avatar  avatar  avatar Joe avatar

Forkers

alexweber

zengine-migrator's Issues

Import core-js/stable in wrapper.js breaks migrated plugin

After migrating a v1 plugin to v2, the import statement in plugins/{plugin-name}/wrapper/lib/wrapper.js, import core-js/stable, breaks the plugin. The current workaround is to replace import core-js/stable with import @babel/polyfill.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.