cmyr-template-cli 1.37.2 → 1.37.3

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/dist/plopfile.js +46 -26
  2. package/package.json +1 -1
package/dist/plopfile.js CHANGED
@@ -995,34 +995,54 @@ async function initDependabot(projectPath, answers) {
995
995
  await removeFiles(projectPath, files);
996
996
  } else {
997
997
  const pkg = await getProjectJson(projectPath);
998
- if (pkg?.devDependencies?.["semantic-release"]) {
999
- const dependabotPath = import_path2.default.join(projectPath, ".github/dependabot.yml");
1000
- if (await import_fs_extra3.default.pathExists(dependabotPath)) {
1001
- const dependabot = import_yaml.default.parse(await import_fs_extra3.default.readFile(dependabotPath, "utf-8"));
1002
- if (dependabot?.updates?.[0]["package-ecosystem"] === "npm") {
1003
- dependabot.updates[0].ignore = (0, import_lodash.uniqBy)([
1004
- ...dependabot?.updates?.[0].ignore || [],
1005
- {
1006
- "dependency-name": "semantic-release",
1007
- versions: [">= 21.0.1"]
1008
- },
1009
- {
1010
- "dependency-name": "@commitlint/cli",
1011
- versions: [">= 19.0.0"]
1012
- },
1013
- {
1014
- "dependency-name": "@commitlint/config-conventional",
1015
- versions: [">= 19.0.0"]
1016
- },
1017
- {
1018
- "dependency-name": "art-template",
1019
- versions: [">= 4.13.3"]
1020
- // 高版本涉嫌危险代码,参考 https://github.com/yoimiya-kokomi/Miao-Yunzai/pull/515
1021
- }
1022
- ], (e) => e["dependency-name"]);
1023
- import_fs_extra3.default.writeFile(dependabotPath, import_yaml.default.stringify(dependabot));
998
+ const dependabotPath = import_path2.default.join(projectPath, ".github/dependabot.yml");
999
+ if (await import_fs_extra3.default.pathExists(dependabotPath)) {
1000
+ const dependabot = import_yaml.default.parse(await import_fs_extra3.default.readFile(dependabotPath, "utf-8"));
1001
+ if (dependabot?.updates?.[0]["package-ecosystem"] === "npm") {
1002
+ const dependencies = [];
1003
+ if (pkg?.devDependencies?.["semantic-release"]) {
1004
+ dependencies.push({
1005
+ "dependency-name": "semantic-release",
1006
+ versions: [">= 21.0.1"]
1007
+ });
1008
+ }
1009
+ if (pkg?.devDependencies?.["@commitlint/cli"]) {
1010
+ dependencies.push({
1011
+ "dependency-name": "@commitlint/cli",
1012
+ versions: [">= 19.0.0"]
1013
+ });
1014
+ }
1015
+ if (pkg?.devDependencies?.["@commitlint/config-conventional"]) {
1016
+ dependencies.push({
1017
+ "dependency-name": "@commitlint/config-conventional",
1018
+ versions: [">= 19.0.0"]
1019
+ });
1020
+ }
1021
+ if (pkg?.dependencies?.["art-template"]) {
1022
+ dependencies.push({
1023
+ "dependency-name": "art-template",
1024
+ versions: [">= 4.13.3"]
1025
+ });
1024
1026
  }
1027
+ dependabot.updates[0].ignore = (0, import_lodash.uniqBy)([
1028
+ ...dependabot?.updates?.[0].ignore || [],
1029
+ ...dependencies
1030
+ ], (e) => e["dependency-name"]);
1031
+ }
1032
+ if (dependabot?.updates?.every((e) => e["package-ecosystem"] !== "github-actions")) {
1033
+ dependabot.updates.push({
1034
+ "package-ecosystem": "github-actions",
1035
+ directory: "/",
1036
+ "open-pull-requests-limit": 20,
1037
+ schedule: {
1038
+ interval: "weekly",
1039
+ time: "04:00",
1040
+ timezone: "Asia/Shanghai"
1041
+ },
1042
+ ignore: []
1043
+ });
1025
1044
  }
1045
+ import_fs_extra3.default.writeFile(dependabotPath, import_yaml.default.stringify(dependabot));
1026
1046
  }
1027
1047
  }
1028
1048
  } catch (error) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cmyr-template-cli",
3
- "version": "1.37.2",
3
+ "version": "1.37.3",
4
4
  "description": "草梅友仁自制的项目模板创建器",
5
5
  "author": "CaoMeiYouRen",
6
6
  "license": "MIT",