fix: exp post build script to strip Table_Internal #6326
beta fromrefs/pull/6326/head·merged by KevinVandy 🎯 Changes#
✅ Checklist#
- I have followed the steps in the Contributing guide.
- I have tested this code locally with
pnpm test:pr.
Summary by CodeRabbit#
- Chores
- Updated the build pipeline to post-process generated TypeScript declaration files, stripping internal-only type references and validating the published output no longer contains them.
- Refined internal table/header/column typing relationships to improve consistency between internal rendering contexts and the exported TypeScript declarations.
- 1
View your CI Pipeline Execution ↗ for commit c4d0aed3f818c8668af273aaa88a08ec86c23615
Command Status Duration Result nx affected --targets=test:eslint,test:sherif,t...✅ Succeeded 5m 18s View ↗ nx run-many --targets=build --exclude=examples/**✅ Succeeded 25s View ↗
☁️ Nx Cloud last updated this comment at
2026-06-18 14:24:50UTCMore templates
- tanstack-angular-table-example-basic-app-table
- tanstack-angular-table-example-basic-external-atoms
- tanstack-angular-table-example-basic-external-state
- tanstack-angular-table-example-basic-inject-table
- tanstack-angular-table-example-column-groups
- tanstack-angular-table-example-column-ordering
- tanstack-angular-table-example-column-pinning
- tanstack-angular-table-example-column-pinning-split
- tanstack-angular-table-example-column-pinning-sticky
- tanstack-angular-table-example-column-resizing
- tanstack-angular-table-example-column-resizing-performant
- tanstack-angular-table-example-column-sizing
- tanstack-angular-table-example-column-visibility
- tanstack-angular-table-example-composable-tables
- tanstack-angular-table-example-custom-plugin
- tanstack-angular-table-example-editable
- tanstack-angular-table-example-expanding
- tanstack-angular-table-example-filters
- tanstack-angular-table-example-filters-faceted
- tanstack-angular-table-example-filters-fuzzy
- tanstack-angular-table-example-grouping
- tanstack-angular-table-example-kitchen-sink
- tanstack-angular-table-example-pagination
- tanstack-angular-table-example-remote-data
- tanstack-angular-table-example-row-dnd
- tanstack-angular-table-example-row-pinning
- tanstack-angular-table-example-row-selection
- tanstack-angular-table-example-row-selection-signal
- tanstack-angular-table-example-signal-input
- tanstack-angular-table-example-sorting
- tanstack-angular-table-example-sub-components
- tanstack-angular-table-example-virtualized-columns
- tanstack-angular-table-example-virtualized-infinite-scrolling
- tanstack-angular-table-example-virtualized-rows
- tanstack-angular-table-example-with-tanstack-form
- tanstack-angular-table-example-with-tanstack-query
- tanstack-lit-table-example-basic-app-table
- tanstack-lit-table-example-basic-external-atoms
- tanstack-lit-table-example-basic-external-state
- tanstack-lit-table-example-basic-table-controller
- tanstack-lit-table-example-column-groups
- tanstack-lit-table-example-column-ordering
- tanstack-lit-table-example-column-pinning
- tanstack-lit-table-example-column-pinning-split
- tanstack-lit-table-example-column-pinning-sticky
- tanstack-lit-table-example-column-resizing
- tanstack-lit-table-example-column-resizing-performant
- tanstack-lit-table-example-column-sizing
- tanstack-lit-table-example-column-visibility
- tanstack-lit-table-example-composable-tables
- tanstack-lit-table-example-expanding
- tanstack-lit-table-example-filters
- tanstack-lit-table-example-filters-faceted
- tanstack-lit-table-example-filters-fuzzy
- tanstack-lit-table-example-grouping
- tanstack-lit-table-example-kitchen-sink
- tanstack-lit-table-example-pagination
- tanstack-lit-table-example-row-pinning
- tanstack-lit-table-example-row-selection
- tanstack-lit-table-example-sorting
- tanstack-lit-table-example-sorting-dynamic-data
- tanstack-lit-table-example-sub-components
- tanstack-lit-table-example-virtualized-columns
- tanstack-lit-table-example-virtualized-infinite-scrolling
- tanstack-lit-table-example-virtualized-rows
- tanstack-preact-table-example-basic-external-atoms
- tanstack-preact-table-example-basic-external-state
- tanstack-preact-table-example-basic-subscribe
- tanstack-preact-table-example-basic-use-app-table
- tanstack-preact-table-example-basic-use-table
- tanstack-preact-table-example-column-groups
- tanstack-preact-table-example-column-ordering
- tanstack-preact-table-example-column-pinning
- tanstack-preact-table-example-column-pinning-split
- tanstack-preact-table-example-column-pinning-sticky
- tanstack-preact-table-example-column-resizing
- tanstack-preact-table-example-column-resizing-performant
- tanstack-preact-table-example-column-sizing
- tanstack-preact-table-example-column-visibility
- tanstack-preact-table-example-composable-tables
- tanstack-preact-table-example-custom-plugin
- tanstack-preact-table-example-expanding
- tanstack-preact-table-example-filters
- tanstack-preact-table-example-filters-faceted
- tanstack-preact-table-example-filters-fuzzy
- tanstack-preact-table-example-grouping
- tanstack-preact-table-example-kitchen-sink
- tanstack-preact-table-example-pagination
- tanstack-preact-table-example-row-pinning
- tanstack-preact-table-example-row-selection
- tanstack-preact-table-example-sorting
- tanstack-preact-table-example-sub-components
- tanstack-preact-table-example-with-tanstack-query
- tanstack-react-table-example-basic-external-atoms
- tanstack-react-table-example-basic-external-state
- tanstack-react-table-example-basic-subscribe
- tanstack-react-table-example-basic-use-app-table
- tanstack-react-table-example-basic-use-legacy-table
- tanstack-react-table-example-basic-use-table
- tanstack-react-table-example-column-dnd
- tanstack-react-table-example-column-groups
- tanstack-react-table-example-column-ordering
- tanstack-react-table-example-column-pinning
- tanstack-react-table-example-column-pinning-split
- tanstack-react-table-example-column-pinning-sticky
- tanstack-react-table-example-column-resizing
- tanstack-react-table-example-column-resizing-performant
- tanstack-react-table-example-column-sizing
- tanstack-react-table-example-column-visibility
- tanstack-react-table-example-composable-tables
- tanstack-react-table-example-custom-plugin
- tanstack-react-table-example-expanding
- tanstack-react-table-example-filters
- tanstack-react-table-example-filters-faceted
- tanstack-react-table-example-filters-fuzzy
- tanstack-react-table-example-grouping
- tanstack-react-table-example-kitchen-sink
- tanstack-react-table-example-kitchen-sink-hero-ui
- tanstack-react-table-example-kitchen-sink-mantine
- tanstack-react-table-example-kitchen-sink-material-ui
- tanstack-react-table-example-kitchen-sink-react-aria
- tanstack-react-table-example-kitchen-sink-shadcn-base
- tanstack-react-table-example-kitchen-sink-shadcn-radix
- tanstack-react-table-example-lib-hero-ui
- tanstack-react-table-example-lib-mantine
- tanstack-react-table-example-lib-material-ui
- tanstack-react-table-example-lib-react-aria
- tanstack-react-table-example-lib-shadcn-base
- tanstack-react-table-example-lib-shadcn-radix
- tanstack-react-table-example-mantine-react-table
- tanstack-react-table-example-material-react-table
- tanstack-react-table-example-pagination
- tanstack-react-table-example-row-dnd
- tanstack-react-table-example-row-pinning
- tanstack-react-table-example-row-selection
- tanstack-react-table-example-sorting
- tanstack-react-table-example-sub-components
- tanstack-react-table-example-virtualized-columns
- tanstack-react-table-example-virtualized-columns-experimental
- tanstack-react-table-example-virtualized-infinite-scrolling
- tanstack-react-table-example-virtualized-rows
- tanstack-react-table-example-virtualized-rows-experimental
- tanstack-react-table-example-with-tanstack-form
- tanstack-react-table-example-with-tanstack-query
- tanstack-react-table-example-with-tanstack-router
- tanstack-solid-table-example-basic-app-table
- tanstack-solid-table-example-basic-external-atoms
- tanstack-solid-table-example-basic-external-state
- tanstack-solid-table-example-basic-use-table
- tanstack-solid-table-example-column-groups
- tanstack-solid-table-example-column-ordering
- tanstack-solid-table-example-column-pinning
- tanstack-solid-table-example-column-pinning-split
- tanstack-solid-table-example-column-pinning-sticky
- tanstack-solid-table-example-column-resizing
- tanstack-solid-table-example-column-resizing-performant
- tanstack-solid-table-example-column-sizing
- tanstack-solid-table-example-column-visibility
- tanstack-solid-table-example-composable-tables
- tanstack-solid-table-example-expanding
- tanstack-solid-table-example-filters
- tanstack-solid-table-example-filters-faceted
- tanstack-solid-table-example-filters-fuzzy
- tanstack-solid-table-example-grouping
- tanstack-solid-table-example-kitchen-sink
- tanstack-solid-table-example-pagination
- tanstack-solid-table-example-row-pinning
- tanstack-solid-table-example-row-selection
- tanstack-solid-table-example-sorting
- tanstack-solid-table-example-sub-components
- tanstack-solid-table-example-virtualized-columns
- tanstack-solid-table-example-virtualized-infinite-scrolling
- tanstack-solid-table-example-virtualized-rows
- tanstack-solid-table-example-with-tanstack-form
- tanstack-solid-table-example-with-tanstack-query
- tanstack-solid-table-example-with-tanstack-router
- tanstack-vanilla-table-example-basic
- tanstack-vanilla-table-example-pagination
- tanstack-vanilla-table-example-sorting
- tanstack-svelte-table-example-basic-app-table
- tanstack-svelte-table-example-basic-create-table
- tanstack-svelte-table-example-basic-external-atoms
- tanstack-svelte-table-example-basic-external-state
- tanstack-svelte-table-example-basic-snippets
- tanstack-svelte-table-example-column-groups
- tanstack-svelte-table-example-column-ordering
- tanstack-svelte-table-example-column-pinning
- tanstack-svelte-table-example-column-pinning-split
- tanstack-svelte-table-example-column-pinning-sticky
- tanstack-svelte-table-example-column-resizing
- tanstack-svelte-table-example-column-resizing-performant
- tanstack-svelte-table-example-column-sizing
- tanstack-svelte-table-example-column-visibility
- tanstack-svelte-table-example-composable-tables
- tanstack-svelte-table-example-expanding
- tanstack-svelte-table-example-filtering
- tanstack-svelte-table-example-filters-faceted
- tanstack-svelte-table-example-filters-fuzzy
- tanstack-svelte-table-example-grouping
- tanstack-svelte-table-example-kitchen-sink
- tanstack-svelte-table-example-pagination
- tanstack-svelte-table-example-row-pinning
- tanstack-svelte-table-example-row-selection
- tanstack-svelte-table-example-sorting
- tanstack-svelte-table-example-sub-components
- tanstack-svelte-table-example-virtualized-columns
- tanstack-svelte-table-example-virtualized-infinite-scrolling
- tanstack-svelte-table-example-virtualized-rows
- tanstack-svelte-table-example-with-tanstack-form
- tanstack-svelte-table-example-with-tanstack-query
- tanstack-vue-table-example-basic-external-atoms
- tanstack-vue-table-example-basic-external-state
- tanstack-vue-table-example-basic-use-app-table
- tanstack-vue-table-example-basic-use-table
- tanstack-vue-table-example-column-groups
- tanstack-vue-table-example-column-ordering
- tanstack-vue-table-example-column-pinning
- tanstack-vue-table-example-column-pinning-split
- tanstack-vue-table-example-column-pinning-sticky
- tanstack-vue-table-example-column-resizing
- tanstack-vue-table-example-column-resizing-performant
- tanstack-vue-table-example-column-sizing
- tanstack-vue-table-example-column-visibility
- tanstack-vue-table-example-composable-tables
- tanstack-vue-table-example-expanding
- tanstack-vue-table-example-filters
- tanstack-vue-table-example-filters-faceted
- tanstack-vue-table-example-filters-fuzzy
- tanstack-vue-table-example-grouping
- tanstack-vue-table-example-kitchen-sink
- tanstack-vue-table-example-pagination
- tanstack-vue-table-example-row-pinning
- tanstack-vue-table-example-row-selection
- tanstack-vue-table-example-sorting
- tanstack-vue-table-example-sub-components
- tanstack-vue-table-example-virtualized-columns
- tanstack-vue-table-example-virtualized-infinite-scrolling
- tanstack-vue-table-example-virtualized-rows
- tanstack-vue-table-example-with-tanstack-form
- tanstack-vue-table-example-with-tanstack-query
@tanstack/angular-table
npm i https://pkg.pr.new/TanStack/table/@tanstack/angular-table@6326@tanstack/angular-table-devtools
npm i https://pkg.pr.new/TanStack/table/@tanstack/angular-table-devtools@6326@tanstack/lit-table
npm i https://pkg.pr.new/TanStack/table/@tanstack/lit-table@6326@tanstack/match-sorter-utils
npm i https://pkg.pr.new/TanStack/table/@tanstack/match-sorter-utils@6326@tanstack/preact-table
npm i https://pkg.pr.new/TanStack/table/@tanstack/preact-table@6326@tanstack/preact-table-devtools
npm i https://pkg.pr.new/TanStack/table/@tanstack/preact-table-devtools@6326@tanstack/react-table
npm i https://pkg.pr.new/TanStack/table/@tanstack/react-table@6326@tanstack/react-table-devtools
npm i https://pkg.pr.new/TanStack/table/@tanstack/react-table-devtools@6326@tanstack/solid-table
npm i https://pkg.pr.new/TanStack/table/@tanstack/solid-table@6326@tanstack/solid-table-devtools
npm i https://pkg.pr.new/TanStack/table/@tanstack/solid-table-devtools@6326@tanstack/svelte-table
npm i https://pkg.pr.new/TanStack/table/@tanstack/svelte-table@6326@tanstack/table-core
npm i https://pkg.pr.new/TanStack/table/@tanstack/table-core@6326@tanstack/table-devtools
npm i https://pkg.pr.new/TanStack/table/@tanstack/table-devtools@6326@tanstack/vue-table
npm i https://pkg.pr.new/TanStack/table/@tanstack/vue-table@6326@tanstack/vue-table-devtools
npm i https://pkg.pr.new/TanStack/table/@tanstack/vue-table-devtools@6326commit:
c4d0aedActionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. Inline comments: In `@scripts/rewrite-table-core-dts.mjs`: - Around line 92-109: The regex pattern in the replacer function does not match TypeScript's `import type { ... }` syntax, only `import { ... }` and `export { ... }`. Modify the regex pattern to make the `type` keyword optional between the import/export keyword and the opening brace, so that both `import { ... }` and `import type { ... }` statements are properly matched and processed by the filtering logic. - Around line 73-87: The removeTypeAlias function currently searches for the pattern `type ${typeName}` but does not account for the `export` keyword that may precede it in the TypeScript declaration file. When an exported type alias is found, the function only removes from the word `type` onward, leaving behind the dangling `export` keyword. Fix this by checking if the character sequence before the start position contains `export ` (including the space), and if so, adjust the start position to include and remove the export keyword as well. This ensures that both exported and non-exported type aliases are completely removed without leaving orphaned tokens.🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID:
ba3a2dcc-5fa1-4116-817b-c15b906fae24📥 Commits
Reviewing files that changed from the base of the PR and between 26fc1057afe18fe5004fa7c2cf44a2fd34fb73b1 and b8eefd250fc3da4088247e1a4c43f5153aef023f.
📒 Files selected for processing (4)
packages/table-core/package.jsonpackages/table-core/src/core/headers/coreHeadersFeature.types.tspackages/table-core/src/types/Column.tsscripts/rewrite-table-core-dts.mjs
scripts/rewrite-table-core-dts.mjs lines 73 to 91Resolvedby coderabbitai[bot](GitHub profile, opens in a new tab)@@ -0,0 +67,21 @@67+ }68+ }69+70+ throw new Error(`Could not find end of ${interfaceName}`)71+}72+73+function removeTypeAlias(source, typeName) {74+ const start = source.indexOf(`type ${typeName}`)75+76+ if (start === -1) {77+ return source78+ }79+80+ const end = source.indexOf(';', start)81+82+ if (end === -1) {83+ throw new Error(`Could not find end of ${typeName}`)84+ }85+86+ return source.slice(0, start) + source.slice(end + 1)87+}⚠️ Potential issue | 🟠 Major
🧩 Analysis chain
🏁 Script executed:
cat -n scripts/rewrite-table-core-dts.mjs | sed -n '60,100p'Repository: TanStack/table
Length of output: 1405
🏁 Script executed:
cat -n scripts/rewrite-table-core-dts.mjs | head -150 | tail -80Repository: TanStack/table
Length of output: 2809
🏁 Script executed:
cat -n scripts/rewrite-table-core-dts.mjs | sed -n '1,72p'Repository: TanStack/table
Length of output: 2151
🏁 Script executed:
find . -name "*.d.ts" -o -name "*.d.cts" | head -20Repository: TanStack/table
Length of output: 1115
🏁 Script executed:
find packages/table-core/dist -name "*.d.ts" -o -name "*.d.cts" | head -5Repository: TanStack/table
Length of output: 118
🏁 Script executed:
ls -la packages/table-core/Repository: TanStack/table
Length of output: 725
🏁 Script executed:
rg "Table_InternalBroadenedKeys" --type ts --type tsx -B 2 -A 2Repository: TanStack/table
Length of output: 86
🏁 Script executed:
rg "Table_InternalBroadenedKeys" --type ts -B 2 -A 2Repository: TanStack/table
Length of output: 717
🏁 Script executed:
rg "export type Table_InternalBroadenedKeys" -B 1 -A 5Repository: TanStack/table
Length of output: 40
🏁 Script executed:
rg "type Table_InternalBroadenedKeys" -B 2 -A 10Repository: TanStack/table
Length of output: 828
🏁 Script executed:
python3 - <<'PY' # Test the proposed fix logic with example cases test_cases = [ ("export type Foo = string;", "Foo", "Should remove entire declaration"), ("some code\nexport type Bar = number;", "Bar", "Should remove with leading newline"), ("type Baz = boolean;", "Baz", "Should work without export"), ] import re for source, typeName, description in test_cases: print(f"\n{description}") print(f"Input: {repr(source)}") # Original logic start_orig = source.indexOf(f"type {typeName}") # Proposed fix logic pattern = f"(?:^|\\n)\\s*(export\\s+)?type\\s+{typeName}\\b" match = source.match(pattern) # Can't use JavaScript methods in Python, simulating with regex match_obj = re.search(pattern, source) if match_obj: start_fix = match_obj.start() + (1 if match_obj.group(0).startswith('\n') else 0) print(f"Original start: {start_orig} → leaves dangling text before 'type'") print(f"Fixed start: {start_fix} → includes 'export' prefix") else: print(f"No match found") PYRepository: TanStack/table
Length of output: 299
🏁 Script executed:
python3 - <<'PY' import re test_cases = [ ("export type Foo = string;", "Foo", "Should remove entire declaration"), ("some code\nexport type Bar = number;", "Bar", "Should remove with leading newline"), ("type Baz = boolean;", "Baz", "Should work without export"), ("export type Table_InternalBroadenedKeys = 'a' | 'b';", "Table_InternalBroadenedKeys", "Real case"), ] for source, typeName, description in test_cases: print(f"\n{description}") print(f"Input: {repr(source)}") # Original logic search_str = f"type {typeName}" start_orig = source.find(search_str) if start_orig != -1: print(f"Original start: {start_orig}") print(f"Text before 'type': {repr(source[:start_orig])}") end = source.find(';', start_orig) result_orig = source[:start_orig] + source[end+1:] print(f"Original result: {repr(result_orig)}") # Proposed fix logic pattern = f"(?:^|\\n)\\s*(export\\s+)?type\\s+{re.escape(typeName)}\\b" match_obj = re.search(pattern, source) if match_obj: print(f"Pattern match: {repr(match_obj.group(0))}") start_fix = match_obj.start() + (1 if match_obj.group(0).startswith('\n') else 0) print(f"Fixed start: {start_fix}") end = source.find(';', start_fix) result_fix = source[:start_fix] + source[end+1:] print(f"Fixed result: {repr(result_fix)}") else: print(f"No match found") PYRepository: TanStack/table
Length of output: 939
🏁 Script executed:
cat -n scripts/rewrite-table-core-dts.mjs | sed -n '128,145p'Repository: TanStack/table
Length of output: 700
🏁 Script executed:
rg "export type" packages/table-core/src -A 1 | head -20Repository: TanStack/table
Length of output: 1331
removeTypeAliasleaves danglingexporttoken when removing exported type aliasesWhen matching
type ${typeName}in compiled.d.tsfiles containingexport type Table_InternalBroadenedKeys = ...;, the function slices from the wordtype, leaving a danglingexportfragment that produces invalid TypeScript syntax.Suggested fix
function removeTypeAlias(source, typeName) { - const start = source.indexOf(`type ${typeName}`) + const match = source.match( + new RegExp(`(?:^|\\n)\\s*(export\\s+)?type\\s+${typeName}\\b`), + ) - if (start === -1) { + if (!match || match.index == null) { return source } + const start = match.index + (match[0].startsWith('\n') ? 1 : 0) const end = source.indexOf(';', start) if (end === -1) { throw new Error(`Could not find end of ${typeName}`) } return source.slice(0, start) + source.slice(end + 1) }🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@scripts/rewrite-table-core-dts.mjs` around lines 73 - 87, The removeTypeAlias function currently searches for the pattern `type ${typeName}` but does not account for the `export` keyword that may precede it in the TypeScript declaration file. When an exported type alias is found, the function only removes from the word `type` onward, leaving behind the dangling `export` keyword. Fix this by checking if the character sequence before the start position contains `export ` (including the space), and if so, adjust the start position to include and remove the export keyword as well. This ensures that both exported and non-exported type aliases are completely removed without leaving orphaned tokens.✅ Addressed in commit 4e7d50a
scripts/rewrite-table-core-dts.mjs lines 92 to 109OutdatedResolvedby coderabbitai[bot](GitHub profile, opens in a new tab)@@ -0,0 +89,21 @@89+function removeNamedSpecifiers(source, names) {90+ return source91+ .replace(92+ /\b(import|export)\s+\{([^}]+)\}\s+from\s+([^;\n]+);/g,93+ (statement, kind, specifiers, fromClause) => {94+ const nextSpecifiers = specifiers95+ .split(',')96+ .map((specifier) => specifier.trim())97+ .filter(Boolean)98+ .filter((specifier) => {99+ const importedName = specifier.split(/\s+as\s+/)[0]?.trim()100+ return importedName && !names.includes(importedName)101+ })102+103+ if (!nextSpecifiers.length) {104+ return ''105+ }106+107+ return `${kind} { ${nextSpecifiers.join(', ')} } from ${fromClause};`108+ },109+ )⚠️ Potential issue | 🟠 Major
🧩 Analysis chain
🏁 Script executed:
cat -n scripts/rewrite-table-core-dts.mjs | head -120 | tail -40Repository: TanStack/table
Length of output: 1575
🏁 Script executed:
rg "import\s+type\s+\{" --type ts --type mjs --type js | head -20Repository: TanStack/table
Length of output: 86
🏁 Script executed:
rg "import\s+type\s+\{" | head -30Repository: TanStack/table
Length of output: 3170
🏁 Script executed:
head -90 scripts/rewrite-table-core-dts.mjsRepository: TanStack/table
Length of output: 2036
🏁 Script executed:
find packages/table-core/dist -name "*.d.ts" -o -name "*.d.cts" | head -10Repository: TanStack/table
Length of output: 118
🏁 Script executed:
find packages/table-core -name "*.d.ts" -o -name "*.d.cts" 2>/dev/null | head -10Repository: TanStack/table
Length of output: 99
🏁 Script executed:
rg "import\s+type\s+\{" packages/table-core/src --type ts | head -20Repository: TanStack/table
Length of output: 2206
🏁 Script executed:
cat -n scripts/rewrite-table-core-dts.mjs | tail -50Repository: TanStack/table
Length of output: 1524
Regex pattern doesn't match
import type { ... }syntaxThe regex at line 92 only matches
import { ... }andexport { ... }, missing TypeScript'simport type { ... }declarations. Since these statements are common in generated.d.tsfiles, forbidden type specifiers likeTable_InternalandColumn_Internalcan escape removal, potentially causing duplication or leak issues.Suggested fix
- /\b(import|export)\s+\{([^}]+)\}\s+from\s+([^;\n]+);/g, + /\b(import|export)(\s+type)?\s+\{([^}]+)\}\s+from\s+([^;\n]+);/g, - (statement, kind, specifiers, fromClause) => { + (statement, kind, typeKeyword, specifiers, fromClause) => { const nextSpecifiers = specifiers .split(',') .map((specifier) => specifier.trim()) .filter(Boolean) .filter((specifier) => { const importedName = specifier.split(/\s+as\s+/)[0]?.trim() return importedName && !names.includes(importedName) }) if (!nextSpecifiers.length) { return '' } - return `${kind} { ${nextSpecifiers.join(', ')} } from ${fromClause};` + return `${kind}${typeKeyword ?? ''} { ${nextSpecifiers.join(', ')} } from ${fromClause};` },📝 Committable suggestion
‼️ IMPORTANT Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
Suggested change92- /\b(import|export)\s+\{([^}]+)\}\s+from\s+([^;\n]+);/g,93- (statement, kind, specifiers, fromClause) => {94- const nextSpecifiers = specifiers95- .split(',')96- .map((specifier) => specifier.trim())97- .filter(Boolean)98- .filter((specifier) => {99- const importedName = specifier.split(/\s+as\s+/)[0]?.trim()100- return importedName && !names.includes(importedName)101- })102-103- if (!nextSpecifiers.length) {104- return ''105- }106-107- return `${kind} { ${nextSpecifiers.join(', ')} } from ${fromClause};`108- },109- )92+ /\b(import|export)(\s+type)?\s+\{([^}]+)\}\s+from\s+([^;\n]+);/g,93+ (statement, kind, typeKeyword, specifiers, fromClause) => {94+ const nextSpecifiers = specifiers95+ .split(',')96+ .map((specifier) => specifier.trim())97+ .filter(Boolean)98+ .filter((specifier) => {99+ const importedName = specifier.split(/\s+as\s+/)[0]?.trim()100+ return importedName && !names.includes(importedName)101+ })102+103+ if (!nextSpecifiers.length) {104+ return ''105+ }106+107+ return `${kind}${typeKeyword ?? ''} { ${nextSpecifiers.join(', ')} } from ${fromClause};`108+ },🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@scripts/rewrite-table-core-dts.mjs` around lines 92 - 109, The regex pattern in the replacer function does not match TypeScript's `import type { ... }` syntax, only `import { ... }` and `export { ... }`. Modify the regex pattern to make the `type` keyword optional between the import/export keyword and the opening brace, so that both `import { ... }` and `import type { ... }` statements are properly matched and processed by the filtering logic.✅ Addressed in commit 4e7d50a
KevinVandy merged this370fdf3
KevinVandy closed this
Sign in to join this conversation.
No actionable comments were generated in the recent review. 🎉
ℹ️ Recent review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID:
5eedbbc9-a1da-4fef-add3-cc18e30b2906📥 Commits
Reviewing files that changed from the base of the PR and between d75689fb28959865ea218bd55eb33424b67b4f57 and c4d0aed3f818c8668af273aaa88a08ec86c23615.
📒 Files selected for processing (1)
packages/table-core/package.json🚧 Files skipped from review as they are similar to previous changes (1)
📝 Walkthrough
Walkthrough#
Column_Internalgains atable: Table_Internal<...>property andHeaderContext.tableis typed asTable_Internal. A new post-build script (rewrite-table-core-dts.mjs) scans emitted.d.ts/.d.ctsfiles, removes those internal interface declarations and type aliases, strips their named specifiers, and replaces remaining references with publicTable/Columnequivalents. Thetable-corebuild script is updated to invoke this script aftertsdown.Changes#
Internal type adoption and .d.ts rewrite
Table_Internalpackages/table-core/src/types/Column.ts,packages/table-core/src/core/headers/coreHeadersFeature.types.tsColumn_Internalomits and re-declarestableasTable_Internal<...>, andHeaderContext.tableis typed asTable_Internal<...>, causing those names to appear in emitted declarations.scripts/rewrite-table-core-dts.mjsdistfor.d.ts/.d.ctsfiles, removesTable_Internal/Column_Internalexported interfaces and theTable_InternalBroadenedKeystype alias, strips their named import/export specifiers, replaces remaining internal references with public equivalents, and validates no names leaked.packages/table-core/package.jsontsdown.Estimated code review effort#
🎯 3 (Moderate) | ⏱️ ~20 minutes
Poem#
🚥 Pre-merge checks | ✅ 4 | ❌ 1
❌ Failed checks (1 warning)#
✅ Passed checks (4 passed)
✨ Finishing Touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
❤️ Share