@ionic/cli-framework
Advanced tools
Comparing version 5.0.6 to 5.1.0
@@ -6,2 +6,13 @@ # Change Log | ||
# [5.1.0](https://github.com/ionic-team/ionic-cli/compare/@ionic/cli-framework@5.0.6...@ionic/cli-framework@5.1.0) (2020-12-10) | ||
### Features | ||
* **config:** add spaces option when writing JSON config ([#4612](https://github.com/ionic-team/ionic-cli/issues/4612)) ([fdd9bb2](https://github.com/ionic-team/ionic-cli/commit/fdd9bb26098441238adc56ea7a67b385a3b9a964)) | ||
## [5.0.6](https://github.com/ionic-team/ionic-cli/compare/@ionic/cli-framework@5.0.5...@ionic/cli-framework@5.0.6) (2020-09-29) | ||
@@ -8,0 +19,0 @@ |
export interface BaseConfigOptions { | ||
/** | ||
* The number of spaces to use when writing the JSON file. | ||
*/ | ||
spaces?: string | number; | ||
/** | ||
* If specified, the class will operate on a nested object within the config | ||
@@ -13,4 +17,5 @@ * file navigated to by this path prefix, an array of object path keys. | ||
readonly p: string; | ||
protected readonly spaces: string | number; | ||
protected readonly pathPrefix: readonly string[]; | ||
constructor(p: string, { pathPrefix }?: BaseConfigOptions); | ||
constructor(p: string, { spaces, pathPrefix }?: BaseConfigOptions); | ||
get file(): any; | ||
@@ -17,0 +22,0 @@ get c(): T; |
@@ -10,4 +10,5 @@ "use strict"; | ||
class BaseConfig { | ||
constructor(p, { pathPrefix = [] } = {}) { | ||
constructor(p, { spaces = 2, pathPrefix = [] } = {}) { | ||
this.p = p; | ||
this.spaces = spaces; | ||
this.pathPrefix = pathPrefix; | ||
@@ -67,5 +68,5 @@ } | ||
utils_fs_1.mkdirpSync(path.dirname(this.p)); | ||
writeFileAtomic.sync(this.p, JSON.stringify(value, undefined, 2) + '\n'); | ||
writeFileAtomic.sync(this.p, JSON.stringify(value, undefined, this.spaces) + '\n'); | ||
} | ||
} | ||
exports.BaseConfig = BaseConfig; |
{ | ||
"name": "@ionic/cli-framework", | ||
"version": "5.0.6", | ||
"version": "5.1.0", | ||
"description": "The foundation framework of the Ionic CLI", | ||
@@ -51,3 +51,3 @@ "homepage": "https://ionicframework.com/", | ||
}, | ||
"gitHead": "85097593e45837e1a0bdef8f3e20a5f44f6cd1e6" | ||
"gitHead": "62a4225e961a48dde3d8b8f3280882c68a604418" | ||
} |
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
140698
2701