Setting up The Folder Structure of ObjectScript Code For InterSystems Package Manager
When you prepare your modules for ZPM (InterSystems Package Manager) it expects the certain directory structure for ObjectScript source files.
ObjectScript in your source folder need to be stored by types in the following subfolders. E.g. if you have the source folder named as /src the structure should be as follows:
/cls - for classes
/inc - for include files
/mac - for mac files
/int - for interpretable files
/gbl - for globals
And the ObjectScript should be in CLS (a.k.a UDL) and not in XML.
Ok! But how could you setup it for your current ObjectScript packages? Manually?
There are at least 2 ways to manage this.
1. Use isc-dev module
Import isc-dev module via ZPM as:
Or import the release into the namespace.
Setup the workdir for isc-dev:
USER>Do ##class(dev.code).workdir("/yoursourcedir") USER>Do ##class(dev.code).export()
It will export all the source code in CLS into "/yoursourcedir" folder and will create proper folders structure with file types and packages.
2. Another way to do the proper export is to use VSCode ObjectScript
1. Open the folder with your project where your want to export sources.
2. Create the source folder, .e.g. /src
3. Put the src folder in VSCode settings.json and add
into the settings. E.g. here is the example of settings.json file:
"objectscript.conn.active": true, "objectscript.conn.version": 3, "objectscript.conn.ns": "USER", "objectscript.conn.port": 52773, "objectscript.export.addCategory": true, "objectscript.export.folder": "src"
After that open InterSystems ObjectScript section in VSCode, find the package you want to export or all of them and click Export: