Skip to content

feat(*): automated update workflow#62

Open
ChronosSF wants to merge 9 commits intomasterfrom
sstoychev/add-automated-workflow
Open

feat(*): automated update workflow#62
ChronosSF wants to merge 9 commits intomasterfrom
sstoychev/add-automated-workflow

Conversation

@ChronosSF
Copy link
Copy Markdown
Member

No description provided.

@ChronosSF ChronosSF changed the base branch from 21.1.x to master March 27, 2026 15:46
@ChronosSF ChronosSF requested a review from Copilot March 27, 2026 15:47
Copy link
Copy Markdown

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

This PR adds automation to refresh API documentation artifacts in this repo from a repository_dispatch event, and introduces scripts to extract/patch translatable strings from the exported TypeDoc JSON.

Changes:

  • Add scripts/i18n-extract.mjs to flatten TypeDoc comment content into an id→translation-unit map (optionally chunked).
  • Add scripts/i18n-patch.mjs to apply translated units back onto a target-language TypeDoc JSON.
  • Add a GitHub Actions workflow to checkout/build IgniteUI/igniteui-angular at a dispatched release tag, copy TypeDoc/SASS docs into this repo, and commit/push updates.

Reviewed changes

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

File Description
scripts/i18n-extract.mjs New CLI script to extract translatable comment content from TypeDoc JSON.
scripts/i18n-patch.mjs New CLI script to patch translated strings back into TypeDoc JSON.
.github/workflows/update-from-dispatch.yml New CI workflow to build/export upstream docs, copy artifacts in, run extraction, and push a versioned branch update.
.gitignore Ignore the workflow’s local igniteui-angular/ checkout directory.

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

Copy link
Copy Markdown

Copilot AI commented Mar 27, 2026

@ChronosSF I've opened a new pull request, #65, to work on those changes. Once the pull request is ready, I'll request review from you.

Copy link
Copy Markdown

Copilot AI commented Mar 27, 2026

@ChronosSF I've opened a new pull request, #66, to work on those changes. Once the pull request is ready, I'll request review from you.

ChronosSF and others added 5 commits March 27, 2026 18:07
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Pin Node.js to v22 in update-from-dispatch workflow
Add release_tag validation guard to update-from-dispatch workflow
Copy link
Copy Markdown

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

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


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

Comment on lines +43 to +46
const EN_PATH = args.input ?? resolve(__dirname, './typedoc/en/igniteui-angular.json');
const OUT_PATH = args.output ?? resolve(__dirname, './typedoc/en/i18n-translatable.json');
const CHUNK_SIZE = parseInt(args['chunk-size'] ?? '0', 10); // 0 = no splitting
const CHUNKS_DIR = args['chunks-dir'] ?? resolve(__dirname, 'i18n-chunks');
Copy link

Copilot AI Mar 27, 2026

Choose a reason for hiding this comment

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

The default paths are resolved relative to scripts/ (resolve(__dirname, './typedoc/...')), but this repo’s typedoc/ folder lives at the repository root (sibling of scripts/). Running the script with no --input/--output will fail because scripts/typedoc/... doesn’t exist. Update the defaults to resolve to ../typedoc/... (or use process.cwd()-relative paths) so the documented node ... usage works out of the box.

Suggested change
const EN_PATH = args.input ?? resolve(__dirname, './typedoc/en/igniteui-angular.json');
const OUT_PATH = args.output ?? resolve(__dirname, './typedoc/en/i18n-translatable.json');
const CHUNK_SIZE = parseInt(args['chunk-size'] ?? '0', 10); // 0 = no splitting
const CHUNKS_DIR = args['chunks-dir'] ?? resolve(__dirname, 'i18n-chunks');
const EN_PATH = args.input ?? resolve(__dirname, '../typedoc/en/igniteui-angular.json');
const OUT_PATH = args.output ?? resolve(__dirname, '../typedoc/en/i18n-translatable.json');
const CHUNK_SIZE = parseInt(args['chunk-size'] ?? '0', 10); // 0 = no splitting
const CHUNKS_DIR = args['chunks-dir'] ?? resolve(dirname(OUT_PATH), 'i18n-chunks');

