Quote from: cipa at Feb 17, 2011, 08:12 AM
To BobRay: What are the main differences between PackMan and MyComponent
PackMan is a quick way to package up existing components that are already installed on a MODx site. It’s great for simple snippets, templates, and plugins, but for more complex packages, you run into its limitations. All your resources and elements are in the DB so you have to edit them in the Manager (or cut and paste them from a code editor) and there’s no way to put them up at GitHub as files or use version control on them. It doesn’t do resources or custom manager pages and there’s no way to create or set system settings or set properties based on the user’s environment. At present, it doesn’t include changelogs and there’s no way to interact with the user during the install or run validators before the install or resolvers afterwards. You also can’t control what happens when a user upgrades or uninstalls the component. It’s also cumbersome to internationalize the component with language strings for messages and for property descriptions, though it can be done. So it limits the ways you can improve your add-on, and if the add-on changes over time, it can make it difficult to work on it.
As an example, the SPForm install asks the user for their email address and lets them determine if they want the contact resource installed or not. The latest version moves the banlist from a file to a chunk, and for users who are upgrading, it backs up their banlist file, copies its contents to the chunk, and deletes the banlist file. During the install, SPForm properties are set for the email and for the IDs of the newly created Contact and Thank You pages. For another example, the Captcha package install checks for the necessary GD and FreeType functions and aborts the install with a message to the user if they’re not there. None of that could be done with PackMan.
MyComponent is a monster package with over 70 files that has examples of almost everything you might want to do in a build script. As installed, its build script will create a full transport package that creates snippets, chunks, resources, plugins, plugin events, template variables, templates, resources, system settings, properties, other packages, etc. -- all with appropriate language strings -- and it copies files to both the core/components/mycomponent and assets/components/mycomponent directories. It connects the plugin events to their plugins and the template variables to their templates. It also includes readme.txt, changelog.txt, and license.text files in the package and includes a readme.md file for GitHub.
Best of all, it’s designed so that you can plug your own code in in the existing files, rename them, set variables to exclude the stuff you don’t need, do some global search-and-replace operations, and build your own package.
None of this is meant to discredit PackMan, which is a really impressive add-on that allows people, even those with limited skills, to create transport packages for Revolution.