Skip to content
This repository has been archived by the owner on Jul 16, 2022. It is now read-only.

Commit

Permalink
feat: Add authConfigFilePath key
Browse files Browse the repository at this point in the history
  • Loading branch information
Romain Lenzotti committed Jul 20, 2018
1 parent d59e432 commit 65680ea
Show file tree
Hide file tree
Showing 4 changed files with 64 additions and 7 deletions.
1 change: 1 addition & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ currentWebsite | `Common` | Sitecore, Vuejs | Current code name of the Sitecore
masterWebsite | `Common` | Sitecore, Vuejs | Master code name of the Sitecore website.
solutionName | `Base` | Sitecore | Solution name of the Visual Studio project.
siteUrl | `http://base.dev.local` | Sitecore | Site url use on your local machine. You change this value in a separated file like `.dev.nsrc`.
authConfigFilePath | `path/to//Unicorn.UI.config` | Auth config file path required by Unicorn task.
instanceRoot | `http://base.dev.local` | Sitecore | Path to the Sitecore instance directory.
srcRoot | `./src` | Sitecore | Source code directory.
websiteRoot | `./website` | Sitecore | Website directory used by Sitecore.
Expand Down
22 changes: 21 additions & 1 deletion src/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ class Config {
pattern: '<solutionPath>',
replacement: `<rootDir>/${this.nconf.get('solutionName')}.sln`
},
// {
// pattern: '<siteName>',
// replacement: this.nconf.get('siteName')
// },
{ pattern: '<rootDir>', replacement: `${process.cwd()}` }
];
}
Expand Down Expand Up @@ -106,6 +110,14 @@ class Config {
return this.nconf.get('masterWebsite');
}

/**
*
* @returns {*}
*/
// get siteName() {
// return this.get('siteName');
// }

/**
*
* @returns {*}
Expand All @@ -119,7 +131,15 @@ class Config {
* @returns {*|string}
*/
get authConfigFile() {
return this.resolve('<websiteDir>', 'App_config', 'Include', 'Unicorn', 'Unicorn.UI.config');
return this.get('authConfigFilePath');
}

/**
*
* @returns {*}
*/
get authConfigFilePath() {
return this.authConfigFile;
}

/**
Expand Down
42 changes: 37 additions & 5 deletions src/constant.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ module.exports = {
*
*/
DEFAULT_CONF: {
// siteName: 'dev-common',
/**
* Current code name of the sitecore website.
* @tags Sitecore, Vuejs
Expand All @@ -28,7 +29,7 @@ module.exports = {
* Site url use on your local machine. You change this value in a separated file like `.dev.nsrc`.
* @tags Sitecore
*/
siteUrl: 'http://base.dev.local',
siteUrl: 'https://base.dev.local',
/**
* Directory the Sitecore files instance.
* @tags Sitecore
Expand Down Expand Up @@ -74,6 +75,11 @@ module.exports = {
* @tags Sitecore
*/
licensePath: '<instanceDir>/Data/license.xml',
/**
* Auth config file path required by Unicorn task.
* @tags Unicorn
*/
authConfigFilePath: '<websiteDir>/App_config/Include/Unicorn/Unicorn.UI.config',
/**
* MsBuild Configuration (Release or Debug).
* @tags MsBuild
Expand Down Expand Up @@ -108,14 +114,14 @@ module.exports = {
* Exclude files from the deployment on the Sitecore instance.
* @tags MsBuild
*/
excludeFilesFromDeployment: ['packages.config'],
excludeFilesFromDeployment: [ 'packages.config' ],

// build
/**
* Build targets options (`Build`, `Clean`, `Rebuild`).
* @tags MsBuild
*/
buildTargets: ['Build'],
buildTargets: [ 'Build' ],
/**
* Publish all solutions or/and projects. Support glob patterns.
*/
Expand All @@ -138,7 +144,7 @@ module.exports = {
* Publish targets options (`Build`, `Clean`, `Rebuild`).
* @tags MsBuild
*/
publishTargets: ['Build'],
publishTargets: [ 'Build' ],
/**
* Publish all solutions or/and projects. Support glob patterns.
*/
Expand Down Expand Up @@ -169,7 +175,33 @@ module.exports = {
bundleName: 'bundle',
polyfills: 'polyfills',
styleguide: 'styleguide'
}
},

// install: {
// customInstallPath: '',
// configPath: '<rootDir>/config/xp-sitecore-cm-82-pse-sxa-wffm.json',
// modulesRoot: '<rootDir>/files/modules',
// sitecorePath: '<rootDir>/files/8.2 rev. 170614/Sitecore 8.2 rev. 170614_single.scwdp.zip',
// cargoPayloadRoot: '<rootDir>/Modules/Sitecore Azure Toolkit 2.0.3 rev. 180328/resources/8.2.4/CargoPayloads',
// ioXMLRoot: '<rootDir>/Modules/ioxml',
// bootloadPath: '<rootDir>/Modules/Sitecore Azure Toolkit 2.0.3 rev. 180328/resources/8.2.4/Addons/Sitecore.Cloud.Integration.Bootload.wdp.zip',
// cloudSearchConnectionString: '',
// skipWFFM: false,
//
// modules: {
// pse: 'Sitecore PowerShell Extensions-4.7.2 for Sitecore 8.scwdp.zip',
// sxa: 'Sitecore Experience Accelerator 1.4 rev. 170623 for 8.2.scwdp.zip',
// wffm: 'Web Forms for Marketers 8.2 rev. 170518_single.scwdp.zip'
// }
// },
/**
* @tags Sitecore
*/
// sql: {
// path: './SQLEXPRESS',
// user: '',
// password: ''
// }
},
/**
*
Expand Down
6 changes: 5 additions & 1 deletion test/unit/config.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,13 +126,17 @@ describe('Config', () => {
});

it('should return siteUrl', () => {
expect(config.siteUrl).to.eq('http://base.dev.local');
expect(config.siteUrl).to.eq('https://base.dev.local');
});

it('should return authConfigFile', () => {
expect(config.authConfigFile).to.contains(formatPath('build/Website/App_config/Include/Unicorn/Unicorn.UI.config'));
});

it('should return authConfigFile', () => {
expect(config.authConfigFilePath).to.contains(formatPath('build/Website/App_config/Include/Unicorn/Unicorn.UI.config'));
});

it('should return instanceRoot', () => {
expect(config.instanceRoot).to.contains(formatPath('/build'));
});
Expand Down

0 comments on commit 65680ea

Please sign in to comment.