Skip to content

Commit

Permalink
Merge pull request #19 from sitecoremaster/bugs/parent-unicorn-fix
Browse files Browse the repository at this point in the history
Bugs/parent unicorn fix
  • Loading branch information
dylanyoung-dev authored Apr 13, 2019
2 parents f1b590c + 2d26a57 commit 747f115
Show file tree
Hide file tree
Showing 7 changed files with 1,581 additions and 31 deletions.
10 changes: 6 additions & 4 deletions generators/create-module/helix-project/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,11 +157,12 @@ module.exports = class extends Generator {
_configureSerializedItems() {

// Templates
this.fs.copyTpl(this.templatePath('./serialization/Templates/.Template.yml'), this.destinationPath(path.join(this.targetPath, 'serialization/', 'Templates/', parameters.ModuleName + '.yml')), { Parameters: parameters, Id: guid.v4() });
var templateId = guid.v4();
this.fs.copyTpl(this.templatePath('./serialization/Templates/.Template.yml'), this.destinationPath(path.join(this.targetPath, 'serialization/', 'Templates/', parameters.ModuleName + '.yml')), { Parameters: parameters, Id: templateId });

mkdir.sync(path.join(this.targetPath, 'serialization', 'Templates', parameters.ModuleName));

this.fs.copyTpl(this.templatePath('./serialization/Templates/.Home.yml'), this.destinationPath(path.join(this.targetPath, 'serialization/', 'Templates/', parameters.ModuleName, 'Home.yml')), { Parameters: parameters, Id: guid.v4() });
this.fs.copyTpl(this.templatePath('./serialization/Templates/.Home.yml'), this.destinationPath(path.join(this.targetPath, 'serialization/', 'Templates/', parameters.ModuleName, 'Home.yml')), { Parameters: parameters, Id: guid.v4(), ParentId: templateId });

// Renderings
this.fs.copyTpl(this.templatePath('./serialization/Renderings/.Rendering.yml'), this.destinationPath(path.join(this.targetPath, 'serialization/', 'Renderings/', parameters.ModuleName + '.yml')), { Parameters: parameters, Id: guid.v4() });
Expand All @@ -177,11 +178,12 @@ module.exports = class extends Generator {
this.fs.copyTpl(this.templatePath('./serialization/Media/.Media.yml'), this.destinationPath(path.join(this.targetPath, 'serialization/', 'Media/', parameters.ModuleName + '.yml')), { Parameters: parameters, Id: guid.v4() });

// Content Items
this.fs.copyTpl(this.templatePath('./serialization/Content/.Folder.yml'), this.destinationPath(path.join(this.targetPath, 'serialization', 'Content', parameters.ModuleName + '.yml')), { Parameters: parameters, Id: guid.v4() });
var folderId = guid.v4();
this.fs.copyTpl(this.templatePath('./serialization/Content/.Folder.yml'), this.destinationPath(path.join(this.targetPath, 'serialization', 'Content', parameters.ModuleName + '.yml')), { Parameters: parameters, Id: folderId });

mkdir.sync(path.join(this.targetPath, 'serialization', 'Content', parameters.ModuleName));

this.fs.copyTpl(this.templatePath('./serialization/Content/.Home.yml'), this.destinationPath(path.join(this.targetPath, 'serialization', 'Content', parameters.ModuleName, 'Home.yml')), { Parameters: parameters, Id: guid.v4() });
this.fs.copyTpl(this.templatePath('./serialization/Content/.Home.yml'), this.destinationPath(path.join(this.targetPath, 'serialization', 'Content', parameters.ModuleName, 'Home.yml')), { Parameters: parameters, Id: guid.v4(), ParentId: folderId });

}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
ID: "<%= Id %>"
Parent: "71b6ecaa-e1ea-4757-b8bd-f533a469a750"
Parent: "<%= ParentId %>"
Template: "19cb0203-de9c-4700-81d7-986c1b7c230d"
Path: /sitecore/content/<%= Parameters.ModuleName %>/Home
DB: master
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
ID: "<%= Id %>"
Parent: "384bbdf5-520c-4a36-aeb6-ccb2bbbf8a56"
Parent: "<%= ParentId %>"
Template: "ab86861a-6030-46c5-b394-e8f99e8b87db"
Path: /sitecore/templates/Project/<%= Parameters.ModuleName %>/Home
DB: master
Expand Down
4 changes: 2 additions & 2 deletions generators/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
],
"scripts": {
"postinstall": "",
"test": "mocha tests/*.tests.js --timeout 60000 --config generators/test/mocha.opts",
"test-report": "mocha tests/*.tests.js --reporter mocha-junit-reporter --timeout 60000 --config generators/test/mocha.opts"
"test": "mocha tests/*.tests.js --timeout 60000",
"test-report": "mocha tests/*.tests.js --reporter mocha-junit-reporter --timeout 60000"
},
"dependencies": {
"chalk": "^1.1.3",
Expand Down
Empty file removed generators/tests/mocha.opts
Empty file.
Loading

0 comments on commit 747f115

Please sign in to comment.