Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

You can create libraries which are then re-usable from any other Iguana X component.

Expand
titleStep 1: Add a component using green [+COMPONENT] buttonStart with a component which you have edit rights for and has a remote setup already.

If you need a reminder Create a Component

Expand
titleStep 2: Make sure it has an upstream repo
Expand
titleStep 3: Create a directory FOO

Click on the

Create Folder iconImage Removed
  • Enter the folder name and click and click the green [CREATE] button

    Image Removed
  • You should see something like this:

    Image Removed
  • new folder icon and name the folder FOO.

    Image Added

  • Select the Create File menu optin on the FOO folder

    Image Removed
  • Enter the folder name and click and click the green [CREATE] button

    Image Removed
  • Create a function in the BAR.lua file, you can paste this example
    Expand
    titleStep 43: Create a file BARFOObar.lua in the FOO directory and add a function
    FOObar

    Start here:

    Image Added

    In 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
  • Click the Commit changes toolbar button

    Image Removed
  • The commit dialogue will open, enter a commit message and click the green [COMMIT] button

  • Click the Push changes to remote toolbar button

    Image Removed
  • The upstream repository will look something like this:
    NOTE: FOO is currently just a folder

    Image Removed

    Expand
    titleStep 5: Commit the changes and push them to the upstream repo
    Expand
    titleStep 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 Removed
    • Click 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

      • Enter the name (also called a slug) for the repository

        • To create a new repository enter a repo name (slug) that does not exist yet

        • Click the [CONFIRM CHANGE] button to connect or create

    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 useful.

    4: Invoke Create Library from the FOO folder ellipsis menu:
    Image Added

    Click CREATE

    Expand
    titleStep 7: 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 button

    • The commit dialogue will open, enter a commit message and click the green [COMMIT] button

    • Click 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 Removed
    • The FOO library upstream repository will look something like this:
      NOTE: That the the FOO library should have the BAR.lua file in it.

      Image Removed
    5: Fill out the repository management screen to determine what remote git repository to put the library code in:
    Image Added

    Expand
    titleStep 8: Now import 6: Commit and push the FOO library into another component using the FOO library URL
    • Get the FOO library URL

      • Choose View Remote menu option for the FOO library

      • Right click on the URL to copy URL

    • Edit the target component in the Translator

      • This is the component you will add the FOO library into

    • Click the Add library button to open the Import Library dialogue

      Image Removed
    • Enter 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.mov

    changes

    You can also add your libraries to a collection so they will show up in the Import Library dialogue list.

  • Choose the Add to Collection option from the right click menu

  • Choose an existing collection or create a new collection in the Add to collection dialogue

    • If you choose an existing collection your library will immediately show in the Import Library list

    • If you create a new collection you will need to add it to Settings → Git Collection

  • In this example I will choose an existing collection Test Lib collection

    Image Removed
  • This will open the Edit Collection dialogue for the chosen collection

    • Here I can edit the details for libraries in this collection

    • In this case I will just update the description for FOO

    • Click the green [SAVE] button to add the new library

      Image Removed
  • Now when I open the Add Library dialogue and filter for FOO it is there in the list

    Image Removed
    Expand
    titleStep 97: Optionally add the FOO library to a collection
    After this the code will be in the remote git repository you configured it to be in