We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 20093
    • 81 Posts
    This is a question for Bruno. I was wondering if the absence of a '_build' folder in the github repo is deliberate. There was never a _build folder before the recent (accidental?) blox pull. Now it's in the .gitignore file.

    I would like to be able to package up nightlies from the git repo if possible. It would also be nice to be able to contribute back to the actual build process for the package. For example, none of the MIGX snippets have any default properties defined, so it's not possible to drag them to a (supported) RTE and customize the snippet call configuration through the resulting pop-up.

    Or maybe you have a different process for creating the MIGX package?

    This question has been answered by Bruno17. See the first response.

    • discuss.answer
      • 4172
      • 5,888 Posts
      The build-folder was accidental there.

      My build-process was just using packman to pack it together.
      For future versions I think I will use myComponent and the myComponentMigxUI to put the pieces together.

      Also, there are missing some files on github.
      Will try to upload the missing files and a new transport-package, at least to github, soon.
        -------------------------------

        you can buy me a beer, if you like MIGX

        http://webcmsolutions.de/migx.html

        Thanks!
        • 20093
        • 81 Posts
        That would be great, Bruno! I am definitely having some odd behaviours in the manager with 2.3.2, 2.3.3-beta3 and the nightly which I suspect may have something to do with something not updating correctly between versions and, in the case of the nightly, possibly a missing file (/core/components/migx/processors/mgr/default/collectmigxitems.php).

        I was able to make the problem go away in one situation, but wasn't able to reproduce the fix. As it's a bit unpredictable I haven't filed a bug, but having some kind of package config would definitely help to ensure the package is being installed correctly on my end so I can be sure I am giving reliable bug reports.

        Thanks again.
          • 4172
          • 5,888 Posts
          did some new commits and uploaded the latest packages.
          This 2.4.x packages are the first ones created by myComponent and myComponentMigxUI after using packman for all the migx-packages created before.
          Hope they will work. Installations should now also create the MIGX-menue.
            -------------------------------

            you can buy me a beer, if you like MIGX

            http://webcmsolutions.de/migx.html

            Thanks!
            • 20093
            • 81 Posts
            That's fantastic. Thanks so much! It appears to fix the issues I was having.

            Eventually, I would like to see the build config in git somehow so we can make contributions back. I am going to familiarize myself with myComponent and myComponentMigxUI to see if they'll support that. Does myComponentMigxUI require myComponent 3.0? If so, is it using the dev branch?
              • 3749
              • 24,544 Posts
              I won't swear to it, but I think the current version of MyComponent would work. I'm fairly certain that I haven't done anything that would affect Bruno's stuff since he started on it. You do need MyComponent > 3.0, though. Earlier versions are missing key parts of the process.

              As for making contributions back, that doesn't really have much to do with what tools you use. It's all Git. You just use the GitHub UI to fork the project, clone it on your local machine, make your changes, push the changes to your fork, and issue a pull request with the GitHub UI (all of which probably sounds like gibberish if you're not used to Git).

              There's an extensive section in my book on how to do this with the MODX project, but the steps are the same for contributing to any project. http://amzn.to/Qfsl1Z
                Did I help you? Buy me a beer
                Get my Book: MODX:The Official Guide
                MODX info for everyone: http://bobsguides.com/modx.html
                My MODX Extras
                Bob's Guides is now hosted at A2 MODX Hosting
                • 20093
                • 81 Posts
                Thanks Bob. Actually my concern about being able to contribute back lies more with my lack of understanding about the packaging process than with git. wink

                To familiarize myself with the packaging process I installed MyComponent 3.0.7-pl and played around. I cloned the dev branch of mycomponent into the assets/mycomponents/mycomponent2 folder and was able to successfully build the package, although it yielded 3.0.6. I am guessing that the changes in 3.0.7 haven't been pushed to GitHub yet.

                Can you confirm what the correct workflow should be for using mycomponent with a git project, or any project originating from an external source? Looks to me like:

                1. Clone project repo to a local folder
                2. Identify package name for project and create a new project in mycomponent matching the package name
                3. If project has a _build folder containing config/<packagename>.config.php, copy that file into core/components/mycomponent/_build/config overwriting the one created by mycomponent, otherwise modify the existing <packagename>.config.php created by mycomponent
                4. Move the local repo folder to the targetRoot path in the config file
                5. Create a folder matching that name in assets/mycomponents
                6. Bootstrap project
                7. Perform initial build
                8. Install resulting package
                9. Do your dev and testing, not touching the contents of the mycomponents folder
                10. Perform build
                11. Commit and push changes, sending pull requests as necessary.

                If that sounds about right then shouldn't component developers include the _build folder in the interest of maintaining package integrity?

                BTW, I'd be happy to buy a copy of your book, but I'm afraid I am waiting for the non-dead-tree version I can just throw on my iPad. Any word on that yet? smiley
                  • 3749
                  • 24,544 Posts
                  Generally speaking, MyComponent is for creating and maintaining extras of your own, not other peoples' extras. I hope I didn't mislead you on that in my comment above.

                  If I were going to contribute to someone else's extra, I would not use MyComponent at all unless the project was built with MC -- and maybe not even then. For one thing, MyComponent has fairly rigid rules about where things go and how they are named, so you'd have likely to modify the other person's extra for that. MyComponent would also replace the person's build.transport.php, create a new project config file, and create new resolvers they've never seen before. They'd get those changes when you pushed to GitHub, and though you might be doing them a favor by making the project compatible with MyComponent, they might not see it that way. wink

                  If you're thinking about contributing to MyComponent itself, I have to warn you that it's a complete nightmare to work on. It's very straightforward to use it on another project that's built in another directory, but it's unsafe to run it directly on itself during development (hence the mycomponent2 directory), so I have a development copy, a build copy, an installed copy for testing it as installed, and to be sure everything works, another installed copy in another install of MODX that doesn't have the first three copies. In addition, there is a fifth copy of much of it in the MODX database and a sixth copy in the database in the other MODX install. It's almost impossible to keep all these straight and there are subtle differences between the various copies that make you nuts or make you think you're going nuts. For example, in the installable version, the current project is set to 'Example' but when developing, it has to be set to 'MyComponent' and I live in fear of releasing a version with it set to 'MyComponent.'

                  Back to your question: There are a number of ways to work on a component. For simple bug fixes, what I usually do is just

                  Install the package in Package Manager
                  Fix the bug

                  If it's a really simple fix, I just paste the change in a note in the issues section at GitHub.

                  If not, I fork and clone the person's GitHub repo, copy the fixed files over their files, commit, push the changed version to my fork, and issue a pull request asking them to pull the commit(s) from my fork.

                  For more extensive work, I would fork and clone their repo, build and install (or install from Package Manager if there's no _build directory).

                  Then, I would make the elements static (pointing to the files in my cloned repo), do the work, commit, push the changes to my fork and issue a pull request as before. If they have any development System Settings to set paths to development directories, I create them (look at any include or require statements).


                  Yes, repos should definitely include the _build directory. Some people have their database credentials in that directory, but those should go in a build.config.php file. The buld.config.php file should be in .gitignore, but not the whole _build directory.

                    Did I help you? Buy me a beer
                    Get my Book: MODX:The Official Guide
                    MODX info for everyone: http://bobsguides.com/modx.html
                    My MODX Extras
                    Bob's Guides is now hosted at A2 MODX Hosting