...
You can create libraries which are then re-usable from any other Iguana X component.
Expand |
---|
title | Step STEP 1: Add a component using green [+ COMPONENT] button |
---|
| Create a Component
Include Page |
---|
Create a Component | Create Start with a component which you have edit rights for and has a remote setup already. |
|
If you need a reminder see Edit a Component |
Expand |
---|
title | Step 2: Make sure it has an upstream repo |
---|
| Set an upstream repository & Set upstream Git repo
Include Page |
---|
Set an upstream repository | Set an upstream repository |
Expand |
---|
title | Step 3: STEP 2: Create a directory FOO |
---|
|
Click on the Create Folder iconImage RemovedEnter the folder name and click and click the green [CREATE] button Image RemovedYou should see something like this: Image Removednew folder icon and name the folder FOO. Image Added |
Expand |
---|
title | Step 4STEP 3: Create a file BARFOObar.lua in the FOO directory and add a function |
---|
| Select the Create File menu optin on the FOO folder
Image RemovedEnter the folder name and click and click the green [CREATE] button
Image RemovedCreate a function in the BAR.lua file, you can paste this example |
Start here: Image AddedIn the context menu that comes up select Create File and create a FOObar.lua file with this content: Code Block |
---|
function FOObar()
return "The world needs more FOO";
end |
You should see something like this: Image Removed |
Expand |
---|
title | Step 5: Commit the changes and push them to the upstream repo |
---|
| Click the Commit changes toolbar button
Image RemovedThe commit dialogue will open, enter a commit message and click the green [COMMIT] button
Click the Push changes to remote toolbar button
Image RemovedThe upstream repository will look something like this:
NOTE: FOO is currently just a folder
Image Removed
Expand |
---|
title | Step 6: Convert FOO to a library by right clicking on it and choosing the "Create Library" menu option |
---|
|
Open the folder menu by right clicking on FOO, or clicking the 3 dot menu
Choose Create Library to convert the FOO folder into a Library
Image RemovedClick the green [CREATE] button in the confirmation dialogue
This will bring you to the Repository Management dialogue
Once you are in the Repository Management screen you can set your upstream repository
Note |
It is possible to connect to an existing repository in the Repository Management dialogue – but we strongly recommend against this as there a few, if any, scenarios where this would be usefulSTEP 4: Invoke Create Library from the FOO folder ellipsis menu: |
|
Image Added Click CREATE |
Expand |
---|
title | STEP 5: Fill out the repository management screen to determine what remote git repository to put the library code in: |
---|
|
See Repository Management Screen if you need a refresher about this. |
Expand |
---|
title | Step 7STEP 6: Commit and push the FOO library changes |
---|
|
See Step 5 for detailed screenshots (the first three steps below are the same) Click the Commit changes toolbar buttonThe commit dialogue will open, enter a commit message and click the green [COMMIT] buttonClick the Push changes to remote toolbar button The component upstream repository will look something like this: NOTE: Notice that FOO was converted from a folder (in step 3) to a reference to the FOO library Image RemovedThe FOO library upstream repository will look something like this: NOTE: That the the FOO library should have the BAR.lua file in it. Image RemovedPush Changes to Git |
Expand |
---|
title | Step 8: Now import the FOO library into another component using the FOO library URL |
---|
| Get the FOO library URL
Edit the target component in the Translator
Click the Add library button to open the Import Library dialogue
Image RemovedEnter the FOO library details in the LIBRARY DETAILS section of the Import Library dialogue
Type in the library name FOO
Paste the URL you copied above into the GIT url field
Click the green [IMPORT] button to import the library
Image RemovedScreen Recording 2023-11-10 at 18.46.24.movSTEP 7: After this the code will be in the remote git repository you configured it to be in |
|
You should able to go to the Repository Management Screen and from there navigate to the remote repository to see your changes. |