Local Strata Development
Changes made in Strata
When looking to make changes in Strata, or there is a Stratasphere site change that requires a a change update from strata, a local version of the app will be your best tool.
First make sure you're on a feature branch in Playset(Stratasphere). From here we are going to update our composer.json file to point to our Strata branch that contains the new code.
// path example in MacOS
// ...
"repositories": [
{
"type": "path",
"url": "/Users/coolesetengineer/Code/3zsites/packages/strata"
},
{
"type": "composer",
"url": "https://packages.hlx.dev"
}
],
// ...So in the require section of the composer.json file we temporarily change which version of Strata to pull in, but instead of providing a version number we give it the name of the branch in Strata with you changes, and prefix it with dev-xxxxx.
For example if you branch is named my-new-feature it becomes dev-my-new-feature. We also need to tell the rest of the packages that might depend on a certain version of Strata what this branch should be represented as in terms of a version number. Best to use your current Strata version, so if that is 1.0.0 you write it out as as 1.0.0. So the full string would be dev-my-new-feature as 1.0.0.
It's important to NOT use any kind of version constraint marker such as ^ in front of the version number.
Now with that in place, save the file and run composer update [NAMESPACE]/[PACKAGE]. This will link Strata to the new branch and save the changes to the composer.lock file.
You should have two changed file, composer.json and composer.lock, commit and these two files and push them up. This should be all that there's needed for the feature build to be created and a QA link to be posted on the Jira ticket, given that the Playset branch that you just pushed to has has a Jira ticket ID in the name, i.e. feature/play-1/my-new-feature.
If you remove "type": "composer" ... in the JSON, or your strata branch name is not properly typed in composer (such as dev-my-new-feature as 1.0.0), you will return errors when running the composer command.
Linking Strata assets
If you're making any changes to Strata's UI you have two options of actually seeing those changes in your local environment.
You can run
php artisan vendor:publish --tag=strata-ui-assetsevery single time you've made any changes, orYou can symlink the public Strata vendor directory.
First make sure to delete the current directory from
public/vendor/strataSymlink your local Strata public directory to the public Strata vendor directory in Stratasphere.
ln -s /YOUR/PATH/TO/strata/public/ /YOUR/PATH/TO/public/vendor/strata
Last updated
Was this helpful?