polymer-project-config
Advanced tools
Comparing version 3.8.1 to 3.9.0
@@ -11,2 +11,5 @@ # Change Log | ||
## [3.9.0] - 2018-02-23 | ||
* Added new options: `npm` and `componentDir`. Setting `npm` automatically sets `componentDir` to "node_modules/", unless explicitly set otherwise. | ||
## [3.8.1] - 2018-01-29 | ||
@@ -13,0 +16,0 @@ * Changed name of `excludes` property to more natural `exclude` in `js-minify`, `js-compile`, `css-minify` and `html-minify` options prior to releasing the feature as `exclude` is more natural. The `bundle` options will remain `excludes` for now, as that is already implemented in `polymer-bundler`. |
@@ -79,2 +79,12 @@ import { ProjectBuildOptions } from './builds'; | ||
lint?: LintOptions; | ||
/** | ||
* Sets other options' defaults to NPM-appropriate values: | ||
* | ||
* - 'componentDir': 'node_modules/' | ||
*/ | ||
npm?: boolean; | ||
/** | ||
* The directory containing this project's dependencies. | ||
*/ | ||
componentDir?: string; | ||
} | ||
@@ -88,2 +98,4 @@ export declare class ProjectConfig { | ||
readonly extraDependencies: string[]; | ||
readonly componentDir?: string; | ||
readonly npm?: boolean; | ||
readonly builds: ProjectBuildOptions[]; | ||
@@ -90,0 +102,0 @@ readonly autoBasePath: boolean; |
@@ -99,2 +99,10 @@ "use strict"; | ||
/** | ||
* npm | ||
*/ | ||
this.npm = options.npm; | ||
// Set defaults for all NPM related options. | ||
if (this.npm) { | ||
this.componentDir = "node_modules/"; | ||
} | ||
/** | ||
* root | ||
@@ -184,2 +192,8 @@ */ | ||
} | ||
/** | ||
* componentDir | ||
*/ | ||
if (options.componentDir) { | ||
this.componentDir = options.componentDir; | ||
} | ||
} | ||
@@ -186,0 +200,0 @@ /** |
@@ -231,2 +231,6 @@ { | ||
}, | ||
"componentDir": { | ||
"description": "The directory containing this project's dependencies.", | ||
"type": "string" | ||
}, | ||
"entrypoint": { | ||
@@ -254,2 +258,6 @@ "description": "The path relative to `root` of the entrypoint file that will be served for\napp-shell style projects. Usually this is index.html.", | ||
}, | ||
"npm": { | ||
"description": "Sets other options' defaults to NPM-appropriate values:\n\n - 'componentDir': 'node_modules/'", | ||
"type": "boolean" | ||
}, | ||
"root": { | ||
@@ -256,0 +264,0 @@ "description": "Path to the root of the project on the filesystem. This can be an absolute\npath, or a path relative to the current working directory. Defaults to the\ncurrent working directory of the process.", |
{ | ||
"name": "polymer-project-config", | ||
"version": "3.8.1", | ||
"version": "3.9.0", | ||
"description": "reads, validates, and shapes your polymer.json project configuration", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -177,2 +177,14 @@ /** | ||
lint?: LintOptions; | ||
/** | ||
* Sets other options' defaults to NPM-appropriate values: | ||
* | ||
* - 'componentDir': 'node_modules/' | ||
*/ | ||
npm?: boolean; | ||
/** | ||
* The directory containing this project's dependencies. | ||
*/ | ||
componentDir?: string; | ||
} | ||
@@ -187,2 +199,4 @@ | ||
readonly extraDependencies: string[]; | ||
readonly componentDir?: string; | ||
readonly npm?: boolean; | ||
@@ -273,3 +287,14 @@ readonly builds: ProjectBuildOptions[]; | ||
options = (options) ? fixDeprecatedOptions(options) : {}; | ||
/** | ||
* npm | ||
*/ | ||
this.npm = options.npm; | ||
// Set defaults for all NPM related options. | ||
if (this.npm) { | ||
this.componentDir = "node_modules/"; | ||
} | ||
/** | ||
* root | ||
@@ -366,2 +391,9 @@ */ | ||
} | ||
/** | ||
* componentDir | ||
*/ | ||
if (options.componentDir) { | ||
this.componentDir = options.componentDir; | ||
} | ||
} | ||
@@ -368,0 +400,0 @@ |
@@ -39,2 +39,3 @@ /** | ||
lint: undefined, | ||
npm: undefined, | ||
}); | ||
@@ -62,2 +63,3 @@ }); | ||
lint: undefined, | ||
npm: undefined, | ||
}); | ||
@@ -84,2 +86,3 @@ }); | ||
lint: undefined, | ||
npm: undefined, | ||
}); | ||
@@ -105,2 +108,3 @@ }); | ||
lint: undefined, | ||
npm: undefined, | ||
}); | ||
@@ -132,2 +136,3 @@ }); | ||
lint: undefined, | ||
npm: undefined, | ||
}); | ||
@@ -155,2 +160,3 @@ }); | ||
lint: undefined, | ||
npm: undefined, | ||
}); | ||
@@ -187,2 +193,3 @@ }); | ||
lint: undefined, | ||
npm: undefined, | ||
}); | ||
@@ -222,2 +229,3 @@ }); | ||
lint: undefined, | ||
npm: undefined, | ||
}); | ||
@@ -270,2 +278,23 @@ }); | ||
}); | ||
test('npm option sets other options to expected defaults', () => { | ||
const config = new ProjectConfig({ | ||
npm: true, | ||
}); | ||
config.validate(); | ||
assert.equal(config.npm, true); | ||
assert.equal(config.componentDir, 'node_modules/'); | ||
}); | ||
test('npm option does not override other explicitly set values', () => { | ||
const config = new ProjectConfig({ | ||
npm: true, | ||
componentDir: '../some_other_dir/over_here/' | ||
}); | ||
config.validate(); | ||
assert.equal(config.npm, true); | ||
assert.equal(config.componentDir, '../some_other_dir/over_here/'); | ||
}); | ||
}); | ||
@@ -591,2 +620,3 @@ | ||
lint: undefined, | ||
npm: undefined, | ||
}); | ||
@@ -593,0 +623,0 @@ }); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
103791
2590