.rulesync/commands/manual-test.md
You are a developer tooling agent that creates manual test projects from AG Grid documentation examples. The test projects live in testing/manual/ (as siblings of the template/ directory) and are based on the template at testing/manual/template/.
$ARGUMENTS may contain a docs URL, a text description, or both. If empty, ask the user what example they want to scaffold.
Docs URLs follow the pattern: https://ag-grid.com/javascript-data-grid/{pageName}/#{fragment} - ag-grid.com may be a different URL or localhost, and the URL may use any framework prefix (javascript-data-grid, react-data-grid, angular-data-grid, vue-data-grid).
pageName from the URL path (last segment before trailing slash)#)documentation/ag-grid-docs/src/content/docs/{pageName}/index.mdoc{% gridExampleRunner tag after that heading{% gridExampleRunner tags and their title attributes) and ask the user to pick oneexampleName is derived from the title attribute: convert to kebab-case (lowercase, replace spaces with hyphens)documentation/ag-grid-docs/src/content/docs/{pageName}/_examples/{exampleName}/:
main.ts (required)data.ts (if present)index.html (if present)provided/ directory (if present)Plunker URLs look like https://plnkr.co/edit/xKgvPnzSSdQPw9Fv
Use the JSON API to get the content of the exaple: https://api.plnkr.co/v2/plunks/{id}
Titles in plunkers are sometimes stale and misleading, consider both the title attribute and the content and derive an exampleName from the title if it is appropriate or the content if not.
row-selection-checkboxtesting/manual/{name}/ does not already exist. If it does, ask the user for an alternative name.rsync -a --exclude='node_modules' --exclude='dist' testing/manual/template/ testing/manual/{name}/
yarn install in the new directory (uses the existing yarn.lock in the template as a starting point)src/config.tsThe template's src/config.ts handles both module registration and grid configuration. It has a typed structure that must be preserved:
import { AllCommunityModule, type ColDef, type GridOptions, ModuleRegistry } from 'ag-grid-community';
import { AllEnterpriseModule } from 'ag-grid-enterprise';
ModuleRegistry.registerModules([AllCommunityModule, AllEnterpriseModule]);
export interface RowData {
// fields matching the data shape
}
export const columnDefs: ColDef<RowData>[] = [
/* ... */
];
export const rowData: RowData[] = [
/* ... */
];
export const gridOptions: GridOptions<RowData> = {
columnDefs,
rowData,
// other grid options
};
Port the example into this structure:
AllCommunityModule and AllEnterpriseModule. If the source example registers specific modules instead (e.g. ClientSideRowModelModule, ColumnsToolPanelModule, SideBarModule), update the ModuleRegistry.registerModules() call to register the same specific modules. This ensures the test project behaves identically to the source — registering all modules can enable features (e.g. row grouping panels in the columns tool panel) that aren't present in the original example.RowData interface matching the data shape from the examplecolumnDefs with proper ColDef<RowData> typingrowData — if the example uses inline data, include it directly; if it fetches from a URL, keep the fetch pattern but adapt it to work with the templatedefaultColDef if present (export it separately)gridOptions objectag-grid-community and ag-grid-enterprise as neededdata.ts, incorporate its exports (inline the data or re-export)main.tsImportant: The gridOptions export must not include columnDefs or rowData as literal values — they should be referenced as the separately exported constants (this allows framework wrappers to bind them independently).
Check the example source for elements that go beyond grid configuration:
index.html: buttons, dropdowns, inputs with onclick handlers that call grid API methodsprovided/ directory: cell renderers, cell editors, filters, overlays, etc.If none are needed, skip this step.
If custom UI or components are needed:
api.deselectAll() and api.selectAll()", "a custom cell renderer that shows a flag icon")src/javascript/src/react/src/angular/src/vue/yarn build in the project directory to check for TypeScript and build errorstesting/manual/{name}/cd testing/manual/{name} && yarn dev