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.

In this example, we are building a feature called, "my new feature" (my-new-feature). We are also assuming you have your strata repo in a chain listed as,Code/3zsites/packages/

composer.json
// 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.

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.

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.

  1. You can run php artisan vendor:publish --tag=strata-ui-assets every single time you've made any changes, or

  2. You can symlink the public Strata vendor directory.

    1. First make sure to delete the current directory from public/vendor/strata

    2. Symlink 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?