0

Hi I am using Sitecore jss with sitecore first approach. My sample solution is under here sitecore.first-jss-helix.git.

Currently i am maintaining in repository all my sitecore related content items as sitecore package like here Package-folder But i need a standard way like Unicorn or TDS.

My question below,

  1. Can we use unicorn for jss , since its using dlls and config files? If possible please guide.

  2. Do we have any option in jss-cli or some other approach to convert all my sitecore items(template, media layout , rendering place holders) to yml files as its in sample applications. If it converts then i will maintain it in repository like that and other users can deploy sitecore items using jss-cli cmd(jss deploy app -c -d) to thier local machine.

  3. Hope TDS is possible but i need to have solution in separate , since its a .net base template project.

0

Yes sure, you can use Unicorn or TDS with JSS. Nothing special. just as normal create a Visual studio solution, project. And configer Unicorn.

When you use Unicorn you can do a Sync to (reg)enerate all yml files. See the Automated Deployment section of the Unicorn documentation for all the scripted options you have: https://github.com/SitecoreUnicorn/Unicorn basically call the /unicorn.aspx with the correct parameters

0

Thanks @Jan.

I had implemented using unicorn like below(Url for implementation),

Since we are using Java script solution for sitecore jss we cant have unicorn solution here. So i have included one more folder under repository and created new C# project called serialization.

enter image description here

Then i installed unicorn nuget packages into the respective solution.

Then i had introduce my custom unicorn config like below,

<?xml version="1.0"?>
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
  <sitecore>
    <sc.variable name="JssUnicornSerializeRootFolder" value="D:\Aga\Git New\JssReactWeb\src" />
    <unicorn>
      <configurations>
        <!--Feature layer-->
        <configuration name="JSS.Feature">
          <targetDataStore physicalRootPath="$(JssUnicornSerializeRootFolder)\Feature\Serialization" />
          <predicate type="Unicorn.Predicates.SerializationPresetPredicate, Unicorn" singleInstance="true">
            <!--Templates-->
            <include name="Template-Feature" database="master" path="/sitecore/templates/Feature" />
            <!--Media-->
            <include name="Media" database="master" path="/sitecore/media library/Feature" />
            <!--Rendering-->
            <include name="Rendering" database="master" path="/sitecore/layout/Renderings/Feature" />
          </predicate>
        </configuration>

        <!--Foundation layer-->
        <!--<configuration name="JSS.Foundation">
          <targetDataStore physicalRootPath="$(JssUnicornSerializeRootFolder)\Foundation\Serialization" />
          <predicate type="Unicorn.Predicates.SerializationPresetPredicate, Unicorn" singleInstance="true">
          </predicate>
        </configuration>-->

        <!--Project layer-->
        <configuration name="JSS.Project">
          <targetDataStore physicalRootPath="$(JssUnicornSerializeRootFolder)\Project\Serialization" />
          <predicate type="Unicorn.Predicates.SerializationPresetPredicate, Unicorn" singleInstance="true">
            <!--Templates-->
            <include name="Template-Project" database="master" path="/sitecore/templates/Project/Commercial Tenants" />
            <!--Layout-->
            <include name="Layout" database="master" path="/sitecore/layout/Layouts/Project/Commercial Tenants" />
            <!--Rendering-->
            <include name="SubLayoutRendering" database="master" path="/sitecore/layout/Renderings/Project/Commercial Tenants" />
            <!--Placeholder-->
            <include name="Placeholder" database="master" path="/sitecore/layout/Placeholder Settings/Project/Commercial Tenants" />
            <!--Content-->
            <include name="Content" database="master" path="/sitecore/content/All Sites" />
          </predicate>

        </configuration>

      </configurations>
    </unicorn>
  </sitecore>
</configuration>

Then i publish my solution to hosted sitecore cm. Then i can able re-serialize all the sitecore items on first time and i can maintain now in my repository.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.