New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@vcmap/plugin-cli

Package Overview
Dependencies
Maintainers
2
Versions
57
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@vcmap/plugin-cli

A CLI to help develop and build plugins for the virtualcityMAP

Source
npmnpm
Version
1.0.1
Version published
Weekly downloads
30
-65.12%
Maintainers
2
Weekly downloads
 
Created
Source

@vcmplugin/plugin-cli

The vcmplugin cli helps develop and build plugins for the vcMAP.

For more information on plugin development refer to map plugin examples, which provides documentations and a tutorial on plugin development.

Features

  • Creating basic plugin structure
  • Providing plugin development server
  • Building plugins for production

Prerequisite

You need nodejs and npm installed on your system to use this tool.

Installation

To install in your project:

npm i -D @vcmap/plugin-cli

To install globally:

npm i -g @vcmap/plugin-cli

Usage

1. Creating a new plugin

To create a new plugin template, run the following within your projects root:

vcmplugin create

This will open a command prompt helping you to create the basic structure of a plugin.

2. Serving a plugin for development

To serve your project, run the following within your projects root:

vcmplugin serve --vcm <url|directory>

This will launch a dev server at localhost:8080 using the specified VC MAP application as its base. You can either specify a directory or a URL to an application.

# using a directory
vcmplugin serve --vcm /home/vcs/virtualcityMAP
# using a URL
vcmplugin serve --vcm https://berlin.virtualcitymap.de

3. Building a plugin

To build your project, run the following from within your projects root:

vcmplugin build

4. Integrating a plugin in a productive VC MAP

To pack your project for productive use, run the following from within your projects root:

vcmplugin pack

This will create a folder dist with a zip file containing your bundled code and assets. To use the plugin productively in a hosted map, unzip this file on your server to {vcm-root}/plugins and add an entry to your VC MAP config plugins section.

Non-Global CLI & npm run

If you only use the vcmplugin-cli as a package dependency, you must add the above scripts to the package.json and use npm run to execute:

{
  "name": "plugin-name",
  "main": "src/index.js",
  "scripts": {
    "build": "vcmplugin build",
    "serve": "vcmplugin serve --vcm ./vcm"
  },
  "devDependencies": {
    "vcmplugin-cli": "^0.1.1"
  }
}

Considerations

The legacy case was not as strict regarding the projects package.json. This approach relies more heavily on a) the precense of a package.json and b) the validity of said package.json. For instance the plugin name is directly derived from the name field in the package.json as is the entry point from main. You can still provide name as a CLI argument and src/index.js is still used, if main is missing from the package.json. This is do to change.

FAQs

Package last updated on 21 Jun 2021

Did you know?

Socket

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