The first thing needed is to set up two site collections - one for design, and one for development. The design site is where changes are made via SPD and the UI, and the dev site is where the WSP is deployed.
To illustrate a simple example, I'll create a new publishing layout page in the design site based on the Welcome Page content type.
The new page has now been added to the master page gallery as seen in SPD.
I'll add some markup, web part zones, and content placeholders to the page, and save it.
When I create a page in the SharePoint UI, the new page template is now available.
As shown in the UI:
In my Visual Studio project, which is based on STSDev, I'll add a new Feature (STSDev, WSP Builder, and WSPProjectTemplate all have been tested and work)
Now I'll add a new file named PublishingPages.spsource to the feature.
This file is nothing more than a stripped-down version of the file provisioning module that was needed before. I just set the Url of the list where the source file is, and add a File element for each file I want to bring down.
To execute SPSource, I have a CMD file at the root of my project that passes one parameter to the executable, the url of the design site.
Once executed, the both the file provisioning module and the files themselves will be located in the Feature folder. Sub-folders are possible, and multiple spsource files are allowed per folder. The source SharePoint files will be added to the same folder as
the spsource file, and the file provisioning module will be placed at the root of the feature.
You can see that the file provisioning module contains the properties set in the document library.
And the source of the ASPX page is the same as what was created in SharePoint designer.
Next, I add the ElementManifest and ElementFile lines to the Feaure.xml file called CustomPublishingPages (only files at the Feature root are needed for WSPProjectTemplate)
When I deploy the WSP and activate the Feature, the new page layout is now available!