Copilot uses AI. Check for mistakes.
Comment on lines +23 to +27
* Usage:
* node i18n-extract.mjs
* node i18n-extract.mjs --input=i18nRepo/typedoc/en/igniteui-angular.json
* node i18n-extract.mjs --output=i18n-translatable.json
* node i18n-extract.mjs --chunk-size=50 (items per chunk file, 0 = single file)
Copy link

Copilot AI Mar 27, 2026

Choose a reason for hiding this comment

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

The usage header still references i18nRepo/typedoc/en/..., but this repo stores the TypeDoc JSON under typedoc/en/... at the repository root. Please update the usage examples to match the actual expected paths (and ideally show node scripts/i18n-extract.mjs ... from repo root).

Suggested change
* Usage:
* node i18n-extract.mjs
* node i18n-extract.mjs --input=i18nRepo/typedoc/en/igniteui-angular.json
* node i18n-extract.mjs --output=i18n-translatable.json
* node i18n-extract.mjs --chunk-size=50 (items per chunk file, 0 = single file)
* Usage (from repo root):
* node scripts/i18n-extract.mjs
* node scripts/i18n-extract.mjs --input=typedoc/en/igniteui-angular.json
* node scripts/i18n-extract.mjs --output=typedoc/en/i18n-translatable.json
* node scripts/i18n-extract.mjs --chunk-size=50 (items per chunk file, 0 = single file)

Copilot uses AI. Check for mistakes.

/**
* Applies a translation unit onto a typedoc comment node.
* Overwrites summary and blockTags with the translated strings.
Copy link

Copilot AI Mar 27, 2026

Choose a reason for hiding this comment

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

The function doc says it “Overwrites summary and blockTags”, but the implementation only overwrites summary and then partially updates blockTags (preserving unmatched existing tags and appending extra incoming ones). Either update the comment to describe the merge behavior, or change the implementation to fully replace node.comment.blockTags when unit.blockTags is present.

Suggested change
* Overwrites summary and blockTags with the translated strings.
* Overwrites the summary text and merges blockTags with the translated
* strings (updating matching tags, preserving unmatched existing ones, and
* appending any additional translated tags).

Copilot uses AI. Check for mistakes.
Comment on lines +15 to +21
* Usage:
* node i18n-patch.mjs
* node i18n-patch.mjs --input=i18n-translatable.json --lang=ja
* node i18n-patch.mjs --input=i18n-translatable.json --target=i18nRepo/typedoc/ja/igniteui-angular.json --output=out.json
*
* When patching from chunk files produced with --chunk-size:
* node i18n-patch.mjs --chunks-dir=i18n-chunks --lang=ja
Copy link

Copilot AI Mar 27, 2026

Choose a reason for hiding this comment

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

The usage examples mention --target=i18nRepo/typedoc/..., but this repository’s checked-in TypeDoc JSON appears under typedoc/<lang>/.... Update the usage examples to reflect the actual repo layout to avoid confusing users (and consider using node scripts/i18n-patch.mjs ... if run from repo root).

Suggested change
* Usage:
* node i18n-patch.mjs
* node i18n-patch.mjs --input=i18n-translatable.json --lang=ja
* node i18n-patch.mjs --input=i18n-translatable.json --target=i18nRepo/typedoc/ja/igniteui-angular.json --output=out.json
*
* When patching from chunk files produced with --chunk-size:
* node i18n-patch.mjs --chunks-dir=i18n-chunks --lang=ja
* Usage (from repo root):
* node scripts/i18n-patch.mjs
* node scripts/i18n-patch.mjs --input=typedoc/ja/i18n-translatable.json --lang=ja
* node scripts/i18n-patch.mjs --input=typedoc/ja/i18n-translatable.json --target=typedoc/ja/igniteui-angular.json --output=out.json
*
* When patching from chunk files produced with --chunk-size:
* node scripts/i18n-patch.mjs --chunks-dir=i18n-chunks --lang=ja

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.

3 participants