loupeteam / LPM

Loupe Package Manager provides a command line interface for installing packages in Automation Studio and Loupe UX-based projects
Other
1 stars 1 forks source link

Documentation missing for few fields #38

Closed marius-dgmd closed 1 month ago

marius-dgmd commented 1 month ago

Hi Loupe team,

We have looked through the LPM code and tried it out and we have several questions that we couldn't find in the documentation and is not clear in the code as well:

  1. Once a project is initialized with lpm init one can see in package.json this 'deploymentConfigs.StarterConfig" - what does this do?
  2. There are several types of packages in the code - library packages, folder packages, project packages, HMI packages - is there somewhere we can find explanation on what the difference is? How are they created?
AndrewMusser commented 1 month ago

Hi @marius-dgmd, good questions! Here are some answers, and you're right that documentation is lacking here:

  1. The deploymentConfigs field in the package.json file is used to tell LPM which Automation Studio configuration newly added packages should be deployed to (i.e. to the cpu.sw file). If this field is missing or empty, LPM will simply add package content to the Logical View, without deploying to any cpu.sw file. If there are one or more strings in this field, LPM also deploys the contents to those configurations. Note that LPM prompts you to choose which configuration to deploy to when you call init. You can also edit this setting in the package.json directly at any time, for instance:
    "lpmConfig": {
    "deploymentConfigs": [
      "APC3100Cfg",
      "X20Cfg"
    ]
    }
  2. We have some documentation here that explains the differences between package types. They are all created the same way (i.e. calling lpm init in a new folder, and then adding the content that you want). Then you need to edit the package.json to include the following field:
    "lpm": {
    "type": "program" | "library" | "project"
    }

    LPM reads this field when it installs a published package, and based on the package type it decides what it should do. For example: if the package type is "library", then LPM decides to place the contents in the "Libraries" folder in the Logical View.

Joshpolansky commented 1 month ago

To add a few more details,

Project and HMI Packages are meant to be "Templates" in that they are starts to new projects of that type. These may replace items.

For example, if you do an

lpm install starterasproject

the package.json should not include startasproject as a depencency, and instead the enture file gets replaced with the package.json that is in the package.

The folder packages are Automation studio folder packages and contain information about where to put the package in the logical view and how to deploy the individual objects.

marius-dgmd commented 1 month ago

Thank you for the quick response.