Skip to content

feat(build): add script to update skills for Angular, React, and WebC…#1625

Open
Marina-L-Stoyanova wants to merge 6 commits intomasterfrom
mstoyanova/update-skills-build
Open

feat(build): add script to update skills for Angular, React, and WebC…#1625
Marina-L-Stoyanova wants to merge 6 commits intomasterfrom
mstoyanova/update-skills-build

Conversation

@Marina-L-Stoyanova
Copy link
Copy Markdown
Contributor

…omponents

Closes # .

Additional information related to this pull request:

@coveralls
Copy link
Copy Markdown

coveralls commented Apr 15, 2026

Coverage Status

coverage: 86.103%. remained the same — mstoyanova/update-skills-build into master

@dkalinovInfra dkalinovInfra marked this pull request as ready for review April 16, 2026 09:36
Copilot AI review requested due to automatic review settings April 16, 2026 09:36
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new build-time utility script for syncing “skills” content from the IgniteUI framework submodules (Angular/React/Web Components) into the corresponding CLI/template destinations in this monorepo.

Changes:

  • Introduce scripts/update-skills.ts to git pull framework submodules and copy their skills/ folders into template destinations.
  • Add an npm script (build:update-skills) to run the updater via tsx.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
scripts/update-skills.ts New script that updates/pulls framework repos and copies skills/ into template locations.
package.json Adds build:update-skills npm script to run the new updater.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread scripts/update-skills.ts
Comment on lines +6 to +7
const branch = process.argv[2] || "master";

Copy link

Copilot AI Apr 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

branch comes from process.argv[2] and is interpolated into a shell command via execSync(...). Because execSync runs through a shell, this allows command injection (e.g., branch values containing ;, &&, etc.) and also breaks on branch names with spaces. Use execFileSync (or spawnSync) with an argument array, and/or validate the branch name against an allowlist regex before invoking git.

Copilot uses AI. Check for mistakes.
Comment thread scripts/update-skills.ts
Comment on lines +30 to +34
if (!existsSync(repo)) {
// eslint-disable-next-line no-console
console.warn(`[update-skills] Skipping ${name}: repo not found at ${repo}`);
continue;
}
Copy link

Copilot AI Apr 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These paths are git submodules (see .gitmodules), and when submodules are not initialized the directory can exist but not be a usable git repo. In that case existsSync(repo) will pass, but git pull will fail. Consider detecting a valid repo (e.g., check for ${repo}/.git or run git rev-parse --is-inside-work-tree) and either auto-run git submodule update --init <path> or skip with a clearer warning.

Copilot uses AI. Check for mistakes.
Comment thread scripts/update-skills.ts
Comment on lines +36 to +43
console.log(`[update-skills] Pulling ${name} from branch '${branch}'...`);
// Abort any in-progress merge left from a previous failed pull
try {
execSync("git merge --abort", { cwd: repo, stdio: "pipe" });
} catch {
// No merge in progress — ignore
}
execSync(`git pull origin ${branch} --no-edit`, { cwd: repo, stdio: "inherit" });
Copy link

Copilot AI Apr 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

git pull origin ${branch} --no-edit will move the submodule HEAD and mark the superproject as having modified submodule pointers. If the intent is just to update skills, it may be safer to fetch/checkout a specific ref (or use git submodule update --remote) and/or print a warning that this will dirty the repo so it’s explicit for users running the script.

Suggested change
console.log(`[update-skills] Pulling ${name} from branch '${branch}'...`);
// Abort any in-progress merge left from a previous failed pull
try {
execSync("git merge --abort", { cwd: repo, stdio: "pipe" });
} catch {
// No merge in progress — ignore
}
execSync(`git pull origin ${branch} --no-edit`, { cwd: repo, stdio: "inherit" });
console.log(`[update-skills] Updating ${name} from branch '${branch}'...`);
// eslint-disable-next-line no-console
console.warn(
`[update-skills] Note: updating ${name} will move the nested repository HEAD and may mark the parent repository as modified if it is checked out as a submodule.`
);
// Abort any in-progress merge left from a previous failed pull
try {
execSync("git merge --abort", { cwd: repo, stdio: "pipe" });
} catch {
// No merge in progress — ignore
}
execSync(`git fetch origin ${branch}`, { cwd: repo, stdio: "inherit" });
execSync("git checkout --detach FETCH_HEAD", { cwd: repo, stdio: "inherit" });

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants