Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at

  • Sean Dooley 283 posts 522 karma points
    Oct 08, 2018 @ 07:16
    Sean Dooley

    uSync as a dependency in a boilerplate NuGet package

    I'm looking at the possibility of creating a NuGet package that contains uSync as a dependency including all the folders and files in the uSync/data folder.

    With this idea, should I have uSync installed in a separate class library where my NuGet package is generated? Or part of the Web Application which has Umbraco and other third-party packages installed?

  • Kevin Jump 2175 posts 13864 karma points MVP 6x c-trib
    Oct 08, 2018 @ 08:42
    Kevin Jump


    It probably only needs to go into the web application that would be generating the files. ?

    the key would be to include uSync as a dependency of your nuget package.

    however - if you are intending to use this for more than just boiler plating your own sites, i would suggest you don't include the usync/data folder, but rather put the usync files somewhere else and import them in code (you can connect to the uSyncBackOffice context and import from any folder, e.g:

    uSyncBackOfficeContext.Instance.ImportAll("myusync/files", false);

    only because with those files as part of your nuget package, you risk them getting confused with the files that might already be there or might change in someone else's site.

  • Sean Dooley 283 posts 522 karma points
    Oct 08, 2018 @ 10:26
    Sean Dooley

    Hi Kevin. Thank you for the feedback, definitely given me food for thought.

    The idea of import the files from another folder sounds interesting. Consider the following scenario (which I need to test)

    • The boilerplate has a Colour Picker (default Umbraco with no colours set) which is added to a number of Document Types.
    • Full uSync export from the boilerplate into a NuGet package.
    • NuGet package imported into another web application, called WebAppA, i.e. uSyncBackOfficeContext.Instance.ImportAll("boilerplate/files", false);
    • Colours are then added to the Colour Picker Data Type in WebAppA.
    • Boilerplate is updated with a new full uSync export (Colour Picker still has no colours).
    • NuGet package is updated in WebAppA.
    • What would happen to the Colour Picker values already set in WebAppA? Would they need re-adding?
Please Sign in or register to post replies

Write your reply to: