It's possible that Export Objects is getting the old file content from the cache. You could try manually deleting everything in the core/cache/ directory before running Export Objects.
More likely, though, is a problem with the file names and/or locations. See the section here on file names (under "Existing Project"):
http://bobsguides.com/mycomponent-tutorial.html.
I think your best bet is to specify the file names in the project config file like this:
'chunks' => array(
'flex-4-header' => array(
'category' => 'flex-4',
'description' => 'Header of the flexibility4 template',
'static' => false,
'source' => 1,
// 'snippet' => file_get_contents('elements/chunks/flex-4-header.html'),
'filename' => 'flex-4-header.html', // this field is stripped out when the transport file is written
),
),
I think you might be able to leave them as static if you do that.
There will be a transport.chunks.php file created automatically by Export Objects, but it will be in the _build/data/flex-4/ directory. You shouldn't have to modify it (and if you do, your changes will be overwritten when you run Export Objects.
How can I have files in my package (css, js, html) and have the package move them to: "media > assets > components > flexibility4"
Try changing this code in build.transport.php:
if ($hasAssets && $i == 1) {
$helper->sendLog(MODX::LOG_LEVEL_INFO,
$modx->lexicon('mc_packaged_assets_files'));
$vehicle->resolve('file', array(
'source' => $sources['source_assets'],
'target' => "return MODX_ASSETS_PATH . 'components/';",
));
}
to something like this:
if ($hasAssets && $i == 1) {
$helper->sendLog(MODX::LOG_LEVEL_INFO,
$modx->lexicon('mc_packaged_assets_files'));
$vehicle->resolve('file', array(
'source' => $sources['source_assets'],
'target' => "return MODX_BASE_PATH . 'media/assets/components/flexibility4/';",
));
}
Once the build.transport.php file exists, MyComponent won't ever modify it. This is the only change I'd recommend making to it, though.