cmyr-template-cli 1.39.3 → 1.40.0

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.
package/dist/plopfile.js CHANGED
@@ -724,6 +724,7 @@ async function init(projectPath, answers) {
724
724
  await initIssueTemplate(projectPath, info);
725
725
  }
726
726
  await initLicense(projectPath, info);
727
+ await initFunding(projectPath, info);
727
728
  }
728
729
  await initGithubWorkflows(projectPath, answers);
729
730
  }
@@ -1848,6 +1849,22 @@ async function initTest(projectPath, answers) {
1848
1849
  loading.fail("测试初始化失败!");
1849
1850
  }
1850
1851
  }
1852
+ async function initFunding(projectPath, projectInfos) {
1853
+ const loading = (0, import_ora2.default)("正在初始化 Funding 配置 ……").start();
1854
+ try {
1855
+ const { isEnableSupport } = projectInfos;
1856
+ if (!isEnableSupport) {
1857
+ loading.succeed("未启用 Funding 支持,跳过 Funding 初始化");
1858
+ return;
1859
+ }
1860
+ const templatePath = import_path2.default.join(__dirname, "../templates/.github/FUNDING.yml");
1861
+ const newPath = import_path2.default.join(projectPath, ".github/FUNDING.yml");
1862
+ await ejsRender(templatePath, { afdianUsername: projectInfos.afdianUsername }, newPath);
1863
+ loading.succeed("Funding 初始化成功!");
1864
+ } catch (error) {
1865
+ loading.fail("Funding 初始化失败!");
1866
+ }
1867
+ }
1851
1868
  async function jsFileExtRename(projectPath) {
1852
1869
  const loading = (0, import_ora2.default)("正在重命名 js 后缀名 ……").start();
1853
1870
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cmyr-template-cli",
3
- "version": "1.39.3",
3
+ "version": "1.40.0",
4
4
  "description": "草梅友仁自制的项目模板创建器",
5
5
  "author": "CaoMeiYouRen",
6
6
  "license": "MIT",
@@ -0,0 +1 @@
1
+ custom: ['https://afdian.com/a/<%= afdianUsername %>'] # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']