|
4 | 4 |
|
5 | 5 | [](LICENSE) |
6 | 6 | # intersystems-iris-dev-template |
7 | | -This is a basic template of a dev environment to edit, make a package module, compile, debug, test, commit/push the objectscript code with InterSystems IRIS. |
| 7 | +This is a basic template for a development environment to work with ObjectScript in InterSystems IRIS. It helps you edit, compile, commit/push, debug and test your ObjectScript code. It also aids in packaging your application as a module installable with ZPM. |
8 | 8 |
|
9 | 9 | ## Description |
10 | | -The idea of the repository is to provide a read-to-go dev environment if one needs to code InterSystems ObjectScript. |
11 | | -* The template runs InterSystems IRIS Community Edition running in a docker container |
12 | | -* It creates a fresh new namespace and database IRISAPP |
13 | | -* It loads the ObjectScript code into IRISAPP database using Package Manager |
14 | | -* It suggests development with 'Package First' paradigm. Watch the video](https://www.youtube.com/watch?v=havPyPbUj1I) |
15 | | -* Provides unittests environment: sample unittests, tests module enablement |
| 10 | +This repository provides a read-to-go development environment for coding productively with InterSystems ObjectScript. This template: |
| 11 | +* Runs InterSystems IRIS Community Edition in a docker container |
| 12 | +* Creates a new namespace and database IRISAPP |
| 13 | +* Loads the ObjectScript code into IRISAPP database using Package Manager |
| 14 | +* Promotes development with the 'Package First' paradigm. [Watch the video](https://www.youtube.com/watch?v=havPyPbUj1I) |
| 15 | +* Provides a unit testing environment: sample unit tests, tests module enablement |
16 | 16 |
|
17 | 17 | ## Usage |
18 | | -start a new dev repository with InterSystems IRIS using this one as a template. |
19 | | -Once you clone the new repo on your laptop and open the VSCode with installed InterSystems Pack you'll be able to start development immediately |
| 18 | +Start a new dev repository with InterSystems IRIS using this one as a template. |
| 19 | +Once you clone the new repo to your laptop and open VSCode (with the [InterSystems ObjectScript Extension Pack](https://marketplace.visualstudio.com/items?itemName=intersystems-community.objectscript-pack) installed) you'll be able to start development immediately. |
20 | 20 |
|
21 | 21 | ## Prerequisites |
22 | 22 | Make sure you have [git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git) and [Docker desktop](https://www.docker.com/products/docker-desktop) installed. |
@@ -74,21 +74,21 @@ IRISAPP>write ##class(dc.sample.PersistentClass).ReadProperty(id) |
74 | 74 | Test string |
75 | 75 | ``` |
76 | 76 |
|
77 | | - |
78 | 77 | ## How to start the development |
79 | 78 | This repository is ready to code in VSCode with ObjectScript plugin. |
80 | | -Install [VSCode](https://code.visualstudio.com/), [Docker](https://marketplace.visualstudio.com/items?itemName=ms-azuretools.vscode-docker) and [ObjectScript](https://marketplace.visualstudio.com/items?itemName=daimor.vscode-objectscript) plugin and open the folder in VSCode. |
| 79 | +Install [VSCode](https://code.visualstudio.com/), [Docker](https://marketplace.visualstudio.com/items?itemName=ms-azuretools.vscode-docker) and the [InterSystems ObjectScript Extension Pack](https://marketplace.visualstudio.com/items?itemName=intersystems-community.objectscript-pack) plugin and open the folder in VSCode. |
81 | 80 | Open /src/cls/PackageSample/ObjectScript.cls class and try to make changes - it will be compiled in running IRIS docker container. |
82 | 81 |  |
83 | 82 |
|
84 | | -Feel free to delete PackageSample folder and place your ObjectScript classes in a form |
| 83 | +Feel free to delete PackageSample folder and place your ObjectScript classes in the form |
85 | 84 | /src/organisation/package/Classname.cls |
86 | 85 | [Read more about folder setup for InterSystems ObjectScript](https://community.intersystems.com/post/simplified-objectscript-source-folder-structure-package-manager) |
87 | 86 | and her on the [naming convention]() |
88 | 87 |
|
89 | | -## running unittests |
90 | | -The template contains to test classes: TestObjectScript.cls and TestPersistentClass.cls |
91 | | -To run the unittests we can use Package Manager environment. |
| 88 | +## Running unit tests |
| 89 | +The template contains to test classes: `TestObjectScript.cls` and `TestPersistentClass.cls ` |
| 90 | +To run the unit tests we can use Package Manager environment. |
| 91 | + |
92 | 92 | ``` |
93 | 93 | IRISAPP>zpm |
94 | 94 |
|
@@ -135,55 +135,63 @@ All PASSED |
135 | 135 | [dc-sample-template] Test SUCCESS |
136 | 136 | zpm:IRISAPP> |
137 | 137 | ``` |
| 138 | + |
138 | 139 | In case of test errors you can check it back in the UnitTest portal, that can be easily opened via ObjectScript menu in VSCode: |
139 | 140 |  |
140 | 141 |
|
141 | 142 | ## What else is inside the repository |
142 | 143 |
|
143 | 144 | ### .github folder |
144 | | -it contains to github actions workflows: |
145 | | -1. github-registry.yml |
| 145 | + |
| 146 | +Contains two GitHub actions workflows: |
| 147 | +1. `github-registry.yml` |
146 | 148 | Once changes pushed to the repo, the action builds the docker image on Github side and pushes the image to Github registry that can be very convenient to further cloud deployement, e.g. kubernetes. |
147 | | -2. objectscript-qaulity.yml |
| 149 | +2. `objectscript-qaulity.yml` |
148 | 150 | with every push to master or main branch the workflow launches the repo test on objectscript issues with Objectscript Quality tool, [see the examples](https://community.objectscriptquality.com/projects?sort=-analysis_date). This works if the repo is open-source only. |
149 | 151 |
|
150 | 152 | Both workflows are repo agnostic: so they work with any repository where they exist. |
151 | 153 |
|
152 | 154 | ### .vscode folder |
153 | | -it contains to files to setup vscode environment: |
| 155 | +Contains two files to setup vscode environment: |
| 156 | + |
154 | 157 | #### .vscode/settings.json |
155 | 158 |
|
156 | | -Settings file to let you immedietly code in VSCode with [VSCode ObjectScript plugin](https://marketplace.visualstudio.com/items?itemName=daimor.vscode-objectscript)) |
| 159 | +Settings file to let you immediately code in VSCode with [VSCode ObjectScript plugin](https://marketplace.visualstudio.com/items?itemName=daimor.vscode-objectscript)) |
157 | 160 |
|
158 | 161 | #### .vscode/launch.json |
159 | | -Config file if you want to debug with VSCode ObjectScript |
160 | 162 |
|
| 163 | +Config file if you want to debug with VSCode ObjectScript |
161 | 164 |
|
162 | 165 | ### src folder |
163 | | -contains source files. |
| 166 | + |
| 167 | +Contains source files. |
164 | 168 | src/iris contains InterSystems IRIS Objectscript code |
165 | 169 |
|
166 | 170 | ### tests folder |
167 | | -contains unittests for the ObjectScript classes |
| 171 | +Contains unit tests for the ObjectScript classes |
168 | 172 |
|
169 | 173 | ### dev.md |
170 | | -contains a set of useful commands that will help during the development |
| 174 | + |
| 175 | +Contains a set of useful commands that will help during the development |
171 | 176 |
|
172 | 177 | ### docker-compose.yml |
173 | | -a docker engine helper file to manage images building and rule ports mapping an the host to container folders(volumes) mapping |
| 178 | + |
| 179 | +A docker engine helper file to manage images building and rule ports mapping an the host to container folders(volumes) mapping |
| 180 | + |
174 | 181 | ### Dockerfile |
175 | 182 |
|
176 | 183 | The simplest dockerfile which starts IRIS and imports code from /src folder into it. |
177 | 184 | Use the related docker-compose.yml to easily setup additional parametes like port number and where you map keys and host folders. |
178 | 185 |
|
179 | 186 |
|
180 | 187 | ### iris.script |
181 | | -contains objectscript commands that are feeded to iris during the image building |
| 188 | + |
| 189 | +Contains objectscript commands that are feeded to iris during the image building |
182 | 190 |
|
183 | 191 | ### module.xml |
| 192 | + |
184 | 193 | IPM Module's description of the code in the repository. |
185 | 194 | It describes what is loaded with the method, how it is being tested and what apps neeed to be created, what files need to be copied. |
186 | 195 |
|
187 | | - |
188 | 196 | [Read about all the files in this artilce](https://community.intersystems.com/post/dockerfile-and-friends-or-how-run-and-collaborate-objectscript-projects-intersystems-iris) |
189 | 197 |
|
0 commit comments