lakutata 0.1.16 → 0.1.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/CLI.js +10 -8
  2. package/package.json +1 -1
package/CLI.js CHANGED
@@ -59434,13 +59434,15 @@ var ProjectInformationCompleter = class extends _chunkVZLDHNU6js.BaseObject {
59434
59434
  projectQuestions.push({
59435
59435
  name: "description",
59436
59436
  type: "input",
59437
- message: "Please enter the application description:"
59437
+ message: "Please enter the application description:",
59438
+ default: "No description"
59438
59439
  });
59439
59440
  if (!options.author)
59440
59441
  projectQuestions.push({
59441
59442
  name: "author",
59442
59443
  type: "input",
59443
- message: "Please enter the application author's name:"
59444
+ message: "Please enter the application author's name:",
59445
+ default: "Anonymous"
59444
59446
  });
59445
59447
  if (!options.license)
59446
59448
  projectQuestions.push({
@@ -59482,7 +59484,7 @@ var ProjectInformationUpdater = class extends _chunkVZLDHNU6js.BaseObject {
59482
59484
  throw new Error("The package.json file could not be found.");
59483
59485
  if (!await _chunkTC35FNWQjs.Exists.call(void 0, this.applicationConfigFilename))
59484
59486
  throw new Error("The Config.ts file could not be found.");
59485
- this.packageJson = JSON.parse(await _promises.readFile.call(void 0, this.packageJsonFilename, { encoding: "utf-8" }));
59487
+ this.packageJson = await _promises.readFile.call(void 0, this.packageJsonFilename, { encoding: "utf-8" });
59486
59488
  this.applicationConfig = await _promises.readFile.call(void 0, this.applicationConfigFilename, { encoding: "utf-8" });
59487
59489
  if (await _chunkTC35FNWQjs.Exists.call(void 0, this.readmeFilename))
59488
59490
  await _promises.rm.call(void 0, this.readmeFilename, { recursive: true, force: true });
@@ -59501,7 +59503,7 @@ var ProjectInformationUpdater = class extends _chunkVZLDHNU6js.BaseObject {
59501
59503
  * @protected
59502
59504
  */
59503
59505
  setName(name) {
59504
- this.packageJson.name = name;
59506
+ this.packageJson = _chunkTC35FNWQjs.TextTemplate.call(void 0, this.packageJson, { name }, { ignoreMissing: true });
59505
59507
  this.applicationConfig = _chunkTC35FNWQjs.TextTemplate.call(void 0, this.applicationConfig, { name }, { ignoreMissing: true });
59506
59508
  }
59507
59509
  /**
@@ -59510,7 +59512,7 @@ var ProjectInformationUpdater = class extends _chunkVZLDHNU6js.BaseObject {
59510
59512
  * @protected
59511
59513
  */
59512
59514
  setDescription(description) {
59513
- this.packageJson.description = description;
59515
+ this.packageJson = _chunkTC35FNWQjs.TextTemplate.call(void 0, this.packageJson, { description }, { ignoreMissing: true });
59514
59516
  }
59515
59517
  /**
59516
59518
  * 设置作者名称
@@ -59518,7 +59520,7 @@ var ProjectInformationUpdater = class extends _chunkVZLDHNU6js.BaseObject {
59518
59520
  * @protected
59519
59521
  */
59520
59522
  setAuthor(author) {
59521
- this.packageJson.author = author;
59523
+ this.packageJson = _chunkTC35FNWQjs.TextTemplate.call(void 0, this.packageJson, { author }, { ignoreMissing: true });
59522
59524
  }
59523
59525
  /**
59524
59526
  * 设置许可证名字
@@ -59526,14 +59528,14 @@ var ProjectInformationUpdater = class extends _chunkVZLDHNU6js.BaseObject {
59526
59528
  * @protected
59527
59529
  */
59528
59530
  setLicense(license) {
59529
- this.packageJson.license = license.toUpperCase();
59531
+ this.packageJson = _chunkTC35FNWQjs.TextTemplate.call(void 0, this.packageJson, { license: license.toUpperCase() }, { ignoreMissing: true });
59530
59532
  }
59531
59533
  /**
59532
59534
  * 将项目信息进行保存
59533
59535
  * @protected
59534
59536
  */
59535
59537
  async save() {
59536
- await _promises.writeFile.call(void 0, this.packageJsonFilename, JSON.stringify(this.packageJson, null, 2), { flag: "w+" });
59538
+ await _promises.writeFile.call(void 0, this.packageJsonFilename, this.packageJson, { flag: "w+" });
59537
59539
  await _promises.writeFile.call(void 0, this.applicationConfigFilename, this.applicationConfig, { flag: "w+" });
59538
59540
  }
59539
59541
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lakutata",
3
- "version": "0.1.16",
3
+ "version": "0.1.18",
4
4
  "description": "An IoC-based universal application framework.",
5
5
  "main": "./Lakutata.js",
6
6
  "types": "./Lakutata.d.ts",