Skip to content

Commit 1f9bf70

Browse files
committed
feature-292-github-action-rename: Update setup files to include .github/ISSUE_TEMPLATE directory, ensuring it is created if missing and files are copied correctly. Modify documentation to reflect these changes for improved clarity.
1 parent ed8a648 commit 1f9bf70

41 files changed

Lines changed: 93 additions & 12 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

build/cli/index.js

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52875,7 +52875,7 @@ class InitialSetupUseCase {
5287552875
const steps = [];
5287652876
const errors = [];
5287752877
try {
52878-
// 0. Setup files (.github/workflows, pull_request_template.md, .env)
52878+
// 0. Setup files (.github/workflows, .github/ISSUE_TEMPLATE, pull_request_template.md, .env)
5287952879
(0, logger_1.logInfo)('📋 Ensuring .github and copying setup files...');
5288052880
(0, setup_files_1.ensureGitHubDirs)(process.cwd());
5288152881
const filesResult = (0, setup_files_1.copySetupFiles)(process.cwd());
@@ -58008,12 +58008,13 @@ const fs = __importStar(__nccwpck_require__(7147));
5800858008
const path = __importStar(__nccwpck_require__(1017));
5800958009
const logger_1 = __nccwpck_require__(8836);
5801058010
/**
58011-
* Ensure .github and .github/workflows exist; create them if missing.
58011+
* Ensure .github, .github/workflows and .github/ISSUE_TEMPLATE exist; create them if missing.
5801258012
* @param cwd - Directory (repo root)
5801358013
*/
5801458014
function ensureGitHubDirs(cwd) {
5801558015
const githubDir = path.join(cwd, '.github');
5801658016
const workflowsDir = path.join(cwd, '.github', 'workflows');
58017+
const issueTemplateDir = path.join(cwd, '.github', 'ISSUE_TEMPLATE');
5801758018
if (!fs.existsSync(githubDir)) {
5801858019
(0, logger_1.logInfo)('📁 Creating .github/...');
5801958020
fs.mkdirSync(githubDir, { recursive: true });
@@ -58022,9 +58023,13 @@ function ensureGitHubDirs(cwd) {
5802258023
(0, logger_1.logInfo)('📁 Creating .github/workflows/...');
5802358024
fs.mkdirSync(workflowsDir, { recursive: true });
5802458025
}
58026+
if (!fs.existsSync(issueTemplateDir)) {
58027+
(0, logger_1.logInfo)('📁 Creating .github/ISSUE_TEMPLATE/...');
58028+
fs.mkdirSync(issueTemplateDir, { recursive: true });
58029+
}
5802558030
}
5802658031
/**
58027-
* Copy setup files from setup/ to repo (.github/ workflows, pull_request_template.md, .env at root).
58032+
* Copy setup files from setup/ to repo (.github/ workflows, ISSUE_TEMPLATE, pull_request_template.md, .env at root).
5802858033
* Skips files that already exist at destination (no overwrite).
5802958034
* Logs each file copied or skipped. No-op if setup/ does not exist.
5803058035
* @param cwd - Repo root
@@ -58056,6 +58061,24 @@ function copySetupFiles(cwd) {
5805658061
}
5805758062
}
5805858063
}
58064+
const issueTemplateSrc = path.join(setupDir, 'ISSUE_TEMPLATE');
58065+
const issueTemplateDst = path.join(cwd, '.github', 'ISSUE_TEMPLATE');
58066+
if (fs.existsSync(issueTemplateSrc)) {
58067+
const files = fs.readdirSync(issueTemplateSrc).filter((f) => fs.statSync(path.join(issueTemplateSrc, f)).isFile());
58068+
for (const f of files) {
58069+
const src = path.join(issueTemplateSrc, f);
58070+
const dst = path.join(issueTemplateDst, f);
58071+
if (fs.existsSync(dst)) {
58072+
(0, logger_1.logInfo)(` ⏭️ .github/ISSUE_TEMPLATE/${f} already exists; skipping.`);
58073+
skipped += 1;
58074+
}
58075+
else {
58076+
fs.copyFileSync(src, dst);
58077+
(0, logger_1.logInfo)(` ✅ Copied setup/ISSUE_TEMPLATE/${f} → .github/ISSUE_TEMPLATE/${f}`);
58078+
copied += 1;
58079+
}
58080+
}
58081+
}
5805958082
const prTemplateSrc = path.join(setupDir, 'pull_request_template.md');
5806058083
const prTemplateDst = path.join(cwd, '.github', 'pull_request_template.md');
5806158084
if (fs.existsSync(prTemplateSrc)) {
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export {};
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export {};
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export {};
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export {};
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export {};
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export {};
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export {};
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export {};
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export {};

0 commit comments

Comments
 (0)