tehpsalmist / parcel-plugin-zengine-js-migrator

For use in Zengine Migration Wrapper

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

parcel-plugin-zengine-js-migrator

Parcel plugin that interpolates v1 plugin JS into v2 JS file

Also see: parcel-plugin-zengine-html-migrator parcel-plugin-zengine-css-migrator

Installation

npm i -d parcel-plugin-zengine-js-migrator

Attention: parcel-bundler has to be installed

Usage

  1. Add this multi-line-style comment: /* PLUGIN_JS */ to your src/plugin.js (probably at the bottom of that file).
  2. Ensure all of your plugin's JS lives in v1-output/plugin.js
  3. Run parcel normally

Example

src/plugin.js

import { plugin } from './wrapper.js'

/* PLUGIN_JS */

run it
parcel index.html

output

import { plugin } from './wrapper.js'

plugin.controller('myController', ['$scope', 'myService', function ($scope, srv) {
  // awesome plugin code
}])

// ...lots more great code...

plugin.register('myCoolPlugin', {
  route: '/my-cool-plugin',
  title: 'Useless Title',
  icon: 'icon-puzzle',
  interfaces: [{
    controller: 'myController',
    template: 'my-template',
    type: 'fullPage',
    order: 300,
    topNav: true,
    routes: ['/:page']
  }]
})

About

For use in Zengine Migration Wrapper

License:MIT License


Languages

Language:JavaScript 100.0%