-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: simplify props, improve updates
- Loading branch information
Showing
5 changed files
with
173 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import { readFile, writeFile } from "node:fs/promises"; | ||
import { resolve } from "node:path"; | ||
|
||
async function updateInitialGridOptions() { | ||
try { | ||
// Read the propertyKeys.d.ts file | ||
const filePath = resolve( | ||
"node_modules/@ag-grid-community/core/dist/types/src/propertyKeys.d.ts", | ||
); | ||
const content = await readFile(filePath, "utf-8"); | ||
|
||
// Extract INITIAL_GRID_OPTION_KEYS object using regex | ||
const match = content.match(/INITIAL_GRID_OPTION_KEYS:\s*{([^}]*)}/); | ||
if (!match) { | ||
console.error( | ||
"Could not find INITIAL_GRID_OPTION_KEYS in the file", | ||
); | ||
return; | ||
} | ||
|
||
// Extract the keys from the object | ||
const keysString = match[1]; | ||
const keys = keysString | ||
.split("\n") | ||
.map((line) => line.trim()) | ||
.filter((line) => line.length > 0) | ||
.map((line) => line.replace(":", " ").split(" ")[0].trim()); | ||
|
||
// Generate the new content for initialGridOptionsSet.ts | ||
const newContent = `// A list of grid options to exclude from the update | ||
export default new Set([ | ||
${keys.map((key) => `"${key}"`).join(",\n ")} | ||
]); | ||
`; | ||
|
||
// Write the updated content | ||
await writeFile( | ||
"src/lib/initialGridOptionsSet.ts", | ||
newContent, | ||
"utf-8", | ||
); | ||
console.log("Successfully updated initialGridOptionsSet.ts"); | ||
} catch (error) { | ||
console.error("Error updating initial grid options:", error); | ||
} | ||
} | ||
|
||
updateInitialGridOptions(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
// A list of grid options to exclude from the update | ||
|
||
export default new Set([ | ||
"enableBrowserTooltips", | ||
"tooltipTrigger", | ||
"tooltipMouseTrack", | ||
"tooltipShowMode", | ||
"tooltipInteraction", | ||
"defaultColGroupDef", | ||
"suppressAutoSize", | ||
"skipHeaderOnAutoSize", | ||
"autoSizeStrategy", | ||
"components", | ||
"stopEditingWhenCellsLoseFocus", | ||
"undoRedoCellEditing", | ||
"undoRedoCellEditingLimit", | ||
"excelStyles", | ||
"cacheQuickFilter", | ||
"advancedFilterModel", | ||
"customChartThemes", | ||
"chartThemeOverrides", | ||
"chartToolPanelsDef", | ||
"loadingCellRendererSelector", | ||
"localeText", | ||
"keepDetailRows", | ||
"keepDetailRowsCount", | ||
"detailRowHeight", | ||
"detailRowAutoHeight", | ||
"tabIndex", | ||
"valueCache", | ||
"valueCacheNeverExpires", | ||
"enableCellExpressions", | ||
"suppressTouch", | ||
"suppressAsyncEvents", | ||
"suppressBrowserResizeObserver", | ||
"suppressPropertyNamesCheck", | ||
"debug", | ||
"dragAndDropImageComponent", | ||
"loadingOverlayComponent", | ||
"suppressLoadingOverlay", | ||
"noRowsOverlayComponent", | ||
"paginationPageSizeSelector", | ||
"paginateChildRows", | ||
"pivotPanelShow", | ||
"pivotSuppressAutoColumn", | ||
"suppressExpandablePivotGroups", | ||
"aggFuncs", | ||
"suppressAggFuncInHeader", | ||
"allowShowChangeAfterFilter", | ||
"ensureDomOrder", | ||
"enableRtl", | ||
"suppressColumnVirtualisation", | ||
"suppressMaxRenderedRowRestriction", | ||
"suppressRowVirtualisation", | ||
"rowDragText", | ||
"suppressGroupMaintainValueType", | ||
"groupLockGroupColumns", | ||
"rowGroupPanelSuppressSort", | ||
"suppressGroupRowsSticky", | ||
"rowModelType", | ||
"cacheOverflowSize", | ||
"infiniteInitialRowCount", | ||
"serverSideInitialRowCount", | ||
"suppressServerSideInfiniteScroll", | ||
"maxBlocksInCache", | ||
"maxConcurrentDatasourceRequests", | ||
"blockLoadDebounceMillis", | ||
"serverSideOnlyRefreshFilteredGroups", | ||
"serverSidePivotResultFieldSeparator", | ||
"viewportRowModelPageSize", | ||
"viewportRowModelBufferSize", | ||
"debounceVerticalScrollbar", | ||
"suppressAnimationFrame", | ||
"suppressPreventDefaultOnMouseWheel", | ||
"scrollbarWidth", | ||
"icons", | ||
"suppressRowTransform", | ||
"gridId", | ||
"enableGroupEdit", | ||
"initialState", | ||
"processUnpinnedColumns", | ||
"createChartContainer", | ||
"getLocaleText", | ||
"getRowId", | ||
"reactiveCustomComponents", | ||
"columnMenu", | ||
"suppressSetFilterByDefault" | ||
]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters