Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Leprechaun & Sitecore Content Serialization #49

Open
rsenk opened this issue Jan 26, 2022 · 4 comments
Open

Leprechaun & Sitecore Content Serialization #49

rsenk opened this issue Jan 26, 2022 · 4 comments

Comments

@rsenk
Copy link

rsenk commented Jan 26, 2022

Is there any public example of project that using Leprechaun with Sitecore content serialization?

I spend a few hours to make it working but only what I can achive is:
1>Loaded metadata for 0 configurations (0 total templates) in 12ms.
1>Code generator has loaded in 199ms.

@blipson89
Copy link
Owner

I don't have a public example to point you at, unfortunately, but I'd be happy to help. First step would be looking at the configs.

Can you please attach your Leprechaun.config and at least one ____.module.json file? Please feel free to redact any sensitive information (names, paths, etc).

When redacting paths, please try to preserve the structure as much as possible. For example: C:\projects\Amazon\src\ would be "redacted" as C:\projects\MYCLIENTNAME\src (or something similar).

@rsenk
Copy link
Author

rsenk commented Jan 26, 2022

I'm trying to use Leprechaun with example sitecore project https://github.com/Sitecore/Helix.Examples, precisly helix-basic-nextjs.

  • I installed dotnet tool install --no-cache Leprechaun.Cli
  • I get default Leprechaun.config (file is in the repository root) and trying to modify configuration to work (see attached one)
    Leprechaun.zip
  • I run dotnet tool run leprechaun /c .\Leprechaun.config
  • I get
    2022-01-27_00-08-40

@rsenk
Copy link
Author

rsenk commented Jan 26, 2022

Ok the first problem that I found is missing configurations in module.json files.
"leprechaun": {
"configuration": {
"@extends": "BasicContent.Base",
"@name": "Project.BasicContent"
}

When I added a configuration to a single module and run, then I get
Unhandled exception. System.InvalidOperationException: There is an extends inheritance loop, or a container extending a nonexistant container name. Unresolved containers probably at fault: Project.BasicContent at Configy.Parsing.XmlContainerParser.OrderBySpecificity(IEnumerable1 containers)
at Configy.Parsing.XmlContainerParser.GetContainers()
at Leprechaun.Configuration.LeprechaunConfigurationBuilder.LoadConfigurations() in D:\a\1\s\src\Leprechaun\Configuration\LeprechaunConfigurationBuilder.cs:line 73
at Leprechaun.Configuration.LeprechaunConfigurationBuilder.get_Configurations() in D:\a\1\s\src\Leprechaun\Configuration\LeprechaunConfigurationBuilder.cs:line 63
at Leprechaun.Execution.Runner.GenerateMetadata(IOrchestrator orchestrator, LeprechaunConfigurationBuilder configuration) in D:\a\1\s\src\Leprechaun\Execution\Runner.cs:line 123
at Leprechaun.Execution.Runner.Run(IRuntimeArgs parsedArgs) in D:\a\1\s\src\Leprechaun\Execution\Runner.cs:line 34
at Leprechaun.Cli.Program.Run(ConsoleArgs parsedArgs, CommandLineParser argsParser) in D:\a\1\s\src\Leprechaun.Cli\Program.cs:line 54
at Leprechaun.Cli.Program.Main(String[] args) in D:\a\1\s\src\Leprechaun.Cli\Program.cs:line 28
PS C:\R\Helix.Examples\examples\helix-basic-nextjs>
`

@blipson89
Copy link
Owner

I don't see a BasicContent.Base configuration in your Leprechaun.config. I do, however, see a BasicCompany.Base. If you update the module.json to read "@extends:": "BasicCompany.Base", I suspect it may fix your issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants